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.

il y a 4 ans
il y a 4 ans
il y a 4 ans
12345678910111213141516171819202122232425262728293031323334353637
  1. #!/usr/bin/env sh
  2. # Description: Run fzf and go to the directory of the file selected
  3. #
  4. # Shell: POSIX compliant
  5. # Author: Anna Arad
  6. . "$(dirname "$0")"/.nnn-plugin-helper
  7. if [ "$(cmd_exists fzf)" -eq "0" ]; then
  8. sel=$(fzf)
  9. else
  10. exit 1
  11. fi
  12. if [ -n "$sel" ]; then
  13. if ! [ -d "$sel" ]; then
  14. sel=$(dirname "$sel")
  15. elif [ "$sel" = "." ]; then
  16. exit 0
  17. fi
  18. # Check if selected path returned
  19. # by fzf command is absolute
  20. case $sel in
  21. /*) nnn_cd "$sel" ;;
  22. *)
  23. # Remove "./" prefix if it exists
  24. sel="${sel#./}"
  25. if [ "$PWD" = "/" ]; then
  26. nnn_cd "/$sel"
  27. else
  28. nnn_cd "$PWD/$sel"
  29. fi;;
  30. esac
  31. fi