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
796 B

  1. #!/usr/bin/env sh
  2. # Description: Fuzzy find a file in directory subtree with fzy
  3. # Opens in $VISUAL or $EDITOR if text
  4. # Opens other type of files with xdg-open
  5. #
  6. # Requires: fzf/fzy, xdg-open
  7. #
  8. # Shell: POSIX compliant
  9. # Author: Arun Prakash Jana
  10. if which fzf >/dev/null 2>&1; then
  11. entry=$(find . -type f 2>/dev/null | fzf --delimiter / --nth=-1 --tiebreak=begin --info=hidden)
  12. # To show only the file name
  13. # entry=$(find . -type f 2>/dev/null | fzf --delimiter / --with-nth=-1 --tiebreak=begin --info=hidden)
  14. elif which fzy >/dev/null 2>&1; then
  15. entry=$(find . -type f 2>/dev/null | fzy)
  16. else
  17. exit 1
  18. fi
  19. case "$(file -biL "$entry")" in
  20. *text*)
  21. "${VISUAL:-$EDITOR}" "$entry" ;;
  22. *)
  23. xdg-open "$entry" >/dev/null 2>&1 ;;
  24. esac