mirror of
https://github.com/dcarrillo/prezto.git
synced 2025-10-14 15:49:09 +00:00
[editor] Add bindkey-all function to show all bound keys (#1358)
* [editor] Add bindkey-all function to show all bound keys Function which allows you to see all the bound keys for all of the different keymaps. It does accept arguments and passes them through to bindkey -m "$keymap" so you could set a shortcut to all keymaps as well if you wished. Makes it much easier to see and grep what keys are bound to each of the different keymaps. When no arguments are given it will print keymap headers to stderr, if given arguments it will not print anything extra to the screen. * [editor] Update README to include information about bindkey-all funct.
This commit is contained in:
committed by
Kaleb Elwert
parent
5cd3380d9d
commit
75a60bc7bf
@@ -78,7 +78,15 @@ zle -N edit-command-line
|
||||
#
|
||||
# Functions
|
||||
#
|
||||
|
||||
# Runs bindkey but for all of the keymaps. Running it with no arguments will
|
||||
# print out the mappings for all of the keymaps.
|
||||
function bindkey-all {
|
||||
local keymap=''
|
||||
for keymap in $(bindkey -l); do
|
||||
[[ "$#" -eq 0 ]] && printf "#### %s\n" "${keymap}" 1>&2
|
||||
bindkey -M "${keymap}" "$@"
|
||||
done
|
||||
}
|
||||
# Exposes information about the Zsh Line Editor via the $editor_info associative
|
||||
# array.
|
||||
function editor-info {
|
||||
|
Reference in New Issue
Block a user