-
Notifications
You must be signed in to change notification settings - Fork 0
/
vimrc
288 lines (241 loc) · 7.08 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
279
280
281
282
283
284
285
286
287
288
set enc=utf-8
set fenc=utf-8
set encoding=utf-8
set fileencodings=utf-8
" 256 colors
set t_Co=256
set nu
set completeopt=menuone
syntax on " syntax hilighting
filetype on
set hlsearch
set showmatch
set laststatus=2
set guioptions+=a
set wildmenu
" Wildmenu
if has("wildmenu")
set wildignore+=*.a,*.o
set wildignore+=*.bmp,*.gif,*.ico,*.jpg,*.png
set wildignore+=.DS_Store,.git,.hg,.svn
set wildignore+=*~,*.swp,*.tmp
set wildmenu
set wildmode=longest,list
endif
" Read NewFile as specified filetype
autocmd FileType javascript setl tabstop=8 expandtab shiftwidth=2 softtabstop=2
autocmd FileType python setl autoindent
autocmd FileType python setl smartindent cinwords=if,elif,else,for,while,try,except,finally,def,class
autocmd FileType python,md,rst,sh,zsh setl tabstop=8 expandtab shiftwidth=4 softtabstop=4
autocmd FileType html setl tabstop=8 expandtab shiftwidth=2 softtabstop=2
autocmd FileType cpp,cc setl tabstop=4 expandtab shiftwidth=2 softtabstop=2
autocmd FileType yaml setl tabstop=2 expandtab shiftwidth=2 softtabstop=2 noet
set nocompatible
filetype plugin indent off " (1)
let s:dein_path = expand('~/.vim/dein')
let s:dein_repo_dir = s:dein_path . '/repos/github.com/Shougo/dein.vim'
if &runtimepath !~# '/dein.vim'
if !isdirectory(s:dein_repo_dir)
execute '!git clone https://github.com/Shougo/dein.vim' s:dein_repo_dir
endif
execute 'set runtimepath^=' . fnamemodify(s:dein_repo_dir, ':p')
endif
if &compatible
set nocompatible
endif
set runtimepath+=~/.vim/dein/repos/github.com/Shougo/dein.vim
if dein#load_state(s:dein_path)
call dein#begin(s:dein_path)
let g:config_dir = expand('~/.vim/dein/userconfig')
let s:toml = g:config_dir . '/plugins.toml'
let s:lazy_toml = g:config_dir . '/plugins_lazy.toml'
call dein#load_toml(s:toml, {'lazy': 0})
call dein#load_toml(s:lazy_toml, {'lazy': 1})
call dein#end()
call dein#save_state()
endif
filetype plugin indent on
if dein#check_install()
call dein#install()
endif
syntax enable
filetype plugin indent on " (5)
"""""""""""""""""
" colorscheme
"""""""""""""""""
colorscheme molokai
"""""""""""""""""""""
" ctrlp
"""""""""""""""""""""
let g:ctrlp_map = '<c-p>'
let g:ctrlp_cmd = 'CtrlP'
set wildignore+=*/tmp/*,*.so,*.swp,*.zip " MacOSX/Linux
set wildignore+=*\\tmp\\*,*.swp,*.zip,*.exe " Windows
let g:ctrlp_custom_ignore = '\v[\/]\.(git|hg|svn)$'
let g:ctrlp_custom_ignore = {
\ 'dir': '\v[\/]\.(git|hg|svn)$',
\ 'file': '\v\.(exe|so|dll)$',
\ 'link': 'some_bad_symbolic_links',
\ }
""""
" denops
"""
let g:denops#debug = 0
"""
" vim-lsp
""""
" Enables a floating window of diagnostic error for the current line to status
let g:lsp_diagnostics_float_cursor = 1
" Disables virtual text to be shown next to diagnostic errors.
let g:lsp_diagnostics_virtual_text_enabled = 0
" Go to definition.
nnoremap <C-]> :<C-u>LspDefinition<CR>
" Gets the hover information and displays it in the preview-window
nnoremap K :<C-u>LspHover<CR>
let g:lsp_settings = {
\ 'pylsp-all': {
\ 'workspace_config': {
\ 'pylsp': {
\ 'configurationSources': ['flake8'],
\ 'plugins': {
\ 'pylsp_mypy': {
\ 'enabled': 1,
\ 'live_mode': 0,
\ },
\ 'pycodestyle': {
\ 'enabled': 0,
\ },
\ 'flake8': {
\ 'enabled': 1,
\ 'maxLineLength': 88,
\ },
\ 'black': {
\ 'enabled': 1,
\ 'line_length': 88,
\ },
\ 'yapf': {
\ 'enabled': 0,
\ },
\ 'autopep8': {
\ 'enabled': 0,
\ },
\ 'isort': {
\ 'enabled': 1,
\ },
\ }
\ }
\ }
\ },
\}
"""""
" ddc
"""""
call ddc#custom#patch_global('ui', 'pum.vim')
call ddc#custom#patch_global('ui', 'native')
call ddc#custom#patch_global('sources', [
\ 'around',
\ 'vim-lsp',
\ 'file',
\ 'neosnippet'
\ ])
call ddc#custom#patch_global('sourceOptions', {
\ '_': {
\ 'matchers': ['matcher_head'],
\ 'sorters': ['sorter_rank'],
\ 'converters': ['converter_remove_overlap'],
\ },
\ 'around': {'mark': 'Around'},
\ 'neosnippet': {'mark': 'Snippet'},
\ 'vim-lsp': {
\ 'mark': 'LSP',
\ 'matchers': ['matcher_head'],
\ 'forceCompletionPattern': '\.|:|->|"\w+/*'
\ },
\ 'file': {
\ 'mark': 'file',
\ 'isVolatile': v:true,
\ 'forceCompletionPattern': '\S/\S*'
\ }})
let g:lightline = {
\ 'active': {
\ 'right': [ [ 'lsp_errors', 'lsp_warnings', 'lsp_ok', 'lineinfo' ],
\ [ 'percent' ],
\ [ 'fileformat', 'fileencoding', 'filetype' ] ]
\ },
\ 'component_expand': {
\ 'lsp_warnings': 'lightline_lsp#warnings',
\ 'lsp_errors': 'lightline_lsp#errors',
\ 'lsp_ok': 'lightline_lsp#ok',
\ },
\ 'component_type': {
\ 'lsp_warnings': 'warning',
\ 'lsp_errors': 'error',
\ 'lsp_ok': 'middle',
\ },
\ }
let g:lsp_diagnostics_signs_enabled = 0
highlight link LspWarningHighlight Error
call ddc#enable()
inoremap <Tab> <Cmd>call pum#map#insert_relative(+1)<CR>
inoremap <S-Tab> <Cmd>call pum#map#insert_relative(-1)<CR>
"""""""""""""""""""""
" Vim indent guide
"""""""""""""""""""""
" hilight indent
let g:indent_guides_enable_on_vim_startup = 1
let g:indent_guides_color_change_percent = 30
let g:indent_guides_guide_size = 1
let g:indent_guides_auto_colors = 0
autocmd VimEnter,ColorScheme * :hi IndentGuidesOdd ctermbg=darkgray
autocmd VimEnter,ColorScheme * :hi IndentGuidesEven ctermbg=lightgreen
highlight Normal guifg=white guibg=black
"""""""""""""""""""""""""""""""
" neosnippet
"""""""""""""""""""""""""""""""
" Plugin key-mappings
imap <C-k> <Plug>(neosnippet_expand_or_jump)
smap <C-k> <Plug>(neosnippet_expand_or_jump)
" SuperTab like snippets behavior
smap <expr><TAB> neosnippet#expandable_or_jumpable() ?
\ "\<Plug>(neosnippet_expand_or_jump)" : "\<TAB>"
" For snippet complete marker
if has('conceal')
set conceallevel=2 concealcursor=i
endif
" Tell Neosnippet about the other snippets
let g:neosnippet#snippets_directory='~/.vim/snippet'
"""""""""""""""
" vim-markdown
"""""""""""""""
let g:markdown_enable_spell_checking = 0
""""""""""""""""""""""
" rainbow_parentheses
""""""""""""""""""""""
let g:rbpt_colorpairs = [
\ ['brown', 'RoyalBlue3'],
\ ['Darkblue', 'SeaGreen3'],
\ ['darkgray', 'DarkOrchid3'],
\ ['darkgreen', 'firebrick3'],
\ ['darkcyan', 'RoyalBlue3'],
\ ['darkred', 'SeaGreen3'],
\ ['darkmagenta', 'DarkOrchid3'],
\ ['brown', 'firebrick3'],
\ ['gray', 'RoyalBlue3'],
\ ['black', 'SeaGreen3'],
\ ['darkmagenta', 'DarkOrchid3'],
\ ['Darkblue', 'firebrick3'],
\ ['darkgreen', 'RoyalBlue3'],
\ ['darkcyan', 'SeaGreen3'],
\ ['darkred', 'DarkOrchid3'],
\ ['red', 'firebrick3'],
\ ]
let g:rbpt_max = 16
let g:rbpt_loadcmd_toggle = 0
au VimEnter * RainbowParenthesesToggle
au Syntax * RainbowParenthesesLoadRound
au Syntax * RainbowParenthesesLoadSquare
au Syntax * RainbowParenthesesLoadBraces
augroup LspAutoFormatting
autocmd!
autocmd BufWritePre *.py LspDocumentFormatSync
augroup END