From b69b57d8877abb398c2444b115d96b56f7dc2db6 Mon Sep 17 00:00:00 2001 From: srdusr Date: Thu, 25 May 2023 22:26:42 +0200 Subject: Add missing auto completion --- .config/zsh/.zshrc | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to '.config/zsh') diff --git a/.config/zsh/.zshrc b/.config/zsh/.zshrc index b5e9659..4ac5612 100644 --- a/.config/zsh/.zshrc +++ b/.config/zsh/.zshrc @@ -43,6 +43,22 @@ exit_zsh() { exit } zle -N exit_zsh bindkey '^D' exit_zsh +# Auto-completion +#autoload -U promptinit && promptinit +autoload -Uz compinit && compinit + +# Accept completion with or Ctrl+i and go to next/previous suggestions with Vi like keys: Ctrl+n/p +zmodload -i zsh/complist +accept-and-complete-next-history() { + zle expand-or-complete-prefix +} + +zle -N accept-and-complete-next-history +bindkey -M menuselect '^i' accept-and-complete-next-history +bindkey '^n' expand-or-complete +bindkey '^p' reverse-menu-complete +zstyle ':completion:*' menu select=1 + # Some other useful functionalities setopt autocd # Automatically cd into typed directory. stty intr '^q' # free Ctrl+C for copy use Ctrl+q instead @@ -51,7 +67,7 @@ stty stop undef # Disable ctrl-s to freeze terminal. stty start undef export PATH="$HOME/.local/bin:$PATH" -#export VIRTUAL_ENV_DISABLE_PROMPT=true +export VIRTUAL_ENV_DISABLE_PROMPT=true #unsetopt BEEP # Enable various options -- cgit v1.2.3