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.

25 lines
806 B

3 years ago
  1. (( ${+commands[percol]} )) || return
  2. function percol_select_history() {
  3. # print history in reverse order (from -1 (latest) to 1 (oldest))
  4. BUFFER=$(fc -l -n -1 1 | percol --query "$LBUFFER")
  5. CURSOR=$#BUFFER
  6. zle -R -c
  7. }
  8. zle -N percol_select_history
  9. bindkey -M emacs '^R' percol_select_history
  10. bindkey -M viins '^R' percol_select_history
  11. bindkey -M vicmd '^R' percol_select_history
  12. if (( ${+functions[marks]} )); then
  13. function percol_select_marks() {
  14. # parse directory from marks output (markname -> path) and quote if necessary
  15. BUFFER=${(q)"$(marks | percol --query "$LBUFFER")"##*-> }
  16. CURSOR=$#BUFFER
  17. zle -R -c
  18. }
  19. zle -N percol_select_marks
  20. bindkey -M emacs '^B' percol_select_marks
  21. bindkey -M viins '^B' percol_select_marks
  22. bindkey -M vicmd '^B' percol_select_marks
  23. fi