mirror of
https://github.com/jarun/nnn.git
synced 2024-11-28 05:41:31 +00:00
Simplify QuitCD scripts
This commit is contained in:
parent
cf388649b9
commit
c24efdbedb
|
@ -7,7 +7,8 @@ n ()
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# The default behaviour is to cd on quit (nnn checks if NNN_TMPFILE is set)
|
# The default behaviour is to cd on quit (nnn checks if NNN_TMPFILE is set)
|
||||||
# To cd on quit only on ^G, export NNN_TMPFILE after the call to nnn
|
# To cd on quit only on ^G, remove the "export" as in:
|
||||||
|
# NNN_TMPFILE="${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.lastd"
|
||||||
# NOTE: NNN_TMPFILE is fixed, should not be modified
|
# NOTE: NNN_TMPFILE is fixed, should not be modified
|
||||||
export NNN_TMPFILE="${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.lastd"
|
export NNN_TMPFILE="${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.lastd"
|
||||||
|
|
||||||
|
@ -15,6 +16,7 @@ n ()
|
||||||
# stty start undef
|
# stty start undef
|
||||||
# stty stop undef
|
# stty stop undef
|
||||||
# stty lwrap undef
|
# stty lwrap undef
|
||||||
|
# stty lnext undef
|
||||||
|
|
||||||
nnn "$@"
|
nnn "$@"
|
||||||
|
|
||||||
|
|
|
@ -9,5 +9,6 @@ set NNN_TMPFILE=~/.config/nnn/.lastd
|
||||||
# stty start undef
|
# stty start undef
|
||||||
# stty stop undef
|
# stty stop undef
|
||||||
# stty lwrap undef
|
# stty lwrap undef
|
||||||
|
# stty lnext undef
|
||||||
|
|
||||||
alias n 'nnn -fis; source "$NNN_TMPFILE"; rm -f "$NNN_TMPFILE"'
|
alias n 'nnn -fis; source "$NNN_TMPFILE"; rm -f "$NNN_TMPFILE"'
|
||||||
|
|
|
@ -10,7 +10,8 @@ function n --description 'support nnn quit and change directory'
|
||||||
end
|
end
|
||||||
|
|
||||||
# The default behaviour is to cd on quit (nnn checks if NNN_TMPFILE is set)
|
# The default behaviour is to cd on quit (nnn checks if NNN_TMPFILE is set)
|
||||||
# To cd on quit only on ^G, export NNN_TMPFILE after the call to nnn
|
# To cd on quit only on ^G, remove the "-x" as in:
|
||||||
|
# set NNN_TMPFILE "$XDG_CONFIG_HOME/nnn/.lastd"
|
||||||
# NOTE: NNN_TMPFILE is fixed, should not be modified
|
# NOTE: NNN_TMPFILE is fixed, should not be modified
|
||||||
if test -n "$XDG_CONFIG_HOME"
|
if test -n "$XDG_CONFIG_HOME"
|
||||||
set -x NNN_TMPFILE "$XDG_CONFIG_HOME/nnn/.lastd"
|
set -x NNN_TMPFILE "$XDG_CONFIG_HOME/nnn/.lastd"
|
||||||
|
@ -22,6 +23,7 @@ function n --description 'support nnn quit and change directory'
|
||||||
# stty start undef
|
# stty start undef
|
||||||
# stty stop undef
|
# stty stop undef
|
||||||
# stty lwrap undef
|
# stty lwrap undef
|
||||||
|
# stty lnext undef
|
||||||
|
|
||||||
nnn $argv
|
nnn $argv
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,8 @@ n ()
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# The default behaviour is to cd on quit (nnn checks if NNN_TMPFILE is set)
|
# The default behaviour is to cd on quit (nnn checks if NNN_TMPFILE is set)
|
||||||
# To cd on quit only on ^G, export NNN_TMPFILE after the call to nnn
|
# To cd on quit only on ^G, remove the "export" as in:
|
||||||
|
# NNN_TMPFILE="${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.lastd"
|
||||||
# NOTE: NNN_TMPFILE is fixed, should not be modified
|
# NOTE: NNN_TMPFILE is fixed, should not be modified
|
||||||
export NNN_TMPFILE="${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.lastd"
|
export NNN_TMPFILE="${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.lastd"
|
||||||
|
|
||||||
|
@ -15,6 +16,7 @@ n ()
|
||||||
# stty start undef
|
# stty start undef
|
||||||
# stty stop undef
|
# stty stop undef
|
||||||
# stty lwrap undef
|
# stty lwrap undef
|
||||||
|
# stty lnext undef
|
||||||
|
|
||||||
nnn "$@"
|
nnn "$@"
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue