From 4660c0f0d2555caae675b2356691e681d0fc514f Mon Sep 17 00:00:00 2001 From: spike Date: Sat, 27 Aug 2022 05:44:09 +0200 Subject: [PATCH] tabularize base config --- lua/core/mappings.lua | 23 +++++++++++++++++++---- lua/custom/plugins/init.lua | 3 +++ 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/lua/core/mappings.lua b/lua/core/mappings.lua index 84b7e4c..dd81332 100644 --- a/lua/core/mappings.lua +++ b/lua/core/mappings.lua @@ -85,7 +85,6 @@ M.general = { --{{{ - -- luasnip edit snippets ["se"] = { function() @@ -123,7 +122,7 @@ M.general = { --{{{ }, -- quick close window - [""] = {"c", "close window"}, + [""] = {"c", "close window"}, @@ -142,10 +141,18 @@ M.general = { --{{{ ["f8"] = { ":set foldlevel=8", "set fold level" }, ["f9"] = { ":set foldlevel=9", "set fold level" }, - ["en"] = { " cn ", "next error" }, + ["en"] = { " cn ", "next error" }, ["ep"] = { " cp ", "previous error" }, + -- Tabularize mappings + ["a&"] = { " Tabularize /&" }, + ["a="] = { " Tabularize /^[^=]*\zs=" }, + ["a:"] = { " Tabularize /:" }, + ["a,"] = { " Tabularize /," }, + ["a"] = { " Tabularize /" }, + + ["g."] = { ":cwd", "change dir to current file", opts = { remap = true } }, ["g."] = { ":Gcd", "change dir to git root" }, @@ -202,6 +209,13 @@ M.general = { --{{{ -- http://stackoverflow.com/a/8064607/127816 ["."] = { ":normal .", opts = { silent = true } }, + -- Tabularize mappings + ["a&"] = { " Tabularize /&" }, + ["a="] = { " Tabularize /^[^=]*\zs=" }, + ["a:"] = { " Tabularize /:" }, + ["a,"] = { " Tabularize /," }, + ["a"] = { " Tabularize /" }, + }, -- command line mappings @@ -212,8 +226,9 @@ M.general = { --{{{ ["cwd"] = { "lcd %:p:h", "change dir to current file" }, ["cd."] = { "lcd %:p:h", "change dir to current file" }, ["w!!"] = { "w !doas tee %", "write file with root perms" }, - ["%%"] = { "=fnameescape(expand('%:h')).'/'", + ["%%"] = { "=fnameescape(expand('%:h')).'/'", "alias to current working dir"}, + ["Tab"] = { "Tabularize"}, } } --}}} diff --git a/lua/custom/plugins/init.lua b/lua/custom/plugins/init.lua index 88607e3..2ce7573 100644 --- a/lua/custom/plugins/init.lua +++ b/lua/custom/plugins/init.lua @@ -74,6 +74,9 @@ return { end }, ["tpope/vim-surround"] = {}, + ["godlygeek/tabular"] = { + cmd = "Tabularize" + }, -- -- misc general plugins -- Read info files