aboutsummaryrefslogtreecommitdiffstats
path: root/misc
diff options
context:
space:
mode:
authorGravatar Arun Prakash Jana <engineerarun@gmail.com>2020-03-18 02:35:05 +0530
committerGravatar Arun Prakash Jana <engineerarun@gmail.com>2020-03-18 02:35:05 +0530
commit85379a703bb698eb69447a1fc2a717e8f2813717 (patch)
tree50e0b2026abc8fbb28137899a075654bea80b061 /misc
parentfc8c5b46b382998e4a25cf4d8bfd5fce4f0831c0 (diff)
downloadnnn-85379a703bb698eb69447a1fc2a717e8f2813717.tar.gz
Option -T to change default sort order
Diffstat (limited to 'misc')
-rw-r--r--misc/auto-completion/bash/nnn-completion.bash4
-rw-r--r--misc/auto-completion/fish/nnn.fish1
-rw-r--r--misc/auto-completion/zsh/_nnn1
3 files changed, 6 insertions, 0 deletions
diff --git a/misc/auto-completion/bash/nnn-completion.bash b/misc/auto-completion/bash/nnn-completion.bash
index b6e370d..64dff7a 100644
--- a/misc/auto-completion/bash/nnn-completion.bash
+++ b/misc/auto-completion/bash/nnn-completion.bash
@@ -31,6 +31,7 @@ _nnn ()
-s
-S
-t
+ -T
-v
-V
-x
@@ -46,6 +47,9 @@ _nnn ()
COMPREPLY=( $(cd "$sessions_dir" && compgen -f -d -- "$cur") )
elif [[ $prev == -t ]]; then
return 1
+ elif [[ $prev == -T ]]; then
+ local keys=$(echo "a d e r s t v" | awk -v RS=' ' '{print $0}')
+ COMPREPLY=( $(compgen -W "$keys" -- "$cur") )
elif [[ $cur == -* ]]; then
COMPREPLY=( $(compgen -W "${opts[*]}" -- "$cur") )
else
diff --git a/misc/auto-completion/fish/nnn.fish b/misc/auto-completion/fish/nnn.fish
index 99c857a..6bc3e0e 100644
--- a/misc/auto-completion/fish/nnn.fish
+++ b/misc/auto-completion/fish/nnn.fish
@@ -30,6 +30,7 @@ complete -c nnn -s R -d 'disable rollover at edges'
complete -c nnn -s s -r -d 'load session by name' -x -a '@\t"last session" (ls $sessions_dir)'
complete -c nnn -s S -d 'start in disk usage analyzer mode'
complete -c nnn -s t -r -d 'timeout in seconds to lock'
+complete -c nnn -s T -r -d 'a d e r s t v'
complete -c nnn -s v -d 'use version compare to sort files'
complete -c nnn -s V -d 'show program version and exit'
complete -c nnn -s x -d 'notis, sel to system clipboard'
diff --git a/misc/auto-completion/zsh/_nnn b/misc/auto-completion/zsh/_nnn
index bd6e926..f355263 100644
--- a/misc/auto-completion/zsh/_nnn
+++ b/misc/auto-completion/zsh/_nnn
@@ -28,6 +28,7 @@ args=(
'(-s)-s[load session]:session name'
'(-S)-S[start in disk usage analyzer mode]'
'(-t)-t[timeout to lock]:seconds'
+ '(-T)-T[a d e r s t v]:key'
'(-v)-v[use version compare to sort files]'
'(-V)-V[show program version and exit]'
'(-x)-x[notis, sel to system clipboard]'