nvim: fixed some wilder and which-key functionalities

master
tiyn 9 months ago
parent 3b1eaeec65
commit 0dbb415546

@ -8,11 +8,12 @@
"cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" },
"comment.nvim": { "branch": "master", "commit": "0236521ea582747b58869cb72f70ccfa967d2e89" }, "comment.nvim": { "branch": "master", "commit": "0236521ea582747b58869cb72f70ccfa967d2e89" },
"conform.nvim": { "branch": "master", "commit": "9d5ba06d6ee7418c674f498634617416d15b6239" }, "conform.nvim": { "branch": "master", "commit": "9d5ba06d6ee7418c674f498634617416d15b6239" },
"cpsm": { "branch": "master", "commit": "1a5fc1b6169bb80c29b0b986130c4f3f1a9ed82e" },
"diffview.nvim": { "branch": "main", "commit": "3dc498c9777fe79156f3d32dddd483b8b3dbd95f" }, "diffview.nvim": { "branch": "main", "commit": "3dc498c9777fe79156f3d32dddd483b8b3dbd95f" },
"fterm.nvim": { "branch": "master", "commit": "d1320892cc2ebab472935242d9d992a2c9570180" }, "fterm.nvim": { "branch": "master", "commit": "d1320892cc2ebab472935242d9d992a2c9570180" },
"fzy-lua-native": { "branch": "master", "commit": "820f745b7c442176bcc243e8f38ef4b985febfaf" }, "fzy-lua-native": { "branch": "master", "commit": "820f745b7c442176bcc243e8f38ef4b985febfaf" },
"git-blame.nvim": { "branch": "master", "commit": "a0282d05adbee80aaf4e2ff35b81b52940b67bed" }, "git-blame.nvim": { "branch": "master", "commit": "a0282d05adbee80aaf4e2ff35b81b52940b67bed" },
"gitsigns.nvim": { "branch": "main", "commit": "1bb277b41d65f68b091e4ab093f59e68a0def2a6" }, "gitsigns.nvim": { "branch": "main", "commit": "a4db718c78bff65198e3b63f1043f1e7bb5e05c8" },
"goto-preview": { "branch": "main", "commit": "527fd81a827234e26ca47891abe90497215db2a6" }, "goto-preview": { "branch": "main", "commit": "527fd81a827234e26ca47891abe90497215db2a6" },
"indent-blankline.nvim": { "branch": "master", "commit": "3d08501caef2329aba5121b753e903904088f7e6" }, "indent-blankline.nvim": { "branch": "master", "commit": "3d08501caef2329aba5121b753e903904088f7e6" },
"knap": { "branch": "main", "commit": "d4ea571d2d4e139d288b758c5bab31788d30eea3" }, "knap": { "branch": "main", "commit": "d4ea571d2d4e139d288b758c5bab31788d30eea3" },
@ -21,15 +22,15 @@
"lsp_signature.nvim": { "branch": "master", "commit": "c6aeb2f1d2538bbdfdaab1664d9d4c3c75aa9db8" }, "lsp_signature.nvim": { "branch": "master", "commit": "c6aeb2f1d2538bbdfdaab1664d9d4c3c75aa9db8" },
"lspkind-nvim": { "branch": "master", "commit": "1735dd5a5054c1fb7feaf8e8658dbab925f4f0cf" }, "lspkind-nvim": { "branch": "master", "commit": "1735dd5a5054c1fb7feaf8e8658dbab925f4f0cf" },
"lualine.nvim": { "branch": "master", "commit": "b5e8bb642138f787a2c1c5aedc2a78cb2cebbd67" }, "lualine.nvim": { "branch": "master", "commit": "b5e8bb642138f787a2c1c5aedc2a78cb2cebbd67" },
"luasnip": { "branch": "master", "commit": "79cc25c39878401d4e8b6ec42fcf14639426bafc" }, "luasnip": { "branch": "master", "commit": "825a61bad1d60d917a7962d73cf3c683f4e0407e" },
"mapx.nvim": { "branch": "main", "commit": "c3dd43474a5fc2f266309bc04a69b74eb2524671" }, "mapx.nvim": { "branch": "main", "commit": "c3dd43474a5fc2f266309bc04a69b74eb2524671" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "9dfcf2036c223920826140f0151d929a43f9eceb" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "9dfcf2036c223920826140f0151d929a43f9eceb" },
"mason-null-ls.nvim": { "branch": "main", "commit": "e270134d83ba59425edc53356c6fd337b61bb8dd" }, "mason-null-ls.nvim": { "branch": "main", "commit": "e270134d83ba59425edc53356c6fd337b61bb8dd" },
"mason.nvim": { "branch": "main", "commit": "751b1fcbf3d3b783fcf8d48865264a9bcd8f9b10" }, "mason.nvim": { "branch": "main", "commit": "751b1fcbf3d3b783fcf8d48865264a9bcd8f9b10" },
"modes.nvim": { "branch": "main", "commit": "4035a46aaabe43faf1b54740575af9dd5bb03809" }, "modes.nvim": { "branch": "main", "commit": "4035a46aaabe43faf1b54740575af9dd5bb03809" },
"none-ls.nvim": { "branch": "main", "commit": "e632688737b6b878e900ac69179a9aae734bb331" }, "none-ls.nvim": { "branch": "main", "commit": "fff481b65d88415933b9574dc0e1947724bcf64a" },
"nvim-autopairs": { "branch": "master", "commit": "dbfc1c34bed415906395db8303c71039b3a3ffb4" }, "nvim-autopairs": { "branch": "master", "commit": "dbfc1c34bed415906395db8303c71039b3a3ffb4" },
"nvim-cmp": { "branch": "main", "commit": "2fb2a3cf78bbc1b0bea030e8c8728985af1cf302" }, "nvim-cmp": { "branch": "main", "commit": "ce16de5665c766f39c271705b17fff06f7bcb84f" },
"nvim-colorizer.lua": { "branch": "master", "commit": "0b3950aed7bc35b78200bc292156aa77d2a4d342" }, "nvim-colorizer.lua": { "branch": "master", "commit": "0b3950aed7bc35b78200bc292156aa77d2a4d342" },
"nvim-docs-view": { "branch": "master", "commit": "78d88bca16f32a430572758677f9246f6d7f7b94" }, "nvim-docs-view": { "branch": "master", "commit": "78d88bca16f32a430572758677f9246f6d7f7b94" },
"nvim-hlslens": { "branch": "main", "commit": "c42b4526e6d83b904eb5f3d50e68d7c2fc4be4b5" }, "nvim-hlslens": { "branch": "main", "commit": "c42b4526e6d83b904eb5f3d50e68d7c2fc4be4b5" },
@ -38,10 +39,10 @@
"nvim-scrollbar": { "branch": "main", "commit": "35f99d559041c7c0eff3a41f9093581ceea534e8" }, "nvim-scrollbar": { "branch": "main", "commit": "35f99d559041c7c0eff3a41f9093581ceea534e8" },
"nvim-surround": { "branch": "main", "commit": "d47001f8ddf9646c24f16d2732d4d0255acd2121" }, "nvim-surround": { "branch": "main", "commit": "d47001f8ddf9646c24f16d2732d4d0255acd2121" },
"nvim-tree.lua": { "branch": "master", "commit": "d8d3a1590a05b2d8b5eb26e2ed1c6052b1b47a77" }, "nvim-tree.lua": { "branch": "master", "commit": "d8d3a1590a05b2d8b5eb26e2ed1c6052b1b47a77" },
"nvim-treesitter": { "branch": "master", "commit": "d31eb5442deb4940a98b5573b78eb822b74fbcea" }, "nvim-treesitter": { "branch": "master", "commit": "54cf9180a36299265e217858e6e531245074c3f4" },
"nvim-ts-autotag": { "branch": "main", "commit": "531f48334c422222aebc888fd36e7d109cb354cd" }, "nvim-ts-autotag": { "branch": "main", "commit": "531f48334c422222aebc888fd36e7d109cb354cd" },
"nvim-ts-rainbow": { "branch": "master", "commit": "ef95c15a935f97c65a80e48e12fe72d49aacf9b9" }, "nvim-ts-rainbow": { "branch": "master", "commit": "ef95c15a935f97c65a80e48e12fe72d49aacf9b9" },
"nvim-ufo": { "branch": "main", "commit": "458aa4451b98614cfab6b3d7beddc8caff5e3052" }, "nvim-ufo": { "branch": "main", "commit": "49acf0010ccc08d727582da8cbf5e4c3f3b0cc53" },
"nvim-web-devicons": { "branch": "master", "commit": "3ee60deaa539360518eaab93a6c701fe9f4d82ef" }, "nvim-web-devicons": { "branch": "master", "commit": "3ee60deaa539360518eaab93a6c701fe9f4d82ef" },
"nvim-yarp": { "branch": "master", "commit": "bb5f5e038bfe119d3b777845a76b0b919b35ebc8" }, "nvim-yarp": { "branch": "master", "commit": "bb5f5e038bfe119d3b777845a76b0b919b35ebc8" },
"plenary.nvim": { "branch": "master", "commit": "8aad4396840be7fc42896e3011751b7609ca4119" }, "plenary.nvim": { "branch": "master", "commit": "8aad4396840be7fc42896e3011751b7609ca4119" },

@ -1,5 +1,5 @@
-- setup keymap function -- setup keymap function
local m = require 'mapx'.setup { global = true, whichkey = true } local m = require("mapx").setup({ global = true, whichkey = true })
-- setup keymap groups -- setup keymap groups
m.nname("g", "LSP: goto") m.nname("g", "LSP: goto")
@ -14,71 +14,91 @@ m.nname("<leader>t", "Terminal")
m.nname("<C-W>", "Navigation") m.nname("<C-W>", "Navigation")
-- unmap unwanted commands -- unmap unwanted commands
m.nnoremap("Zt", '<NOP>') m.nnoremap("Zt", "<NOP>")
m.nnoremap("ZT", '<NOP>') m.nnoremap("ZT", "<NOP>")
m.nnoremap("<Space>", '<NOP>') m.nnoremap("<Space>", "<NOP>")
m.inoremap("<F2>", '<NOP>') m.inoremap("<F2>", "<NOP>")
m.inoremap("<F3>", '<NOP>') m.inoremap("<F3>", "<NOP>")
m.inoremap("<F4>", '<NOP>') m.inoremap("<F4>", "<NOP>")
m.inoremap("<F5>", '<NOP>') m.inoremap("<F5>", "<NOP>")
m.inoremap("<F6>", '<NOP>') m.inoremap("<F6>", "<NOP>")
m.inoremap("<F8>", '<NOP>') m.inoremap("<F8>", "<NOP>")
m.inoremap("<F9>", '<NOP>') m.inoremap("<F9>", "<NOP>")
m.nnoremap("<F9>", '<NOP>') m.nnoremap("<F9>", "<NOP>")
m.inoremap("<F10>", '<NOP>') m.inoremap("<F10>", "<NOP>")
m.nnoremap("<F10>", '<NOP>') m.nnoremap("<F10>", "<NOP>")
m.inoremap("<F11>", '<NOP>') m.inoremap("<F11>", "<NOP>")
m.nnoremap("<F11>", '<NOP>') m.nnoremap("<F11>", "<NOP>")
m.inoremap("<F12>", '<NOP>') m.inoremap("<F12>", "<NOP>")
m.nnoremap("<F12>", '<NOP>') m.nnoremap("<F12>", "<NOP>")
-- spell
m.nmap("<F6>s", "z=", "Spell: display suggestions")
-- shortcuts for quitting -- shortcuts for quitting
m.nnoremap("ZA", ':xa<CR>', 'Exit: write and quit all buffers') m.nnoremap("ZA", ":xa<CR>", "Exit: write and quit all buffers")
m.nnoremap("ZQ", ':conf q<CR>', 'Exit: quit current buffer') m.nnoremap("ZQ", ":conf q<CR>", "Exit: quit current buffer")
m.nnoremap("ZZ", ':x<CR>', 'Exit: write and quit current buffer') m.nnoremap("ZZ", ":x<CR>", "Exit: write and quit current buffer")
-- shortcut for split navigation -- shortcut for split navigation
m.nnoremap("<C-h>", '<C-w>h', 'Navigation: go to left window') m.nnoremap("<C-h>", "<C-w>h", "Navigation: go to left window")
m.nnoremap("<C-j>", '<C-w>j', 'Navigation: go to lower window') m.nnoremap("<C-j>", "<C-w>j", "Navigation: go to lower window")
m.nnoremap("<C-k>", '<C-w>k', 'Navigation: go to upper window') m.nnoremap("<C-k>", "<C-w>k", "Navigation: go to upper window")
m.nnoremap("<C-l>", '<C-w>l', 'Navigation: go to right window') m.nnoremap("<C-l>", "<C-w>l", "Navigation: go to right window")
-- remap for dealing with word wrap -- remap for dealing with word wrap
m.nmap('j', "v:count == 0 ? 'gj' : 'j'", { "expr", "silent" }, 'Navigation: go down in wrapped lines') m.nmap(
m.nmap('k', "v:count == 0 ? 'gk' : 'k'", { "expr", "silent" }, 'Navigation: go up in wrapped lines') "j",
"v:count == 0 ? 'gj' : 'j'",
{ "expr", "silent" },
"Navigation: go down in wrapped lines"
)
m.nmap("k", "v:count == 0 ? 'gk' : 'k'", { "expr", "silent" }, "Navigation: go up in wrapped lines")
-- compiler for languages -- compiler for languages
m.nnoremap("<leader>c", ':w! | !compiler <c-r>%<CR>', 'Compile: current file') m.nnoremap("<leader>c", ":w! | !compiler <c-r>%<CR>", "Compile: current file")
-- save file as sudo on files that require root permission -- save file as sudo on files that require root permission
m.cnoremap("w!!", 'execute "silent! write !sudo tee % >/dev/null" <bar> edit!', 'Write: overwrite file over with sudo') m.cnoremap(
"w!!",
'execute "silent! write !sudo tee % >/dev/null" <bar> edit!',
"Write: overwrite file over with sudo"
)
-- tpope/vim-abolish -- tpope/vim-abolish
m.nnoremap("<leader>sa", ':%S//g<Left><Left>', 'Substitute: free form') m.nnoremap("<leader>sa", ":%S//g<Left><Left>", "Substitute: free form")
m.nnoremap("<leader>ss", ':%S/\\<<C-r><C-w>\\>//g<Left><Left>', 'Substitute: word under cursor') m.nnoremap("<leader>ss", ":%S/\\<<C-r><C-w>\\>//g<Left><Left>", "Substitute: word under cursor")
-- simrat39/symbols-outline.nvim -- simrat39/symbols-outline.nvim
m.nmap('<F3>', ':SymbolsOutline<CR>', 'CTags: toggle') m.nmap("<F3>", ":SymbolsOutline<CR>", "CTags: toggle")
-- nvim-tree/nvim-tree.lua -- nvim-tree/nvim-tree.lua
m.nmap("<F2>", ':NvimTreeToggle toggle<CR>', 'File tree: toggle') m.nmap("<F2>", ":NvimTreeToggle toggle<CR>", "File tree: toggle")
-- mbbill/undotree -- mbbill/undotree
m.nmap("<F1>", ':UndotreeToggle<CR>', 'Undo tree: toggle') m.nmap("<F1>", ":UndotreeToggle<CR>", "Undo tree: toggle")
-- amrbashir/nvim-docs-view -- amrbashir/nvim-docs-view
m.nnoremap("go", ':DocsViewToggle<CR>', 'LSP: toggle documentation window') m.nnoremap("go", ":DocsViewToggle<CR>", "LSP: toggle documentation window")
-- numtostr/fterm.nvim -- numtostr/fterm.nvim
m.nnoremap("<leader>tt", require("FTerm").toggle, 'Terminal: open') m.nnoremap("<leader>tt", require("FTerm").toggle, "Terminal: open")
m.tnoremap("<leader>tt", require("FTerm").toggle, 'Terminal: open') m.tnoremap("<leader>tt", require("FTerm").toggle, "Terminal: open")
local lazygit = require("FTerm"):new({ local lazygit = require("FTerm"):new({
cmd = 'lazygit', cmd = "lazygit",
}) })
m.nnoremap("<leader>gt", function() lazygit:toggle() end, 'Git: open lazygit') m.nnoremap("<leader>gt", function()
m.tnoremap("<leader>gt", function() lazygit:toggle() end, 'Git: open lazygit') lazygit:toggle()
m.nnoremap("<leader>tg", function() lazygit:toggle() end, 'Terminal: open lazygit') end, "Git: open lazygit")
m.tnoremap("<leader>tg", function() lazygit:toggle() end, 'Terminal: open lazygit') m.tnoremap("<leader>gt", function()
lazygit:toggle()
end, "Git: open lazygit")
m.nnoremap("<leader>tg", function()
lazygit:toggle()
end, "Terminal: open lazygit")
m.tnoremap("<leader>tg", function()
lazygit:toggle()
end, "Terminal: open lazygit")
-- sindrets/diffview.nvim -- sindrets/diffview.nvim
m.nmap("<leader>gdo", ":DiffviewOpen<CR>", "Git: open diff") m.nmap("<leader>gdo", ":DiffviewOpen<CR>", "Git: open diff")
@ -91,42 +111,78 @@ m.nmap("<leader>x", ":TroubleToggle<CR>", "LSP: toggle error list")
m.nnoremap("gd", vim.lsp.buf.definition(), "LSP: goto definition") m.nnoremap("gd", vim.lsp.buf.definition(), "LSP: goto definition")
m.nnoremap("gD", vim.lsp.buf.declaration(), "LSP: goto declaration") m.nnoremap("gD", vim.lsp.buf.declaration(), "LSP: goto declaration")
m.nnoremap("gi", vim.lsp.buf.implementation(), "LSP: list implementation") m.nnoremap("gi", vim.lsp.buf.implementation(), "LSP: list implementation")
m.nnoremap("gr", function() vim.lsp.buf.references() end, "LSP: list references") m.nnoremap("gr", function()
vim.lsp.buf.references()
end, "LSP: list references")
m.nnoremap("gy", vim.lsp.buf.type_definition(), "LSP: goto type definition") m.nnoremap("gy", vim.lsp.buf.type_definition(), "LSP: goto type definition")
m.nnoremap("K", vim.lsp.buf.hover(), "LSP: show documentation") m.nnoremap("K", vim.lsp.buf.hover(), "LSP: show documentation")
m.nnoremap("<F8>", function() require("conform").format({ async = true, lsp_fallback = true }) end, "LSP: format") m.nnoremap("<F8>", function()
require("conform").format({ async = true, lsp_fallback = true })
end, "LSP: format")
-- rmagatti/goto-preview -- rmagatti/goto-preview
m.nnoremap("gpd", function() require('goto-preview').goto_preview_definition() end, "LSP: preview definition") m.nnoremap("gpd", function()
m.nnoremap("gpy", function() require('goto-preview').goto_preview_type_definition() end, "LSP: preview type definition") require("goto-preview").goto_preview_definition()
m.nnoremap("gpi", function() require('goto-preview').goto_preview_implementation() end, "LSP: list preview implementation") end, "LSP: preview definition")
m.nnoremap("gpD", function() require('goto-preview').goto_preview_declaration() end, "LSP: preview declaration") m.nnoremap("gpy", function()
m.nnoremap("gpr", function() require('goto-preview').goto_preview_references() end, "LSP: list preview references") require("goto-preview").goto_preview_type_definition()
m.nnoremap("gpc", function() require('goto-preview').close_all_win() end, "LSP: close all preview windows") end, "LSP: preview type definition")
m.nnoremap("gpi", function()
require("goto-preview").goto_preview_implementation()
end, "LSP: list preview implementation")
m.nnoremap("gpD", function()
require("goto-preview").goto_preview_declaration()
end, "LSP: preview declaration")
m.nnoremap("gpr", function()
require("goto-preview").goto_preview_references()
end, "LSP: list preview references")
m.nnoremap("gpc", function()
require("goto-preview").close_all_win()
end, "LSP: close all preview windows")
-- filipdutescu/renamer.nvim -- filipdutescu/renamer.nvim
m.nnoremap("<F5>", function() require("renamer").rename() end, "LSP: rename") m.nnoremap("<F5>", function()
require("renamer").rename()
end, "LSP: rename")
-- nvim-telescope/telescope.nvim -- nvim-telescope/telescope.nvim
m.nnoremap("<F4>", ':Telescope find_files<CR>', "Telescope: find files") m.nnoremap("<F4>", ":Telescope find_files<CR>", "Telescope: find files")
m.nnoremap("<leader>ff", ':Telescope find_files<CR>', "Telescope: find files") m.nnoremap("<leader>ff", ":Telescope find_files<CR>", "Telescope: find files")
-- kamykn/spelunker.vim -- kamykn/spelunker.vim
m.nnoremap("<F6>", ':call spelunker#toggle()<CR>', "Spelling: toggle spell check") m.nnoremap("<F6>t", ":call spelunker#toggle()<CR>", "Spelunker: toggle spell check")
m.nnoremap("<F6>l", function()
if vim.opt.spelllang._value == "de_de" then
vim.opt.spelllang = "en_us"
print("Spell language set to en_us")
else
vim.opt.spelllang = "de_de"
print("Spell language set to de_de")
end
vim.opt.spell = false
end, "Spell: toggle spell language")
-- kevinhwang91/nvim-ufo -- kevinhwang91/nvim-ufo
m.nnoremap("K", function() m.nnoremap("K", function()
local winid = require('ufo').peekFoldedLinesUnderCursor() local winid = require("ufo").peekFoldedLinesUnderCursor()
if not winid then if not winid then
vim.lsp.buf.hover() vim.lsp.buf.hover()
end end
end, "LSP: peek folded section") end, "LSP: peek folded section")
-- kevinhwang91/nvim-hlslens -- kevinhwang91/nvim-hlslens
m.nnoremap("n", [[<Cmd>execute('normal! ' . v:count1 . 'n')<CR><Cmd>lua require('hlslens').start()<CR>]], m.nnoremap(
'silent', "Search: search forward") "n",
m.nnoremap("N", [[<Cmd>execute('normal! ' . v:count1 . 'N')<CR><Cmd>lua require('hlslens').start()<CR>]], [[<Cmd>execute('normal! ' . v:count1 . 'n')<CR><Cmd>lua require('hlslens').start()<CR>]],
'silent', "Search: search backwards") "silent",
"Search: search forward"
)
m.nnoremap(
"N",
[[<Cmd>execute('normal! ' . v:count1 . 'N')<CR><Cmd>lua require('hlslens').start()<CR>]],
"silent",
"Search: search backwards"
)
-- sindrets/winshift.nvim -- sindrets/winshift.nvim
m.nnoremap("<C-W>m", ":WinShift<CR>", "Navigation: enter window shift mode") m.nnoremap("<C-W>m", ":WinShift<CR>", "Navigation: enter window shift mode")
@ -137,4 +193,6 @@ m.nnoremap("S", "<Plug>(leap-backward)", "Navigation: enter leap mode for backwa
m.nnoremap("gs", "<Plug>(leap-from-window", "Navigation: enter leap mode for other windows") m.nnoremap("gs", "<Plug>(leap-from-window", "Navigation: enter leap mode for other windows")
-- gnikdroy/projections.nvim -- gnikdroy/projections.nvim
m.nnoremap("<leader>fp", function() vim.cmd("Telescope projections") end, "Telescope: find projects") m.nnoremap("<leader>fp", function()
vim.cmd("Telescope projections")
end, "Telescope: find projects")

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

Loading…
Cancel
Save