-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbasic-acmds.vim
More file actions
35 lines (28 loc) · 1.13 KB
/
Copy pathbasic-acmds.vim
File metadata and controls
35 lines (28 loc) · 1.13 KB
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
fun! TrimWhitespace()
let l:save = winsaveview()
keeppatterns %s/\s\+$//e
call winrestview(l:save)
endfun
let filePtrns2Trim = ["*.v", "*.py"]
for f in filePtrns2Trim
execute "autocmd BufWritePre " . f . " :call TrimWhitespace()"
endfor
" Wrapping and spelling
let file_patterns_wrap = ["tex", "bib", "markdown"]
for f in file_patterns_wrap
execute "autocmd FileType " . f . " setlocal wrap"
execute "autocmd FileType " . f . " setlocal spell"
endfor
autocmd FileType python set shiftwidth=4
autocmd FileType python set tabstop=4
autocmd FileType python set sts=4
autocmd FileType python set expandtab
" Indentation guides
set list
" Update the guides after every change to the shiftwidth option
autocmd OptionSet shiftwidth execute 'setlocal listchars=trail:·,tab:│\ ,leadmultispace:┆' . repeat('\ ', &sw - 1)
" Start the guides after loading the buffer as well
autocmd BufWinEnter * execute 'setlocal listchars=trail:·,tab:│\ ,leadmultispace:┆' . repeat('\ ', &sw - 1)
autocmd BufReadPost *.tex execute "setlocal nolist"
autocmd BufReadPost *.bib execute "setlocal nolist"
autocmd FileType openscad setl commentstring=//\ %s