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.
 
 
 
 
 
 

35 lignes
1021 B

  1. # Rename this file to match the name of the function
  2. # e.g. ~/.config/fish/functions/n.fish
  3. # or, add the lines to the 'config.fish' file.
  4. function n --description 'support nnn quit and change directory'
  5. # Block nesting of nnn in subshells
  6. if [ (expr $NNNLVL + 0) -ge 1 ]
  7. echo "nnn is already running"
  8. return
  9. end
  10. # The default behaviour is to cd on quit (nnn checks if NNN_TMPFILE is set)
  11. # To cd on quit only on ^G, remove the "-x" as in:
  12. # set NNN_TMPFILE "$XDG_CONFIG_HOME/nnn/.lastd"
  13. # NOTE: NNN_TMPFILE is fixed, should not be modified
  14. if test -n "$XDG_CONFIG_HOME"
  15. set -x NNN_TMPFILE "$XDG_CONFIG_HOME/nnn/.lastd"
  16. else
  17. set -x NNN_TMPFILE "$HOME/.config/nnn/.lastd"
  18. end
  19. # Unmask ^Q (, ^V etc.) (if required, see `stty -a`) to Quit nnn
  20. # stty start undef
  21. # stty stop undef
  22. # stty lwrap undef
  23. # stty lnext undef
  24. nnn $argv
  25. if test -e $NNN_TMPFILE
  26. source $NNN_TMPFILE
  27. rm $NNN_TMPFILE
  28. end
  29. end