mirror of
https://github.com/jarun/nnn.git
synced 2024-11-24 11:51:27 +00:00
Support directory diff
This commit is contained in:
parent
7bf671c954
commit
d6fbe87768
|
@ -9,7 +9,7 @@
|
||||||
| imgur | bash | - | Upload an image to imgur (from [imgur-screenshot](https://github.com/jomo/imgur-screenshot)) |
|
| imgur | bash | - | Upload an image to imgur (from [imgur-screenshot](https://github.com/jomo/imgur-screenshot)) |
|
||||||
| ipinfo | sh | curl, whois | Fetch external IP address and whois information |
|
| ipinfo | sh | curl, whois | Fetch external IP address and whois information |
|
||||||
| kdeconnect | sh | kdeconnect-cli | Send selected files to an Android device |
|
| kdeconnect | sh | kdeconnect-cli | Send selected files to an Android device |
|
||||||
| ndiff | sh | vimdiff | Show diff for selection |
|
| ndiff | bash | vimdiff | Diff for selection (limited to 2 for directories) |
|
||||||
| nmount | sh | pmount | Toggle mount status of a device as normal user |
|
| nmount | sh | pmount | Toggle mount status of a device as normal user |
|
||||||
| nwal | sh | nitrogen | Set the selected image as wallpaper using nitrogen |
|
| nwal | sh | nitrogen | Set the selected image as wallpaper using nitrogen |
|
||||||
| pastebin | sh | [pastebinit](https://launchpad.net/pastebinit) | Paste contents of current (text) file to paste.ubuntu.com |
|
| pastebin | sh | [pastebinit](https://launchpad.net/pastebinit) | Paste contents of current (text) file to paste.ubuntu.com |
|
||||||
|
|
|
@ -1,8 +1,14 @@
|
||||||
#!/usr/bin/env sh
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
# Description: Show diff using vimdiff
|
# Description: Show diff of 2 directories or multiple files in vimdiff
|
||||||
#
|
#
|
||||||
# Shell: POSIX compliant
|
# Shell: Bash
|
||||||
# Author: Arun Prakash Jana
|
# Author: Arun Prakash Jana
|
||||||
|
|
||||||
vimdiff $(cat ~/.config/nnn/.selection | tr '\0' '\n')
|
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
|
||||||
|
|
Loading…
Reference in a new issue