-
Notifications
You must be signed in to change notification settings - Fork 27
/
Copy path.vimrc
54 lines (43 loc) · 1.67 KB
/
.vimrc
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
""" To use this you need to have the following plugins installed
""" with your favorite plugin manager:
"""
""" Plugin 'justmao945/vim-clang'
""" Plugin 'w0rp/ale'
"""
""" And also have the following lines in your ~/.vimrc, so that
""" the project specific .vimrc will get evaluated:
"""
""" set exrc
""" set secure
"""
""" Then run the clang-complete-config target:
"""
""" make docker-clang-complete-config
""" (or without docker- if not using docker)
"""
let s:path = resolve(expand('<sfile>:p:h'))
let g:clang_dotfile = s:path . '/.clang_complete'
let g:clang_exec = s:path . '/scripts/vim-clang'
let g:ale_c_clangtidy_executable = s:path . '/scripts/vim-clang-tidy'
let g:ale_cpp_clangtidy_executable = s:path . '/scripts/vim-clang-tidy'
let g:ale_c_build_dir = s:path
set expandtab
set tabstop=2
set softtabstop=2
set shiftwidth=2
set autoindent
let $_VIM_PROJ_DIR = s:path
set path+=$_VIM_PROJ_DIR/package
set path+=$_VIM_PROJ_DIR/package/libpiksi/libpiksi/include
autocmd FileType c setlocal cindent
autocmd FileType cpp setlocal cindent
autocmd FileType c let b:ale_linters = { 'c': ['clangtidy'] }
autocmd FileType cpp let b:ale_linters = { 'cpp' : ['clangtidy'] }
let g:clang_tidy_checks = [
\ 'bugprone-*', 'cert-*-c', 'performance-*', 'readability-*', 'misc-*',
\ 'clange-analyzer-core.*', 'clang-analyzer-nullability.*', 'clang-analyzer-optin.*',
\ 'clange-analyzer-unix.*', 'clang-analyzer-valist.*', 'clang-analyzer-security.*',
\ '-readability-braces-around-statements',
\ ]
autocmd FileType c let b:ale_c_clangtidy_checks = g:clang_tidy_checks
autocmd FileType cpp let b:ale_cpp_clangtidy_checks = g:clang_tidy_checks