mirror of
https://github.com/trimstray/the-book-of-secret-knowledge
synced 2024-12-28 09:59:00 +01:00
vimdiff & diffchar
This commit is contained in:
parent
ecf087c7b8
commit
9147a49cf7
1 changed files with 26 additions and 0 deletions
26
README.md
26
README.md
|
@ -1827,6 +1827,32 @@ diff <(cd directory1 && find | sort) <(cd directory2 && find | sort)
|
||||||
```bash
|
```bash
|
||||||
diff <(cat /etc/passwd) <(cut -f2 /etc/passwd)
|
diff <(cat /etc/passwd) <(cut -f2 /etc/passwd)
|
||||||
```
|
```
|
||||||
|
##### Tool: vimdiff
|
||||||
|
|
||||||
|
##### Highlight the exact differences, based on characters and words
|
||||||
|
|
||||||
|
```sh
|
||||||
|
vimdiff file1 file2
|
||||||
|
```
|
||||||
|
Compare two JSON files
|
||||||
|
|
||||||
|
```sh
|
||||||
|
vimdiff <(jq -S . A.json) <(jq -S . B.json)
|
||||||
|
```
|
||||||
|
|
||||||
|
Compare Hex dump
|
||||||
|
```sh
|
||||||
|
d(){ vimdiff <(f $1) <(f $2);};f(){ hexdump -C $1|cut -d' ' -f3-|tr -s ' ';}; d ~/bin1 ~/bin2
|
||||||
|
```
|
||||||
|
|
||||||
|
Save [diffchar](https://raw.githubusercontent.com/vim-scripts/diffchar.vim/master/plugin/diffchar.vim) @ `~/.vim/plugins`
|
||||||
|
|
||||||
|
Click `F7` to switch between diff modes
|
||||||
|
|
||||||
|
Usefull vimdiff commands:
|
||||||
|
* `qa` to exit all windows
|
||||||
|
* `:vertical resize 70` to resize window
|
||||||
|
* Set window width `Ctrl+W [N columns]+(Shift+)<\>`
|
||||||
|
|
||||||
___
|
___
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue