1
0
mirror of https://github.com/tiyn/dotfiles.git synced 2025-10-10 19:41:15 +02:00

nvim: fixed some wilder and which-key functionalities

This commit is contained in:
2024-04-03 03:43:12 +02:00
parent 3b1eaeec65
commit 0dbb415546
3 changed files with 153 additions and 88 deletions

View File

@@ -1,35 +1,36 @@
return {
-- improved wild menu
{
'gelguy/wilder.nvim',
"gelguy/wilder.nvim",
dependencies = {
{
"nvim-tree/nvim-web-devicons",
lazy = true
lazy = true,
},
'roxma/nvim-yarp',
'roxma/vim-hug-neovim-rpc',
'romgrk/fzy-lua-native'
"roxma/nvim-yarp",
"roxma/vim-hug-neovim-rpc",
"romgrk/fzy-lua-native",
"nixprime/cpsm",
},
config = function()
local wilder = require('wilder')
local wilder = require("wilder")
wilder.setup({
modes = {':', '/', '?'},
accept_key = '<CR>',
reject_key = '<C-e>'
modes = { ":", "/", "?" },
accept_key = "<CR>",
reject_key = "<C-e>",
})
wilder.set_option('pipeline', {
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'}
if string.find(arg, ".") ~= nil then
return { "fd", "-tf", "-H" }
else
return {'fd', '-tf'}
return { "fd", "-tf" }
end
end,
dir_command = {'fd', '-td'},
filters = {'cpsm_filter'},
dir_command = { "fd", "-td" },
filters = { "cpsm_filter" },
}),
wilder.substitute_pipeline({
pipeline = wilder.python_search_pipeline({
@@ -44,7 +45,9 @@ return {
fuzzy_filter = wilder.lua_fzy_filter(),
}),
{
wilder.check(function(ctx, x) return x == '' end),
wilder.check(function(ctx, x)
return x == ""
end),
wilder.history(),
},
wilder.python_search_pipeline({
@@ -58,11 +61,14 @@ return {
wilder.pcre2_highlighter(),
wilder.lua_fzy_highlighter(),
}
wilder.set_option('renderer', wilder.popupmenu_renderer({
highlighter = highlighters,
left = { ' ', wilder.popupmenu_devicons() },
right = { ' ', wilder.popupmenu_scrollbar() },
}))
wilder.set_option(
"renderer",
wilder.popupmenu_renderer({
highlighter = highlighters,
left = { " ", wilder.popupmenu_devicons() },
right = { " ", wilder.popupmenu_scrollbar() },
})
)
end,
}
},
}