nnn

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit f2c7495f5079d99f9b702c768dd1ee179ec40d3e
parent b0580905f2d209f67e557eafd78ada1b53500bf2
Author: Anomalocaridid <29845794+Anomalocaridid@users.noreply.github.com>
Date:   Sun, 17 Jul 2022 00:25:59 +0000

escape call to `nnn` so `nnn` can be used as an alias to `n`

Diffstat:
Mmisc/quitcd/quitcd.bash_zsh | 4+++-
Mmisc/quitcd/quitcd.csh | 4+++-
Mmisc/quitcd/quitcd.elv | 2++
Mmisc/quitcd/quitcd.fish | 4+++-
4 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/misc/quitcd/quitcd.bash_zsh b/misc/quitcd/quitcd.bash_zsh @@ -19,7 +19,9 @@ n () # stty lwrap 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 . "$NNN_TMPFILE" diff --git a/misc/quitcd/quitcd.csh b/misc/quitcd/quitcd.csh @@ -12,4 +12,6 @@ set NNN_TMPFILE=~/.config/nnn/.lastd # stty lwrap 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"' diff --git a/misc/quitcd/quitcd.elv b/misc/quitcd/quitcd.elv @@ -30,6 +30,8 @@ fn n {|@a| # stty lwrap 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 if (path:is-regular $E:NNN_TMPFILE) { diff --git a/misc/quitcd/quitcd.fish b/misc/quitcd/quitcd.fish @@ -27,7 +27,9 @@ function n --wraps nnn --description 'support nnn quit and change directory' # stty lwrap 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 source $NNN_TMPFILE