Improvments to dap, lsp-cmp and trouble
- dap ui listeners - LSPkind for symbols in suggestions' - improving vim lua lsp support - complete options added ( Preview ) - fixed annoying C-d not working ( had overwritten it for code actions) - Added shortcut , s t to open a terminal at the bottom - Added a keymap to exit terminal mode (thnx teejdev) - set inccommand to split ( shows actions that will be taken in a split window) - fixed trouble suggestions toggle (C-t)
This commit is contained in:
@ -106,6 +106,20 @@ return {
|
||||
args = {'dap', '-l', '127.0.0.1:${port}'},
|
||||
}
|
||||
}
|
||||
local dap = require("dap")
|
||||
local ui = require("dapui")
|
||||
dap.listeners.before.attach.dapui_config = function()
|
||||
ui.open()
|
||||
end
|
||||
dap.listeners.before.launch.dapui_config = function()
|
||||
ui.open()
|
||||
end
|
||||
dap.listeners.before.event_terminated.dapui_config = function()
|
||||
ui.close()
|
||||
end
|
||||
dap.listeners.before.event_exited.dapui_config = function()
|
||||
ui.close()
|
||||
end
|
||||
end
|
||||
}
|
||||
}
|
||||
|
@ -19,8 +19,11 @@ return
|
||||
version = "v2.*",
|
||||
},
|
||||
{'mfussenegger/nvim-jdtls', dependencies = {'nvim-dap'}},
|
||||
"onsails/lspkind.nvim",
|
||||
},
|
||||
config = function()
|
||||
vim.opt.completeopt = { "menu", "menuone", "noselect", "preview"}
|
||||
require("lspkind").init({})
|
||||
require("mason").setup()
|
||||
require("mason-lspconfig").setup({
|
||||
ensure_installed = { "lua_ls", "bashls", "rust_analyzer" }
|
||||
@ -32,7 +35,16 @@ return
|
||||
enable_autosnippets = true,
|
||||
})
|
||||
local cmp = require('cmp')
|
||||
local lspkind = require("lspkind")
|
||||
cmp.setup({
|
||||
formatting = {
|
||||
format = lspkind.cmp_format({
|
||||
mode = 'symbol',
|
||||
maxwidth = 60,
|
||||
ellipsis_char = '...',
|
||||
show_labelDetails = true,
|
||||
}),
|
||||
},
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
require('luasnip').lsp_expand(args.body)
|
||||
@ -132,10 +144,21 @@ return
|
||||
gopls = true,
|
||||
intelephense = true,
|
||||
lua_ls = {
|
||||
settings = {
|
||||
Lua = {
|
||||
diagnostics = {
|
||||
globals = { 'vim'}
|
||||
config = {
|
||||
settings = {
|
||||
Lua = {
|
||||
runtime = {
|
||||
version = 'LuaJIT',
|
||||
},
|
||||
workspace = {
|
||||
checkThirdParty= false,
|
||||
library = {
|
||||
vim.env.VIMRUNTIME
|
||||
}
|
||||
},
|
||||
-- diagnostics = {
|
||||
-- globals = { 'vim'}
|
||||
-- }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user