Main Page | Report this Page
Computers Forum Index  »  Computer - Editors  »  VIM: locally import options at startup?...
Page 1 of 1    

VIM: locally import options at startup?...

Author Message
Rui Maciel...
Posted: Thu Oct 08, 2009 9:57 am
Guest
Is it possible to set up some sort of config file inside a directory
so that, when vim is ran in it, it picks up the config file and
imports all sort of options, from key maps to macros, specific to that
directory?


Thanks in advance,
Rui Maciel
 
Mikolaj Machowski...
Posted: Thu Oct 08, 2009 1:50 pm
Guest
Rui Maciel scripsit:
Quote:
Is it possible to set up some sort of config file inside a directory
so that, when vim is ran in it, it picks up the config file and
imports all sort of options, from key maps to macros, specific to that
directory?

For example:

http://www.vim.org/scripts/script.php?script_id=441

m.
--
LaTeX + Vim = http://vim-latex.sourceforge.net/
Vim Universal Templates: http://vim.sf.net/script.php?script_id=1078
CLEWN - http://clewn.sf.net
 
Florian Rehnisch...
Posted: Thu Oct 08, 2009 2:32 pm
Guest
o Rui Maciel <rui.maciel at (no spam) gmail.com>:

Quote:
Is it possible to set up some sort of config file inside a directory
so that, when vim is ran in it, it picks up the config file and
imports all sort of options, from key maps to macros, specific to that
directory?

hmm, put a line in your vimrc:

autocmd BufEnter,BufNew /path/to/dir/* source /path/to/dir/mystuff.vim
--
flori
Vim-Hilfe auf Deutsch http://www.florianrehnisch.de/vimhelp/
 
James Michael Fultz...
Posted: Thu Oct 08, 2009 7:38 pm
Guest
* Mikolaj Machowski <mikmach at (no spam) wp.pl>:
Quote:
Rui Maciel scripsit:
Is it possible to set up some sort of config file inside a directory
so that, when vim is ran in it, it picks up the config file and
imports all sort of options, from key maps to macros, specific to that
directory?

For example:

http://www.vim.org/scripts/script.php?script_id=441

Or more simply, set 'exrc' and create a '.vimrc' in the desired
directory.

--
James Michael Fultz <xyzzy at (no spam) sent.as.invalid>
Remove this part when replying ^^^^^^^^
 
Gary Johnson...
Posted: Fri Oct 09, 2009 12:22 am
Guest
Rui Maciel <rui.maciel at (no spam) gmail.com> wrote:
Quote:
Is it possible to set up some sort of config file inside a directory
so that, when vim is ran in it, it picks up the config file and
imports all sort of options, from key maps to macros, specific to that
directory?

If the 'exrc' option is set, vim will load the .vimrc (Unix) or _vimrc
(Windows) file in the current directory after it loads the system and
user vimrc files. See

:help startup

If you want the directory-specific config file to be loaded instead of
your user vimrc, then I think putting this near the top of your user
vimrc will work (untested):

if filereadable("config.vim")
so "config.vim"
finish
endif

where "config.vim" is just a name I chose as as an example.

--
Gary Johnson
 
 
Page 1 of 1    
All times are GMT
The time now is Wed Nov 25, 2009 9:08 pm