thoughtbot / dotfiles

A set of vim, zsh, git, and tmux configuration files.
https://thoughtbot.com
Other
7.99k stars 1.86k forks source link

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

Open jkereako opened 4 years ago

jkereako commented 4 years ago

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.

jimrpy commented 4 years ago

The same error.

ashwinvidiyala commented 4 years ago

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

micahjsmith commented 4 years ago

@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
ashwinvidiyala commented 4 years ago

@micahjsmith Sweet! Thanks :)

pawan2901 commented 4 years ago

Thanks, it's working for me.