Skip to content

Commit

Permalink
update zsh completion rules
Browse files Browse the repository at this point in the history
  • Loading branch information
Sqvid committed Jun 26, 2024
1 parent 407d063 commit 245811b
Showing 1 changed file with 23 additions and 14 deletions.
37 changes: 23 additions & 14 deletions zsh/.zshrc
Original file line number Diff line number Diff line change
Expand Up @@ -12,40 +12,49 @@
HISTFILE=~/.zsh_history
HISTSIZE=1000
SAVEHIST=5000
KEYTIMEOUT=1
KEYTIMEOUT=10

setopt extendedglob
unsetopt beep
setopt correct
setopt nobeep
setopt menu_complete

# Completions:
zstyle ':completion:*' completer _complete _ignored _correct _approximate
zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS}
zstyle ':completion:*' completer _complete _approximate
zstyle ':completion:*' matcher-list '' 'm:{[:lower:]}={[:upper:]} l:|=* r:|=*' 'r:|[._-]=** r:|=**'
zstyle ':completion:*' max-errors 1
zstyle ':completion:*' menu select=long
zstyle ':completion:*' prompt 'Completions:'
zstyle ':completion:*' select-prompt %SScrolling active: current selection at %p%s
zstyle :compinstall filename '/home/siddhartha/.zshrc'
autoload -Uz compinit
compinit
zmodload -i zsh/complist
zstyle ':completion:*' max-errors 2
zstyle ':completion:*:*:*:*:descriptions' format '%F{green}-- %d --%f'
zstyle ':completion:*' menu select
zstyle ':completion:*' group-name ''
zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS}
zstyle ':completion:*' squeeze-slashes true
zstyle ':completion:*' use-cache on
zstyle ':completion:*' cache-path "$XDG_CACHE_HOME/zsh/.zcompcache"

autoload -Uz compinit; compinit
zmodload zsh/complist

# Bindkeys:
bindkey -v
bindkey "^?" backward-delete-char
bindkey "M-l" forward-char
bindkey "M-w" forward-word
bindkey '^R' history-incremental-search-backward
# Use vim keys in tab complete menu:
# Use vi keys in completion menu:
bindkey -M menuselect 'h' vi-backward-char
bindkey -M menuselect 'k' vi-up-line-or-history
bindkey -M menuselect 'l' vi-forward-char
bindkey -M menuselect 'j' vi-down-line-or-history
bindkey -M menuselect '0' vi-beginning-of-line
bindkey -M menuselect '$' vi-end-of-line
bindkey -M menuselect 'g' beginning-of-history
bindkey -M menuselect 'G' end-of-history

# Plugins:
source /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh
source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
source /usr/share/autojump/autojump.zsh

# Add completions provided by zsh-completions plugin
fpath=(/usr/share/zsh/site-functions/ $fpath)

# *****************************************************************************
Expand Down

0 comments on commit 245811b

Please sign in to comment.