mirror of
https://github.com/tiyn/dotfiles.git
synced 2026-03-19 14:44:46 +01:00
updated neovim to use modern lazy
This commit is contained in:
74
.config/nvim/lua/plugins/wilder.lua
Normal file
74
.config/nvim/lua/plugins/wilder.lua
Normal file
@@ -0,0 +1,74 @@
|
||||
return {
|
||||
-- improved wild menu
|
||||
{
|
||||
"gelguy/wilder.nvim",
|
||||
dependencies = {
|
||||
{
|
||||
"nvim-tree/nvim-web-devicons",
|
||||
lazy = true,
|
||||
},
|
||||
"roxma/nvim-yarp",
|
||||
"roxma/vim-hug-neovim-rpc",
|
||||
"romgrk/fzy-lua-native",
|
||||
"nixprime/cpsm",
|
||||
},
|
||||
config = function()
|
||||
local wilder = require("wilder")
|
||||
wilder.setup({
|
||||
modes = { ":", "/", "?" },
|
||||
accept_key = "<CR>",
|
||||
reject_key = "<C-e>",
|
||||
})
|
||||
wilder.set_option("pipeline", {
|
||||
wilder.branch(
|
||||
wilder.python_file_finder_pipeline({
|
||||
file_command = function(ctx, arg)
|
||||
if string.find(arg, ".") ~= nil then
|
||||
return { "fd", "-tf", "-H" }
|
||||
else
|
||||
return { "fd", "-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({
|
||||
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({
|
||||
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,
|
||||
},
|
||||
}
|
||||
Reference in New Issue
Block a user