My build of nnn with minor changes
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

quitcd.zsh 483 B

7 vuotta sitten
7 vuotta sitten
7 vuotta sitten
12345678910111213141516171819
  1. n()
  2. {
  3. # Block nesting of nnn in subshells
  4. if [ $(expr $NNNLVL + 0) -ge 1 ]; then
  5. echo "nnn is already running"
  6. return
  7. fi
  8. # The default behaviour is to cd on quit (nnn checks if NNN_TMPFILE is set)
  9. # To cd on quit only on ^G, export NNN_TMPFILE after the call to nnn
  10. export NNN_TMPFILE=${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.lastd
  11. nnn "$@"
  12. if [ -f $NNN_TMPFILE ]; then
  13. . $NNN_TMPFILE
  14. rm $NNN_TMPFILE
  15. fi
  16. }