diff options
author | 2019-06-07 21:53:27 +0530 | |
---|---|---|
committer | 2019-06-07 21:58:45 +0530 | |
commit | fa4f082ac0d1789b10c7b8465c43aa083a5d82d6 (patch) | |
tree | 8449891f01e5bbe7c678e861153b042331629ebe /scripts | |
parent | cd458b9ab444b1b38ce5fc23f4fe81460728e923 (diff) | |
download | nnn-fa4f082ac0d1789b10c7b8465c43aa083a5d82d6.tar.gz |
Move cd on quit file
The new location is ~/.config/nnn/.lastd
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/quitcd/quitcd.bash | 14 | ||||
-rw-r--r-- | scripts/quitcd/quitcd.csh | 3 | ||||
-rw-r--r-- | scripts/quitcd/quitcd.fish | 14 | ||||
-rw-r--r-- | scripts/quitcd/quitcd.zsh | 14 |
4 files changed, 22 insertions, 23 deletions
diff --git a/scripts/quitcd/quitcd.bash b/scripts/quitcd/quitcd.bash index a4482e4..85b028a 100644 --- a/scripts/quitcd/quitcd.bash +++ b/scripts/quitcd/quitcd.bash @@ -1,11 +1,11 @@ -export NNN_TMPFILE="/tmp/nnn" - n() { - nnn "$@" + nnn "$@" + + NNN_TMPFILE=~/.config/nnn/.lastd - if [ -f $NNN_TMPFILE ]; then - . $NNN_TMPFILE - rm -f $NNN_TMPFILE > /dev/null - fi + if [ -f $NNN_TMPFILE ]; then + . $NNN_TMPFILE + rm -f $NNN_TMPFILE > /dev/null + fi } diff --git a/scripts/quitcd/quitcd.csh b/scripts/quitcd/quitcd.csh index 8feabcf..62e9897 100644 --- a/scripts/quitcd/quitcd.csh +++ b/scripts/quitcd/quitcd.csh @@ -1,3 +1,2 @@ -setenv NNN_TMPFILE /tmp/nnn - +set NNN_TMPFILE=~/.config/nnn/.lastd alias n 'nnn; source "$NNN_TMPFILE"; rm "$NNN_TMPFILE"' diff --git a/scripts/quitcd/quitcd.fish b/scripts/quitcd/quitcd.fish index 748f0dd..3478014 100644 --- a/scripts/quitcd/quitcd.fish +++ b/scripts/quitcd/quitcd.fish @@ -2,13 +2,13 @@ # e.g. ~/.config/fish/functions/n.fish # or, add the lines to the 'config.fish' file. -export NNN_TMPFILE="/tmp/nnn" - function n --description 'support nnn quit and change directory' - nnn $argv + nnn $argv + + set NNN_TMPFILE ~/.config/nnn/.lastd - if test -e $NNN_TMPFILE - source $NNN_TMPFILE - rm $NNN_TMPFILE - end + if test -e $NNN_TMPFILE + source $NNN_TMPFILE + rm $NNN_TMPFILE + end end diff --git a/scripts/quitcd/quitcd.zsh b/scripts/quitcd/quitcd.zsh index dc83b23..79f5a03 100644 --- a/scripts/quitcd/quitcd.zsh +++ b/scripts/quitcd/quitcd.zsh @@ -1,11 +1,11 @@ -export NNN_TMPFILE="/tmp/nnn" - n() { - nnn "$@" + nnn "$@" + + NNN_TMPFILE=~/.config/nnn/.lastd - if [ -f $NNN_TMPFILE ]; then - . $NNN_TMPFILE - rm $NNN_TMPFILE - fi + if [ -f $NNN_TMPFILE ]; then + . $NNN_TMPFILE + rm $NNN_TMPFILE + fi } |