Add completion

This commit is contained in:
2025-08-08 22:00:55 -04:00
parent 2ac2b83105
commit 4198f9e6f7
3 changed files with 27 additions and 5 deletions

View File

@@ -1,2 +0,0 @@
return {
}

View File

@@ -3,9 +3,6 @@ return {
"neovim/nvim-lspconfig",
lazy = false,
config = function()
local lspconfig = require("lspconfig")
lspconfig.lua_ls.setup({})
vim.keymap.set("n", "K", vim.lsp.buf.hover, {})
vim.keymap.set("n", "<leader>gd", vim.lsp.buf.definition, {})
vim.keymap.set("n", "<leader>gr", vim.lsp.buf.references, {})

View File

@@ -0,0 +1,27 @@
return {
"hrsh7th/nvim-cmp",
dependencies = {
"hrsh7th/cmp-nvim-lsp",
"hrsh7th/cmp-buffer",
"hrsh7th/cmp-path",
"hrsh7th/cmp-cmdline",
},
config = function()
local cmp = require("cmp")
cmp.setup({
snippet = {
expand = function(args)
vim.snippet.expand(args.body)
end
},
window = {
completion = cmp.config.window.bordered(),
documentation = cmp.config.window.bordered()
},
sources = cmp.config.sources({
{ name = "nvim_lsp" },
},
{{ name = "buffer"}})
})
end
}