vis-config
lua scripts to configure vis editor
git clone https://9o.is/git/vis-config.git
commit 1f841de1422cc46b48487fbf8d33dd8cd8ca9f04 parent 99424e699d72060fc298d36a4a23a0538b27d360 Author: Jul <jul@9o.is> Date: Thu, 26 Feb 2026 01:16:18 +0800 add tag-search command Diffstat:
| M | lib/search.lua | | | 11 | +++++++++++ |
| M | visrc.lua | | | 1 | + |
2 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/lib/search.lua b/lib/search.lua @@ -90,6 +90,17 @@ vis:command_register('mru', function(argv, force, win) return run(cmd, win.navigate) end, 'Most recently used files') +vis:command_register('tag-search', function() + local command = string.format([[ + readtags -t %s -F '(list \$input ":" \$line ": " \$kind " " \$name #t)' -l | + column -td -C right | fzy]], argv[1] or '.tags') + + return run(command, function(out) + out = split(out, ':') + win.navigate(out[1], string.format('normal %sG', out[2])) + end) +end, 'Search ctags') + vis:command_register('scope', function(argv, _, win) if win.file.name then win.scope = dirname(win.file.name) diff --git a/visrc.lua b/visrc.lua @@ -101,6 +101,7 @@ settings = { flags = '-R --extras=+q-F --fields=+SzK --languages=c,c++', }) + mapwin(win, m.NORMAL, lr..'r', cmd('tag-search .tags'), '[S]earch [T]ags') mapwin(win, {m.NORMAL, m.VISUAL}, 'K', function() local sec = vis.count local name = content(vis.win)