about summary refs log tree commit diff
path: root/home/shell/zsh/completion-style.zsh
diff options
context:
space:
mode:
authorFranck Cuny <franck@fcuny.net>2023-03-11 14:33:26 -0800
committerFranck Cuny <franck@fcuny.net>2023-03-11 14:33:26 -0800
commitdea91567f215c0245517f9b87d28130a291a19a6 (patch)
tree0a7457b90f224467ff9994fbc1435a9524528878 /home/shell/zsh/completion-style.zsh
parentsecrets: move aptos' gcloud secrets to homeage (diff)
downloadworld-dea91567f215c0245517f9b87d28130a291a19a6.tar.gz
home/shell: switch the default shell back to zsh
I keep running into issues when using fish: I'm not familiar with the
syntax and I don't use it enough that it sticks. I also need to google
stuff regularly to figure out how things are supposed to work. This is
annoying enough that the supposed benefits of fish are not worth it for
me.
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}'