diff options
author | Raymaekers Luca <raymaekers.luca@gmail.com> | 2024-08-15 13:25:05 +0200 |
---|---|---|
committer | Raymaekers Luca <raymaekers.luca@gmail.com> | 2024-08-15 13:25:05 +0200 |
commit | b3a25c858a5cf55c954e9d78acd75a135992778d (patch) | |
tree | 5110f03eb46a2728c89e8d537ec358165cc70f66 /config/essentials/vis/visrc.lua | |
parent | 4185a9b7ef76d686af011c8f66c14150add04426 (diff) | |
parent | b6484958979b0bb6398dc95b72f233bea20fe1b4 (diff) |
Merge branch 'main' of debuc.com:dotfiles
Diffstat (limited to 'config/essentials/vis/visrc.lua')
-rw-r--r-- | config/essentials/vis/visrc.lua | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/config/essentials/vis/visrc.lua b/config/essentials/vis/visrc.lua index 8b83eb4..30e4946 100644 --- a/config/essentials/vis/visrc.lua +++ b/config/essentials/vis/visrc.lua @@ -12,8 +12,6 @@ require("ctags") require("title") require("commentary") require("complete-line") --- removed formatting because already fulfilled by format.lua -require("vis-go") -- set height to 40% require("fzf-open") require("vis-ultisnips") @@ -78,6 +76,7 @@ end, "Quit all") vis:command_register("delws", function() vis:command(",x/[ \t]+$|^[ \t]+$/d") end, "Remove trailing whitespace") +vis:command_register("redraw", function() vis:redraw() end, "Redraw UI") ------------------------------------- --- MAPPINGS @@ -121,8 +120,8 @@ vis.events.subscribe(vis.events.WIN_OPEN, function(win) -- luacheck: no unused a -- automatically cd in parent dir of file vis:command_register("cdp", function() if win and win.file and win.file.path then - -- local dir = win.file.path:match(".*/") - -- vis:info("cd " .. tostring(dir)) + local dir = win.file.path:match(".*/") + vis:info("cd " .. tostring(dir)) end end, "Cd to parent dir of file") @@ -133,6 +132,10 @@ vis.events.subscribe(vis.events.WIN_OPEN, function(win) -- luacheck: no unused a end -- FILETYPE OPTIONS + if win.syntax == "ansi_c" then + map_keys(m.NORMAL, "\\a", "f,a <Escape>hdw<S-Tab>i<Tab><Escape>", "Align table") + end + if win.syntax == "bash" then vis:command_register("curl", function() vis:command("x/ -H/ c/\\\n\t-H/") @@ -157,9 +160,12 @@ vis.events.subscribe(vis.events.WIN_OPEN, function(win) -- luacheck: no unused a map_cmd(m.NORMAL, "\\si", "-/\\<if\\>/,/\\<fi\\>/", "Expand to if") end - if win.syntax == "yaml" then - win.options.tabwidth = 2 - win.options.expandtab = true + if win.syntax == "go" then + require("vis-go") + end + + if win.syntax == "lua" then + require("vis-lua") end if win.syntax == "markdown" then @@ -175,7 +181,8 @@ vis.events.subscribe(vis.events.WIN_OPEN, function(win) -- luacheck: no unused a -- ,x/^# Planning\n([^#]|\n)+ end - if win.syntax == "ansi_c" then - map_keys(m.NORMAL, "\\a", "f,a <Escape>hdw<S-Tab>i<Tab><Escape>", "Align table") + if win.syntax == "yaml" then + win.options.tabwidth = 2 + win.options.expandtab = true end end) |