/
project.vim
41 lines (36 loc) · 1.13 KB
/
project.vim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
"
" This file is used along with a simple wrapper for vim
" (pvim) that loads project specific settings.
" It makes the asumption you are working on one project per
" (g)vim session.
"
let g:project_path = expand('<sfile>:p:h')
"
" May need to make this a bit smarter.
" Maybe integrate with on of the cmake-vim
" modules.
"
execute 'set makeprg=' . 'cmake\ --build\ ' . g:project_path. '/build'
let s:puml_make_cmd = g:project_path . '/scripts/gendiag %'
"
" For PlantUML files, set the make program
" to a wrapper in the scripts directory that
" helps do the correct thing for the common.puml
" file.
"
augroup filetype_plantuml
autocmd!
" use let with the local option so that we can get consistent
" handling of spaces.
autocmd FileType plantuml let &l:makeprg = s:puml_make_cmd
augroup END
"
" pvim uses session support (-S) to load this file. But seesion
" files are loaded very late. So there may already be buffers
" loaded that need have the makeprg set.
"
"for buf in getbufinfo()
" if getbufvar(buf.bufnr, '&filetype') == "plantuml"
" call setbufvar(buf.bufnr, '&makeprg', s:puml_make_cmd)
" endif
"endfor