diff --git a/.config/sheldon/plugins.toml b/.config/sheldon/plugins.toml index c8899bb..afbd84d 100644 --- a/.config/sheldon/plugins.toml +++ b/.config/sheldon/plugins.toml @@ -16,3 +16,6 @@ github = 'djui/alias-tips' [plugins.fast-syntax-highlighting] github = 'zdharma-continuum/fast-syntax-highlighting' + +[plugins.zsh-vi-mode] +github = 'jeffreytse/zsh-vi-mode' diff --git a/.zshrc b/.zshrc index bea1348..9bc80d4 100644 --- a/.zshrc +++ b/.zshrc @@ -63,7 +63,7 @@ # Would you like to use another custom folder than $ZSH/custom? # ZSH_CUSTOM=/path/to/new-custom-folder - plugins=(asdf fzf git gitignore golang safe-paste systemd terraform lol) + plugins=(asdf git gitignore golang safe-paste systemd terraform lol) source $ZSH/oh-my-zsh.sh ZSH_HIGHLIGHT_HIGHLIGHTERS=(main brackets pattern cursor) @@ -78,11 +78,28 @@ # map arrow up/down to control fish-like history substring search and highlighting bindkey '^[[A' history-substring-search-up bindkey '^[[B' history-substring-search-down + # also map the same keys in 'viins' (INSERT) mode... + bindkey -M viins '^[[A' history-substring-search-up + bindkey -M viins '^[[B' history-substring-search-down + # ...and in 'vicmd' (NORMAL) mode... + bindkey -M vicmd '^[[A' history-substring-search-up + bindkey -M vicmd '^[[B' history-substring-search-down + # ...and as well to K, J, instead of arrow up/down, respectively. + # note these are capital letters, original behaviour of j, k is left unchanged + bindkey -M vicmd 'K' history-substring-search-up + bindkey -M vicmd 'J' history-substring-search-down HISTORY_SUBSTRING_SEARCH_FUZZY=" " + export FZF_DEFAULT_COMMAND="fd --type f --hidden --follow --exclude .git --exclude 'node_modules' ." + export FZF_CTRL_T_COMMAND="fd --follow --full-path --base-directory . --exclude '.git' --exclude 'node_modules' ." + export FZF_ALT_C_COMMAND="fd -H -t d ." + export DISABLE_FZF_AUTO_COMPLETION="true" # Options to fzf command - FZF_COMPLETION_OPTS='+c -x' - FZF_DEFAULT_OPTS="--height=60% --inline-info --color=fg:#f8f8f2,bg:#282a36,hl:#bd93f9 --color=fg+:#f8f8f2,bg+:#44475a,hl+:#bd93f9 --color=info:#ffb86c,prompt:#50fa7b,pointer:#ff79c6 --color=marker:#ff79c6,spinner:#ffb86c,header:#6272a4" + export FZF_COMPLETION_OPTS='+c -x' + export FZF_DEFAULT_OPTS="--height=60% --inline-info --color=fg:#f8f8f2,bg:#282a36,hl:#bd93f9 --color=fg+:#f8f8f2,bg+:#44475a,hl+:#bd93f9 --color=info:#ffb86c,prompt:#50fa7b,pointer:#ff79c6 --color=marker:#ff79c6,spinner:#ffb86c,header:#6272a4" + export FZF_CTRL_T_OPTS="--preview 'bat --style=numbers --color=always --line-range :200 {}'" + + zvm_after_init_commands+=('[ -f /usr/share/fzf/shell/key-bindings.zsh ] && source /usr/share/fzf/shell/key-bindings.zsh') # User configuration source ~/.dotenv