Skip to content

Commit

Permalink
Set key binding (^space) to expand all aliases including global (sori…
Browse files Browse the repository at this point in the history
  • Loading branch information
akarzim authored and belak committed Nov 2, 2017
1 parent 4b0ecff commit ff9b901
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions modules/editor/init.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,14 @@ function prepend-sudo {
}
zle -N prepend-sudo

# Expand aliases
function glob-alias {
zle _expand_alias
zle expand-word
zle magic-space
}
zle -N glob-alias

# Reset to default key bindings.
bindkey -d

Expand Down Expand Up @@ -368,6 +376,9 @@ for keymap in 'emacs' 'viins'; do

# Insert 'sudo ' at the beginning of the line.
bindkey -M "$keymap" "$key_info[Control]X$key_info[Control]S" prepend-sudo

# control-space expands all aliases, including global
bindkey -M "$keymap" "$key_info[Control] " glob-alias
done

# Delete key deletes character in vimcmd cmd mode instead of weird default functionality
Expand Down

0 comments on commit ff9b901

Please sign in to comment.