summaryrefslogtreecommitdiff
path: root/.config/nvim
diff options
context:
space:
mode:
authorWriterV2 <primary-v2@protonmail.com>2026-04-13 20:00:10 +0200
committerWriterV2 <primary-v2@protonmail.com>2026-04-13 20:03:35 +0200
commitfc96e7432f30ecb6d469937ee253d2e69ba3536c (patch)
tree96f3c57d9b655063782fef2342f8dc833166e89f /.config/nvim
parentb6e9a54f81de6254f85e7559ddf0256eb048fe5c (diff)
Neovim: Update to 0.12 features and other changes
- Remove redundant treesitter configuration - Replace Paq with built-in plugin manager Pack - Replace fidget with prints on `LspProgress` event - Fix rust-analyzer clippy check on save
Diffstat (limited to '.config/nvim')
-rw-r--r--.config/nvim/init.lua1
-rw-r--r--.config/nvim/lua/lsp_config.lua23
-rw-r--r--.config/nvim/lua/plugins.lua31
-rw-r--r--.config/nvim/lua/treesitter_config.lua49
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 = {},
-}