Tag: vim

  • Git with vimdiff

    Some people are really a big fan of ‘vim’ and so they also use ‘vimdiff’ over the default ‘diff’ utility. ‘vimdiff’ shows you a side by side diff which is very easy to read (shown in the image below).

    vimdiff in action
    vimdiff in action

    Now if you are using ‘git’ and you run ‘git diff’ you will get a diff which is not very human readable. Thats where ‘vimdiff’ comes.

    > git diff
    diff --git a/todo-java-app/pom.xml b/todo-java-app/pom.xml
    index 96aebba..6b9af3f 100644
    --- a/todo-java-app/pom.xml
    +++ b/todo-java-app/pom.xml
    @@ -1,5 +1,6 @@
    
    +testing
         4.0.0
         com.rokoder
         todo-java-app
    @@ -48,4 +49,4 @@
                 5.1.18
    
    -
    \ No newline at end of file
    +
    >
    >

    ‘git’ supports ‘vimdiff’ as a diff tool. Run the below command to change the diff tool to ‘vimdiff’.
    (more…)