Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error open files after creating ~/.vimrc

Tags:

vim

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.

like image 814
ronnie Avatar asked Aug 23 '12 21:08

ronnie


1 Answers

This is the solution by example since most of the answers are correct above but they don't directly help you solve the problem. Areas of interest in bold.

" code with redefinition issues

function CloseDuplicateTabs() endfunction

command CloseDupTabs :call CloseDuplicateTabs()

" fixed code with overrides

function! CloseDuplicateTabs() endfunction

command! CloseDupTabs :call CloseDuplicateTabs()

like image 59
Ivandir Avatar answered Oct 26 '22 14:10

Ivandir