mirror of
https://github.com/ksyasuda/rice.git
synced 2024-11-22 03:19:58 -08:00
add toggle lsp diagnostic
This commit is contained in:
parent
164aa942e0
commit
c70f3ec15a
@ -181,10 +181,12 @@ if has('nvim')
|
||||
source ~/.config/nvim/plugin-confs/github-theme.lua
|
||||
source ~/.config/nvim/plugin-confs/onedarkpro.lua
|
||||
|
||||
source ~/.config/nvim/lua/toggle_lsp_diagnostics.lua
|
||||
|
||||
" makes fzf match colorscheme (I think)
|
||||
augroup fzf_preview
|
||||
autocmd!
|
||||
autocmd User fzf_preview#rpc#initialized call s:fzf_preview_settings() " fzf_preview#remote#initialized or fzf_preview#coc#initialized
|
||||
autocmd User fzf_preview#rpc#initialized call s:fzf_preview_settings()
|
||||
augroup END
|
||||
function! s:fzf_preview_settings() abort
|
||||
let g:fzf_preview_command = 'COLORTERM=truecolor ' . g:fzf_preview_command
|
||||
@ -192,7 +194,6 @@ if has('nvim')
|
||||
endfunction
|
||||
" make terminal not have line numbers
|
||||
autocmd TermOpen * setlocal nonumber norelativenumber
|
||||
|
||||
else
|
||||
source ~/.vim/keybindings.vim
|
||||
|
||||
|
@ -128,3 +128,6 @@ nnoremap <leader>xl <cmd>TroubleToggle loclist<cr>
|
||||
nnoremap <leader>xq <cmd>TroubleToggle quickfix<cr>
|
||||
nnoremap <leader>xw <cmd>TroubleToggle workspace_diagnostics<cr>
|
||||
nnoremap <leader>xx <cmd>TroubleToggle<cr>
|
||||
|
||||
nmap <leader>y "+
|
||||
vmap <leader>y "+
|
||||
|
11
nvim/lua/toggle_lsp_diagnostics.lua
Normal file
11
nvim/lua/toggle_lsp_diagnostics.lua
Normal file
@ -0,0 +1,11 @@
|
||||
local diagnostics_active = true
|
||||
local toggle_diagnostics = function()
|
||||
diagnostics_active = not diagnostics_active
|
||||
if diagnostics_active then
|
||||
vim.diagnostic.show()
|
||||
else
|
||||
vim.diagnostic.hide()
|
||||
end
|
||||
end
|
||||
|
||||
vim.keymap.set('n', '<leader>td', toggle_diagnostics)
|
Loading…
Reference in New Issue
Block a user