diff options
Diffstat (limited to 'misc')
-rw-r--r-- | misc/quitcd/quitcd.bash | 10 | ||||
-rw-r--r-- | misc/quitcd/quitcd.fish | 9 | ||||
-rw-r--r-- | misc/quitcd/quitcd.zsh | 10 |
3 files changed, 29 insertions, 0 deletions
diff --git a/misc/quitcd/quitcd.bash b/misc/quitcd/quitcd.bash new file mode 100644 index 0000000..94accd6 --- /dev/null +++ b/misc/quitcd/quitcd.bash @@ -0,0 +1,10 @@ +export NNN_TMPFILE="/tmp/nnn" + +n() +{ + nnn -d + if [ -f $NNN_TMPFILE ]; then + . $NNN_TMPFILE + rm $NNN_TMPFILE + fi +} diff --git a/misc/quitcd/quitcd.fish b/misc/quitcd/quitcd.fish new file mode 100644 index 0000000..35551c8 --- /dev/null +++ b/misc/quitcd/quitcd.fish @@ -0,0 +1,9 @@ +export NNN_TMPFILE="/tmp/nnn" + +function n --description 'support nnn quit and change directory' + nnn -d + if test -e $NNN_TMPFILE + . $NNN_TMPFILE + rm $NNN_TMPFILE + end +end diff --git a/misc/quitcd/quitcd.zsh b/misc/quitcd/quitcd.zsh new file mode 100644 index 0000000..94accd6 --- /dev/null +++ b/misc/quitcd/quitcd.zsh @@ -0,0 +1,10 @@ +export NNN_TMPFILE="/tmp/nnn" + +n() +{ + nnn -d + if [ -f $NNN_TMPFILE ]; then + . $NNN_TMPFILE + rm $NNN_TMPFILE + fi +} |