On 19/05/11 11:36 PM, cyboman wrote:
i'm continuously making additions to my _vimrc file and sometimes need
to re-source the file. i have a lot of mappings in the file so every
time i re-source it i get errors saying that the given mapping already
exists. does anybody know if there is a way to source _vimrc  without
showing all those errors?

I don't see any problem with mappings being redefined. I can do

:map a b

and then the same again with no error. Nor can I find an error message about mappings already existing in the help, so I don't think I've just turned it off, though perhaps I have.

If it's commands and functions, you can redefine those by adding a ! so you have function! and command!. To deal with autocommands, you should use autocommand groups and clear them, e.g.:

augroup MyAutocommands
   au!
   au BufRead * do something
augroup END

That should take care of most things and allow you to source your vimrc multiple times. I do it often with mine, so it's definitely possible.

Ben.


--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Reply via email to