mirror of
https://github.com/jarun/nnn.git
synced 2025-01-15 21:36:42 +00:00
Merge pull request #1337 from pcapriotti/pcapriotti/quit-on-cd-docs
Clarify docs in the quit-on-cd wrapper
This commit is contained in:
commit
bb875cd5e7
|
@ -7,10 +7,10 @@ n ()
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# The behaviour is set to cd on quit (nnn checks if NNN_TMPFILE is set)
|
# The behaviour is set to cd on quit (nnn checks if NNN_TMPFILE is set)
|
||||||
# To cd on quit only on ^G, either remove the "export" as in:
|
# If NNN_TMPFILE is set to a custom path, it must be exported for nnn to
|
||||||
|
# see. To cd on quit only on ^G, remove the "export" and make sure not to
|
||||||
|
# use a custom path, i.e. set NNN_TMPFILE *exactly* as follows:
|
||||||
# NNN_TMPFILE="${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.lastd"
|
# NNN_TMPFILE="${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.lastd"
|
||||||
# (or, to a custom path: NNN_TMPFILE=/tmp/.lastd)
|
|
||||||
# or, export NNN_TMPFILE after nnn invocation
|
|
||||||
export NNN_TMPFILE="${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.lastd"
|
export NNN_TMPFILE="${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.lastd"
|
||||||
|
|
||||||
# Unmask ^Q (, ^V etc.) (if required, see `stty -a`) to Quit nnn
|
# Unmask ^Q (, ^V etc.) (if required, see `stty -a`) to Quit nnn
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
# NOTE: set NNN_TMPFILE correctly if you use 'XDG_CONFIG_HOME'
|
# NOTE: set NNN_TMPFILE correctly if you use 'XDG_CONFIG_HOME'
|
||||||
|
|
||||||
# The behaviour is set to cd on quit (nnn checks if NNN_TMPFILE is set)
|
# The behaviour is set to cd on quit (nnn checks if NNN_TMPFILE is set)
|
||||||
# To cd on quit only on ^G, set NNN_TMPFILE after nnn invocation
|
# If NNN_TMPFILE is set to a custom path, it must be exported for nnn to see.
|
||||||
# A custom path can also be set e.g. set NNN_TMPFILE=/tmp/.lastd
|
# To cd on quit only on ^G, set NNN_TMPFILE after the nnn invocation, and make
|
||||||
|
# sure not to use a custom path.
|
||||||
set NNN_TMPFILE=~/.config/nnn/.lastd
|
set NNN_TMPFILE=~/.config/nnn/.lastd
|
||||||
|
|
||||||
# Unmask ^Q (, ^V etc.) (if required, see `stty -a`) to Quit nnn
|
# Unmask ^Q (, ^V etc.) (if required, see `stty -a`) to Quit nnn
|
||||||
|
|
|
@ -12,10 +12,9 @@ function n --wraps nnn --description 'support nnn quit and change directory'
|
||||||
end
|
end
|
||||||
|
|
||||||
# The behaviour is set to cd on quit (nnn checks if NNN_TMPFILE is set)
|
# The behaviour is set to cd on quit (nnn checks if NNN_TMPFILE is set)
|
||||||
# To cd on quit only on ^G, remove the "-x" as in:
|
# If NNN_TMPFILE is set to a custom path, it must be exported for nnn to
|
||||||
# set NNN_TMPFILE "$XDG_CONFIG_HOME/nnn/.lastd"
|
# see. To cd on quit only on ^G, remove the "-x" from both lines below,
|
||||||
# (or, to a custom path: set NNN_TMPFILE "/tmp/.lastd")
|
# without changing the paths.
|
||||||
# or, export NNN_TMPFILE after nnn invocation
|
|
||||||
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"
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue