@@ -147,7 +147,6 @@ Plug 'kevinhwang91/nvim-hlslens', has('nvim') ? {} : { 'on': [] }
147147Plug 'petertriho/nvim-scrollbar', has('nvim') ? {} : { 'on': [] }
148148Plug 'otavioschwanck/tmux-awesome-manager.nvim', has('nvim') ? {} : { 'on': [] }
149149Plug 'chrisgrieser/nvim-early-retirement', has('nvim') ? {} : { 'on': [] }
150- Plug 'folke/trouble.nvim', has('nvim') ? { 'tag': 'v2.10.0' } : { 'on': [] }
151150
152151if exists('$OPENAI_API_KEY')
153152 Plug 'dpayne/CodeGPT.nvim', has('nvim') ? {} : { 'on': [] }
@@ -382,10 +381,10 @@ else
382381 inoremap <silent><expr> <c-@> coc#refresh()
383382endif
384383
385- " Use `[g ` and `]g ` to navigate diagnostics
384+ " Use `g[ ` and `g] ` to navigate diagnostics
386385" 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)
389388
390389" GoTo code navigation.
391390nmap <silent> gd <Plug>(coc-definition)
@@ -507,39 +506,11 @@ let g:diagnostic_window_size = 3
507506xmap <silent> <space>d :call ToggleDiagnostics()<CR>
508507nmap <silent> <space>d :call ToggleDiagnostics()<CR>
509508
510- if has('nvim')
511- let g:auto_diagnostic_window = 0
512- endif
513-
514509function! 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'
540511endfunction
541512
542- augroup coc_diag
513+ augroup coc_nvim
543514 " shutdown coc on exit
544515 autocmd VimLeavePre * :call coc#rpc#kill()
545516 " auto close outline if it's the last window
@@ -558,32 +529,6 @@ augroup coc_diag
558529 endif
559530 endif
560531 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-
587532augroup end
588533
589534" Remove plugins not explicitly defined in g:coc_global_extensions
0 commit comments