2015-02-22 10:37:39 +01:00
|
|
|
" Main VIM configuration file: only serves as a loader
|
|
|
|
|
|
|
|
|
|
|
|
" If another runtime directory is specified, use it
|
|
|
|
let s:own_path = expand( '<sfile>:p:h' )
|
2023-06-17 17:17:36 +02:00
|
|
|
let $VIM_HOME = $VIM_HOME == '' ? ''
|
2015-02-22 10:37:39 +01:00
|
|
|
\ : fnamemodify( $VIM_HOME . '/x' , ':p:h' )
|
2015-02-22 11:43:04 +01:00
|
|
|
|
2015-02-22 10:37:39 +01:00
|
|
|
if $VIM_HOME == '' || $VIM_HOME == s:own_path
|
2015-02-22 11:43:04 +01:00
|
|
|
" Default configuration directory
|
2015-02-22 10:37:39 +01:00
|
|
|
let $VIM_HOME = s:own_path
|
|
|
|
let g:vim_home = fnameescape( $VIM_HOME )
|
|
|
|
let g:vim_vimrc = fnameescape( $VIM_HOME . '/vimrc' )
|
|
|
|
else
|
2015-02-22 11:43:04 +01:00
|
|
|
" Use another configuration directory
|
2015-02-22 10:37:39 +01:00
|
|
|
let g:vim_home = fnameescape( $VIM_HOME )
|
|
|
|
let g:vim_vimrc = fnameescape( $VIM_HOME . '/vimrc' )
|
2015-02-22 11:43:04 +01:00
|
|
|
let &rtp = printf(
|
|
|
|
\ '%s/vimfiles,%s,%s,%s/vimfiles/after,%s/after' ,
|
|
|
|
\ $VIM , $VIMRUNTIME , g:vim_home , $VIM , g:vim_home )
|
2015-02-22 10:37:39 +01:00
|
|
|
if filereadable( g:vim_vimrc )
|
|
|
|
execute 'source ' . g:vim_vimrc
|
|
|
|
endif
|
|
|
|
finish
|
|
|
|
endif
|
|
|
|
|
2015-02-23 22:11:15 +01:00
|
|
|
" Execute configuration in cfg-pre/, which should in turn execute the main
|
|
|
|
" configuration in cfg/
|
|
|
|
let s:cfg_bits_path = g:vim_home . '/cfg-pre'
|
2015-03-13 11:20:55 +01:00
|
|
|
let s:cfg_files = glob( s:cfg_bits_path . '/??-?*.vim' , 0 , 1 )
|
|
|
|
for s:cfg_file in sort( s:cfg_files )
|
2015-02-22 10:37:39 +01:00
|
|
|
execute 'source ' . s:cfg_file
|
|
|
|
endfor
|