globalias.plugin.zsh 365 Bytes
Newer Older
slavaGanzin's avatar
slavaGanzin committed
1
2
3
4
5
6
globalias() {
   zle _expand_alias
   zle expand-word
   zle self-insert
}
zle -N globalias
slavaGanzin's avatar
slavaGanzin committed
7
8
9
10
11
12
13
14

# space expands all global aliases
bindkey -M emacs " " globalias
bindkey -M viins " " globalias

# control-space to make a normal space
bindkey -M emacs "^ " magic-space
bindkey -M viins "^ " magic-space
slavaGanzin's avatar
slavaGanzin committed
15
16
17

# normal space during searches
bindkey -M isearch " " magic-space