Browse Source

Update config and plug.

jackyalcine 3 months ago
parent
commit
60e00b945a
Signed by: Jacky Alciné <yo@jacky.wtf> GPG Key ID: 537A4F904B15268D
2 changed files with 88 additions and 30 deletions
  1. 1
    1
      home/.config/nvim/autoload/plug.vim
  2. 87
    29
      home/.config/nvim/init.vim

+ 1
- 1
home/.config/nvim/autoload/plug.vim View File

@@ -2224,7 +2224,7 @@ function! s:upgrade()
2224 2224
   let new = tmp . '/plug.vim'
2225 2225
 
2226 2226
   try
2227
-    let out = s:system(printf('git clone --depth 1 %s %s', s:plug_src, tmp))
2227
+    let out = s:system(printf('git clone --depth 1 %s %s', s:shellesc(s:plug_src), s:shellesc(tmp)))
2228 2228
     if v:shell_error
2229 2229
       return s:err('Error upgrading vim-plug: '. out)
2230 2230
     endif

+ 87
- 29
home/.config/nvim/init.vim View File

@@ -153,6 +153,7 @@ Plug 'tpope/vim-surround'
153 153
 Plug 'tpope/vim-endwise'
154 154
 Plug 'tpope/vim-repeat'
155 155
 Plug 'tpope/vim-eunuch'
156
+Plug 'tpope/vim-dispatch'
156 157
 Plug 'tpope/vim-vinegar'
157 158
 Plug 'tpope/vim-scriptease'
158 159
 Plug 'janko-m/vim-test'
@@ -199,17 +200,30 @@ Plug 'sodapopcan/vim-twiggy'
199 200
 Plug 'junegunn/gv.vim'
200 201
 Plug 'vrybas/vim-flayouts'
201 202
 Plug 'ekalinin/dockerfile.vim'
203
+Plug 'meain/vim-package-info', { 'do': 'npm install' }
202 204
 
203 205
 Plug 'ncm2/ncm2'
206
+      \ | Plug 'roxma/nvim-yarp'
204 207
       \ | Plug 'ncm2/ncm2-bufword'
205 208
       \ | Plug 'ncm2/ncm2-path'
206 209
       \ | Plug 'ncm2/ncm2-tmux'
207 210
       \ | Plug 'ncm2/ncm2-cssomni'
211
+      \ | Plug 'ncm2/ncm2-syntax' | Plug 'Shougo/neco-syntax'
212
+      \ | Plug 'ncm2/ncm2-tagprefix'
208 213
       \ | Plug 'ncm2/ncm2-racer'
209 214
       \ | Plug 'ncm2/ncm2-vim' | Plug 'Shougo/neco-vim'
210 215
       \ | Plug 'pbogut/ncm2-alchemist' | Plug 'slashmili/alchemist.vim'
211 216
       \ | Plug 'ncm2/ncm2-ultisnips'
212
-      \ | Plug 'roxma/nvim-yarp'
217
+      \ | Plug 'roxma/LanguageServer-php-neovim',  {'do': 'composer install && composer run-script parse-stubs'}
218
+      \ | Plug 'JakeBecker/elixir-ls', {'do': 'mix deps.get && mix compile && mix elixir_ls.release -o ' . vimrc_root . '/bin'}
219
+      \ | Plug 'autozimu/LanguageClient-neovim', {
220
+      \ 'branch': 'next',
221
+      \ 'do': 'bash install.sh',
222
+      \ }
223
+
224
+
225
+Plug 'severin-lemaignan/vim-minimap'
226
+Plug 'brooth/far.vim'
213 227
 
214 228
 call plug#end()
215 229
 " }}}
@@ -217,49 +231,52 @@ call plug#end()
217 231
 " {{{ Options
218 232
 " {{{2 vim-bookmarks
219 233
 let g:bookmark_sign = '♥'
220
-let g:bookmark_highlight_lines = 1
234
+let g:bookmark_highlight_lines = 0
221 235
 " }}}
222 236
 "
223 237
 " {{{2 signify
224 238
 let g:signify_vcs_list = [ 'git', 'hg', 'bzr' ]
225 239
 let g:signify_realtime = 1
226
-let g:signify_sign_show_count = 0
240
+let g:signify_sign_show_count = 1
227 241
 let g:signify_line_highlight = 0
228 242
 " 2}}}
229 243
 " {{{2 twiggy
230 244
 let g:twiggy_enable_remote_delete = 1
231 245
 " 2}}}
232 246
 
233
-if executable('ag')
247
+if executable('ripgrep')
234 248
   let $FZF_DEFAULT_COMMAND = 'ag --hidden --ignore .git -g ""'
235 249
   set grepprg=ag\ --nogroup\ --column\ --smart-case\ --nocolor\ --follow
236 250
   set grepformat=%f:%l:%c:%m
237 251
 endif
238 252
 " }}}
239 253
 "
240
-let g:autoformat_remove_trailing_spaces = 0
254
+let g:autoformat_remove_trailing_spaces = 1
241 255
 " {{{2 ale
242 256
 let g:ale_command_wrapper = 'nice -n4'
243 257
 let g:ale_set_ballons = 1
244 258
 let g:ale_completion_enabled = 0
259
+let g:ale_use_global_executables = 0
245 260
 let g:ale_fix_on_save = 1
246
-let g:ale_completion_delay = 1
247
-let g:ale_completion_max_suggestions = 10
248 261
 let g:ale_fixers = {
249 262
       \ '*' : ['remove_trailing_lines', 'trim_whitespace'],
250
-      \ 'javascript': ['eslint'],
251
-      \ 'typescript': ['eslint'],
252
-      \ 'vue': ['prettier'],
263
+      \ 'javascript': ['eslint', 'prettier'],
264
+      \ 'typescript': ['tslint', 'eslint', 'prettier'],
265
+      \ 'vue': ['prettier', 'eslint'],
253 266
       \ 'scss': ['stylelint'],
254
-      \ 'html': ['stylelint', 'tidy'],
267
+      \ 'html': ['stylelint', 'prettier', 'tidy'],
255 268
       \ 'rust': ['rustfmt'],
256 269
       \ 'elixir': ['mix_format'],
257 270
       \ }
258
-let g:ale_linters  = {
259
-      \ 'elixir': 'all'
260
-      \ }
261 271
 " 2}}}
262 272
 "
273
+" {{{2 minimap
274
+let g:minimap_show='<leader>Ms'
275
+let g:minimap_update='<leader>Mu'
276
+let g:minimap_close='<leader>Mc'
277
+let g:minimap_toggle='<leader>Mt'
278
+" }}}
279
+"
263 280
 " {{{2 vim-test
264 281
 let g:test#custom_transformations = {
265 282
       \ 'vagrant': function('<SID>VagrantTransform'),
@@ -331,11 +348,11 @@ endfunction
331 348
 
332 349
 let g:startify_lists = [
333 350
       \ { 'header': ['   Sessions'],       'type': 'sessions' },
334
-      \ { 'header': ['   MRU'],            'type': 'files' },
335
-      \ { 'header': ['   MRU '. getcwd()], 'type': 'dir' },
336
-      \ { 'header': ['   Vim Config Edits'],        'type': function('s:list_commits') },
337 351
       \ { 'header': ['   Bookmarks'],      'type': 'bookmarks' },
338 352
       \ { 'header': ['   Commands'],       'type': 'commands' },
353
+      \ { 'header': ['   MRU '. getcwd()], 'type': 'dir' },
354
+      \ { 'header': ['   MRU'],            'type': 'files' },
355
+      \ { 'header': ['   Vim Config Edits'],        'type': function('s:list_commits') },
339 356
       \ ]
340 357
 let g:startify_session_before_save = [
341 358
       \ 'silent! s:terminal_kill_extra_buffers()'
@@ -345,6 +362,9 @@ let g:startify_session_before_save = [
345 362
 let g:UltiSnipsJumpForwardTrigger = "<c-j>"
346 363
 let g:UltiSnipsJumpBackwardTrigger  = "<c-k>"
347 364
 let g:UltiSnipsRemoveSelectModeMappings = 0
365
+
366
+let g:ncm2_look_enabled = 1
367
+let g:float_preview#docked = 1
348 368
 "
349 369
 " {{{2
350 370
 let g:test#strategy = 'neovim'
@@ -358,6 +378,13 @@ let g:localvimrc_persistent_file = expand('$HOME/.config/nvim/localvimrc_persist
358 378
 let g:localvimrc_whitelist = [expand('$HOME/.lvimrc')]
359 379
 " 2}}}
360 380
 "
381
+" {{{2
382
+let g:far#source = "agnvim"
383
+let g:far#collapse_result = 1
384
+let g:far#auto_write_replaced_buffers = 1
385
+let g:far#auto_delete_replaced_buffers = 1
386
+" }}}
387
+"
361 388
 " {{{2 airline
362 389
 let g:airline_powerline_fonts = 1
363 390
 let g:airline_skip_empty_sections = 1
@@ -400,6 +427,21 @@ let g:airline_mode_map = {
400 427
       \ }
401 428
 " 2}}}
402 429
 " }}}
430
+"
431
+" {{{2 langserver
432
+let g:LanguageClient_serverCommands = {
433
+      \ 'typescript': ['asdf', 'exec', 'javascript-typescript-stdio'],
434
+      \ 'javascript': ['asdf', 'exec', 'javascript-typescript-stdio'],
435
+      \ 'python': ['asdf', 'exec', 'pyls'],
436
+      \ 'rust': ['asdf', 'exec', 'rls'],
437
+      \ 'elixir': [vimrc_root . '/bin/language_server.sh']
438
+      \ }
439
+let g:LanguageClient_rootMarkers = {
440
+      \ 'javascript': ['package.json'],
441
+      \ 'elixir': ['mix.exs'],
442
+      \ 'rust': ['Cargo.toml']
443
+      \ }
444
+"}}}
403 445
 
404 446
 " {{{ Mappings
405 447
 let s:mappings = {
@@ -409,15 +451,7 @@ let s:mappings = {
409 451
 exec 'let g:mapleader="' . s:mappings.leader . '"'
410 452
 exec 'let g:maplocalleader="' . s:mappings.localLeader. '"'
411 453
 
412
-call <SID>apply_bulk_mappings([
413
-      \ ['m', ':Make<space>'],
414
-      \ ['a', ':Make all<CR>'],
415
-      \ ['c', ':Make clean<CR>'],
416
-      \ ['i', ':Make install<CR>'],
417
-      \ ['t', ':Make test<CR>'],
418
-      \ ['tb', ":call('Make',['test',expand('%')])<CR>"],
419
-      \ ['u', ':Make uninstall<CR>'],
420
-      \ ], { 'prefix' : 'm' })
454
+nnoremap <silent> <F9> :Dispatch<CR>
421 455
 
422 456
 call <SID>apply_bulk_mappings([
423 457
       \ ['t', ':TestNearest<CR>'],
@@ -427,6 +461,13 @@ call <SID>apply_bulk_mappings([
427 461
       \ ['v', ':TestVisit<CR>'],
428 462
       \ ], { 'prefix' : 't' })
429 463
 
464
+call <SID>apply_bulk_mappings([
465
+      \ ['i', ':Make install<CR>'],
466
+      \ ['b', ':Make build<CR>'],
467
+      \ ['c', ':Make clean<CR>'],
468
+      \ ], { 'prefix' : 'm' })
469
+
470
+
430 471
 call <SID>apply_bulk_mappings([
431 472
       \ ['b', ':Buffers<cr>'],
432 473
       \ ['c', ':Commits<cr>'],
@@ -481,6 +522,16 @@ call <SID>apply_bulk_mappings([
481 522
       \ ['r', '<Plug>(ale_reset)'],
482 523
       \ ], { 'prefix': 'a'})
483 524
 
525
+call <SID>apply_bulk_mappings([
526
+      \ ['c', ':call LanguageClient_contextMenu()<CR>'],
527
+      \ ['d', ':call LanguageClient#textDocument_definition()<CR>'],
528
+      \ ['D', ':call LanguageClient#textDocument_typeDefinition()<CR>'],
529
+      \ ['i', ':call LanguageClient#textDocument_implementation()<CR>'],
530
+      \ ['r', ':call LanguageClient#textDocument_rename()<CR>'],
531
+      \ ['f', ':call LanguageClient#textDocument_references()<CR>'],
532
+      \ ['a', ':call LanguageClient#textDocument_codeAction()<CR>'],
533
+      \ ], { 'prefix': 'lc'})
534
+
484 535
 call <SID>apply_bulk_mappings([
485 536
       \ ['e', '<ESC>:cnext<CR>'],
486 537
       \ ['f', '<ESC>:cfirst<CR>'],
@@ -504,7 +555,6 @@ call <SID>apply_bulk_mappings([
504 555
 inoremap <c-c> <ESC>
505 556
 inoremap <expr> <Tab> pumvisible() ? "\<C-n>" : "\<Tab>"
506 557
 inoremap <expr> <S-Tab> pumvisible() ? "\<C-p>" : "\<S-Tab>"
507
-inoremap <silent> <expr> <CR> ncm2_ultisnips#expand_or("\<CR>", 'n')
508 558
 
509 559
 tnoremap <Esc> <C-\><C-n>
510 560
 tnoremap <A-h> <C-\><C-n><C-w>h
@@ -531,7 +581,7 @@ cnoremap <silent> <leader>pd <C-R>=strftime("%Y-%m-%d")<CR>
531 581
 " }}}
532 582
 
533 583
 
534
-if $TERM !~# "konsole.*"
584
+if !exists('$KONSOLE_VERSION')
535 585
   " As a work around for the following bugs in kde4's konsole:
536 586
   "   use the output of 16.colorscheme.rb and don't set base16colorspace.
537 587
   "   base-shell script will not be called
@@ -539,6 +589,7 @@ if $TERM !~# "konsole.*"
539 589
   " https://bugs.kde.org/show_bug.cgi?id=344181
540 590
   let base16colorspace=256
541 591
 endif
592
+
542 593
 if filereadable(expand("~/.vimrc_background"))
543 594
   source ~/.vimrc_background
544 595
 endif
@@ -548,7 +599,6 @@ syntax on
548 599
 
549 600
 autocmd FileType gitcommit set bufhidden=delete
550 601
 autocmd TermOpen * setl nonumber signcolumn=no foldcolumn=0 bufhidden=delete
551
-autocmd BufWrite * :Autoformat
552 602
 autocmd BufEnter * call ncm2#enable_for_buffer()
553 603
 autocmd TextChangedI * call ncm2#auto_trigger()
554 604
 autocmd User Ncm2PopupOpen set completeopt=noinsert,menuone,noselect
@@ -569,3 +619,11 @@ command! DisconnectClients
569 619
         \|     silent! call rpcnotify(client, 'Exit', 1)
570 620
         \|   endfor
571 621
         \| endif
622
+
623
+command! -bang -nargs=* Ag
624
+      \ call fzf#vim#ag(<q-args>,
625
+      \                 <bang>0 ? fzf#vim#with_preview('up:60%')
626
+      \                         : fzf#vim#with_preview('right:50%:hidden', '?'),
627
+      \                 <bang>0)
628
+command! -bang -nargs=? -complete=dir Files
629
+      \ call fzf#vim#files(<q-args>, fzf#vim#with_preview(), <bang>0)

Loading…
Cancel
Save