my xfce4 dotfiles
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
637 B

3 years ago
  1. globalias() {
  2. # Get last word to the left of the cursor:
  3. # (z) splits into words using shell parsing
  4. # (A) makes it an array even if there's only one element
  5. local word=${${(Az)LBUFFER}[-1]}
  6. if [[ $GLOBALIAS_FILTER_VALUES[(Ie)$word] -eq 0 ]]; then
  7. zle _expand_alias
  8. zle expand-word
  9. fi
  10. zle self-insert
  11. }
  12. zle -N globalias
  13. # space expands all aliases, including global
  14. bindkey -M emacs " " globalias
  15. bindkey -M viins " " globalias
  16. # control-space to make a normal space
  17. bindkey -M emacs "^ " magic-space
  18. bindkey -M viins "^ " magic-space
  19. # normal space during searches
  20. bindkey -M isearch " " magic-space