bug: Format pattern for searching not working as expected #825
-
Did you check docs and existing issues?
Neovim version (nvim -v)0.10.0 Operating system/versionArch Linux Describe the bugI assume using the default setup that noice would show an icon for search/replace but it isn't. I have tried setting up with defaults and I have tried adding my own replace pattern. As in the seen in my reproducable example, I tested using Steps To Reproduce
Expected BehaviorFor cmdline format to show the correct icon when entering search/replace Reprolocal root = vim.fn.fnamemodify("./.repro", ":p")
for _, name in ipairs({ "config", "data", "state", "cache" }) do
vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", lazypath, })
end
vim.opt.runtimepath:prepend(lazypath)
-- install plugins
local plugins = {
"folke/tokyonight.nvim",
{
"folke/noice.nvim",
dependencies = "MunifTanjim/nui.nvim",
opts = {
cmdline = {
format = {
replace = { pattern = "^:%s/", icon = "", lang = "vim" }
}
}
}
}
}
require("lazy").setup(plugins, { root = root .. "/plugins"})
vim.cmd.colorscheme("tokyonight") |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
Hi. There is no icon for search and replace. The only available icons are described here. To search and replace you enter first the command line with |
Beta Was this translation helpful? Give feedback.
-
I don't know if it's possible, because you entered first the command line with |
Beta Was this translation helpful? Give feedback.
Yes, you are absolutely right.
I played a little bit with the format options and with regex. And it works! Look here...
search_replace_with_icon.mov
Place this code inside the
opts
table:✌🏻🙂