mirror of
https://github.com/jarun/nnn.git
synced 2025-01-15 21:36:42 +00:00
escape call to nnn
so nnn
can be used as an alias to n
This commit is contained in:
parent
b0580905f2
commit
f2c7495f50
|
@ -19,7 +19,9 @@ n ()
|
||||||
# stty lwrap undef
|
# stty lwrap undef
|
||||||
# stty lnext undef
|
# stty lnext undef
|
||||||
|
|
||||||
nnn "$@"
|
# The backslash allows one to alias n to nnn if desired without making an
|
||||||
|
# infinitely recursive alias
|
||||||
|
\nnn "$@"
|
||||||
|
|
||||||
if [ -f "$NNN_TMPFILE" ]; then
|
if [ -f "$NNN_TMPFILE" ]; then
|
||||||
. "$NNN_TMPFILE"
|
. "$NNN_TMPFILE"
|
||||||
|
|
|
@ -12,4 +12,6 @@ set NNN_TMPFILE=~/.config/nnn/.lastd
|
||||||
# stty lwrap undef
|
# stty lwrap undef
|
||||||
# stty lnext undef
|
# stty lnext undef
|
||||||
|
|
||||||
alias n 'nnn; source "$NNN_TMPFILE"; rm -f "$NNN_TMPFILE"'
|
# The backslash allows one to alias n to nnn if desired without making an
|
||||||
|
# infinitely recursive alias
|
||||||
|
alias n '\nnn; source "$NNN_TMPFILE"; rm -f "$NNN_TMPFILE"'
|
||||||
|
|
|
@ -30,6 +30,8 @@ fn n {|@a|
|
||||||
# stty lwrap undef
|
# stty lwrap undef
|
||||||
# stty lnext undef
|
# stty lnext undef
|
||||||
|
|
||||||
|
# The e: prefix allows one to alias n to nnn if desired without making an
|
||||||
|
# infinitely recursive alias
|
||||||
e:nnn $@a
|
e:nnn $@a
|
||||||
|
|
||||||
if (path:is-regular $E:NNN_TMPFILE) {
|
if (path:is-regular $E:NNN_TMPFILE) {
|
||||||
|
|
|
@ -27,7 +27,9 @@ function n --wraps nnn --description 'support nnn quit and change directory'
|
||||||
# stty lwrap undef
|
# stty lwrap undef
|
||||||
# stty lnext undef
|
# stty lnext undef
|
||||||
|
|
||||||
nnn $argv
|
# The command function allows one to alias this function to `nnn` without
|
||||||
|
# making an infinitely recursive alias
|
||||||
|
command nnn $argv
|
||||||
|
|
||||||
if test -e $NNN_TMPFILE
|
if test -e $NNN_TMPFILE
|
||||||
source $NNN_TMPFILE
|
source $NNN_TMPFILE
|
||||||
|
|
Loading…
Reference in a new issue