diff options
| author | Kyren223 <ulmliad223@gmail.com> | 2024-07-11 20:13:10 +0300 |
|---|---|---|
| committer | Kyren223 <ulmliad223@gmail.com> | 2024-07-11 20:13:10 +0300 |
| commit | 46915185a44a40b909821c3a0187b7f9cc840f71 (patch) | |
| tree | 3e9ec12edbfb42311ed079e9753f45548df256a6 /.config/nvim/lua/custom/lsp.lua | |
| parent | 6f98acd1dac05792c4b53107be96b9c8ace4fa0a (diff) | |
Neovim: worked on lsp nicities and also git configuration
Diffstat (limited to '.config/nvim/lua/custom/lsp.lua')
| -rw-r--r-- | .config/nvim/lua/custom/lsp.lua | 59 |
1 files changed, 45 insertions, 14 deletions
diff --git a/.config/nvim/lua/custom/lsp.lua b/.config/nvim/lua/custom/lsp.lua index 2acbed1..ff85390 100644 --- a/.config/nvim/lua/custom/lsp.lua +++ b/.config/nvim/lua/custom/lsp.lua @@ -1,18 +1,37 @@ +-- Setup null-ls +local null_ls = require('null-ls') +null_ls.setup({ + sources = { + null_ls.builtins.formatting.stylua, + }, +}) + +-- Setup lsp signature +-- FIXME: fork the repo and fix the following issues +-- Remove documentation, show just the signature (in insert AND normal) +-- Make both insert and normal be toggelable rather than insert always showing and normal toggleable +require('lsp_signature').setup({ + bind = true, -- This is mandatory, otherwise border config won't get registered. + handler_opts = { border = 'single' }, + doc_lines = 0, + hint_enable = false, +}) + -- NOTE: A list of language servers (and potentially their config) -- Accepts either true to enable, false to disable or a table with settings local servers = { - lua_ls = true, -- lua - clangd = true, -- C/C++ - gradle_ls = true, -- java package manager - jdtls = true, -- java eclipse lsp + lua_ls = true, -- lua + clangd = true, -- C/C++ + gradle_ls = true, -- java package manager + jdtls = true, -- java eclipse lsp kotlin_language_server = true, -- kotlin - pyright = true, -- python - rust_analyzer = true, -- rust - bashls = true, -- bash - taplo = true, -- toml - lemminx = true, -- xml - yamlls = true, -- yaml - jsonls = true, -- json + pyright = true, -- python + rust_analyzer = true, -- rust + bashls = true, -- bash + taplo = true, -- toml + lemminx = true, -- xml + yamlls = true, -- yaml + jsonls = true, -- json } -- NOTE: Not language servers but still make sure mason installs them @@ -91,6 +110,18 @@ vim.api.nvim_create_autocmd('LspAttach', { -- }) -- end, -- }) --- --- require('lsp_lines').setup() --- vim.diagnostic.config({ virtual_text = false }) + +require('lsp_lines').setup() +vim.diagnostic.config({ virtual_text = false }) +vim.keymap.set('', '<Leader>dt', require('lsp_lines').toggle, { desc = '[D]iagnostics [T]oggle inline' }) + +-- LSP Keybindings +local builtin = require('telescope.builtin') +vim.keymap.set('n', 'gd', builtin.lsp_definitions, { desc = '[G]oto [D]efinition' }) +vim.keymap.set('n', 'gu', builtin.lsp_references, { desc = '[G]oto [U]sages' }) +vim.keymap.set('n', 'gi', builtin.lsp_implementations, { desc = '[G]oto [I]mplementations' }) +-- vim.keymap.set('n', 'gt', builtin.lsp_type_definitions, { desc = '[G]oto [T]ype Definitions' }) +vim.keymap.set('n', 'gw', builtin.diagnostics, { desc = '[G]oto [W]arnings' }) +vim.keymap.set('n', '<leader>ds', builtin.lsp_document_symbols, { desc = '[D]ocument [S]symbols' }) +vim.keymap.set('n', '<leader>ps', builtin.lsp_workspace_symbols, { desc = '[P]roject [S]ymbols' }) +vim.keymap.set({ 'n', 'i' }, '<C-p>', vim.lsp.buf.signature_help, { desc = 'List [P]arameters' }) |
