Unfortunately, $VIM is only used for the user rc. $VIM =
/usr/share/vim, but global vimrc = /etc/vimrc, despite whatever I
tried to override VIM/VIMRUNTIME with.

How annoying. Your Vim must be compiled with a system vimrc path
hardcoded in, rather than using $VIM.

Going with the alias v='vim -u ~/.vimrc -N' solution. Not too
horrible, I guess.

Hmm. That's not a bad option. Just pondering the problem, though,
another thing you can try, if you don't mind the increased startup time,
is trying to clear everything (well, as much as you can) and start from
scratch in your vimrc. I had fun putting together a little script to do
it:

set all&
syntax off
filetype off
highlight clear
comclear
mapclear
mapclear!
autocmd!
set nomore
redir => s:augroups
   augroup
redir end
for s:group in split(s:augroups)
   exec "autocmd! ".s:group
   unlet s:group
endfor
unlet s:augroups
redir => s:funcs
   function
redir end
for s:func in split(s:funcs,'\n')
   exec "delfunction ".matchstr(s:func,'\s\zs.\{-}\ze(')
   unlet s:func
endfor
unlet s:funcs
redir => s:vars
   let
redir end
for s:var in split(s:vars,'\n')
   if s:var =~ '^v:' | continue | endif
   if s:var =~ '^s:' | continue | endif
   if s:var =~ '^b:changedtick\s' | continue | endif
   exec "unlet ".matchstr(s:var,'^.\{-}\ze\s')
   unlet s:var
endfor
unlet s:vars
set more&

It won't clear out local variables for other buffers/windows/scripts,
but otherwise should pretty much clear everything, I think. And before
plugins are loaded there shouldn't be much/any of that stuff anyway.

You might want to protect it somehow if you source your vimrc
mid-session (I sometimes do) so that the clearing only happens at
startup. Otherwise you'll 'turn off' all your plugins each time you
source your vimrc mid-session (as they won't be loaded automatically
like they are at startup). Just using a global variable or something
like that should work. Another way around it would be to do

:set noloadplugins
:runtime! plugin/**/*.vim

in vimrc and then plugins would be loaded by your vimrc, not Vim itself,
and it would happen every time your vimrc was sourced.

Just another few ideas.

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