My build of nnn with minor changes
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
 
 
 
 

28 lignes
793 B

  1. n ()
  2. {
  3. # Block nesting of nnn in subshells
  4. if [ -n $NNNLVL ] && [ "${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, remove the "export" as in:
  10. # NNN_TMPFILE="${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.lastd"
  11. # NOTE: NNN_TMPFILE is fixed, should not be modified
  12. export NNN_TMPFILE="${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.lastd"
  13. # Unmask ^Q (, ^V etc.) (if required, see `stty -a`) to Quit nnn
  14. # stty start undef
  15. # stty stop undef
  16. # stty lwrap undef
  17. # stty lnext undef
  18. nnn "$@"
  19. if [ -f "$NNN_TMPFILE" ]; then
  20. . "$NNN_TMPFILE"
  21. rm -f "$NNN_TMPFILE" > /dev/null
  22. fi
  23. }