Adding neodev plugin for better vim lsp

Signed-off-by: Taken <taken@mairimashita.org>
This commit is contained in:
2023-09-18 19:27:43 +02:00
parent 44e4e8addf
commit 0bb96dc00c
3 changed files with 15 additions and 5 deletions

1
.gitignore vendored
View File

@@ -1,2 +1,3 @@
lua/taken/prefs.lua lua/taken/prefs.lua
lazy-lock.json lazy-lock.json
.luarc.json

View File

@@ -21,10 +21,10 @@ opt.softtabstop = 4
opt.shiftwidth = 4 opt.shiftwidth = 4
opt.expandtab = true opt.expandtab = true
vim.opt.swapfile = false opt.swapfile = false
vim.opt.backup = false opt.backup = false
vim.opt.undodir = os.getenv("HOME") .. "/.vim/undodir" opt.undofile = true
vim.opt.undofile = true opt.undodir = vim.fn.expand("~") .. "/.vim/undodir"
opt.smartindent = true opt.smartindent = true
opt.wrap = false opt.wrap = false

View File

@@ -1,11 +1,17 @@
return { return {
"neovim/nvim-lspconfig", "neovim/nvim-lspconfig",
dependencies = "hrsh7th/cmp-nvim-lsp", dependencies = {
"hrsh7th/cmp-nvim-lsp",
"folke/neodev.nvim",
},
event = { "BufReadPre", "BufNewFile" }, event = { "BufReadPre", "BufNewFile" },
config = function() config = function()
local neodev = require("neodev")
local lspconfig = require("lspconfig") local lspconfig = require("lspconfig")
local cmp_nvim_lsp = require("cmp_nvim_lsp") local cmp_nvim_lsp = require("cmp_nvim_lsp")
neodev.setup({})
local on_attach = function(client, bufnr) local on_attach = function(client, bufnr)
local opts = { noremap = true, silent = true, buffer = bufnr } local opts = { noremap = true, silent = true, buffer = bufnr }
vim.keymap.set("n", "gd", "<cmd>Telescope lsp_definitions<CR>", opts) vim.keymap.set("n", "gd", "<cmd>Telescope lsp_definitions<CR>", opts)
@@ -56,6 +62,9 @@ return {
diagnostics = { diagnostics = {
globals = { "vim" }, globals = { "vim" },
}, },
completion = {
callSnippet = "Replace",
},
}, },
}, },
}) })