local_vimrc.vim : Load local vimrs's from $HOME to the current directory
| script karma |
Rating 13/4,
Downloaded by 796
|
Comments, bugs, improvements
|
Vim wiki
|
| created by |
| Luc Hermitte |
| |
| script type |
| utility |
| |
| description |
Note: this plugin is maintained on googlecode. The last version is available at: http://code.google.com/p/lh-vim/source/browse/misc/trunk/plugin/local_vimrc.vim
---------------------------------
This plugin recursivelly sources the _vimrc_local.vim files present from $HOME to the directory of the current buffer every time we change buffer.
Example: current dir is ~/a/b/c. Files are sourced in this order:
~/_vimrc_local.vim, then ~/a/_vimrc_local.vim, ~/a/b/_vimrc_local.vim, and finally ~/a/b/c/_vimrc_local.vim
No messages issued if some of _vimrc_local.vim does not exist. |
| |
| install details |
0- Set g:local_vimrc in your .vimrc if you wish to use filenames other than '_vimrc_local.vim'
a- Drop this plugin into a {rtp}/plugin/ directory
b- Define _vimrc_local.vim files into your directories
Ideally, each foo/bar/_vimrc_local.vim should be defined the same way as a ftplugin, i.e.:
:::: foo/bar/_vimrc_local.vim:::
" Global stuff that needs to be updated/override
let g:bar = 'bar' " YES! This is a global variable!
" Local stuff that needs to be defined once for each buffer
if exists('b:foo_bar_local_vimrc') | finish | endif
let b:foo_bar_local_vimrc = 1
setlocal xxx
nnoremap <buffer> foo :call <sid>s:Foo()<cr>
let b:foo = 'foo'
" Global stuff that needs to be defined once only => functions
if exists('g:foo_bar_local_vimrc') | finish | endif
let g:foo_bar_local_vimrc = 1
function s:Foo()
...
endfunction
:::::::::::::: |
| |
script versions (upload new version)
Click on the package to download.
ip used for rating: 184.73.74.47
|