I have this issue where I need to both compare files, which I do using vimdiff
, but also work on individual files with vertically split screens (vs
). However, after I call vimdiff on a file, opening the file again later I see that scrollbind
and cursorbind
are set, which gets annoying to deactivate manually all the time. Is there a way to turn off scrollbind
and cursorbind
off automatically on exit form vimdiff?
As a clarification, here's an example of what I experience:
$ vim foo.txt # works fine, noscrollbind and nocursorbind are set
$ vimdiff foo.txt bar.txt # works as expected, scrollbind and cursorbind are set during diff
$ vim foo.txt # now scrollbind and cursorbind remain set, which I don't want
:diffoff
solves the problem. Will post an answer if it works for you. Add!
if you want it to effect all windows (in current tabpage).set noscrollbind
andset nocursorbind
, but I don't want to do it every time manually, as the steps I outlined above are part of a workflow that I use very often.