dotfiles icon indicating copy to clipboard operation
dotfiles copied to clipboard

Error detected while processing ~/.vimrc: line 176: E474: Invalid argument: diffopt+=vertical

Open jkereako opened this issue 5 years ago • 5 comments

Hi there,

I'm running Vim 8.1 on macOS Catalina. When I open Vim, I always get this error message.

Error detected while processing ~/.vimrc: line 176: E474: Invalid argument: diffopt+=vertical Press ENTER or type command to continue

Removing the "+" seemed to have silenced the error, but, because I'm a Vim neophyte I'm not convinced that this is the correct solution.

jkereako avatar Jan 09 '20 16:01 jkereako

The same error.

jimrpy avatar Jan 30 '20 09:01 jimrpy

Same here. Did anyone ever find a fix to this?

ashwinvidiyala avatar Mar 09 '20 16:03 ashwinvidiyala

@ashwinvidiyala I identified the problem and wrote about it here: https://www.micahsmith.com/blog/2019/11/fixing-vim-invalid-argument-diffopt-iwhite/

In short: stock vim on Catalina does not support diffopt=internal even though the default options include internal. Thus :set diffopt+=vertical is equivalent to :set diffopt=internal,filler,vertical which is an error because internal is not supported. One solution is to modify your .vimrc as follows:

if &diff
    set diffopt-=internal
    set diffopt+=vertical
endif

micahjsmith avatar Mar 27 '20 14:03 micahjsmith

@micahjsmith Sweet! Thanks :)

ashwinvidiyala avatar Mar 27 '20 22:03 ashwinvidiyala

Thanks, it's working for me.

pawan2901 avatar Sep 06 '20 08:09 pawan2901