-
Notifications
You must be signed in to change notification settings - Fork 0
/
.nvimrc
33 lines (27 loc) · 874 Bytes
/
.nvimrc
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
" Enable hlint and GHC via Cabal
let g:ale_linters = {'c': ['clangtidy'], 'sh': ['shellcheck'], 'python': ['mypy', 'pylint']}
" ... only
let g:ale_linters_explicit = 1
" Don't lint until I save
let g:ale_lint_on_text_changed = 'never'
let g:ale_lint_on_insert_leave = 0
let g:ale_lint_on_enter = 0
" Configure Neoformat to use clang-format for C
let g:neoformat_c_clangformat = {
\ 'exe': 'clang-format',
\ 'args': ['--style=Chromium', '-assume-filename=' . expand('%:t')],
\ 'stdin': 1,
\}
let g:neoformat_enabled_c = ['clangformat']
" Configure Neoformat to use yapf for Python
let g:neoformat_enabled_c = ['yapf']
" Treat .h files as C
augroup project
autocmd!
autocmd BufRead,BufNewFile *.h,*.c set filetype=c
augroup END
" Enable automagic autoformatting
augroup fmt
autocmd!
autocmd BufWritePre * undojoin | Neoformat
augroup end