diff --git a/nvim/lazy-lock.json b/nvim/lazy-lock.json index 67a545f..dce7865 100644 --- a/nvim/lazy-lock.json +++ b/nvim/lazy-lock.json @@ -52,5 +52,6 @@ "trouble.nvim": { "branch": "main", "commit": "254145ffd528b98eb20be894338e2d5c93fa02c2" }, "vim-sleuth": { "branch": "master", "commit": "be69bff86754b1aa5adcbb527d7fcd1635a84080" }, "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" } } diff --git a/nvim/lua/plugins/wilder.lua b/nvim/lua/plugins/wilder.lua new file mode 100644 index 0000000..a595697 --- /dev/null +++ b/nvim/lua/plugins/wilder.lua @@ -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('', wilder.next) + map('', wilder.previous) + map('', wilder.next) + map('', wilder.previous) + end, + }, +}