Your ~/.vimrc
is read and executed only once. If you want to nullify it with another file, you'll have to change the value of every single option and unmap every single mapping in, of course, both files. This sounds like a very bad and unnecessarily complex idea.
If you want another environment, just use another environment:
$ vim <-- starts Vim normally, reading ~/.vimrc
$ vim -u ~/.vimsqlrc <-- starts Vim using your alternative vimrc
$ vim -u NONE <-- starts Vim without any vimrc
$ vim -u NORC <-- starts Vim without any vimrc, but with plugins
but I'm afraid you'll have to stop and restart Vim for that.
Anyway, your question has a very strong XY problem smell. Do you want to have specific settings for *.sql
files?
If that's your goal, you can put your settings in ~/.vim/after/ftplugin/sql.vim
like this:
setlocal autoindent
nnoremap <buffer> <F6> :echo "F6"<CR>
Using setlocal
for options and <buffer>
for mappings ensures that your settings are only applied for *.sql
files.
:source filename
working? – Adrian Aug 30 '13 at 14:21:h initilization
or:h vimrc
. What are the differences between the two vimrc? It seems like you might be able to go with per filetype settings. – FDinoff Aug 30 '13 at 14:30