|
|
@ -133,13 +133,6 @@ vim.api.nvim_create_autocmd('LspAttach', {
|
|
|
|
-- key mappings
|
|
|
|
-- key mappings
|
|
|
|
local opts = {
|
|
|
|
local opts = {
|
|
|
|
buffer = ev.buf,
|
|
|
|
buffer = ev.buf,
|
|
|
|
noremap = true,
|
|
|
|
|
|
|
|
focusable = false,
|
|
|
|
|
|
|
|
border = 'rounded',
|
|
|
|
|
|
|
|
source = 'always',
|
|
|
|
|
|
|
|
prefix = ' ',
|
|
|
|
|
|
|
|
scope = 'cursor',
|
|
|
|
|
|
|
|
close_events = { "BufLeave","CursorMoved","InsertEnter","FocusLost" },
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
-- error viewing
|
|
|
|
-- error viewing
|
|
|
|
vim.keymap.set('n', '<leader>e', vim.diagnostic.open_float, opts)
|
|
|
|
vim.keymap.set('n', '<leader>e', vim.diagnostic.open_float, opts)
|
|
|
@ -152,10 +145,20 @@ vim.api.nvim_create_autocmd('LspAttach', {
|
|
|
|
vim.keymap.set('n', '<leader>H', vim.lsp.buf.hover, opts)
|
|
|
|
vim.keymap.set('n', '<leader>H', vim.lsp.buf.hover, opts)
|
|
|
|
-- auto hover for error viewing
|
|
|
|
-- auto hover for error viewing
|
|
|
|
vim.api.nvim_create_autocmd("CursorHold", {
|
|
|
|
vim.api.nvim_create_autocmd("CursorHold", {
|
|
|
|
callback = function()
|
|
|
|
opts = {
|
|
|
|
vim.diagnostic.open_float(nil, opts)
|
|
|
|
buffer = ev.buf,
|
|
|
|
end
|
|
|
|
noremap = true,
|
|
|
|
})
|
|
|
|
focusable = false,
|
|
|
|
|
|
|
|
border = 'rounded',
|
|
|
|
|
|
|
|
source = 'always',
|
|
|
|
|
|
|
|
prefix = ' ',
|
|
|
|
|
|
|
|
scope = 'cursor',
|
|
|
|
|
|
|
|
close_events = { "BufLeave","CursorMoved","InsertEnter","FocusLost" }
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
callback = function()
|
|
|
|
|
|
|
|
vim.diagnostic.open_float(nil, opts)
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
})
|
|
|
|
-- local opts = { buffer = ev.buf }
|
|
|
|
-- local opts = { buffer = ev.buf }
|
|
|
|
-- -- error viewing
|
|
|
|
-- -- error viewing
|
|
|
|
-- vim.keymap.set('n', '<leader>e', vim.diagnostic.open_float, opts)
|
|
|
|
-- vim.keymap.set('n', '<leader>e', vim.diagnostic.open_float, opts)
|
|
|
|