forked from ets-labs/python-vimrc
- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvimrc
More file actions
Latest commit
240 lines (195 loc) · 9.36 KB
/
Copy pathvimrc
File metadata and controls
240 lines (195 loc) · 9.36 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
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
" "
" __ _ _ _ __ ___ _ __ ___ "
" \ \ / / | '_ ` _ \| '__/ __| "
" \ V /| | | | | | | | | (__ "
" \_/ |_|_| |_| |_|_| \___| "
" "
" "
"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
let$vimhome=fnamemodify(resolve(expand("~/.vimrc")), ':p:h')
let$vundle=$vimhome."/bundle/Vundle.vim"
" Be iMproved
setnocompatible
"=====================================================
"" Vundle settings
"=====================================================
filetypeoff
setrtp+=$vundle
callvundle#begin()
Plugin'VundleVim/Vundle.vim'" let Vundle manage Vundle, required
"-------------------=== Code/Project navigation ===-------------
Plugin'scrooloose/nerdtree'" Project and file navigation
Plugin'majutsushi/tagbar'" Class/module browser
Plugin'kien/ctrlp.vim'" Fast transitions on project files
"-------------------=== Other ===-------------------------------
Plugin'bling/vim-airline'" Lean & mean status/tabline for vim
Plugin'vim-airline/vim-airline-themes'" Themes for airline
Plugin'Lokaltog/powerline'" Powerline fonts plugin
Plugin'fisadev/FixedTaskList.vim'" Pending tasks list
Plugin'rosenfeld/conque-term'" Consoles as buffers
Plugin'tpope/vim-surround'" Parentheses, brackets, quotes, XML tags, and more
Plugin'flazz/vim-colorschemes'" Colorschemes
"-------------------=== Snippets support ===--------------------
Plugin'garbas/vim-snipmate'" Snippets manager
Plugin'MarcWeber/vim-addon-mw-utils'" dependencies #1
Plugin'tomtom/tlib_vim'" dependencies #2
Plugin'honza/vim-snippets'" snippets repo
"-------------------=== Languages support ===-------------------
Plugin'tpope/vim-commentary'" Comment stuff out
Plugin'mitsuhiko/vim-sparkup'" Sparkup(XML/jinja/htlm-django/etc.) support
Plugin'Rykka/riv.vim'" ReStructuredText plugin
Plugin'Valloric/YouCompleteMe'" Autocomplete plugin
"-------------------=== Python ===-----------------------------
Plugin'klen/python-mode'" Python mode (docs, refactor, lints...)
Plugin'scrooloose/syntastic'" Syntax checking plugin for Vim
callvundle#end()" required
filetypeon
filetypepluginon
filetypepluginindenton
"=====================================================
"" General settings
"=====================================================
syntaxenable" syntax highlight
sett_Co=256" set 256 colors
colorscheme wombat256mod" set color scheme
setnumber" show line numbers
setruler
setttyfast" terminal acceleration
settabstop=4" 4 whitespaces for tabs visual presentation
setshiftwidth=4" shift lines by 4 spaces
setsmarttab" set tabs for a shifttabs logic
setexpandtab" expand tabs into spaces
setautoindent" indent when moving to the next line while writing code
setcursorline" shows line under the cursor's line
setshowmatch" shows matching part of bracket pairs (), [], {}
setenc=utf-8" utf-8 by default
setnobackup" no backup files
setnowritebackup" only in case you don't want a backup file while editing
setnoswapfile" no swap files
setbackspace=indent,eol,start" backspace removes all (indents, EOLs, start) What is start?
setscrolloff=10" let 10 lines before/after cursor during scroll
setclipboard=unnamed" use system clipboard
setexrc" enable usage of additional .vimrc files from working directory
setsecure" prohibit .vimrc files to execute shell, create files, etc...
" Additional mappings for Esc (useful for MacBook with touch bar)
inoremapjj<Esc>
inoremapjk<Esc>
"=====================================================
"" Tabs / Buffers settings
"=====================================================
tabsball
setswitchbuf=useopen
setlaststatus=2
nmap<F9>:bprev<CR>
nmap<F10>:bnext<CR>
nmap<silent><leader>q:SyntasticCheck # <CR> :bp <BAR> bd #<CR>
"" Search settings
"=====================================================
setincsearch" incremental search
sethlsearch" highlight search results
"=====================================================
"" AirLine settings
"=====================================================
letg:airline_theme='badwolf'
letg:airline#extensions#tabline#enabled=1
letg:airline#extensions#tabline#formatter='unique_tail'
letg:airline_powerline_fonts=1
"=====================================================
"" TagBar settings
"=====================================================
letg:tagbar_autofocus=0
letg:tagbar_width=42
autocmdBufEnter*.py :calltagbar#autoopen(0)
autocmdBufWinLeave*.py :TagbarClose
"=====================================================
"" NERDTree settings
"=====================================================
let NERDTreeIgnore=['\.pyc$', '\.pyo$', '__pycache__$']" Ignore files in NERDTree
let NERDTreeWinSize=40
autocmdVimEnter*if!argc() | NERDTree | endif" Load NERDTree only if vim is run without arguments
nmap":NERDTreeToggle<CR>
"=====================================================
"" SnipMate settings
"=====================================================
letg:snippets_dir='~/.vim/vim-snippets/snippets'
"=====================================================
"" Riv.vim settings
"=====================================================
letg:riv_disable_folding=1
"=====================================================
"" Python settings
"=====================================================
" python executables for different plugins
letg:pymode_python='python'
letg:syntastic_python_python_exec='python'
" rope
letg:pymode_rope=0
letg:pymode_rope_completion=0
letg:pymode_rope_complete_on_dot=0
letg:pymode_rope_auto_project=0
letg:pymode_rope_enable_autoimport=0
letg:pymode_rope_autoimport_generate=0
letg:pymode_rope_guess_project=0
" documentation
letg:pymode_doc=0
letg:pymode_doc_bind='K'
" lints
letg:pymode_lint=0
" virtualenv
letg:pymode_virtualenv=1
" breakpoints
letg:pymode_breakpoint=1
letg:pymode_breakpoint_key='<leader>b'
" syntax highlight
letg:pymode_syntax=1
letg:pymode_syntax_slow_sync=1
letg:pymode_syntax_all=1
letg:pymode_syntax_print_as_function=g:pymode_syntax_all
letg:pymode_syntax_highlight_async_await=g:pymode_syntax_all
letg:pymode_syntax_highlight_equal_operator=g:pymode_syntax_all
letg:pymode_syntax_highlight_stars_operator=g:pymode_syntax_all
letg:pymode_syntax_highlight_self=g:pymode_syntax_all
letg:pymode_syntax_indent_errors=g:pymode_syntax_all
letg:pymode_syntax_string_formatting=g:pymode_syntax_all
letg:pymode_syntax_space_errors=g:pymode_syntax_all
letg:pymode_syntax_string_format=g:pymode_syntax_all
letg:pymode_syntax_string_templates=g:pymode_syntax_all
letg:pymode_syntax_doctests=g:pymode_syntax_all
letg:pymode_syntax_builtin_objs=g:pymode_syntax_all
letg:pymode_syntax_builtin_types=g:pymode_syntax_all
letg:pymode_syntax_highlight_exceptions=g:pymode_syntax_all
letg:pymode_syntax_docstrings=g:pymode_syntax_all
" highlight 'long' lines (>= 80 symbols) in python files
augroupvimrc_autocmds
autocmd!
autocmdFileTypepython,rst,c,cpphighlight Excess ctermbg=DarkGrey guibg=Black
autocmdFileTypepython,rst,c,cppmatch Excess /\%81v.*/
autocmdFileTypepython,rst,c,cppsetnowrap
autocmdFileTypepython,rst,c,cppsetcolorcolumn=80
augroupEND
" code folding
letg:pymode_folding=0
" pep8 indents
letg:pymode_indent=1
" code running
letg:pymode_run=1
letg:pymode_run_bind='<F5>'
" syntastic
letg:syntastic_always_populate_loc_list=1
letg:syntastic_auto_loc_list=1
letg:syntastic_enable_signs=1
letg:syntastic_check_on_wq=0
letg:syntastic_aggregate_errors=1
letg:syntastic_loc_list_height=5
letg:syntastic_error_symbol='X'
letg:syntastic_style_error_symbol='X'
letg:syntastic_warning_symbol='x'
letg:syntastic_style_warning_symbol='x'
letg:syntastic_python_checkers=['flake8', 'pydocstyle', 'python']
" YouCompleteMe
setcompleteopt-=preview
letg:ycm_global_ycm_extra_conf='~/.vim/ycm_extra_conf.py'
letg:ycm_confirm_extra_conf=0
nmap<leader>g :YcmCompleter GoTo<CR>
nmap<leader>d :YcmCompleter GoToDefinition<CR>