Permalink
Browse files

added substring history script from http://fishshell.com

  • Loading branch information...
graysky2 committed Jan 20, 2013
1 parent c9537ec commit 7d28a3d7451f63208f8bc9be153a7ec11b13cfae
Showing with 678 additions and 11 deletions.
  1. +29 −0 shell/.zsh/lib/key-bindings.zsh
  2. +0 −3 shell/.zsh/lib/{keys.old → keys.zsh.old}
  3. +642 −0 shell/.zsh/lib/substring-search.zsh
  4. 0 shell/{.zsh-syntax-highlighting → .zsh/zsh-syntax-highlighting}/highlighters/README.md
  5. 0 shell/{.zsh-syntax-highlighting → .zsh/zsh-syntax-highlighting}/highlighters/brackets/README.md
  6. 0 ...yntax-highlighting → .zsh/zsh-syntax-highlighting}/highlighters/brackets/brackets-highlighter.zsh
  7. 0 ...lighting → .zsh/zsh-syntax-highlighting}/highlighters/brackets/test-data/mismatch-patentheses.zsh
  8. 0 ...ghlighting → .zsh/zsh-syntax-highlighting}/highlighters/brackets/test-data/nested-parentheses.zsh
  9. 0 ...ghlighting → .zsh/zsh-syntax-highlighting}/highlighters/brackets/test-data/quoted-patentheses.zsh
  10. 0 ...ghlighting → .zsh/zsh-syntax-highlighting}/highlighters/brackets/test-data/simple-parentheses.zsh
  11. 0 ...lighting → .zsh/zsh-syntax-highlighting}/highlighters/brackets/test-data/unclosed-patentheses.zsh
  12. 0 ...ighting → .zsh/zsh-syntax-highlighting}/highlighters/brackets/test-data/unclosed-patentheses2.zsh
  13. 0 shell/{.zsh-syntax-highlighting → .zsh/zsh-syntax-highlighting}/highlighters/cursor/README.md
  14. 0 ...sh-syntax-highlighting → .zsh/zsh-syntax-highlighting}/highlighters/cursor/cursor-highlighter.zsh
  15. 0 shell/{.zsh-syntax-highlighting → .zsh/zsh-syntax-highlighting}/highlighters/main/README.md
  16. 0 .../{.zsh-syntax-highlighting → .zsh/zsh-syntax-highlighting}/highlighters/main/main-highlighter.zsh
  17. 0 .../{.zsh-syntax-highlighting → .zsh/zsh-syntax-highlighting}/highlighters/main/test-data/assign.zsh
  18. 0 ...ighlighting → .zsh/zsh-syntax-highlighting}/highlighters/main/test-data/multiple-redirections.zsh
  19. 0 ...-syntax-highlighting → .zsh/zsh-syntax-highlighting}/highlighters/main/test-data/path-space- .zsh
  20. 0 ...ntax-highlighting → .zsh/zsh-syntax-highlighting}/highlighters/main/test-data/path-tilde-home.zsh
  21. 0 ...tax-highlighting → .zsh/zsh-syntax-highlighting}/highlighters/main/test-data/path-tilde-named.zsh
  22. 0 shell/{.zsh-syntax-highlighting → .zsh/zsh-syntax-highlighting}/highlighters/main/test-data/path.zsh
  23. 0 ...yntax-highlighting → .zsh/zsh-syntax-highlighting}/highlighters/main/test-data/simple-command.zsh
  24. 0 ...x-highlighting → .zsh/zsh-syntax-highlighting}/highlighters/main/test-data/simple-redirection.zsh
  25. 0 ...ntax-highlighting → .zsh/zsh-syntax-highlighting}/highlighters/main/test-data/unknown-command.zsh
  26. 0 shell/{.zsh-syntax-highlighting → .zsh/zsh-syntax-highlighting}/highlighters/pattern/README.md
  27. 0 ...-syntax-highlighting → .zsh/zsh-syntax-highlighting}/highlighters/pattern/pattern-highlighter.zsh
  28. 0 shell/{.zsh-syntax-highlighting → .zsh/zsh-syntax-highlighting}/highlighters/root/README.md
  29. 0 .../{.zsh-syntax-highlighting → .zsh/zsh-syntax-highlighting}/highlighters/root/root-highlighter.zsh
  30. 0 shell/{.zsh-syntax-highlighting → .zsh/zsh-syntax-highlighting}/tests/README.md
  31. 0 shell/{.zsh-syntax-highlighting → .zsh/zsh-syntax-highlighting}/tests/test-highlighting.zsh
  32. 0 shell/{.zsh-syntax-highlighting → .zsh/zsh-syntax-highlighting}/tests/test-perfs.zsh
  33. 0 shell/{.zsh-syntax-highlighting → .zsh/zsh-syntax-highlighting}/zsh-syntax-highlighting.zsh
  34. +7 −8 shell/.zshrc
@@ -0,0 +1,29 @@
+bindkey -e
+bindkey '\ew' kill-region
+bindkey -s '\el' "ls\n"
+bindkey '^r' history-incremental-search-backward
+bindkey "^[[5~" up-line-or-history
+bindkey "^[[6~" down-line-or-history
+
+# make search up and down work, so partially type and hit up/down to find relevant stuff
+bindkey '^[[A' up-line-or-search
+bindkey '^[[B' down-line-or-search
+
+bindkey "^[[H" beginning-of-line
+bindkey "^[[1~" beginning-of-line
+bindkey "^[OH" beginning-of-line
+bindkey "^[[F" end-of-line
+bindkey "^[[4~" end-of-line
+bindkey "^[OF" end-of-line
+bindkey ' ' magic-space # also do history expansion on space
+
+bindkey "^[[1;5C" forward-word
+bindkey "^[[1;5D" backward-word
+
+bindkey '^[[Z' reverse-menu-complete
+
+# Make the delete key (or Fn + Delete on the Mac) work instead of outputting a ~
+bindkey '^?' backward-delete-char
+bindkey "^[[3~" delete-char
+bindkey "^[3;5~" delete-char
+bindkey "\e[3~" delete-char
@@ -1,4 +1,3 @@
-###
autoload up-line-or-beginning-search
autoload down-line-or-beginning-search
zle -N up-line-or-beginning-search
@@ -36,8 +35,6 @@ key[Enter]=${terminfo[kent]}
# active. Only then are the values from $terminfo valid.
zle-line-init () { echoti smkx }
zle-line-finish () { echoti rmkx }
-bindkey "^[[A" history-beginning-search-backward
-bindkey "^[[B" history-beginning-search-forward
zle -N zle-line-init
zle -N zle-line-finish
Oops, something went wrong.

0 comments on commit 7d28a3d

Please sign in to comment.