From d570e1eb33fdda1e61935e47ee8edd6ce8adebb1 Mon Sep 17 00:00:00 2001 From: PlexSheep Date: Sun, 21 Jan 2024 02:20:47 +0100 Subject: [PATCH] line indent updown stuff --- lua/custom/mappings.lua | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/lua/custom/mappings.lua b/lua/custom/mappings.lua index 222ef80..92e7134 100644 --- a/lua/custom/mappings.lua +++ b/lua/custom/mappings.lua @@ -335,22 +335,22 @@ M.edit = { plugin = false, n = { -- easy newline - ["OO"] = { "O", "insert a line above"}, - ["oo"] = { "o", "insert a line below"}, + ["OO"] = { "O", "insert a line above" }, + ["oo"] = { "o", "insert a line below" }, -- substitute (change hovered/selection with insert mode) -- normally, this is s, but that is leaps binding now - ["s"] = { "s", "replace with insert mode"}, + ["s"] = { "s", "replace with insert mode" }, -- split and join lines [""] = { "join", "join lines" }, - [""] = { "il", "split line", }, + [""] = { "il", "split line" }, -- do something useful with the arrows - [""] = { " move-2", "Move line up", opts = { expr = true } }, - [""] = { " move+", "Move line down", opts = { expr = true } }, - [""] = { " << ", "Less indentation", opts = { expr = true } }, - [""] = { " >> ", "More indentation", opts = { expr = true } }, + [""] = { " move-2", "Move line up" }, + [""] = { " move+", "Move line down" }, + [""] = { "<<", "Less indentation" }, + [""] = { ">>", "More indentation" }, -- format with conform ["ff"] = { @@ -373,13 +373,14 @@ M.edit = { ["z="] = { "Telescope spell_suggest", "Spell suggest" }, }, v = { + -- NOTE: I would love to know why these commands work, they seem really + -- crazy. + [""] = { ":move'<-2gv=gv", "Move lines up", opts = { silent = true } }, + [""] = { ":move'>+gv=gv", "Move lines down", opts = { silent = true } }, [""] = { ""] = { ">gv", "More indentation" }, }, - x = { - [""] = { "move'<-2gv=gv", "Move line up", opts = { expr = true } }, - [""] = { "move'<-2gv=gv", "Move line down", opts = { expr = true } }, - }, + x = {}, t = { --big move [""] = { "", "big step down" },