From 7f891225ab081fb5d0745e6114eaaca103c697f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emmanuel=20Beno=C3=AEt?= Date: Sun, 22 Feb 2015 10:37:39 +0100 Subject: [PATCH] Initial version * Allows custom VIM configuration directory through VIM_HOME * Loads NeoBundle * Various directories created, they'll be used later --- .gitignore | 3 +++ .gitmodules | 3 +++ bundle/neobundle.vim | 1 + bundles-init/.keep | 0 config-bits/20-neobundle.vim | 18 ++++++++++++++++++ keys/.keep | 0 vimrc | 28 ++++++++++++++++++++++++++++ 7 files changed, 53 insertions(+) create mode 100644 .gitignore create mode 100644 .gitmodules create mode 160000 bundle/neobundle.vim create mode 100644 bundles-init/.keep create mode 100644 config-bits/20-neobundle.vim create mode 100644 keys/.keep create mode 100644 vimrc diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..66d6d5e --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +/bundle +/.netrwhist +/keys diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..2c3072f --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "bundle/neobundle.vim"] + path = bundle/neobundle.vim + url = https://github.com/Shougo/neobundle.vim.git diff --git a/bundle/neobundle.vim b/bundle/neobundle.vim new file mode 160000 index 0000000..0c31437 --- /dev/null +++ b/bundle/neobundle.vim @@ -0,0 +1 @@ +Subproject commit 0c31437b58831efa20a9623e78be25a90df8c8c8 diff --git a/bundles-init/.keep b/bundles-init/.keep new file mode 100644 index 0000000..e69de29 diff --git a/config-bits/20-neobundle.vim b/config-bits/20-neobundle.vim new file mode 100644 index 0000000..9304e37 --- /dev/null +++ b/config-bits/20-neobundle.vim @@ -0,0 +1,18 @@ +" Load and initialise NeoBundle and plugins + +let s:bundles_dir = g:vim_home . "/bundle/" + +if has( 'vim_starting' ) + if &compatible + set nocompatible + endif + + let s:neobundle_path=s:bundles_dir . "neobundle.vim/" + let &g:runtimepath = &g:runtimepath . "," . s:neobundle_path +endif + +call neobundle#begin( s:bundles_dir ) + +NeoBundleFetch 'Shougo/neobundle.vim' + +call neobundle#end() diff --git a/keys/.keep b/keys/.keep new file mode 100644 index 0000000..e69de29 diff --git a/vimrc b/vimrc new file mode 100644 index 0000000..dfec902 --- /dev/null +++ b/vimrc @@ -0,0 +1,28 @@ +" Main VIM configuration file: only serves as a loader + + +" If another runtime directory is specified, use it +let s:own_path = expand( ':p:h' ) +let $VIM_HOME = $VIM_HOME == '' ? '' + \ : fnamemodify( $VIM_HOME . '/x' , ':p:h' ) +if $VIM_HOME == '' || $VIM_HOME == s:own_path + let $VIM_HOME = s:own_path + let g:vim_home = fnameescape( $VIM_HOME ) + let g:vim_vimrc = fnameescape( $VIM_HOME . '/vimrc' ) +else + let g:vim_home = fnameescape( $VIM_HOME ) + let g:vim_vimrc = fnameescape( $VIM_HOME . '/vimrc' ) + let &rtp = g:vim_home + if filereadable( g:vim_vimrc ) + execute 'source ' . g:vim_vimrc + endif + finish +endif + +" Execute configuration in config-bits +let s:cfg_bits_path = g:vim_home . '/config-bits' +for s:cfg_file in sort( + \ split( glob( s:cfg_bits_path . '/??-?*.vim' ) , "\n" ) ) + execute 'source ' . s:cfg_file +endfor +