3 # Block nesting of nnn in subshells
4 if [[ "${NNNLVL:-0}" -ge 1 ]]; then
5 echo "nnn is already running"
9 # The behaviour is set to cd on quit (nnn checks if NNN_TMPFILE is set)
10 # If NNN_TMPFILE is set to a custom path, it must be exported for nnn to
11 # see. To cd on quit only on ^G, remove the "export" and make sure not to
12 # use a custom path, i.e. set NNN_TMPFILE *exactly* as follows:
13 # NNN_TMPFILE="${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.lastd"
14 export NNN_TMPFILE="${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.lastd"
16 # Unmask ^Q (, ^V etc.) (if required, see `stty -a`) to Quit nnn
22 # The backslash allows one to alias n to nnn if desired without making an
23 # infinitely recursive alias
26 if [ -f "$NNN_TMPFILE" ]; then
28 rm -f "$NNN_TMPFILE" > /dev/null