dotfiles/shells/zsh/lib/fish.zsh

34 lines
1.3 KiB
Bash
Raw Normal View History

source $FRESH_PATH/build/vendor/zsh-autosuggestions/zsh-autosuggestions.zsh
source $FRESH_PATH/build/vendor/zsh-history-substring-search/zsh-history-substring-search.zsh
2020-05-26 13:33:59 +10:00
source $FRESH_PATH/build/vendor/zsh-fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh
2013-11-12 15:24:58 +11:00
autoload -U up-line-or-beginning-search
zle -N up-line-or-beginning-search
2013-11-12 15:24:58 +11:00
autoload -U down-line-or-beginning-search
zle -N down-line-or-beginning-search
# bind UP and DOWN arrow keys to prefix search history (diff keys for diff terms)
bindkey '^[[A' up-line-or-beginning-search
bindkey '^[OA' up-line-or-beginning-search
bindkey '^[[B' down-line-or-beginning-search
bindkey '^[OB' down-line-or-beginning-search
# bind SHIFT-UP / SHIFT-DOWN & PAGE UP / PAGE DOWN to search history matching current contents (non-prefix)
bindkey '^[[5~' history-substring-search-up
bindkey '^[[1;2A' history-substring-search-up
bindkey '^[[6~' history-substring-search-down
bindkey '^[[1;2B' history-substring-search-down
2019-07-22 16:21:32 +10:00
# Bind control + LEFT and RIGHT arrow keys to jump by word
bindkey "^[[1;5C" forward-word
bindkey "^[[1;5D" backward-word
2013-11-12 15:24:58 +11:00
# bind P and N for EMACS mode
bindkey -M emacs '^P' history-substring-search-up
bindkey -M emacs '^N' history-substring-search-down
# bind k and j for VI mode
bindkey -M vicmd 'k' history-substring-search-up
bindkey -M vicmd 'j' history-substring-search-down