vis: fix search, add keys for rg/fd, change global marks keys, add notes keys
This commit is contained in:
@@ -118,7 +118,7 @@ end)
|
|||||||
local function search(cmd, action)
|
local function search(cmd, action)
|
||||||
if action == nil then
|
if action == nil then
|
||||||
action = function(out)
|
action = function(out)
|
||||||
if (out:find('\n') or #s) == #s then
|
if (out:find('\n') or #out) == #out then
|
||||||
open_file_pos(out, 'e')
|
open_file_pos(out, 'e')
|
||||||
else
|
else
|
||||||
vis:message(out)
|
vis:message(out)
|
||||||
@@ -274,6 +274,8 @@ vis.events.subscribe(vis.events.INIT, function()
|
|||||||
|
|
||||||
vis:map(vis.modes.NORMAL, ' s', '<vis-prompt-show>fzf-files auto-search<Enter>', 'fzf: search')
|
vis:map(vis.modes.NORMAL, ' s', '<vis-prompt-show>fzf-files auto-search<Enter>', 'fzf: search')
|
||||||
vis:map(vis.modes.NORMAL, ' f', '<vis-prompt-show>fzf-files auto-files<Enter>', 'fzf: files')
|
vis:map(vis.modes.NORMAL, ' f', '<vis-prompt-show>fzf-files auto-files<Enter>', 'fzf: files')
|
||||||
|
vis:map(vis.modes.NORMAL, ' S', '<vis-prompt-show>fzf-files search<Enter>', 'fzf: search with rg')
|
||||||
|
vis:map(vis.modes.NORMAL, ' F', '<vis-prompt-show>fzf-files files<Enter>', 'fzf: files with fd')
|
||||||
|
|
||||||
vis:map(vis.modes.NORMAL, ' /', function()
|
vis:map(vis.modes.NORMAL, ' /', function()
|
||||||
search(fzf_reload(ripgrep .. ' --with-filename {q} ' .. escape_and_quoted(vis.win.file.path)))
|
search(fzf_reload(ripgrep .. ' --with-filename {q} ' .. escape_and_quoted(vis.win.file.path)))
|
||||||
@@ -341,16 +343,23 @@ vis.events.subscribe(vis.events.INIT, function()
|
|||||||
end
|
end
|
||||||
end, 'lf file manager in current file directory')
|
end, 'lf file manager in current file directory')
|
||||||
|
|
||||||
vis:map(vis.modes.NORMAL, ' ma', add_global_mark, 'global marks: add')
|
vis:map(vis.modes.NORMAL, ' m', add_global_mark, 'global marks: add')
|
||||||
|
|
||||||
vis:map(vis.modes.NORMAL, ' mj', function()
|
vis:map(vis.modes.NORMAL, ' M', function()
|
||||||
search('cat ~/.config/vis/global-marks.txt | fzf --tac')
|
search('cat ~/.config/vis/global-marks.txt | fzf --tac')
|
||||||
end, 'global marks: jump')
|
end, 'global marks: jump')
|
||||||
|
|
||||||
vis:map(vis.modes.NORMAL, ' me', function()
|
vis:map(vis.modes.NORMAL, ' em', function()
|
||||||
vis:command('o ~/.config/vis/global-marks.txt')
|
vis:command('o ~/.config/vis/global-marks.txt')
|
||||||
end, 'global marks: edit')
|
end, 'global marks: edit')
|
||||||
|
|
||||||
|
vis:map(vis.modes.NORMAL, ' n', function()
|
||||||
|
vis:command('o ~/notes/notes.md')
|
||||||
|
end, 'add note')
|
||||||
|
|
||||||
|
vis:map(vis.modes.NORMAL, ' N', function()
|
||||||
|
search(fzf_reload(ripgrep .. ' --with-filename {q} ~/notes'))
|
||||||
|
end, 'search notes')
|
||||||
|
|
||||||
vis:map(vis.modes.NORMAL, ' td', function()
|
vis:map(vis.modes.NORMAL, ' td', function()
|
||||||
vis:command('set theme lupan-dark')
|
vis:command('set theme lupan-dark')
|
||||||
|
|||||||
Reference in New Issue
Block a user