diff --git a/conf.mk b/conf.mk index 9476a62..9a629f9 100644 --- a/conf.mk +++ b/conf.mk @@ -2,7 +2,7 @@ INSTALL_TARGETS += install-conf install-rc CLEAN_TARGETS += clean-shellexrc ALL_TARGETS += conf/shellexrc -default_confs := 10-autoexec 20-nobeep 40-escape 40-home_end 40-setprompt 40-sigint 40-recent 90-hist 99-clear +default_confs := 10-autoexec 20-completion 20-nobeep 40-escape 40-home_end 40-setprompt 40-sigint 40-recent 90-hist 99-clear install-conf: echo "[INSTALL] $@" diff --git a/conf/20-completion b/conf/20-completion new file mode 100644 index 0000000..787bb97 --- /dev/null +++ b/conf/20-completion @@ -0,0 +1,4 @@ +# enable tab completion system +# © 2016 Paul Seyfert and contributors (see also: LICENSE) +autoload -U compinit +compinit -C diff --git a/conf/40-recent b/conf/40-recent index f4bd9d2..3313f4a 100644 --- a/conf/40-recent +++ b/conf/40-recent @@ -1,11 +1,15 @@ -autoload compinit -compinit -C - # 'ctrl-x r' will complete the 12 last modified (mtime) files/directories -zle -C newest-files complete-word _generic -bindkey '^Xr' newest-files -zstyle ':completion:newest-files:*' completer _files -zstyle ':completion:newest-files:*' file-patterns '*~.*(omN[1,12])' -zstyle ':completion:newest-files:*' menu select yes -zstyle ':completion:newest-files:*' sort false -zstyle ':completion:newest-files:*' matcher-list 'b:=*' # important +# © 2018 Michael Stapelberg and contributors (see also: LICENSE) + +# only add this completion if compinit has been called +if [[ -v _comps ]] +then + # 'ctrl-x r' will complete the 12 last modified (mtime) files/directories + zle -C newest-files complete-word _generic + bindkey '^Xr' newest-files + zstyle ':completion:newest-files:*' completer _files + zstyle ':completion:newest-files:*' file-patterns '*~.*(omN[1,12])' + zstyle ':completion:newest-files:*' menu select yes + zstyle ':completion:newest-files:*' sort false + zstyle ':completion:newest-files:*' matcher-list 'b:=*' # important +fi