add wilder plugin
This commit is contained in:
parent
7f95b4d367
commit
d4f8c75582
|
@ -52,5 +52,6 @@
|
||||||
"trouble.nvim": { "branch": "main", "commit": "254145ffd528b98eb20be894338e2d5c93fa02c2" },
|
"trouble.nvim": { "branch": "main", "commit": "254145ffd528b98eb20be894338e2d5c93fa02c2" },
|
||||||
"vim-sleuth": { "branch": "master", "commit": "be69bff86754b1aa5adcbb527d7fcd1635a84080" },
|
"vim-sleuth": { "branch": "master", "commit": "be69bff86754b1aa5adcbb527d7fcd1635a84080" },
|
||||||
"volt": { "branch": "main", "commit": "43f72b49037c191eb3cfe26ba7a5574b4bfce226" },
|
"volt": { "branch": "main", "commit": "43f72b49037c191eb3cfe26ba7a5574b4bfce226" },
|
||||||
"which-key.nvim": { "branch": "main", "commit": "8badb359f7ab8711e2575ef75dfe6fbbd87e4821" }
|
"which-key.nvim": { "branch": "main", "commit": "8badb359f7ab8711e2575ef75dfe6fbbd87e4821" },
|
||||||
|
"wilder.nvim": { "branch": "master", "commit": "679f348dc90d80ff9ba0e7c470c40a4d038dcecf" }
|
||||||
}
|
}
|
||||||
|
|
50
nvim/lua/plugins/wilder.lua
Normal file
50
nvim/lua/plugins/wilder.lua
Normal file
|
@ -0,0 +1,50 @@
|
||||||
|
return {
|
||||||
|
{
|
||||||
|
'gelguy/wilder.nvim',
|
||||||
|
config = function()
|
||||||
|
local wilder = require 'wilder'
|
||||||
|
wilder.setup {
|
||||||
|
modes = { ':', '/', '?' },
|
||||||
|
}
|
||||||
|
|
||||||
|
wilder.set_option('pipeline', {
|
||||||
|
wilder.branch(
|
||||||
|
{
|
||||||
|
wilder.check(function(_, x)
|
||||||
|
return vim.fn.empty(x)
|
||||||
|
end),
|
||||||
|
wilder.history(15),
|
||||||
|
},
|
||||||
|
wilder.cmdline_pipeline {
|
||||||
|
fuzzy = 1,
|
||||||
|
fuzzy_filter = wilder.vim_fuzzy_filter(),
|
||||||
|
},
|
||||||
|
wilder.search_pipeline()
|
||||||
|
),
|
||||||
|
})
|
||||||
|
wilder.set_option(
|
||||||
|
'renderer',
|
||||||
|
wilder.popupmenu_renderer {
|
||||||
|
highlighter = wilder.basic_highlighter(),
|
||||||
|
left = { ' ', wilder.popupmenu_devicons() },
|
||||||
|
right = { ' ', wilder.popupmenu_scrollbar() },
|
||||||
|
max_height = 15,
|
||||||
|
highlights = {
|
||||||
|
accent = wilder.make_hl('WilderAccent', 'Pmenu', { { a = 1 }, { a = 1 }, { foreground = '#7aa2f7' } }),
|
||||||
|
},
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
local map = function(keys, func)
|
||||||
|
vim.keymap.set('c', keys, function()
|
||||||
|
return wilder.in_context() and func() or keys
|
||||||
|
end, { noremap = true, expr = true })
|
||||||
|
end
|
||||||
|
|
||||||
|
map('<C-n>', wilder.next)
|
||||||
|
map('<C-p>', wilder.previous)
|
||||||
|
map('<C-j>', wilder.next)
|
||||||
|
map('<C-k>', wilder.previous)
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
}
|
Loading…
Reference in a new issue