update lsp and color
This commit is contained in:
parent
2845e0c638
commit
bff6f8ae18
@ -6,11 +6,11 @@ local has_words_before = function()
|
||||
return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil
|
||||
end
|
||||
cmp.setup({
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
require('luasnip').lsp_expand(args.body) -- For `luasnip` users.
|
||||
end,
|
||||
},
|
||||
-- snippet = {
|
||||
-- expand = function(args)
|
||||
-- require('luasnip').lsp_expand(args.body) -- For `luasnip` users.
|
||||
-- end,
|
||||
-- },
|
||||
mapping = {
|
||||
['<C-k>'] = cmp.mapping.select_prev_item(),
|
||||
['<C-p>'] = cmp.mapping.select_prev_item(),
|
||||
@ -47,12 +47,10 @@ cmp.setup({
|
||||
end, { "i", "s" })
|
||||
},
|
||||
sources = cmp.config.sources({
|
||||
{ name = 'path' },
|
||||
{ name = 'buffer' },
|
||||
{ name = 'nvim_lsp' },
|
||||
{ name = 'nvim_lsp_signature_help' },
|
||||
--{ name = 'nvim_lua' },
|
||||
{ name = 'buffer' },
|
||||
--{ name = 'luasnip' }, -- For luasnip users.
|
||||
-- { name = 'path' },
|
||||
}),
|
||||
window = {
|
||||
completion = cmp.config.window.bordered(),
|
||||
|
@ -71,12 +71,15 @@ require("dapui").setup()
|
||||
|
||||
M.setup()
|
||||
dap.listeners.after.event_initialized["dapui_config"] = function()
|
||||
print('dap event init')
|
||||
dapui.open()
|
||||
end
|
||||
dap.listeners.before.event_terminated["dapui_config"] = function()
|
||||
print('dap event terminate')
|
||||
dapui.close()
|
||||
end
|
||||
dap.listeners.before.event_exited["dapui_config"] = function()
|
||||
print('dap event exit')
|
||||
dapui.close()
|
||||
end
|
||||
return M
|
||||
|
@ -7,15 +7,14 @@ require('mason').setup({
|
||||
}
|
||||
}
|
||||
})
|
||||
require('mason-lspconfig').setup({
|
||||
ensure_installed = {"tsserver"}
|
||||
})
|
||||
require('mason-lspconfig').setup({})
|
||||
|
||||
require 'mason-tool-installer'.setup {
|
||||
ensure_installed = {
|
||||
{ 'bash-language-server', auto_update = true },
|
||||
'lua-language-server',
|
||||
'vim-language-server',
|
||||
'typescript-language-server',
|
||||
'stylua',
|
||||
},
|
||||
auto_update = false,
|
||||
|
@ -1,6 +1,5 @@
|
||||
|
||||
vim.cmd('hi CursorLine term=bold cterm=bold ctermbg=darkgrey')
|
||||
|
||||
vim.cmd.colorscheme "gruvbox"
|
||||
vim.cmd.colorscheme "catppuccin"
|
||||
vim.o.background = "light"
|
||||
vim.o.termguicolors = true
|
||||
|
@ -11,7 +11,7 @@ vim.keymap.set('n', '<space>q', vim.diagnostic.setloclist, opts)
|
||||
-- after the language server attaches to the current buffer
|
||||
local on_attach = function(client, bufnr)
|
||||
-- Enable completion triggered by <c-x><c-o>
|
||||
vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc')
|
||||
--vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc')
|
||||
|
||||
-- Mappings.
|
||||
-- See `:help vim.lsp.*` for documentation on any of the below functions
|
||||
@ -105,6 +105,17 @@ require('mason-lspconfig').setup_handlers {
|
||||
settings = {}
|
||||
}
|
||||
end,
|
||||
['tsserver'] = function()
|
||||
require('lspconfig')['tsserver'].setup {
|
||||
on_attach = on_attach,
|
||||
flags = lsp_flags,
|
||||
settings = {
|
||||
init_options = {
|
||||
host_info = 'neovim'
|
||||
}
|
||||
}
|
||||
}
|
||||
end,
|
||||
['yamlls'] = function()
|
||||
require('lspconfig')["yamlls"].setup {
|
||||
on_attach = on_attach,
|
||||
|
Loading…
Reference in New Issue
Block a user