Close
AlgoliaLogoLight
Close full mode
logo

Diff file with vim

Git RepositoryEdit on Github

A small trick to diff 2 files with vim

Demo

  • First open file_a.txt in vim.

demo

  • Then open another file, file_b.txt in split mode (:vsp file_b.txt).

demo

  • Incase we need to diff file_a.txt with file_b.txt then press <Ctrl-W> + w (press control button + w then w).

  • We are in file_a.txt, run :diffthis.

  • Go to file_b.txt press <Ctrl-W> + w and run :diffthis.

  • Wala..magic right!, it's show diff between 2 files.

demo

  • After that we can disable diff by run :diffoff both of file...done.

demo

Loading comments...