dotfiles

personal dotfiles
git clone anongit@rnpnr.xyz:dotfiles.git
Log | Files | Refs | Feed | Submodules

Commit: fab887c735f2ce596ef558a19080cf5282367a71
Parent: f5d8861656374d7446d9bd0e3269b0e84fd438ea
Author: Randy Palamar
Date:   Tue,  2 Apr 2024 09:41:59 -0600

vis: update config

Diffstat:
M.config/vis/themes/term.lua | 2+-
M.config/vis/visrc.lua | 21++++++++++++++++++---
2 files changed, 19 insertions(+), 4 deletions(-)

diff --git a/.config/vis/themes/term.lua b/.config/vis/themes/term.lua @@ -34,7 +34,7 @@ lexers.STYLE_CURSOR = 'back:white,fore:black' lexers.STYLE_CURSOR_PRIMARY = lexers.STYLE_CURSOR lexers.STYLE_CURSOR_LINE = 'underlined' lexers.STYLE_COLOR_COLUMN = 'back:' .. grey0 -lexers.STYLE_SELECTION = 'back:' .. grey0 +lexers.STYLE_SELECTION = 'bold,back:' .. grey0 lexers.STYLE_STATUS = 'fore:black,back:white' lexers.STYLE_STATUS_FOCUSED = lexers.STYLE_STATUS .. ',bold' lexers.STYLE_SEPARATOR = lexers.STYLE_DEFAULT diff --git a/.config/vis/visrc.lua b/.config/vis/visrc.lua @@ -26,6 +26,11 @@ vis.ftdetect.filetypes.matlab.cmd = { "set tw 4" } vis.ftdetect.filetypes.haskell.cmd = { "set tw 4", "set expandtab true" } lint.fixers["haskell"] = { "hindent --indent-size 4 --sort-imports" } +lint.fixers["python"] = {"black -l 80 -q -"} +vis.ftdetect.filetypes.python.cmd = { "set tw 4", "set expandtab true" } + +vis.ftdetect.filetypes.yaml.cmd = { "set tw 2", "set expandtab true" } + vis.events.subscribe(vis.events.INIT, function() vis:command("set theme term") @@ -64,12 +69,11 @@ end, "Search for each regex in argv with the_silver_searcher") local function adjust_layout(wclose) local ui = vis.ui - local tw, nw = 0, 0 + local tw, nw = 0, wclose and -1 or 0 for w in vis:windows() do tw = tw + w.width nw = nw + 1 end - if wclose == true then nw = nw - 1 end if ui.layout == ui.layouts.HORIZONTAL then if vis.win.width > nw * mww then ui.layout = ui.layouts.VERTICAL @@ -80,7 +84,18 @@ local function adjust_layout(wclose) end vis.events.subscribe(vis.events.WIN_OPEN, function(win) - win.options = { relativenumbers = true } + win.options = { + colorcolumn = 80, + relativenumbers = true, + } + + local m, cmd = vis.modes, util.command + -- pass some args to fmt(1) + local fmtcmd = ":|fmt -l %d -w 66" + local fmt = cmd(fmtcmd:format(win.options.tabwidth)) + win:map(m.NORMAL, "=", fmt) + win:map(m.VISUAL, "=", fmt) + adjust_layout(false) end)