vis: add keys for shell and themes, change current dir keys
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user