Luc Hermitte's VIM configuration | Monday 22nd November 2004 |
I have been using VIM on different types of architectures : under Sun/Solaris/*sh, under a PC/WindowsNT/zsh, under a PC/WindowsMillenium/ + Cygwin, under a PC/WindowsXP/ + Cygwin, and under a GNU/Linux Debian box.
Instead of managing a .vimrc
and a _vimrc
file,
they both are very short and source a common file :
vimrc_core.vim
On my hard drives, I have VIM 6.3, and I used to have VIM 5.7. Hence I have
isolated some stuff really common to both versions in my
$VIM/
, move VIM 5.7 stuff to $VIM/vim57/
and put
VIM 6.x specific stuff into $HOME/vimfiles/
(or what stands for it ; check
«:h 'runtimepath'
»).
This looks like this :
$VIM/ +--> plugin/ # plugins common to both versions of VIM +--> macros/ # macros common to both versions of VIM +--> vim57/ # initial $VIMRUNTIME for VIM 5.7 | +--> ftplugin/ # used to be my settings/ folder | +--> ... # default installation +--> vim63/ # initial $VIMRUNTIME for VIM 6.3 | +--> ... # default installation +--> vimrc_core.vim # I reckon it has nothing to do here +--> _vimrc_nix/win # special initialisations for *NIX / Ms-Windows +--> _gvimrc $HOME/vimfiles/ # personnal stuff for VIM 6.x +--> ... # default hierarchy, filled with my scripts
_vimrc <raw file> |
Example of a very succinct .vimrc file. |
|
vimrc_core.vim <raw file> help on : <S-F1>
|
The main file that contains all the mappings. It relies on two plugins : runtime.vim :
required!, and
help.vim : facultative.
|
|
_vimrc_nix <raw file> |
Some customizations for *NIX environments ; mainly keycodes remappings for my putty terminal. | |
_vimrc_win <raw file> |
Some customizations for Ms-Windows environments. | |
_gvimrc <raw file> |
Some stuff to load only when GUI is enabled. | |
myfiletypes.vim <raw file> |
Some custom filetypes. | |
cyg-wrapper.sh | This shell script combined, with the alias:
alias gvim='cyg-wrapper.sh "C:/Progra~1/Edition/vim/vim63/gvim.exe" -c', wraps VIM calls when the current *NIX environement is cygwin -- and the VIM version: a plain win32 executable like the default release for windows systems, or the one available on Cream web site. Indeed, cygwin is strictly unable to send correct (i.e. PC-ish) path names to VIM. If you have ever tried to type "gvim /etc/profile" or "gvim file-that-is-a-sym-link" from cygwin/bash, then I'm sure you see what I mean and why you definitively need this shell script. |
Some more explanations
vimrc_core.vim
vimrc_core.vim
corresponds to my .vimrc
. I gave it
another name in order to keep my .vimrc
and
_vimrc
short and always uptodate.
It sources _vimrc_nix
or _vimrc_win
regarding the
current environnement.
I will not detail every mapping or abbreviation defined, they are very
classical. Actually many are not mine at all and come from the
Sven Guckes's .vimrc
. If you want a short description of the
definitions, source the file and then hit <S-F1>
(if you have installed
help.vim
).
But it also contains many initialisations used for different (ft)plugins I use :
:runtime
extended to VIM 5.x) &
runtimepath
personal configuration.
Back to the VIM Page | hermitte at free.fr |