diff options
author | Arun Prakash Jana <engineerarun@gmail.com> | 2017-04-19 18:22:30 +0530 |
---|---|---|
committer | Arun Prakash Jana <engineerarun@gmail.com> | 2017-04-20 17:33:54 +0530 |
commit | 01c1ef6e58c195821ff9ccb9489bd99a9101b0ec (patch) | |
tree | 32b5350310cd42b1f7256f4b3654ddeb01aa3cd1 /misc | |
parent | afa05409348fd3aa50ea9f491300ca00efb35c8d (diff) | |
download | nnn-01c1ef6e58c195821ff9ccb9489bd99a9101b0ec.tar.gz |
Support cd on quit
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 +} |