about summary refs log tree commit diff
path: root/home/shell/zsh/completion-style.zsh
diff options
context:
space:
mode:
Diffstat (limited to 'home/shell/zsh/completion-style.zsh')
-rw-r--r--home/shell/zsh/completion-style.zsh18
1 files changed, 13 insertions, 5 deletions
diff --git a/home/shell/zsh/completion-style.zsh b/home/shell/zsh/completion-style.zsh
index 32bd6f4..79a4e68 100644
--- a/home/shell/zsh/completion-style.zsh
+++ b/home/shell/zsh/completion-style.zsh
@@ -1,5 +1,16 @@
-# Style the completion a bit
-zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS}
+# 'ctrl-x r' will complete the 12 last modified (mtime) files/directories
+zle -C newest-files menu-complete _generic
+# Use "*newest-files" so that it matches both "newest-files" and
+# "load-completion-and-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
+
+# colors for zsh file name completion
+zmodload zsh/complist
+zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS}
 
 # Show a prompt on selection
 zstyle ':completion:*' select-prompt '%SScrolling active: current selection at %p%s'
@@ -13,9 +24,6 @@ zstyle ':completion:*' group-name ''
 # Keep directories and files separated
 zstyle ':completion:*' list-dirs-first true
 
-# Add colors to processes for kill completion
-zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#)*=0=01;31'
-
 # match uppercase from lowercase
 zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}'