diff options
Diffstat (limited to '.config/nvim')
| -rw-r--r-- | .config/nvim/init.lua | 1 | ||||
| -rw-r--r-- | .config/nvim/lua/lsp_config.lua | 23 | ||||
| -rw-r--r-- | .config/nvim/lua/plugins.lua | 31 | ||||
| -rw-r--r-- | .config/nvim/lua/treesitter_config.lua | 49 |
4 files changed, 31 insertions, 73 deletions
diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index 64f9138..1a69fc7 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -1,5 +1,4 @@ require("plugins"); require("settings"); require("lsp_config"); -require("treesitter_config"); require("writing_config"); diff --git a/.config/nvim/lua/lsp_config.lua b/.config/nvim/lua/lsp_config.lua index 20eecd1..6ca0202 100644 --- a/.config/nvim/lua/lsp_config.lua +++ b/.config/nvim/lua/lsp_config.lua @@ -47,6 +47,7 @@ cmp.setup({ }) }) + -- Jump forward or backward to snippet placeholders in insert mode vim.api.nvim_set_keymap("i", "<C-l>", "<Plug>(vsnip-jump-next)", { noremap = false }) vim.api.nvim_set_keymap("s", "<C-l>", "<Plug>(vsnip-jump-next)", { noremap = false }) @@ -75,7 +76,6 @@ cmp.setup.cmdline(':', { -- add additional completion capabilities local capabilities = require('cmp_nvim_lsp').default_capabilities() - -- attaches settings after language server attaches to current buffer local on_attach = function(client, bufnr) local bufopts = { noremap = true, silent = true, buffer = bufnr } @@ -102,6 +102,21 @@ for _, method in ipairs({ 'textDocument/diagnostic', 'workspace/diagnostic' }) d return default_diagnostic_handler(err, result, context, config) end end +-- +-- show nvim-lsp progress +vim.api.nvim_create_autocmd('LspProgress', { + callback = function(ev) + local value = ev.data.params.value + vim.api.nvim_echo({ { value.message or 'done' } }, false, { + id = 'lsp.' .. ev.data.params.token, + kind = 'progress', + source = 'vim.lsp', + title = value.title, + status = value.kind ~= 'end' and 'running' or 'success', + percent = value.percentage, + }) + end, +}) -- Language Servers @@ -111,7 +126,7 @@ vim.lsp.config('rust_analyzer', { on_attach = on_attach, settings = { ["rust-analyzer"] = { - checkOnSave = { + check = { command = "clippy" }, assist = { @@ -258,7 +273,3 @@ vim.lsp.config('expert', { filetypes = { 'elixir', 'eelixir', 'heex' }, }) vim.lsp.enable('expert') - - --- show nvim-lsp progress -require "fidget".setup {} diff --git a/.config/nvim/lua/plugins.lua b/.config/nvim/lua/plugins.lua index c255508..aced6b6 100644 --- a/.config/nvim/lua/plugins.lua +++ b/.config/nvim/lua/plugins.lua @@ -1,17 +1,14 @@ -require "paq" { - "savq/paq-nvim", - "wadackel/vim-dogrun", - "neovim/nvim-lspconfig", - "hrsh7th/cmp-nvim-lsp", - "hrsh7th/cmp-buffer", - "hrsh7th/cmp-path", - "hrsh7th/cmp-cmdline", - "hrsh7th/nvim-cmp", - "hrsh7th/cmp-vsnip", - "hrsh7th/vim-vsnip", - "rafamadriz/friendly-snippets", - "hrsh7th/cmp-nvim-lsp-signature-help", - "nvim-treesitter/nvim-treesitter", - "j-hui/fidget.nvim", - --"LhKipp/nvim-nu", -} +local gh = function(x) return 'https://github.com/' .. x end +vim.pack.add({ + gh('wadackel/vim-dogrun'), + gh('neovim/nvim-lspconfig'), + gh('hrsh7th/cmp-nvim-lsp'), + gh('hrsh7th/cmp-buffer'), + gh('hrsh7th/cmp-path'), + gh('hrsh7th/cmp-cmdline'), + gh('hrsh7th/cmp-vsnip'), + gh('hrsh7th/vim-vsnip'), + gh('rafamadriz/friendly-snippets'), + gh('hrsh7th/cmp-nvim-lsp-signature-help'), + gh('nvim-treesitter/nvim-treesitter') +}) diff --git a/.config/nvim/lua/treesitter_config.lua b/.config/nvim/lua/treesitter_config.lua deleted file mode 100644 index e934d71..0000000 --- a/.config/nvim/lua/treesitter_config.lua +++ /dev/null @@ -1,49 +0,0 @@ -require("nvim-treesitter.configs").setup { - ensure_installed = { - "rust", - "bash", - "c", - "comment", - "cpp", - "css", - "dockerfile", - "fish", - "gdscript", - "gitignore", - "glsl", - "go", - "haskell", - "help", - "html", - "http", - "java", - "javascript", - "json", - "kotlin", - "latex", - "llvm", - "lua", - "make", - "markdown", - "pascal", - "python", - "regex", - "scss", - "sql", - "svelte", - "toml", - "typescript", - "vim", - "vue", - "yaml", - }, - sync_install = true, - auto_install = true, - highlight = { - enable = true, - }, - ignore_install = { - "nu" - }, - modules = {}, -} |
