Skip to content

Commit

Permalink
feat: added cmdline formatter help
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Oct 24, 2022
1 parent 9b4c7b9 commit 7f0ecd8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, CmdlineFormat>
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`
},
},
Expand Down
5 changes: 3 additions & 2 deletions lua/noice/config/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, CmdlineFormat>
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`
},
},
Expand Down

0 comments on commit 7f0ecd8

Please sign in to comment.