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/autoload/plug.vim
vim/backup/*~
vim/plugged/* vim/plugged/*
vim/rc/*.local.rc.vim vim/rc/*.local.rc.vim
vim/tmp/*.swp
vim/tmp/*.swo 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 {{ " Navigation {{
Plug 'file-line' Plug 'file-line'
Plug 'tpope/vim-vinegar' Plug 'tpope/vim-vinegar'
@ -17,7 +29,7 @@ Plug 'sandeepcr529/Buffet.vim', { 'on': 'Bufferlist' }
Plug 'ctrlpvim/ctrlp.vim' Plug 'ctrlpvim/ctrlp.vim'
call g:source_rc('plugins/ctrlp.rc.vim') call s:source_rc('plugins/ctrlp.rc.vim')
" ag / ack {{ " ag / ack {{
if executable('ag') if executable('ag')

18
vimrc
View File

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