From 376703922920c88b0f94c08591faa11065ee04b1 Mon Sep 17 00:00:00 2001 From: sinanmohd Date: Sun, 27 Aug 2023 21:17:20 +0530 Subject: config/nvim: lsp init --- .config/nvim/init.lua | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index 5171b7b..4285f23 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -89,6 +89,17 @@ require("lazy").setup({ end, }, }, + + { + "VonHeikemen/lsp-zero.nvim", + branch = "v2.x", + dependencies = { + {"neovim/nvim-lspconfig"}, + {"hrsh7th/nvim-cmp"}, + {"hrsh7th/cmp-nvim-lsp"}, + {"L3MON4D3/LuaSnip"}, + }, + }, }, { lockfile = lazylock }) -- [[ treesitter setup ]] @@ -114,3 +125,16 @@ require("nvim-treesitter.configs").setup { }, } } + +-- [[ lsp setup ]] +local lsp = require("lsp-zero").preset{} +lsp.on_attach(function(_, bufnr) + lsp.default_keymaps({buffer = bufnr}) +end) + +require("lspconfig").ccls.setup{} +require("lspconfig").bashls.setup{} +require("lspconfig").nil_ls.setup{} +require("lspconfig").lua_ls.setup(lsp.nvim_lua_ls()) + +lsp.setup() -- cgit v1.2.3