From 90e7cbe7c6ba9703bbf6c61dcb4ff77f22a841dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Pankowski?= Date: Sun, 14 Sep 2025 10:09:06 +0200 Subject: [PATCH] vis: add keys for shell and themes, change current dir keys --- vis/.config/vis/visrc.lua | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/vis/.config/vis/visrc.lua b/vis/.config/vis/visrc.lua index a5f6f0a..e0be4f8 100644 --- a/vis/.config/vis/visrc.lua +++ b/vis/.config/vis/visrc.lua @@ -192,7 +192,7 @@ vis.events.subscribe(vis.events.INIT, function() search('fd -H --type f | fzf') end, 'fzf: files with hidden files') - vis:map(vis.modes.NORMAL, ' .', function() + vis:map(vis.modes.NORMAL, ' df', function() local path = vis.win.file.path if path then local dir = path:match('^.*/') @@ -203,7 +203,7 @@ vis.events.subscribe(vis.events.INIT, function() end end, 'fzf in file directory') - vis:map(vis.modes.NORMAL, ' h.', function() + vis:map(vis.modes.NORMAL, ' dh', function() local path = vis.win.file.path if path then local dir = path:match('^.*/') @@ -214,6 +214,23 @@ vis.events.subscribe(vis.events.INIT, function() end end, 'fzf in file directory with hidden files') + vis:map(vis.modes.NORMAL, ' sh', function() + local shell = os.getenv('SHELL') + vis:command('!' .. shell) + end, 'run shell') + + vis:map(vis.modes.NORMAL, ' ds', function() + local shell = os.getenv('SHELL') + local path = vis.win.file.path + if path then + local dir = path:match('^.*/') + local arg = escape_and_quoted(dir) + vis:command('!cd ' .. arg .. ' && ' .. shell) + else + vis:command('!' .. shell) + end + end, 'run shell in file directory') + vis:map(vis.modes.NORMAL, ' gf', function() search('git ls-files | fzf') end, 'fzf: git files') @@ -276,6 +293,14 @@ vis.events.subscribe(vis.events.INIT, function() vis:map(vis.modes.NORMAL, ' me', function() vis:command('o ~/.config/vis/global-marks.txt') end, 'global marks: edit') + + + vis:map(vis.modes.NORMAL, ' td', function() + vis:command('set theme lupan-dark') + end, 'change to dark theme') + vis:map(vis.modes.NORMAL, ' tl', function() + vis:command('set theme lupan-light') + end, 'change to light theme') end) vis.events.subscribe(vis.events.WIN_OPEN, function(win)