dotfiles

My personal shell configs and stuff
git clone git://git.alex.balgavy.eu/dotfiles.git
Log | Files | Refs | Submodules | README | LICENSE

commit 76937788034ff0c7a36c29d173983850a6ad70b6
parent df5e54bfb30758b3e3ab1b2932b6e953015d9a9b
Author: Alex Balgavy <alexander.balgavy@spaceapplications.com>
Date:   Fri, 24 Oct 2025 21:21:54 +0200

nvim: bunch of config improvements

Diffstat:
Mnvim/lua/mappings.lua | 4++--
Mnvim/lua/plugins/formatting.lua | 2++
Mnvim/lua/plugins/init.lua | 23+++++++++++++++++++++--
Mnvim/lua/plugins/lsp.lua | 99++++++++++++++++++++++++++++++-------------------------------------------------
Mnvim/lua/plugins/snacks.lua | 19+++++++++++++++++--
Mnvim/lua/plugins/treesitter.lua | 3+++
Mnvim/lua/plugins/trouble.lua | 5+++++
7 files changed, 88 insertions(+), 67 deletions(-)

diff --git a/nvim/lua/mappings.lua b/nvim/lua/mappings.lua @@ -13,10 +13,10 @@ end, 'Previous error') map(']e', function() diag.jump({ count = 1, float = true, severity = diag.severity.ERROR }) end, 'Next error') -map('[e', function() +map('[w', function() diag.jump({ count = -1, float = true, severity = diag.severity.WARN }) end, 'Previous warning') -map(']e', function() +map(']w', function() diag.jump({ count = 1, float = true, severity = diag.severity.WARN }) end, 'Next warning') diff --git a/nvim/lua/plugins/formatting.lua b/nvim/lua/plugins/formatting.lua @@ -40,6 +40,8 @@ return { ruby = { "rubyfmt", lsp_format = "fallback" }, python = { "ruff_format", "ruff_organize_imports", lsp_format = "fallback" }, lua = { "stylua" }, + cpp = { "clang-format", lsp_format = "fallback" }, + -- python = { "black", lsp_format = "fallback" }, -- -- lua = { 'stylua' }, -- -- Conform can also run multiple formatters sequentially diff --git a/nvim/lua/plugins/init.lua b/nvim/lua/plugins/init.lua @@ -19,7 +19,7 @@ return { }, { - "echasnovski/mini.align", + "nvim-mini/mini.align", opts = { mappings = { start_with_preview = 'ga', @@ -27,11 +27,30 @@ return { }, }, { - "echasnovski/mini.ai", + "nvim-mini/mini.ai", opts = {}, event = "VeryLazy", }, { + "nvim-mini/mini.surround", + config = function() + require('mini.surround').setup({ + mappings = { + add = 'ys', + delete = 'ds', + } + }) + + -- Remap adding surrounding to Visual mode selection + vim.keymap.del('x', 'ys') + vim.keymap.set('x', 'S', [[:<C-u>lua MiniSurround.add('visual')<CR>]], { silent = true }) + + -- Make special mapping for "add surrounding for line" + vim.keymap.set('n', 'yss', 'ys_', { remap = true }) + end, + event = "VeryLazy", + }, + { "m00qek/baleia.nvim", version = "*", config = function() diff --git a/nvim/lua/plugins/lsp.lua b/nvim/lua/plugins/lsp.lua @@ -113,60 +113,35 @@ local config = function() features = "all", extraArgs = { "--", - "-D", - "clippy::pedantic", - "-D", - "clippy::nursery", - "-D", - "clippy::restriction", - "-A", - "clippy::blanket_clippy_restriction_lints", - "-A", - "clippy::missing_docs_in_private_items", - "-A", - "clippy::implicit_return", - "-A", - "clippy::question_mark_used", - "-A", - "clippy::min_ident_chars", - "-A", - "clippy::pattern_type_mismatch", - "-A", - "clippy::single_call_fn", - "-A", - "clippy::as_conversions", - "-A", - "clippy::pub_with_shorthand", - "-A", - "clippy::shadow_reuse", - "-A", - "clippy::separated_literal_suffix", - "-A", - "clippy::float_arithmetic", - "-A", - "clippy::pub_use", - "-A", - "clippy::single_char_lifetime_names", - "-A", - "clippy::missing_trait_methods", - "-A", - "clippy::mod_module_files", - "-A", - "clippy::std_instead_of_alloc", - "-A", - "clippy::integer_division_remainder_used", - "-D", - "rust_2018_idioms", - "-D", - "missing_docs", - "-D", - "warnings", - "-A", - "clippy::too_many_lines", - "-A", - "clippy::arbitrary_source_item_ordering", - "-A", - "clippy::redundant_test_prefix", + "--no-deps", + "-D", "clippy::pedantic", + "-D", "clippy::nursery", + "-D", "clippy::restriction", + "-A", "clippy::blanket_clippy_restriction_lints", + "-A", "clippy::missing_docs_in_private_items", + "-A", "clippy::implicit_return", + "-A", "clippy::question_mark_used", + "-A", "clippy::min_ident_chars", + "-A", "clippy::pattern_type_mismatch", + "-A", "clippy::single_call_fn", + "-A", "clippy::as_conversions", + "-A", "clippy::pub_with_shorthand", + "-A", "clippy::shadow_reuse", + "-A", "clippy::separated_literal_suffix", + "-A", "clippy::float_arithmetic", + "-A", "clippy::pub_use", + "-A", "clippy::single_char_lifetime_names", + "-A", "clippy::missing_trait_methods", + "-A", "clippy::mod_module_files", + "-A", "clippy::std_instead_of_alloc", + "-A", "clippy::integer_division_remainder_used", + "-D", "rust_2018_idioms", + "-D", "missing_docs", + "-D", "warnings", + "-A", "clippy::too_many_lines", + "-A", "clippy::arbitrary_source_item_ordering", + "-A", "clippy::redundant_test_prefix", + "-A", "clippy::cognitive_complexity", }, }, }, @@ -193,7 +168,11 @@ local config = function() vim.lsp.enable("yamlls") vim.lsp.config("nixd", { on_attach = on_attach }) - vim.lsp.enable("nixd") + vim.lsp.enable("nixd", { + opts = { + root_markers = { "flake.nix", ".git", "darwin-configuration.nix" }, + }, + }) vim.lsp.config("lua_ls", { on_attach = on_attach, @@ -243,12 +222,10 @@ local config = function() }, }) vim.lsp.enable("ruby_lsp") - vim.lsp.config("nil_ls", { - init_options = { - root_markers = { "flake.nix", ".git", "darwin-configuration.nix" }, - }, - }) - vim.lsp.enable("nil_ls") + + vim.lsp.enable('ansiblels') + + vim.lsp.enable('clangd') end return { diff --git a/nvim/lua/plugins/snacks.lua b/nvim/lua/plugins/snacks.lua @@ -119,15 +119,30 @@ return { lazy = false, ---@type snacks.Config opts = { - picker = {}, + picker = { + sources = + { + ---@class snacks.picker.Explorer.Config + explorer = { + win = { + list = { + keys = { + ["-"] = "explorer_up", + } + } + }, + }, + } + }, animate = {}, notifier = {}, indent = { enabled = true, indent = { char = '┊', - } + }, }, + input = {}, }, keys = keys, } diff --git a/nvim/lua/plugins/treesitter.lua b/nvim/lua/plugins/treesitter.lua @@ -68,6 +68,9 @@ return { -- Show context { "nvim-treesitter/nvim-treesitter-context", + opts = { + enable = false, + }, keys = { { "<leader>^", function() require('treesitter-context').toggle() end, desc = "Context" }, }, diff --git a/nvim/lua/plugins/trouble.lua b/nvim/lua/plugins/trouble.lua @@ -34,5 +34,10 @@ return { "<cmd>Trouble qflist toggle<cr>", desc = "Quickfix List (Trouble)", }, + { + "<leader>xo", + "<cmd>Trouble focus<cr>", + desc = "Focus (Trouble)", + }, }, }