From 7f0ecd88ee3e3ac3d11a8646f1e9a209b4579715 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Mon, 24 Oct 2022 20:08:44 +0200 Subject: [PATCH] feat: added cmdline formatter help --- README.md | 7 ++++--- lua/noice/config/init.lua | 5 +++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index abc1e0ee..2fd1a3b7 100644 --- a/README.md +++ b/README.md @@ -59,18 +59,19 @@ Check the [wiki](https://github.com/folke/noice.nvim/wiki/Configuration-Recipes) cmdline = { enabled = true, -- enables the Noice cmdline UI view = "cmdline_popup", -- view for rendering the cmdline. Change to `cmdline` to get a classic cmdline at the bottom - opts = { lang = "vim" }, -- enable syntax highlighting in the cmdline + opts = {}, -- extra opts for the cmdline view. See section on views ---@type table format = { -- conceal: (default=true) This will hide the text in the cmdline that matches the pattern. -- view: (default is cmdline view) -- opts: any options passed to the view -- icon_hl_group: optional hl_group for the icon - cmdline = { pattern = "^:", icon = "" }, + cmdline = { pattern = "^:", icon = "", lang = "vim" }, search_down = { kind = "search", pattern = "^/", icon = " ", lang = "regex" }, search_up = { kind = "search", pattern = "^%?", icon = " ", lang = "regex" }, - filter = { pattern = "^:%s*!", icon = "$", lang = "sh" }, + filter = { pattern = "^:%s*!", icon = "$", lang = "bash" }, lua = { pattern = "^:%s*lua%s+", icon = "", lang = "lua" }, + help = { pattern = "^:%s*h%s+", icon = "" }, -- lua = false, -- to disable a format, set to `false` }, }, diff --git a/lua/noice/config/init.lua b/lua/noice/config/init.lua index 3350d059..5b757783 100644 --- a/lua/noice/config/init.lua +++ b/lua/noice/config/init.lua @@ -11,18 +11,19 @@ M.defaults = { cmdline = { enabled = true, -- enables the Noice cmdline UI view = "cmdline_popup", -- view for rendering the cmdline. Change to `cmdline` to get a classic cmdline at the bottom - opts = { lang = "vim" }, -- enable syntax highlighting in the cmdline + opts = {}, -- extra opts for the cmdline view. See section on views ---@type table format = { -- conceal: (default=true) This will hide the text in the cmdline that matches the pattern. -- view: (default is cmdline view) -- opts: any options passed to the view -- icon_hl_group: optional hl_group for the icon - cmdline = { pattern = "^:", icon = "" }, + cmdline = { pattern = "^:", icon = "", lang = "vim" }, search_down = { kind = "search", pattern = "^/", icon = " ", lang = "regex" }, search_up = { kind = "search", pattern = "^%?", icon = " ", lang = "regex" }, filter = { pattern = "^:%s*!", icon = "$", lang = "bash" }, lua = { pattern = "^:%s*lua%s+", icon = "", lang = "lua" }, + help = { pattern = "^:%s*h%s+", icon = "" }, -- lua = false, -- to disable a format, set to `false` }, },