aboutsummaryrefslogtreecommitdiffstats
path: root/misc
diff options
context:
space:
mode:
authorGravatar Arun Prakash Jana <engineerarun@gmail.com>2020-05-18 09:05:19 +0530
committerGravatar Arun Prakash Jana <engineerarun@gmail.com>2020-05-18 09:05:19 +0530
commit1b5c3096caaa6cd903473a69ec0890f40a986967 (patch)
treeb1f04dd8a77dc6963bfb430f8e0ec769995b0b82 /misc
parentcafcf1c4859c7a43eed0e2489142166195078d5d (diff)
downloadnnn-1b5c3096caaa6cd903473a69ec0890f40a986967.tar.gz
Option -P: specify plugin key to run on start
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 eeb1156..e8f2548 100644
--- a/misc/auto-completion/bash/nnn-completion.bash
+++ b/misc/auto-completion/bash/nnn-completion.bash
@@ -27,6 +27,7 @@ _nnn ()
-n
-o
-p
+ -P
-Q
-r
-R
@@ -45,6 +46,9 @@ _nnn ()
return 1
elif [[ $prev == -p ]]; then
COMPREPLY=( $(compgen -f -d -- "$cur") )
+ elif [[ $prev == -P ]]; then
+ local plugins=$(echo $NNN_PLUG | awk -F: -v RS=\; '{print $1}')
+ COMPREPLY=( $(compgen -W "$plugins" -- "$cur") )
elif [[ $prev == -s ]]; then
local sessions_dir=${XDG_CONFIG_HOME:-$HOME/.config}/nnn/sessions
COMPREPLY=( $(cd "$sessions_dir" && compgen -f -d -- "$cur") )
diff --git a/misc/auto-completion/fish/nnn.fish b/misc/auto-completion/fish/nnn.fish
index 65ab030..1b6455b 100644
--- a/misc/auto-completion/fish/nnn.fish
+++ b/misc/auto-completion/fish/nnn.fish
@@ -26,6 +26,7 @@ complete -c nnn -s l -r -d 'lines to move per scroll'
complete -c nnn -s n -d 'start in type-to-nav mode'
complete -c nnn -s o -d 'open files only on Enter'
complete -c nnn -s p -r -d 'copy selection to file' -a '-\tstdout'
+complete -c nnn -s P -r -d 'plugin key to run' -x -a '(echo $NNN_PLUG | awk -F: -v RS=\; \'{print $1"\t"$2}\')'
complete -c nnn -s Q -d 'disable quit confirmation'
complete -c nnn -s r -d 'show cp, mv progress (Linux-only)'
complete -c nnn -s R -d 'disable rollover at edges'
diff --git a/misc/auto-completion/zsh/_nnn b/misc/auto-completion/zsh/_nnn
index 4b40306..441589a 100644
--- a/misc/auto-completion/zsh/_nnn
+++ b/misc/auto-completion/zsh/_nnn
@@ -24,6 +24,7 @@ args=(
'(-n)-n[start in type-to-nav mode]'
'(-o)-o[open files only on Enter]'
'(-p)-p[copy selection to file]:file name'
+ '(-P)-P[plugin key to runn]:key char'
'(-Q)-Q[disable quit confirmation]'
'(-r)-r[show cp, mv progress (Linux-only)]'
'(-R)-R[disable rollover at edges]'