Skip to content

Commit

Permalink
split up ctrl-x r into two files
Browse files Browse the repository at this point in the history
  • Loading branch information
pseyfert committed Nov 23, 2018
1 parent 13300c0 commit cb89e84
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 11 deletions.
2 changes: 1 addition & 1 deletion conf.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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] $@"
Expand Down
4 changes: 4 additions & 0 deletions conf/20-completion
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# enable tab completion system
# © 2016 Paul Seyfert and contributors (see also: LICENSE)
autoload -U compinit
compinit -C
24 changes: 14 additions & 10 deletions conf/40-recent
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit cb89e84

Please sign in to comment.