diff options
| author | anand <anand.panchdhari@gmail.com> | 2026-04-06 23:55:30 +0530 |
|---|---|---|
| committer | anand <anand.panchdhari@gmail.com> | 2026-04-06 23:55:30 +0530 |
| commit | acf9fdb09419dbd1e5921ea4d8b837bf440ee859 (patch) | |
| tree | df4e6361a7cc7003cb1021375b38425e044bf1bc /nvim/lua/config/lsp.lua | |
| parent | 76f6235bcd178cc5c28cc4fbf0d09fafb1f63a9b (diff) | |
Nvim config rearranged and neovide addedmain
Diffstat (limited to 'nvim/lua/config/lsp.lua')
| -rw-r--r-- | nvim/lua/config/lsp.lua | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/nvim/lua/config/lsp.lua b/nvim/lua/config/lsp.lua new file mode 100644 index 0000000..95e564c --- /dev/null +++ b/nvim/lua/config/lsp.lua @@ -0,0 +1,23 @@ +vim.api.nvim_create_autocmd('LspAttach', { + callback = function(args) + local client = vim.lsp.get_client_by_id(args.data.client_id) + if client ~= nil and client:supports_method('textDocument/foldingRange') then + local win = vim.api.nvim_get_current_win() + vim.wo[win].foldexpr = 'v:lua.vim.lsp.foldexpr()' + vim.wo[win].foldmethod = 'expr' + end + end, +}) + +vim.api.nvim_create_autocmd("BufWritePre", { + pattern = "*", + callback = function() vim.lsp.buf.format() end, +}) + +vim.lsp.enable( + 'lua_ls', + 'basedpyright', + 'rust-analyzer' +) + +vim.diagnostic.config({ virtual_text = false }) |
