Просмотр исходного кода

Move ctrl-z keybinding to keybindings file

Weiyi Lou 10 лет назад
Родитель
Сommit
8928d94a56
2 измененных файлов с 14 добавлено и 13 удалено
  1. 0 13
      zsh/custom/ctrl-z.zsh
  2. 14 0
      zsh/custom/lib/key-bindings.zsh

+ 0 - 13
zsh/custom/ctrl-z.zsh

@@ -1,13 +0,0 @@
-# From http://sheerun.net/2014/03/21/how-to-boost-your-vim-productivity/
-# Perhaps the one actually-good idea from this post.
-fancy-ctrl-z () {
-  if [[ $#BUFFER -eq 0 ]]; then
-    BUFFER="fg"
-    zle accept-line
-  else
-    zle push-input
-    zle clear-screen
-  fi
-}
-zle -N fancy-ctrl-z
-bindkey '^Z' fancy-ctrl-z

+ 14 - 0
zsh/custom/lib/key-bindings.zsh

@@ -48,3 +48,17 @@ fi
 if [[ "${terminfo[kcud1]}" != "" ]]; then
   bindkey "${terminfo[kcud1]}" down-line-or-search    # start typing + [Down-Arrow] - fuzzy find history backward
 fi
+
+# Ctrl-z for `fg`
+# From http://sheerun.net/2014/03/21/how-to-boost-your-vim-productivity/
+fancy-ctrl-z () {
+  if [[ $#BUFFER -eq 0 ]]; then
+    BUFFER="fg"
+    zle accept-line
+  else
+    zle push-input
+    zle clear-screen
+  fi
+}
+zle -N fancy-ctrl-z
+bindkey '^Z' fancy-ctrl-z