From 78bfabfc08c90d45085179b9a23378625c7f35f0 Mon Sep 17 00:00:00 2001 From: tiyn Date: Fri, 13 Oct 2023 23:48:17 +0200 Subject: [PATCH] nvim: updated wilder --- .config/nvim/lua/plugins/wilder.lua | 48 +++++++++++++++++++++-------- 1 file changed, 35 insertions(+), 13 deletions(-) diff --git a/.config/nvim/lua/plugins/wilder.lua b/.config/nvim/lua/plugins/wilder.lua index b7482b8..6fccf14 100644 --- a/.config/nvim/lua/plugins/wilder.lua +++ b/.config/nvim/lua/plugins/wilder.lua @@ -14,33 +14,55 @@ return { config = function() local wilder = require('wilder') wilder.setup({ - modes = { ':', '/', '?' }, + modes = {':', '/', '?'}, accept_key = '', reject_key = '' }) - wilder.set_option('renderer', wilder.popupmenu_renderer({ - highlighter = wilder.basic_highlighter(), - left = { ' ', wilder.popupmenu_devicons() }, - right = { ' ', wilder.popupmenu_scrollbar() }, - })) wilder.set_option('pipeline', { wilder.branch( wilder.python_file_finder_pipeline({ - file_command = { 'find', '.', '-type', 'f', '-printf', '%P\n' }, - dir_command = { 'find', '.', '-type', 'd', '-printf', '%P\n' }, - filters = { 'fuzzy_filter', 'difflib_sorter' }, + file_command = function(ctx, arg) + if string.find(arg, '.') ~= nil then + return {'fdfind', '-tf', '-H'} + else + return {'fdfind', '-tf'} + end + end, + dir_command = {'fd', '-td'}, + filters = {'cpsm_filter'}, + }), + wilder.substitute_pipeline({ + pipeline = wilder.python_search_pipeline({ + skip_cmdtype_check = 1, + pattern = wilder.python_fuzzy_pattern({ + start_at_boundary = 0, + }), + }), }), wilder.cmdline_pipeline({ - language = 'python', fuzzy = 2, + fuzzy_filter = wilder.lua_fzy_filter(), }), + { + wilder.check(function(ctx, x) return x == '' end), + wilder.history(), + }, wilder.python_search_pipeline({ - pattern = wilder.python_fuzzy_pattern(), - sorter = wilder.python_difflib_sorter(), - engine = 're', + pattern = wilder.python_fuzzy_pattern({ + start_at_boundary = 0, + }), }) ), }) + local highlighters = { + wilder.pcre2_highlighter(), + wilder.lua_fzy_highlighter(), + } + wilder.set_option('renderer', wilder.popupmenu_renderer({ + highlighter = highlighters, + left = { ' ', wilder.popupmenu_devicons() }, + right = { ' ', wilder.popupmenu_scrollbar() }, + })) end, } }