nnn/plugins/ndiff
2019-05-26 10:27:09 +05:30

15 lines
347 B
Bash
Executable file

#!/usr/bin/env bash
# Description: Show diff of 2 directories or multiple files in vimdiff
#
# Shell: Bash
# Author: Arun Prakash Jana
arr=($(cat ~/.config/nnn/.selection | tr '\0' '\n'))
if [ -d "${arr[0]}" ] && [ -d "${arr[1]}" ]; then
vimdiff <(cd ${arr[0]} && find | sort) <(cd ${arr[1]} && find | sort)
else
vimdiff "${arr[@]}"
fi