From 871fcb331ee551bdd7eeac992544b6f1a87f7b12 Mon Sep 17 00:00:00 2001 From: Erik Mertens Date: Thu, 21 Aug 2025 19:24:34 +0200 Subject: [PATCH] - corrected ltex_lsp config and added nixd settings (still not working correctly) - improved mini pairs behavior but still not perfect --- lua/plugins/lspconfig.lua | 12 ++++++++++-- lua/plugins/mini.lua | 16 +++++++++++++++- lua/settings.lua | 6 +++--- 3 files changed, 28 insertions(+), 6 deletions(-) diff --git a/lua/plugins/lspconfig.lua b/lua/plugins/lspconfig.lua index da2cfb2..3ba6be2 100644 --- a/lua/plugins/lspconfig.lua +++ b/lua/plugins/lspconfig.lua @@ -164,11 +164,18 @@ return { -- LSP Configuration & Plugins -- nvim 0.11 or above vim.lsp.config('vtsls', vtsls_config) vim.lsp.config('vue_ls', vue_ls_config) - vim.lsp.enable({ 'vtsls', 'vue_ls' }) - vim.lsp.enable('nixd', { + vim.lsp.config('nixd', { settings = { nixpkgs = { expr = "import { }" + }, + options = { + nixos = { + expr = '(builtins.getFlake "/etc/nixos/").nixosConfigurations.pcerik.options', + }, + home_manager = { + expr = '(builtins.getFlake "/etc/nixos").homeConfigurations.erik.options', + }, } } }) @@ -180,5 +187,6 @@ return { -- LSP Configuration & Plugins } } }) + vim.lsp.enable({ 'vtsls', 'vue_ls', 'ltex_plus', 'nixd' }) end, } diff --git a/lua/plugins/mini.lua b/lua/plugins/mini.lua index 003b519..9e8c682 100644 --- a/lua/plugins/mini.lua +++ b/lua/plugins/mini.lua @@ -33,7 +33,21 @@ return { } }) require("mini.tabline").setup() - require("mini.pairs").setup() + require("mini.pairs").setup({ + mappings = { + ['('] = { action = 'open', pair = '()', neigh_pattern = '.[%s%z%)]' }, + ['['] = { action = 'open', pair = '[]', neigh_pattern = '.[%s%z%)}%]]' }, + ['{'] = { action = 'open', pair = '{}', neigh_pattern = '.[%s%z%)}%]]' }, + + [')'] = { action = 'close', pair = '()', neigh_pattern = '[^\\].' }, + [']'] = { action = 'close', pair = '[]', neigh_pattern = '[^\\].' }, + ['}'] = { action = 'close', pair = '{}', neigh_pattern = '[^\\].' }, + + ['"'] = { action = 'closeopen', pair = '""', neigh_pattern = '[^%w\\][^%w]', register = { cr = false } }, + ["'"] = { action = 'closeopen', pair = "''", neigh_pattern = '[^%w\\][^%w]', register = { cr = false } }, + ['`'] = { action = 'closeopen', pair = '``', neigh_pattern = '[^%w\\][^%w]', register = { cr = false } }, + } + }) require("mini.colors").setup() end } diff --git a/lua/settings.lua b/lua/settings.lua index f7c443d..4493221 100644 --- a/lua/settings.lua +++ b/lua/settings.lua @@ -65,11 +65,11 @@ if vim.g.vscode then -- put vscode specific settings / keymaps here else -- Keymaps - -- Copy - vim.api.nvim_set_keymap("n", "", '"+gp', { noremap = true }) + -- Paste + -- vim.api.nvim_set_keymap("n", "", '"+gp', { noremap = true }) vim.api.nvim_set_keymap("i", "", '"+gp', { noremap = true }) - -- Paste + -- Copy vim.api.nvim_set_keymap("v", "", '"+y', { noremap = true }) vim.api.nvim_set_keymap("n", "", '"+yy', { noremap = true }) end