The Linux Page

Removing the fold columns on the left gvim after using diffsplit

One thing that I find annoying in gvim is the foldcolumn parameter which is not reset once you are done with a diff process.

Of course, gVIM does not really know when you are done diff-ing, so its behavior makes sense... only it is still annoying.

To remove the fold (2 gray columns on the left used to hide areas that match in each file) you simply have to set the foldcolumn parameter to zero:

:set foldcolumn=0

Just in case, you enter a diff from within vim by loading two files, then using;

:diffsplit #

The diffsplit can specify any buffer number, I use the # as the other buffer (the one you had loaded just before the current one, the one you access using Ctrl-6).

Also, for those who make pretty heavy use of the diff (by making a lot of modifications) you'll notice that once in a while even once equal on both sides, the diff doesn't get folded. To reset the current diff, use the update command:

:diffupdate

Now you should be set!