This commit is contained in:
ViViDboarder 2015-03-26 17:54:29 -07:00
parent 8ff7681f09
commit c5892e0bf0
3 changed files with 25 additions and 12 deletions

5
.gitignore vendored
View File

@ -1,6 +1,7 @@
vim/.netrwhist
vim/autoload/plug.vim
vim/backup/*~
vim/plugged/*
vim/rc/*.local.rc.vim
vim/tmp/*.swp
vim/tmp/*.swo
vim/.netrwhist
vim/tmp/*.swp

View File

@ -1,3 +1,15 @@
function! s:smart_source_rc(name)
call s:source_rc(a:name . '.rc.vim')
call s:source_rc(a:name . '.local.rc.vim')
endfunction
function! s:source_rc(path)
let l:f_path = fnameescape(expand('~/.vim/rc/' . a:path))
if filereadable(l:f_path)
execute 'source' . l:f_path
endif
endfunction
" Navigation {{
Plug 'file-line'
Plug 'tpope/vim-vinegar'
@ -17,7 +29,7 @@ Plug 'sandeepcr529/Buffet.vim', { 'on': 'Bufferlist' }
Plug 'ctrlpvim/ctrlp.vim'
call g:source_rc('plugins/ctrlp.rc.vim')
call s:source_rc('plugins/ctrlp.rc.vim')
" ag / ack {{
if executable('ag')

18
vimrc
View File

@ -7,12 +7,12 @@ if &compatible
set nocompatible
endif
function! g:smart_source_rc(name)
call g:source_rc(a:name . '.rc.vim')
call g:source_rc(a:name . '.local.rc.vim')
function! s:smart_source_rc(name)
call s:source_rc(a:name . '.rc.vim')
call s:source_rc(a:name . '.local.rc.vim')
endfunction
function! g:source_rc(path)
function! s:source_rc(path)
let l:f_path = fnameescape(expand('~/.vim/rc/' . a:path))
if filereadable(l:f_path)
execute 'source' . l:f_path
@ -43,12 +43,12 @@ if empty(glob('~/.vim/autoload/plug.vim'))
autocmd VimEnter * PlugInstall
endif
call g:source_rc('init.rc.vim')
call s:source_rc('init.rc.vim')
call plug#begin()
call g:smart_source_rc('plugins')
call s:smart_source_rc('plugins')
call plug#end()
call g:smart_source_rc('edit')
call g:smart_source_rc('keymap')
call g:smart_source_rc('ui')
call s:smart_source_rc('edit')
call s:smart_source_rc('keymap')
call s:smart_source_rc('ui')