Skip to content

Commit 5de76f5

Browse files
committed
Initial commit
1 parent 824ea22 commit 5de76f5

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

autoload/projectrc.vim

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
function! projectrc#load(filename)
2+
let dir = expand('%:p:h')
3+
let prevdir = ''
4+
while dir !=# prevdir
5+
if !empty(globpath(dir, a:filename))
6+
let projectconfig = dir . '/' . a:filename
7+
source `=projectconfig`
8+
endif
9+
let prevdir = dir
10+
let dir = fnamemodify(dir, ':h')
11+
endwhile
12+
endfunction

plugin/projectrc.vim

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
" Enable configuration file of each directory.
2+
" Version: 0.2.0
3+
" Author : thinca <[email protected]>
4+
" License: zlib License
5+
6+
if !exists('g:projectrc_filename')
7+
let g:projectrc_filename = '.project.vimrc'
8+
endif
9+
10+
augroup plugin-projectrc
11+
autocmd!
12+
autocmd VimEnter * call projectrc#load(g:projectrc_filename)
13+
augroup END

0 commit comments

Comments
 (0)