@@ -147,7 +147,6 @@ Plug 'kevinhwang91/nvim-hlslens', has('nvim') ? {} : { 'on': [] }
147
147
Plug 'petertriho/nvim-scrollbar', has('nvim') ? {} : { 'on': [] }
148
148
Plug 'otavioschwanck/tmux-awesome-manager.nvim', has('nvim') ? {} : { 'on': [] }
149
149
Plug 'chrisgrieser/nvim-early-retirement', has('nvim') ? {} : { 'on': [] }
150
- Plug 'folke/trouble.nvim', has('nvim') ? { 'tag': 'v2.10.0' } : { 'on': [] }
151
150
152
151
if exists('$OPENAI_API_KEY')
153
152
Plug 'dpayne/CodeGPT.nvim', has('nvim') ? {} : { 'on': [] }
@@ -382,10 +381,10 @@ else
382
381
inoremap <silent><expr> <c-@> coc#refresh()
383
382
endif
384
383
385
- " Use `[g ` and `]g ` to navigate diagnostics
384
+ " Use `g[ ` and `g] ` to navigate diagnostics
386
385
" Use `:CocDiagnostics` to get all diagnostics of current buffer in location list.
387
- nmap <silent> [g <Plug>(coc-diagnostic-prev)
388
- nmap <silent> ]g <Plug>(coc-diagnostic-next)
386
+ nmap <silent> g[ <Plug>(coc-diagnostic-prev)
387
+ nmap <silent> g] <Plug>(coc-diagnostic-next)
389
388
390
389
" GoTo code navigation.
391
390
nmap <silent> gd <Plug>(coc-definition)
@@ -507,39 +506,11 @@ let g:diagnostic_window_size = 3
507
506
xmap <silent> <space>d :call ToggleDiagnostics()<CR>
508
507
nmap <silent> <space>d :call ToggleDiagnostics()<CR>
509
508
510
- if has('nvim')
511
- let g:auto_diagnostic_window = 0
512
- endif
513
-
514
509
function! ToggleDiagnostics() abort
515
- if !has('nvim')
516
- if get(getloclist(0, {'winid':0}), 'winid', 0)
517
- " the location window is open
518
- windo lcl\|ccl
519
- else
520
- " the location window is closed
521
- if empty(&l:buftype)
522
- if (&filetype !=# 'floaterm') && (&buftype !=# 'terminal')
523
- execute 'CocDiagnostics ' . g:diagnostic_window_size
524
- execute 'botright lwindow'
525
- execute 'wincmd p'
526
- endif
527
- endif
528
- endif
529
- else
530
- if g:auto_diagnostic_window
531
- call v:lua.notify('LSP Diagnostics Window', 'Disabling auto-open', 'info')
532
- let g:auto_diagnostic_window = 0
533
- endif
534
- if empty(&l:buftype)
535
- call coc#rpc#request('fillDiagnostics', [bufnr('%')])
536
- execute 'TroubleToggle'
537
- execute 'wincmd p'
538
- endif
539
- endif
510
+ execute 'CocList --height=5 diagnostics --buffer'
540
511
endfunction
541
512
542
- augroup coc_diag
513
+ augroup coc_nvim
543
514
" shutdown coc on exit
544
515
autocmd VimLeavePre * :call coc#rpc#kill()
545
516
" auto close outline if it's the last window
@@ -558,32 +529,6 @@ augroup coc_diag
558
529
endif
559
530
endif
560
531
endfunction
561
-
562
- function! s:RefreshDiagnostics() abort
563
- if empty(&l:buftype)
564
- if has('nvim')
565
- let l:trouble_open = bufwinnr('^Trouble$') != -1
566
- if g:auto_diagnostic_window
567
- call coc#rpc#request('fillDiagnostics', [bufnr('')])
568
- if len(getloclist(0)) > 0
569
- if l:trouble_open
570
- execute 'TroubleRefresh'
571
- else
572
- execute 'Trouble loclist'
573
- execute 'wincmd p'
574
- endif
575
- else
576
- execute 'TroubleClose'
577
- endif
578
- elseif l:trouble_open
579
- execute 'TroubleRefresh'
580
- endif
581
- endif
582
- endif
583
- endfunction
584
-
585
- autocmd User CocDiagnosticChange call timer_start(0, {-> s:RefreshDiagnostics()})
586
-
587
532
augroup end
588
533
589
534
" Remove plugins not explicitly defined in g:coc_global_extensions
0 commit comments