From 38aca8584286842dd99dc8f28e3d44a4c743d3bc Mon Sep 17 00:00:00 2001 From: Thomas Schmucker Date: Sat, 27 May 2023 10:10:55 +0200 Subject: Besseres Setup für Auto-Vervollständigung MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- zsh/aliases | 2 ++ zsh/completion | 16 ++++++++++++++++ zsh/prompt | 2 ++ zsh/zshrc | 13 +++++-------- 4 files changed, 25 insertions(+), 8 deletions(-) create mode 100644 zsh/completion (limited to 'zsh') diff --git a/zsh/aliases b/zsh/aliases index b9a1866..ebeafdc 100644 --- a/zsh/aliases +++ b/zsh/aliases @@ -1,2 +1,4 @@ +# vim: filetype=zsh + alias mc='mc -u' alias gdb='gdb -q' diff --git a/zsh/completion b/zsh/completion new file mode 100644 index 0000000..ce676bb --- /dev/null +++ b/zsh/completion @@ -0,0 +1,16 @@ +# vim: filetype=zsh + +# Command completion +autoload -U compinit; compinit +_comp_options+=(globdots) # With hidden files + +zstyle ':completion:*' completer _extensions _complete _approximate + +zstyle ':completion:*' menu select + +zstyle ':completion:*:*:*:*:descriptions' format '%F{green}-- %d --%f' +zstyle ':completion:*:*:*:*:corrections' format '%F{yellow}!- %d (errors: %e) -!%f' +zstyle ':completion:*:*:*:*:messages' format ' %F{purple} -- %d --%f' +zstyle ':completion:*:*:*:*:warnings' format ' %F{red}-- no matches found --%f' +zstyle ':completion:*' group-name '' + diff --git a/zsh/prompt b/zsh/prompt index 47f7149..5c2ba5a 100644 --- a/zsh/prompt +++ b/zsh/prompt @@ -1,3 +1,5 @@ +# vim: filetype=zsh + autoload -Uz vcs_info precmd_vcs_info() { vcs_info } precmd_functions+=( precmd_vcs_info ) diff --git a/zsh/zshrc b/zsh/zshrc index 3628698..036b90a 100644 --- a/zsh/zshrc +++ b/zsh/zshrc @@ -6,21 +6,18 @@ setopt AUTO_PARAM_SLASH unsetopt CASE_GLOB setopt HIST_SAVE_NO_DUPS -# Command completion -autoload -U compinit; compinit -_comp_options+=(globdots) # With hidden files - -zstyle ':completion:*' menu select -zstyle ':completion:*:*:*:*:descriptions' format '%F{green}-- %d --%f' - -[[ ! -r ~/.opam/opam-init/init.zsh ]] || source ~/.opam/opam-init/init.zsh >/dev/null 2>&1 +[[ ! -r /usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh ]] || source /usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh +[[ ! -r /usr/local/share/zsh-autosuggestions/zsh-autosuggestions.zsh ]] || source /usr/local/share/zsh-autosuggestions/zsh-autosuggestions.zsh +[[ ! -r ~/.opam/opam-init/init.zsh ]] || source ~/.opam/opam-init/init.zsh bindkey -v export KEYTIMEOUT=1 fpath=($XDG_CONFIG_HOME/zsh $fpath) autoload -Uz prompt; prompt +autoload -Uz completion; completion +# Keybindings zmodload zsh/complist bindkey -M menuselect 'h' vi-backward-char bindkey -M menuselect 'k' vi-up-line-or-history -- cgit v1.3