-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvimrc
More file actions
270 lines (219 loc) · 10.8 KB
/
vimrc
File metadata and controls
270 lines (219 loc) · 10.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
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
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
" "
" __ _ _ _ __ ___ _ __ ___ "
" \ \ / / | '_ ` _ \| '__/ __| "
" \ V /| | | | | | | | | (__ "
" \_/ |_|_| |_| |_|_| \___| "
" "
" "
"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
let $vimhome=fnamemodify(resolve(expand("~/.vimrc")), ':p:h')
" Be iMproved
set nocompatible
"=====================================================
"" vim-plug settings
"=====================================================
filetype off
call plug#begin('~/.vim/plugged')
"-------------------=== Code/Project navigation ===-------------
Plug 'scrooloose/nerdtree' " Project and file navigation
Plug 'majutsushi/tagbar' " Class/module browser
Plug 'kien/ctrlp.vim' " Fast transitions on project files
Plug 'tmhedberg/SimpylFold' " Enabled simple python folding
"-------------------=== Other ===-------------------------------
Plug 'bling/vim-airline' " Lean & mean status/tabline for vim
Plug 'vim-airline/vim-airline-themes' " Themes for airline
Plug 'Lokaltog/powerline', {'branch':'develop'} " Powerline fonts Plug
Plug 'fisadev/FixedTaskList.vim' " Pending tasks list
Plug 'rosenfeld/conque-term' " Consoles as buffers
Plug 'tpope/vim-surround' " Parentheses, brackets, quotes, XML tags, and more
Plug 'flazz/vim-colorschemes' " Colorschemes
Plug 'Konfekt/FastFold' " Fast Folding
Plug 'wikitopian/hardmode' " Hardmode - call HardMode(), call EasyMode()
"-------------------=== Snippets support ===--------------------
Plug 'garbas/vim-snipmate' " Snippets manager
Plug 'MarcWeber/vim-addon-mw-utils' " dependencies #1
Plug 'tomtom/tlib_vim' " dependencies #2
Plug 'honza/vim-snippets' " snippets repo
"-------------------=== Languages support ===-------------------
Plug 'tpope/vim-commentary' " Comment stuff out
Plug 'mitsuhiko/vim-sparkup' " Sparkup(XML/jinja/htlm-django/etc.) support
Plug 'Rykka/riv.vim' " ReStructuredText Plug
"-------------------=== Python ===-----------------------------
Plug 'klen/python-mode' " Python mode (docs, refactor, lints...)
Plug 'davidhalter/jedi-vim' " Jedi-vim autocomplete Plug
Plug 'scrooloose/syntastic' " Syntax checking plugin for Vim
"-------------------=== LaTeX ===-----------------------------
Plug 'xuhdev/vim-latex-live-preview' " Live preview for latex
"-------------------=== Note Taking ===-----------------------------
Plug 'xolox/vim-notes' " Vim Notes for notetaking
Plug 'xolox/vim-misc' " Required by Vim-Notes
call plug#end() " required
filetype on
filetype plugin on
filetype plugin indent on
"=====================================================
"" General settings
"=====================================================
syntax enable " syntax highlight
set t_Co=256 " set 256 colors
"colorscheme wombat256mod " set color scheme
set relativenumber
set number " show line numbers
set ruler
set ttyfast " terminal acceleration
set tabstop=4 " 4 whitespaces for tabs visual presentation
set shiftwidth=4 " shift lines by 4 spaces
set smarttab " set tabs for a shifttabs logic
set expandtab " expand tabs into spaces
set autoindent " indent when moving to the next line while writing code
set cursorline " shows line under the cursor's line
set showmatch " shows matching part of bracket pairs (), [], {}
set enc=utf-8 " utf-8 by default
set shortmess+=A " don't give atttention to swap messages
"set nobackup " no backup files
"set nowritebackup " only in case you don't want a backup file while editing
"set noswapfile " no swap files
set backspace=indent,eol,start " backspace removes all (indents, EOLs, start) What is start?
set scrolloff=10 " let 10 lines before/after cursor during scroll
set clipboard=unnamed " use system clipboard
autocmd BufNewFile,BufRead * setlocal formatoptions-=r " disable autocomment
"=====================================================
"" Navigation/Map settings
"=====================================================
nnoremap <C-J> <C-W><C-J> " split navigation Ctrl-J - down
nnoremap <C-K> <C-W><C-K> " split navigation Ctrl-K - up
nnoremap <C-L> <C-W><C-L> " split navigation Ctrl-L - left
nnoremap <C-H> <C-W><C-H> " split navigation Ctrl-H - right
nnoremap <space> za " enable folding with the spacebar
"=====================================================
"" Backup/Tmp/Undo settings
"=====================================================
set backupdir=~/.vim/.backup//,/tmp/.backup//,.
set directory=~/.vim/.swp//,/tmp/.swp//,.
set undodir=~/.vim/.undo//,/tmp/.undo//,.
set backup " keep a backup file (restore to previous version)
set undofile " keep an undo file (undo changes after closing)
set swapfile " keep a swapfile (recover from errors)
"=====================================================
"" Tabs / Buffers settings
"=====================================================
tab sball
set switchbuf=useopen
set laststatus=2
nmap <F9> :bprev<CR>
nmap <F10> :bnext<CR>
nmap <silent> <leader>q :SyntasticCheck # <CR> :bp <BAR> bd #<CR>
"" Search settings
"=====================================================
set incsearch " incremental search
set hlsearch " highlight search results
"=====================================================
"" AirLine settings
"=====================================================
"let g:airline_theme='wombat'
"let g:airline_theme='badwolf'
let g:airline#extensions#tabline#enabled=1
let g:airline#extensions#tabline#formatter='unique_tail'
let g:airline_powerline_fonts=1
"=====================================================
"" TagBar settings
"=====================================================
let g:tagbar_autofocus=0
let g:tagbar_width=42
autocmd BufEnter *.py :call tagbar#autoopen(0)
"autocmd BufWinLeave *.py :TagbarToggle
"=====================================================
"" NERDTree settings
"=====================================================
let NERDTreeIgnore=['\.pyc$', '\.pyo$', '__pycache__$'] " Ignore files in NERDTree
let NERDTreeWinSize=40
autocmd VimEnter * if !argc() | NERDTree | endif " Load NERDTree only if vim is run without arguments
nmap " :NERDTreeToggle<CR>
"=====================================================
"" SnipMate settings
"=====================================================
let g:snippets_dir='~/.vim/vim-snippets/snippets'
"=====================================================
"" Riv.vim settings
"=====================================================
let g:riv_disable_folding=1
"=====================================================
"" Python settings
"=====================================================
" omnicomplete
set completeopt-=preview " remove omnicompletion dropdown
" python executables for different plugins
let g:pymode_python='python'
let g:syntastic_python_python_exec='python'
let g:jedi#force_py_version=2
" rope
let g:pymode_rope=0
let g:pymode_rope_completion=0
let g:pymode_rope_complete_on_dot=0
let g:pymode_rope_auto_project=0
let g:pymode_rope_enable_autoimport=0
let g:pymode_rope_autoimport_generate=0
let g:pymode_rope_guess_project=0
" documentation
let g:pymode_doc=0
let g:pymode_doc_key='K'
" lints
let g:pymode_lint=0
" virtualenv
let g:pymode_virtualenv=1
" breakpoints
let g:pymode_breakpoint=1
let g:pymode_breakpoint_key='<leader>b'
" syntax highlight
let g:pymode_syntax=1
let g:pymode_syntax_slow_sync=1
let g:pymode_syntax_all=1
let g:pymode_syntax_print_as_function=g:pymode_syntax_all
let g:pymode_syntax_highlight_async_await=g:pymode_syntax_all
let g:pymode_syntax_highlight_equal_operator=g:pymode_syntax_all
let g:pymode_syntax_highlight_stars_operator=g:pymode_syntax_all
let g:pymode_syntax_highlight_self=g:pymode_syntax_all
let g:pymode_syntax_indent_errors=g:pymode_syntax_all
let g:pymode_syntax_string_formatting=g:pymode_syntax_all
let g:pymode_syntax_space_errors=g:pymode_syntax_all
let g:pymode_syntax_string_format=g:pymode_syntax_all
let g:pymode_syntax_string_templates=g:pymode_syntax_all
let g:pymode_syntax_doctests=g:pymode_syntax_all
let g:pymode_syntax_builtin_objs=g:pymode_syntax_all
let g:pymode_syntax_builtin_types=g:pymode_syntax_all
let g:pymode_syntax_highlight_exceptions=g:pymode_syntax_all
let g:pymode_syntax_docstrings=g:pymode_syntax_all
" highlight 'long' lines (>= 80 symbols) in python files
augroup vimrc_autocmds
autocmd!
autocmd FileType python,rst highlight Excess ctermbg=DarkGrey guibg=Black
autocmd FileType python,rst match Excess /\%81v.*/
autocmd FileType python,rst set nowrap
augroup END
" code folding
let g:pymode_folding=0
" pep8 indents
let g:pymode_indent=1
" code running
let g:pymode_run=0
" jedi-vim
let g:jedi#popup_select_first=0 " Disable choose first option on autocomplete
let g:jedi#show_call_signatures=0 " Show call signatures
let g:jedi#popup_on_dot=1 " Enable autocomplete on dot
" syntastic
let g:syntastic_always_populate_loc_list=1
let g:syntastic_auto_loc_list=1
let g:syntastic_enable_signs=1
let g:syntastic_check_on_wq=0
let g:syntastic_aggregate_errors=1
let g:syntastic_loc_list_height=5
let g:syntastic_error_symbol='X'
let g:syntastic_style_error_symbol='X'
let g:syntastic_warning_symbol='x'
let g:syntastic_style_warning_symbol='x'
let g:syntastic_python_checkers=['flake8', 'pydocstyle', 'python']
"=====================================================
"" LaTeX Live Preview
"=====================================================
let g:livepreview_previewer = 'zathura'