On 04/12/09 13:23, Tim Chase wrote: >>> After I change the vimrc with vim, how to make it useful right now? now >>> I have to close vim, and reopen it again. >> >> That's the way to go; anything else requires special precautions in how >> you write the vimrc, and I'm not even sure the vimrc_example.vim uses them. > > > However you can get a close approximation by using > > :source ~/.vimrc > > Any quirks that arise stem from Tony's statement about > "requir[ing] special precautions". > > -tim > > >
The precautions in question include - defining functions, autocommands and commands with a bang to remove any existing versions - explicit :unlet, :unmap etc. to remove anything present in the old version and removed in the new one; then wrapping them in if exists(), if hasmapto(), or alternately in try... catch... [finally...] endtry, to avoid errors when it's not necessary anymore. - etc. Personally I prefer restarting Vim rather than constant care about making my vimrc "re-sourceable". Making it portable (with "if has()", "if exists()" and the like) is already trouble enough, but I do it because I believe it's useful -- I have several Vim versions installed and I used to run on double-boot Win&Lin with a single vimrc. Best regards, Tony. -- "Of _course_ it's the murder weapon. Who would frame someone with a fake?" -- You received this message from the "vim_use" maillist. For more information, visit http://www.vim.org/maillist.php
