mirror of
https://github.com/ksyasuda/rice.git
synced 2024-10-28 09:04:10 -07:00
add toggle lsp diagnostic
This commit is contained in:
parent
164aa942e0
commit
c70f3ec15a
@ -181,18 +181,19 @@ if has('nvim')
|
|||||||
source ~/.config/nvim/plugin-confs/github-theme.lua
|
source ~/.config/nvim/plugin-confs/github-theme.lua
|
||||||
source ~/.config/nvim/plugin-confs/onedarkpro.lua
|
source ~/.config/nvim/plugin-confs/onedarkpro.lua
|
||||||
|
|
||||||
|
source ~/.config/nvim/lua/toggle_lsp_diagnostics.lua
|
||||||
|
|
||||||
" makes fzf match colorscheme (I think)
|
" makes fzf match colorscheme (I think)
|
||||||
augroup fzf_preview
|
augroup fzf_preview
|
||||||
autocmd!
|
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
|
augroup END
|
||||||
function! s:fzf_preview_settings() abort
|
function! s:fzf_preview_settings() abort
|
||||||
let g:fzf_preview_command = 'COLORTERM=truecolor ' . g:fzf_preview_command
|
let g:fzf_preview_command = 'COLORTERM=truecolor ' . g:fzf_preview_command
|
||||||
let g:fzf_preview_grep_preview_cmd = 'COLORTERM=truecolor ' . g:fzf_preview_grep_preview_cmd
|
let g:fzf_preview_grep_preview_cmd = 'COLORTERM=truecolor ' . g:fzf_preview_grep_preview_cmd
|
||||||
endfunction
|
endfunction
|
||||||
" make terminal not have line numbers
|
" make terminal not have line numbers
|
||||||
autocmd TermOpen * setlocal nonumber norelativenumber
|
autocmd TermOpen * setlocal nonumber norelativenumber
|
||||||
|
|
||||||
else
|
else
|
||||||
source ~/.vim/keybindings.vim
|
source ~/.vim/keybindings.vim
|
||||||
|
|
||||||
|
@ -128,3 +128,6 @@ nnoremap <leader>xl <cmd>TroubleToggle loclist<cr>
|
|||||||
nnoremap <leader>xq <cmd>TroubleToggle quickfix<cr>
|
nnoremap <leader>xq <cmd>TroubleToggle quickfix<cr>
|
||||||
nnoremap <leader>xw <cmd>TroubleToggle workspace_diagnostics<cr>
|
nnoremap <leader>xw <cmd>TroubleToggle workspace_diagnostics<cr>
|
||||||
nnoremap <leader>xx <cmd>TroubleToggle<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