My build of nnn with minor changes
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
 
 
 
 
 
 

27 rindas
640 B

  1. #!/usr/bin/env bash
  2. # Description: Show diff of 2 directories or multiple files in vimdiff
  3. #
  4. # Shell: Bash
  5. # Author: Arun Prakash Jana
  6. selection=~/.config/nnn/.selection
  7. if [ -s $selection ]; then
  8. arr=$(cat $selection | tr '\0' '\n')
  9. { read -r f1; read -r f2; } <<< "$arr"
  10. if [ -z "$f2" ]; then
  11. exit
  12. fi
  13. if [ -d "$f1" ] && [ -d "$f2" ]; then
  14. vimdiff <(cd "$f1" && find | sort) <(cd "$f2" && find | sort)
  15. else
  16. cat $selection | xargs -0 -o vimdiff
  17. # For GNU xargs (note: ignoreme takes up $0)
  18. # cat $selection | xargs -0 bash -c '</dev/tty vimdiff "$@"' ignoreme
  19. fi
  20. fi