gitreadonlyvimdiffdifftool

How to prevent git vimdiff from opening files as read-only?


I'm trying to use vimdiff as a diff tool for Git but, for some reason, the files are always open in read-only mode. It makes sense for the original file but not for the ones that I have modified (since I haven't committed them yet).

This is my current .gitconfig:

[diff]
        tool = vimdiff
[merge]
        tool = vimdiff
[difftool]
        prompt = false

Any idea what could be causing this?


Solution

  • That's the default desired behaviour for vimdiff. You can unset using :set noro.

    Or in your .vimrc config, add this:

    " Default to not read-only in vimdiff
    set noro