My build of nnn with minor changes
Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

123456789101112131415161718192021222324252627
  1. #!/usr/bin/env sh
  2. # Description: cd to any dir in the z database using an fzf pane
  3. #
  4. # Shell: POSIX compliant
  5. # Author: Nick Waywood
  6. . "$(dirname "$0")"/.nnn-plugin-helper
  7. if which fzf >/dev/null 2>&1; then
  8. fuzzy=fzf
  9. elif which fzy >/dev/null 2>&1; then
  10. fuzzy=fzy
  11. else
  12. exit 1
  13. fi
  14. if [ -f "$HOME/.z" ]; then
  15. # I read the data from z's file instead of calling the z command so that the data doesn't need to be processed twice
  16. sel=$(awk -F "|" '{print $1}' "$HOME/.z" | "$fuzzy" | awk '{$1=$1};1')
  17. # NOTE: Uncomment this line and comment out the line above if you want to see the weightings of the dir's in the fzf/fzy pane
  18. # sel=$(awk -F "|" '{printf "%s %s\n", $2, $1}' "$HOME/.z" | "$fuzzy" | sed 's/^[0-9,.]* *//' | awk '{$1=$1};1')
  19. else
  20. exit 1
  21. fi
  22. printf "%s" "0$sel" > "$NNN_PIPE"