mirror of
https://github.com/jarun/nnn.git
synced 2024-12-01 02:49:44 +00:00
Merge pull request #302 from fokinpv/fix-quitcd-example
Fix quitcd snippets for 'zsh' and 'bash'
This commit is contained in:
commit
d03ff4dc91
|
@ -1,9 +1,9 @@
|
||||||
n()
|
n()
|
||||||
{
|
{
|
||||||
nnn "$@"
|
|
||||||
|
|
||||||
NNN_TMPFILE=${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.lastd
|
NNN_TMPFILE=${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.lastd
|
||||||
|
|
||||||
|
nnn "$@"
|
||||||
|
|
||||||
if [ -f $NNN_TMPFILE ]; then
|
if [ -f $NNN_TMPFILE ]; then
|
||||||
. $NNN_TMPFILE
|
. $NNN_TMPFILE
|
||||||
rm -f $NNN_TMPFILE > /dev/null
|
rm -f $NNN_TMPFILE > /dev/null
|
||||||
|
|
|
@ -3,11 +3,11 @@
|
||||||
# or, add the lines to the 'config.fish' file.
|
# or, add the lines to the 'config.fish' file.
|
||||||
|
|
||||||
function n --description 'support nnn quit and change directory'
|
function n --description 'support nnn quit and change directory'
|
||||||
nnn $argv
|
|
||||||
|
|
||||||
# NOTE: set NNN_TMPFILE correctly if you use 'XDG_CONFIG_HOME'
|
# NOTE: set NNN_TMPFILE correctly if you use 'XDG_CONFIG_HOME'
|
||||||
set NNN_TMPFILE ~/.config/nnn/.lastd
|
set NNN_TMPFILE ~/.config/nnn/.lastd
|
||||||
|
|
||||||
|
nnn $argv
|
||||||
|
|
||||||
if test -e $NNN_TMPFILE
|
if test -e $NNN_TMPFILE
|
||||||
source $NNN_TMPFILE
|
source $NNN_TMPFILE
|
||||||
rm $NNN_TMPFILE
|
rm $NNN_TMPFILE
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
n()
|
n()
|
||||||
{
|
{
|
||||||
nnn "$@"
|
|
||||||
|
|
||||||
NNN_TMPFILE=${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.lastd
|
NNN_TMPFILE=${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.lastd
|
||||||
|
|
||||||
|
nnn "$@"
|
||||||
|
|
||||||
if [ -f $NNN_TMPFILE ]; then
|
if [ -f $NNN_TMPFILE ]; then
|
||||||
. $NNN_TMPFILE
|
. $NNN_TMPFILE
|
||||||
rm $NNN_TMPFILE
|
rm $NNN_TMPFILE
|
||||||
|
|
Loading…
Reference in a new issue