-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit.vim
195 lines (153 loc) · 5.12 KB
/
init.vim
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
set nocompatible
filetype off
set rtp+=~/.config/nvim/bundle/Vundle.vim
call vundle#begin('~/.config/nvim/bundle')
" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'
" Syntax highliters
Plugin 'derekwyatt/vim-scala'
Plugin 'GEverding/vim-hocon'
Plugin 'aklt/plantuml-syntax'
Plugin 'kalafut/vim-taskjuggler'
Plugin 'mitsuhiko/vim-jinja'
Plugin 'martinda/Jenkinsfile-vim-syntax'
Plugin 'posva/vim-vue.git'
Bundle 'altercation/vim-colors-solarized.git'
Bundle 'crusoexia/vim-monokai'
Bundle 'morhetz/gruvbox'
" Markdown
Plugin 'godlygeek/tabular'
Plugin 'plasticboy/vim-markdown'
" Tab detection
Plugin 'tpope/vim-sleuth.git'
Bundle 'Yggdroot/indentLine'
" Golden ratio multiwindow
Bundle 'roman/golden-ratio'
" Status line decorations
Plugin 'vim-airline/vim-airline'
Plugin 'vim-airline/vim-airline-themes'
" Git
Plugin 'airblade/vim-gitgutter'
Plugin 'tpope/vim-fugitive'
" --- Python ---
Plugin 'klen/python-mode' " Python mode (docs, refactor, lints, highlighting, run and ipdb and more)
Plugin 'davidhalter/jedi-vim' " Jedi-vim autocomplete plugin
" JSON
Plugin 'elzr/vim-json'
" OpenSCAD
Plugin 'sirtaj/vim-openscad'
" Some exotics
Plugin 'edkolev/tmuxline.vim'
call vundle#end()
filetype plugin on
" Always show statusbar
set laststatus=2
" Disable mouse click to go to position
set mouse-=a
" Don't let autocomplete affect usual typing habits
set completeopt=menuone,preview,noinsert
" Let vim-gitgutter do its thing on large files
let g:gitgutter_max_signs=10000
" Tabs configuration
set tabstop=4 shiftwidth=4 expandtab smarttab autoindent
set nowrap " попросим Vim НЕ переносить длинные строки
set ai " включим автоотступы для новых строк
set cin " включим отступы в стиле Си
" Search highlighting
set showmatch hlsearch incsearch smartcase
" Показываем табы в начале строки точками
set listchars=tab:··
set list
" Порядок применения кодировок и формата файлов
set ffs=unix,dos,mac
set fencs=utf-8,cp1251,koi8-r,ucs-2,cp866
" Solarized configuration
set t_Co=256
set background=dark
" colorscheme solarized
" colorscheme monokai
colorscheme gruvbox
" trailing whitespaces highlight
highlight ExtraWhitespace ctermbg=darkgreen guibg=darkgreen
autocmd Syntax * syn match ExtraWhitespace /\s\+$/
autocmd FileType c,cpp,java,php,py,pl,sh,h,hpp,js,javascript,html,css,scala autocmd BufWritePre <buffer> :%s/\s\+$//e
autocmd BufWritePost *.uml silent call jobstart(["plantuml", expand('%:p')])
" klen/python-mode configuration
let g:pymode = 1
let g:pymode_options = 1
let g:pymode_options_colorcolumn = 0
let g:pymode_folding = 0
let g:pymode_indent = 1
let g:pymode_doc = 1
let g:pymode_virtualenv = 1
" let g:pymode_debug = 0
let g:pymode_lint = 1
let g:pymode_lint_checkers = ['pylint', 'pep8', 'pyflakes']
let g:pymode_lint_on_write = 1
let g:pymode_lint_on_fly = 0
let g:pymode_lint_message = 1
let g:pymode_lint_ignore = 'C901,R0911,W0101,W0702,R0914,E265,E501,E0611,W0201,line-too-long,missing-docstring,abstract-method,invalid-name,no-self-use,fixme,too-many-arguments,no-member,too-few-public-methods,star-args'
let g:pymode_lint_cwindow = 1
let g:pymode_lint_signs = 1
let g:pymode_lint_options_pylint = { 'max-branches': 20 }
let g:pymode_rope = 0
let g:pymode_rope_lookup_project = 1
let g:pymode_rope_regenerate_on_write = 0
let g:pymode_rope_autoimport = 0
let g:pymode_rope_completion = 1
let g:pymode_rope_complete_on_dot = 1
let g:pymode_rope_goto_definition_cmd = 'vnew'
let g:pymode_rope_organize_imports_bind = '<localleader>ro'
let g:pymode_syntax = 1
let g:pymode_syntax_slow_sync = 1
let g:pymode_syntax_all = 1
" Yggdroot/indentLine configuration
let g:indentLine_enabled = 1
let g:indentLine_char = '⏐'
" Airline
let g:airline_powerline_fonts = 1
let g:airline_theme='solarized'
let g:airline#extensions#tabline#enabled = 1
" jedi-vim
let g:jedi#show_call_signatures = 0
" golden-ratio
let g:golden_ratio_exclude_nonmodifiable = 1
" Highlight all instances of word under cursor, when idle.
" Useful when studying strange source code.
" Type z/ to toggle highlighting on/off.
function! AutoHighlightToggle()
let @/ = ''
if exists('#auto_highlight')
au! auto_highlight
augroup! auto_highlight
setl updatetime=4000
"echo 'Highlight current word: off'
return 0
else
augroup auto_highlight
au!
au CursorHold * let @/ = '\V\<'.escape(expand('<cword>'), '\').'\>'
augroup end
setl updatetime=500
"echo 'Highlight current word: ON'
return 1
endif
endfunction
" Tabularize
nnoremap <localleader>a= :Tabularize /=<CR>
vnoremap <localleader>a= :Tabularize /=<CR>
nnoremap <localleader>a: :Tabularize /:\zs<CR>
vnoremap <localleader>a: :Tabularize /:\zs<CR>
" Let plugins show effects after 500ms, not 4s
set updatetime=100
set number
set colorcolumn=120
nnoremap <localleader>l :PymodeLint<CR>
nnoremap <localleader>z :set hls<CR>call AutoHighlightToggle()<CR>
nnoremap <C-J> i<CR><Esc>
inoremap jj <Esc>l
"split navigations
nnoremap <C-J> <C-W><C-J>
nnoremap <C-K> <C-W><C-K>
nnoremap <C-L> <C-W><C-L>
nnoremap <C-H> <C-W><C-H>