nnn/misc/auto-completion/zsh/_nnn
Arun Prakash Jana 600286b627
Always prefer selection over current file
If you have selected some files, you intend to work on them. Also, this prompt
expects <kbd>c</kbd> / <kbd>s</kbd> which should cancel the next prompt in the
delete workflow. Rest of the three workflows are non-fatal.

Benefits of removing this option:
- code reduction
- one less step in the relevant workflows (more than one prompt feels dragged)

This prompt shows in the following workflows:
- delete: users have explicitly requested to prefer sel over current
- batch rename: key <kbd>^R</kbd> renames a single file
- archive: in most of the cases the user would want to archive the selection
- create sym/hard link: not a frequently used workflow (in general)
2021-02-10 05:12:40 +05:30

47 lines
1.4 KiB
Plaintext

#compdef nnn
#
# Completion definition for nnn.
#
# Author:
# Arun Prakash Jana <engineerarun@gmail.com>
#
setopt localoptions noshwordsplit noksharrays
local -a args
args=(
'(-a)-a[auto-create NNN_FIFO]'
'(-A)-A[disable dir auto-select]'
'(-b)-b[bookmark key to open]:key char'
'(-c)-c[cli-only opener]'
'(-C)-C[color by context]'
'(-d)-d[start in detail mode]'
'(-D)-D[dirs in context color]'
'(-e)-e[open text files in $VISUAL/$EDITOR/vi]'
'(-E)-E[use EDITOR for undetached edits]'
'(-f)-f[use readline history file]'
'(-F)-F[show fortune]'
'(-g)-g[regex filters]'
'(-H)-H[show hidden files]'
'(-J)-J[no auto-proceed on select]'
'(-K)-K[detect key collision]'
'(-l)-l[lines to move per scroll]:val'
'(-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]'
'(-s)-s[load session]:session name'
'(-S)-S[persistent session]'
'(-t)-t[timeout to lock]:seconds'
'(-T)-T[a d e r s t v]:key'
'(-U)-U[show user and group]'
'(-V)-V[show program version and exit]'
'(-w)-C[hardware cursor mode]'
'(-x)-x[notis, sel to system clipboard]'
'(-h)-h[show program help]'
'*:filename:_files'
)
_arguments -S -s $args