aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorGravatar Arun Prakash Jana <engineerarun@gmail.com>2019-06-07 21:53:27 +0530
committerGravatar Arun Prakash Jana <engineerarun@gmail.com>2019-06-07 21:58:45 +0530
commitfa4f082ac0d1789b10c7b8465c43aa083a5d82d6 (patch)
tree8449891f01e5bbe7c678e861153b042331629ebe /scripts
parentcd458b9ab444b1b38ce5fc23f4fe81460728e923 (diff)
downloadnnn-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.bash14
-rw-r--r--scripts/quitcd/quitcd.csh3
-rw-r--r--scripts/quitcd/quitcd.fish14
-rw-r--r--scripts/quitcd/quitcd.zsh14
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
}