Commit: 77899a13424a098002268b5d9a73385b44569c1d
Parent: d28d185bbdbdbea05f14501ea5e858fefb392dee
Author: Randy Palamar
Date: Thu, 2 Mar 2023 21:20:08 -0700
vis: add keybind to toggle layout
note this needs martanne/vis#1066 which will hopefully be merged
at some point
Diffstat:
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/.config/vis/visrc.lua b/.config/vis/visrc.lua
@@ -16,8 +16,17 @@ vis.events.subscribe(vis.events.INIT, function()
vis:command("map visual ,s :|sort<Enter>")
vis:map(vis.modes.NORMAL, "vo", function()
- vis:command("x/[ \t\r]+$/ d")
- end, "remove spaces, tabs, and \r from end of all lines")
+ vis:command("x/[ \t\r]+$/ d")
+ end, "remove spaces, tabs, and \r from end of all lines")
+
+ vis:map(vis.modes.NORMAL, ",l", function()
+ local ui = vis.ui
+ if ui.layout == ui.layouts.HORIZONTAL then
+ ui:arrange(ui.layouts.VERTICAL)
+ else
+ ui:arrange(ui.layouts.HORIZONTAL)
+ end
+ end, "swap ui layout")
end)
vis.events.subscribe(vis.events.WIN_OPEN, function(win)