vis-config
lua scripts to configure vis editor
git clone https://9o.is/git/vis-config.git
commit 413589dcf13802f0078ee986305675f8703d9732 parent 210140326bc2c418155aa06f704d95a8d94722bc Author: Jul <jul@9o.is> Date: Mon, 26 Jan 2026 00:55:09 -0500 fix directory search quitting with xargs -r Diffstat:
| M | lib/search.lua | | | 7 | +++---- |
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/lib/search.lua b/lib/search.lua @@ -1,8 +1,8 @@ local session = require('lib/session') local M = { - find = 'ag --vimgrep -g . {path} | fzy', - dfind = 'find {path} -type d | fzy | fe', + find = 'ag -g . {path} | fzy', + dfind = 'find {path} -type d | fzy | xargs -r fe', grep = "ag --vimgrep --smart-case {pattern} {path} | fzy", explore = 'fe', grep_wrap = '"', @@ -29,7 +29,6 @@ local function run(command, onsuccess, fullscreen) local file = io.popen(string.format('sh -c "%s"', command:gsub('"', '\\"'))) local out = file:read() local success, msg, status = file:close() - -- local status, out = vis:pipe(command, fullscreen) if success then onsuccess(out) @@ -45,7 +44,7 @@ vis:command_register('find', function(argv, _, win) end, 'Find files') vis:command_register('dfind', function(_, _, win) - local command = M.find:gsub('{path}', win.scope) + local command = M.dfind:gsub('{path}', win.scope) return run(command, win.navigate) end, 'Find directories')