globalias.plugin.zsh 451 Bytes
Newer Older
slavaGanzin's avatar
slavaGanzin committed
1
globalias() {
2
3
4
5
   if [[ $GLOBALIAS_FILTER_VALUES[(Ie)$LBUFFER] -eq 0 ]]; then
      zle _expand_alias
      zle expand-word
   fi
slavaGanzin's avatar
slavaGanzin committed
6
7
8
   zle self-insert
}
zle -N globalias
slavaGanzin's avatar
slavaGanzin committed
9

slavaGanzin's avatar
slavaGanzin committed
10
# space expands all aliases, including global
slavaGanzin's avatar
slavaGanzin committed
11
12
13
14
15
16
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
17
18
19

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