diff --git a/config/astronvim/lua/user/mappings.lua b/config/astronvim/lua/user/mappings.lua index 8fa83db..106ed58 100644 --- a/config/astronvim/lua/user/mappings.lua +++ b/config/astronvim/lua/user/mappings.lua @@ -1,9 +1,21 @@ return { n = { + --Usefull vanilla remaps + + ["J"] = { "mzJ`z", desc = "Keep cursor in column while joining lines" }, + + -- + [""] = { "zz", desc = "Keep cursor centered while junping" }, + [""] = { "zz", desc = "Keep cursor centered while junping" }, + + -- Keep cursor centered while searching + ["n"] = { "nzzzv", desc = "Keep cursor centered while searching" }, + ["N"] = { "Nzzzv", desc = "Keep cursor centered while searching" }, + + ["q"] = "", -- Buffers ["H"] = { - function() require("astronvim.utils.buffer").nav( -(vim.v.count > 0 and vim.v.count or 1)) end, @@ -126,8 +138,8 @@ return { }, ["r"] = { - ":s/", - desc = "Search and replace", + [[:%s/\<\>//gI]], + desc = "Search and replace current word", }, ["R"] = { ":%s/", @@ -141,9 +153,13 @@ return { }, ["p"] = { - "pgvy", - desc = "Paste and re yank text", + [["_dP]], + desc = "Paste whitout lossing yanked text", }, + + -- move selection up and down + ["J"] = ":m '>+1gv=gv", + ["K"] = ":m '<-2gv=gv", }, t = { [""] = { "ToggleTerm", desc = "Toggle terminal" }, diff --git a/config/astronvim/lua/user/plugins/mason-lspconfig.lua b/config/astronvim/lua/user/plugins/mason-lspconfig.lua index b10832e..efed07e 100644 --- a/config/astronvim/lua/user/plugins/mason-lspconfig.lua +++ b/config/astronvim/lua/user/plugins/mason-lspconfig.lua @@ -10,7 +10,7 @@ return { "pyright", "rust_analyzer", "sqlls", - "sumneko_lua", + "lua_ls", "tsserver", "yamlls", } diff --git a/config/astronvim/lua/user/plugins/nvim-spider.lua b/config/astronvim/lua/user/plugins/nvim-spider.lua index 2bbb0d6..2b5b634 100644 --- a/config/astronvim/lua/user/plugins/nvim-spider.lua +++ b/config/astronvim/lua/user/plugins/nvim-spider.lua @@ -2,6 +2,9 @@ return { "chrisgrieser/nvim-spider", event = "VeryLazy", config = function() + require("spider").setup({ + skipInsignificantPunctuation = false, + }) vim.keymap.set({ "n", "o", "x" }, "w", "lua require('spider').motion('w')", { desc = "Spider-w" }) vim.keymap.set({ "n", "o", "x" }, "e", "lua require('spider').motion('e')", { desc = "Spider-e" }) vim.keymap.set({ "n", "o", "x" }, "b", "lua require('spider').motion('b')", { desc = "Spider-b" })