Before today I was using /etc/vim/vimrc to configure my vim setup. Today I thought of creating .vimrc file. So, I used
touch .vimrc
cat /etc/vim/vimrc > .vimrc
So, now when I open any file with vim I get the following errors:
Error detected while processing /home/ronnie/.vimrc:
line 68:
E122: Function SplitColors already exists, add ! to replace it
line 77:
E122: Function ChangeColors already exists, add ! to replace it
line 171:
E174: Command already exists: add ! to replace it
line 174:
E174: Command already exists: add ! to replace it
Press ENTER or type command to continue
I have both /etc/vim/vimrc and .vimrc file located in my system. So, is this the reason I am getting this error because from now on I would like to use only .vimrc to configure my vim setup.
You’re defining functions that have the same name as some already defined. Adding an exclamation mark after
function“overwrites” the previous definition, and in your case will stop the error message from showing.