-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfile_type.vim
More file actions
87 lines (74 loc) · 2.27 KB
/
Copy pathfile_type.vim
File metadata and controls
87 lines (74 loc) · 2.27 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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
"" =========
"" Functions
"" =========
if !exists('*s:setupWrapping')
function s:setupWrapping()
set wrap
set wrapmargin=2
set textwidth=80
endfunction
endif
"" =======================
"" Autocmd rules for files
"" =======================
"" The PC is fast enough,
"" do syntax highlight syncing from start unless 200 lines
augroup vimrc-sync-fromstart
autocmd!
autocmd BufEnter * :syntax sync maxlines=200
augroup END
"" Remember cursor position
augroup vimrc-remember-cursor-position
autocmd!
autocmd BufReadPost * if line("'\"") > 1 &&
\ line("'\"") <= line("$") | exe "normal! g`\"" | endif
augroup END
" c
augroup cpp-settings
" autocmd FileType c setlocal tabstop=4 shiftwidth=4 expandtab formatprg=clang-format
autocmd FileType c setlocal tabstop=4 shiftwidth=4
\ expandtab formatprg=astyle\ -A1\ -p\ -xg\ -f\ -H\ -d
autocmd FileType cpp setlocal tabstop=4 shiftwidth=4 expandtab
augroup END
" python
" vim-python
augroup vimrc-python
autocmd!
autocmd FileType python setlocal expandtab shiftwidth=4 tabstop=8 colorcolumn=79
\ formatoptions+=croq softtabstop=4 formatprg=autopep8\ -aa
\ cinwords=if,elif,else,for,while,try,except,finally,def,class,with
augroup END
augroup vimrc-vim
autocmd FileType vim setlocal shiftwidth=2
augroup END
" haskell
augroup haskell-lang
autocmd!
autocmd FileType haskell setlocal expandtab shiftwidth=2
\ nofoldenable softtabstop=2
augroup END
" autocmd Filetype haskell set formatprg=brittany
" autocmd Filetype haskell set ai
" autocmd Filetype haskell set expandtab
" autocmd Filetype haskell set tabstop=2
" autocmd Filetype haskell set shiftwidth=2
" autocmd FileType haskell set nofoldenable
"" txt
augroup vimrc-wrapping
autocmd!
autocmd BufRead,BufNewFile *.txt call s:setupWrapping()
augroup END
"" make/cmake
augroup vimrc-make-cmake
autocmd!
autocmd FileType make setlocal noexpandtab
autocmd BufNewFile,BufRead CMakeLists.txt setlocal filetype=cmake
augroup END
"" For Dlang
augroup dlang
autocmd FileType d set efm=%*[^@]@%f\(%l\):\ %m,%f\(%l\\,%c\):\ %m,%f\(%l\):\ %m
" autocmd Filetype d set colorcolumn=79
autocmd Filetype d set softtabstop=2 shiftwidth=2
autocmd FileType d set formatprg=dfmt\
\--brace_style\ allman\ 2>\ /dev/null
augroup END