-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.vimrc
More file actions
226 lines (186 loc) · 4.8 KB
/
.vimrc
File metadata and controls
226 lines (186 loc) · 4.8 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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
call plug#begin()
" let Vundle manage Vundle, required
Plug 'VundleVim/Vundle.vim'
"Plugin 'craigemery/vim-autotag'
Plug 'kergoth/vim-bitbake'
Plug 'scrooloose/syntastic'
"Plugin 'davidhalter/jedi-vim'
Plug 'chr4/nginx.vim'
Plug 'dense-analysis/ale'
Plug 'mitsuhiko/jinja2'
Plug 'mustache/vim-mustache-handlebars'
Plug 'github/copilot.vim'
Plug 'hashivim/vim-terraform'
" All of your Plugins must be added before the following line
call plug#end() " required
" Syntax highlighting
if has("syntax")
syntax on
set background=dark
" Comments color distract, let's make it grey!
hi SpecialKey ctermfg=DarkGray
hi NonText ctermfg=DarkGray
hi Comment ctermfg=DarkGray
endif
" detect mac
if has("macunix")
set backspace=start,indent,eol
endif
" Various programming aids
if has("autocmd")
" per-filetype plugin on
filetype plugin on
" per-filetype indent on
filetype indent on
" jump to last position (TODO: has problems with window split)
"autocmd BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif
" per-filetype settings
autocmd FileType * call SetFileMappings()
endif
let g:ale_lint_on_text_changed = 'always'
let g:ale_fix_on_save = 0
let g:ale_linters = {
\ 'python': ['flake8', 'pylint'],
\ 'json': ['jsonlint-php'],
\ 'sh': ['shellcheck'],
\ 'yaml': ['yamllint'],
\ 'javascript': ['jslint'],
\ '*': ['remove_trailing_lines', 'trim_whitespace'],
\}
fun SetFileMappings()
if &ft == "python" || &ft == "pyrex"
imap <F8> #!/usr/bin/env python# -*- coding: utf-8 -*-
let g:ale_python_pylint_options = '--rcfile ~/.pylintrc'
set commentstring=" # %s"
set tabstop=4
set shiftwidth=4
set expandtab
set shiftround
set softtabstop=4
set foldmethod=syntax
endif
if &ft == "json"
set tabstop=4
set shiftwidth=4
set expandtab
set shiftround
set softtabstop=4
set foldmethod=syntax
endif
if &ft == "yaml"
set tabstop=2
set shiftwidth=2
set expandtab
set shiftround
set softtabstop=2
set foldmethod=syntax
endif
if &ft == "sh"
imap <F8> #!/usr/bin/env bash# -*- coding: utf-8 -*-
set tabstop=2
set shiftwidth=2
set expandtab
set shiftround
set softtabstop=2
endif
if &ft == "ruby"
set tabstop=2
set shiftwidth=2
set expandtab
set shiftround
set softtabstop=2
endif
if &ft == "c" || &ft == "cpp"
imap <F1> #include <.h>ODODOD
imap <F2> #define
imap <F8> #include <stdio.h>int main(int argc, char *argv[], char *envp[]){return 0;}OAOA
endif
if &ft == "php"
let html_use_css=1
let PHP_removeCRwhenUnix = 1
" Not DTD, starting from HTML5
imap <F8> <!DOCTYPE html>
endif
if &ft =~ "htm"
" Not DTD, starting from HTML5
imap <F8> <!DOCTYPE html>
let html_use_css=1
set tabstop=2
set shiftwidth=2
set expandtab
set shiftround
set softtabstop=2
endif
if &ft == "javascript"
set tabstop=4
set shiftwidth=4
set expandtab
set shiftround
set softtabstop=4
let g:syntastic_javascript_checkers = ['jslint']
endif
if &ft == "tex"
set tabstop=4
set shiftwidth=4
set expandtab
set shiftround
set softtabstop=4
" it basically sucks, explicitly turned off
let tex_fold_enabled = 0
let g:syntastic_tex_checkers = ['lacheck', 'chktex']
TTarget pdf
endif
if &ft == "perl"
imap <F8> #!/usr/bin/perluse strict;use warnings;use feature qw(say);use Data::Dumper;use Carp;
let perl_fold = 1
set matchpairs+=<:>
" perl-support.vim
let g:Perl_AuthorName = 'Bartosz Woronicz'
let g:Perl_AuthorRef = ''
let g:Perl_Email = 'bartosz@woronicz.com'
let g:Perl_Company = ''
endif
if &ft == "xml"
set tabstop=4
set shiftwidth=4
set expandtab
set shiftround
set softtabstop=4
endif
endfun
" Desired defaults!
set showcmd
set showmatch
set incsearch
set hlsearch
set nowrap
set ruler
set splitright
set colorcolumn=100
" Exit Vim from Midnight Commander.
map <F3> ZQ
map <F4> ZQ
set modeline
set modelines=5
" Enhanced command-line completion.
set wildmenu
" http://vim.wikia.com/wiki/Highlight_text_beyond_80_columns
"match Todo '\%81v.*'
" It's XXI century after all!
set ttyfast
packloadall