My build of nnn with minor changes
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

4 anos atrás
7 anos atrás
7 anos atrás
123456789101112131415161718192021222324252627282930313233343536
  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 --wraps nnn --description 'support nnn quit and change directory'
  5. # Block nesting of nnn in subshells
  6. if test -n "$NNNLVL"
  7. if [ (expr $NNNLVL + 0) -ge 1 ]
  8. echo "nnn is already running"
  9. return
  10. end
  11. end
  12. # The default behaviour is to cd on quit (nnn checks if NNN_TMPFILE is set)
  13. # To cd on quit only on ^G, remove the "-x" as in:
  14. # set NNN_TMPFILE "$XDG_CONFIG_HOME/nnn/.lastd"
  15. # NOTE: NNN_TMPFILE is fixed, should not be modified
  16. if test -n "$XDG_CONFIG_HOME"
  17. set -x NNN_TMPFILE "$XDG_CONFIG_HOME/nnn/.lastd"
  18. else
  19. set -x NNN_TMPFILE "$HOME/.config/nnn/.lastd"
  20. end
  21. # Unmask ^Q (, ^V etc.) (if required, see `stty -a`) to Quit nnn
  22. # stty start undef
  23. # stty stop undef
  24. # stty lwrap undef
  25. # stty lnext undef
  26. nnn $argv
  27. if test -e $NNN_TMPFILE
  28. source $NNN_TMPFILE
  29. rm $NNN_TMPFILE
  30. end
  31. end