Diff Selections, Files, Directories and Git History with Vim
In this video we'll go over how to diff text in a bunch of different ways using Vim and the command line.
Quick Jump:
As developers we’re constantly evaluating text. Let’s go over how we can use Vim and the command line to see what changed between 2 versions of text. These are plugins and commands I’ve been using for many many months. They work very nicely in practice.
# Demo Video of Diffing a Few Things with Vim
Timestamped Table of Contents
- 1:01 – Taking a look at diffing 2 different files side by side within Vim
- 2:08 – Modifying one of the files so we can see the add / remove diff colors
- 2:53 – Diffing 2 different directories with Vim
- 5:07 – Quickly applying changes from 1 diff to the other one with Vim
- 7:04 – Going over the vdiff Bash alias to make this work
- 8:35 – Adding 2 plugins to our .vimrc file to make everything work
- 9:20 – Diffing selections of text from within Vim
- 11:39 – Doing a diff in a git repo based on the current file and the last commit
- 13:39 – Finding a list of git commits for a file and diffing any one of them
- 14:53 – Quickly diffing 2 files on the command line with the diff tool
- 16:13 – Running the non-aliased version of a program that you might have aliased
Reference Links
- https://github.com/nickjj/dotfiles
- https://github.com/will133/vim-dirdiff
- https://github.com/AndrewRadev/linediff.vim
- https://github.com/tpope/vim-fugitive
How do you manage diffing things in Vim / command line? Let me know below!