-
Notifications
You must be signed in to change notification settings - Fork 0
/
.vimrc
278 lines (194 loc) · 6.12 KB
/
.vimrc
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
271
272
273
274
275
276
277
278
" ===================================
" CHANGE THIS TO YOUR PYTHON PROVIDER !!!
" ===================================
let g:python3_host_prog='/home/mperepichka/miniconda3/envs/py37/bin/python'
"Windows subsystem annoying beep fix
set visualbell
set autoindent
" show existing tab with 4 spaces width
set tabstop=8
" when indenting with '>', use 2 spaces width
set shiftwidth=2
" On pressing tab, insert 4 spaces
set expandtab
" Turn on line numbering. Turn it off with “set nonu”
set number
set relativenumber
" Case insensitive search
set ic
" Higlhight search
set hls
" Wrap text instead of being on one line
set lbr
"set t_8f=^[[38;2;%lu;%lu;%lum
"set t_8b=^[[48;2;%lu;%lu;%lum
" Backspace stuff
set backspace=indent,eol,start
" Language settings
setlocal spell spelllang=en_us
" Bracket matching selection
"noremap % v%
" Automates the above
":set showmatch
"
":set matchtime=3
"
"inoremap } }<Left><c-o>%<c-o>:sleep 500m<CR><c-o>%<c-o>a
"
"inoremap ] ]<Left><c-o>%<c-o>:sleep 500m<CR><c-o>%<c-o>a
"
"inoremap ) )<Left><c-o>%<c-o>:sleep 500m<CR><c-o>%<c-o>a
" Rebinds for escape key
ino jj <esc>
cno jj <c-c>
vno v <esc>
" Folding stuff
set foldenable
set foldlevelstart=10 "Opens most folds by def
set foldnestmax=10 " sets max for fold
"move vertically by visual line
"nnoremap j gj
"nnoremap k gk
" Sudo permissions (unix-based os)
command W :execute ':silent w !sudo tee % > /dev/null' | :edit!
" Adds column at line 80
set colorcolumn=80
" mouse support
set mouse=a
" Helps you actually get out of the terminal in nvim terminal emulator
tnoremap <Esc> <C-\><C-n>
" ======================= Python Dev Stuff ======================= "
" Python PEP8
"au BufNewFile,BufRead *.py
" \ set tabstop=4
" \ set softtabstop=4
" \ set shiftwidth=4
" \ set textwidth=79
" \ set expandtab
" \ set autoindent
" \ set fileformat=unix
" Flag extra white spaces as red
"au BufRead,BufNewFile *.py,*.pyw,*.c,*.h match BadWhitespace /\s\+$/
" Work with utf-8
set encoding=utf-8
" ------------------------- Plugin stuff ------------------------- "
filetype off
" --- VIM PLUG STUFF --- "
call plug#begin('~/.vim/plugged')
" Color scheme
Plug 'overcache/NeoSolarized'
" Tim Pope's plugins
"Plug 'tpope/vim-fugitive' " Git integration
Plug 'tpope/vim-unimpaired' " Unimpaired vim keybinds
Plug 'tpope/vim-speeddating' " Increment dates
Plug 'tpope/vim-surround' " Increment dates
Plug 'tpope/vim-repeat' " Repeat plugin commands with .
Plug 'vim-scripts/indentpython.vim' " Auto-indent pep8 style
Plug 'kshenoy/vim-signature' " Visual marks
Plug 'Yggdroot/LeaderF', { 'do': ':LeaderfInstallCExtension' }
"Plug 'scrooloose/nerdtree' " File browser on the left, disabled for now
Plug 'vim-airline/vim-airline' " Status bar on the bottom
Plug 'vim-airline/vim-airline-themes' " Airline themes
Plug 'gcmt/taboo.vim' " Taboo
" Deoplete
if has('nvim')
Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
else
Plug 'Shougo/deoplete.nvim'
Plug 'roxma/nvim-yarp'
Plug 'roxma/vim-hug-neovim-rpc'
endif
" Jedi python autocompletion
Plug 'zchee/deoplete-jedi'
Plug 'donRaphaco/neotex' " neo tex latex auto preview
" Fuzzy file search fzf
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
Plug 'junegunn/fzf.vim'
" Neovim debugging
Plug 'sakhnik/nvim-gdb', { 'do': ':!./install.sh' }
" Code syntax check + build automation
Plug 'neomake/neomake'
" Python formatting
Plug 'sbdchd/neoformat'
" Initialize plugin system
call plug#end()
" Set syntax on
syntax on
filetype plugin indent on
" =============== Color Scheme Stuff =============== "
" Change colorscheme from default to solarized
set termguicolors
set t_Co=256
colorscheme NeoSolarized
let g:neosolarized_contrast = "normal"
let g:neosolarized_visibility = "normal"
let g:neosolarized_vertplitBgTrans = 0
" Bunch of color hacks to make this work in WSL
hi Normal guibg=bg
hi Normal guifg=fg
hi NonText guibg=bg
hi NonText guifg=fg
hi SpellBad guibg=bg
hi SpellBad guifg=fg
hi SpellLocal guibg=bg
hi SpellLocal guifg=fg
hi SpellCap guibg=bg
hi SpellCap guifg=fg
hi SpellRare guibg=bg
hi SpellRare guifg=fg
hi EndOfBuffer guibg=bg
hi EndOfBuffer guifg=fg
hi Underline guibg=bg
hi Underline guifg=fg
set background=dark
" =============== Airline Stuff =============== "
" enable/disable bufferline integration >
let g:airline#extensions#tabline#enabled = 1
let g:airline#extensions#tabline#left_sep = ' '
let g:airline#extensions#tabline#fnamemod = ':t'
let g:airline_theme='solarized'
" Replace tabs with buffers. Solution by Josh Davis
set hidden
nmap <leader>T :enew<cr>
nmap <leader>l :bnext<CR>
nmap <leader>h :bprevious<CR>
nmap <leader>bq :bp <BAR> bd #<CR>
nmap <leader>bl :ls<CR>
set wildignore+=*/tmp/*,*.so,*.swp,*.zip " MacOSX/Linux
" =============== Jedi Stuff =============== "
" disable autocompletion, because we use deoplete for completion
let g:jedi#completions_enabled = 0
" open the go-to function in split, not another buffer
let g:jedi#use_splits_not_buffers = "right"
" =============== Deoplete Stuff =============== "
let g:deoplete#enable_at_startup=1
" Disable buffer and around source for deoplete
call deoplete#custom#option('ignore_sources', {'_': ['around', 'buffer']})
" Autoclose Preview window that gives hints on usage of functions
autocmd InsertLeave,CompleteDone * if pumvisible() == 0 | pclose | endif
" Navigate thru auto-complete list with Tab key
inoremap <expr><tab> pumvisible() ? "\<c-n>" : "\<tab>"
" =============== Neomake/Pylint Stuff =============== "
let g:neomake_python_pylint_maker = {
\ 'args': [
\ '-d', 'C0103, C0111',
\ '-f', 'text',
\ '--msg-template="{path}:{line}:{column}:{C}: [{symbol}] {msg}"',
\ '-r', 'n'
\ ],
\ 'errorformat':
\ '%A%f:%l:%c:%t: %m,' .
\ '%A%f:%l: %m,' .
\ '%A%f:(%l): %m,' .
\ '%-Z%p^%.%#,' .
\ '%-G%.%#',
\ }
let g:neomake_python_enabled_makers = ['flake8', 'pylint']
call neomake#configure#automake('nrwi', 500)
" =============== Alignment Stuff =============== "
" Enable alignment
let g:neoformat_basic_format_align = 1
" Enable tab to space conversion
let g:neoformat_basic_format_retab = 1
" Enable trimmming of trailing whitespace
let g:neoformat_basic_format_trim = 1