My build of nnn with minor changes
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。
 
 
 
 
 
 

28 行
588 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. fuzzy=fzf
  12. elif which fzy >/dev/null 2>&1; then
  13. fuzzy=fzy
  14. else
  15. exit 1
  16. fi
  17. entry="$(find . -type f 2>/dev/null | "$fuzzy")"
  18. case "$(file -biL "$entry")" in
  19. *text*)
  20. "${VISUAL:-$EDITOR}" "$entry" ;;
  21. *)
  22. xdg-open "$entry" >/dev/null 2>&1 ;;
  23. esac