-
Notifications
You must be signed in to change notification settings - Fork 109
Configuration Recipes
Folke Lemaitre edited this page May 13, 2024
·
13 revisions
Noice now supports a number of the recipes below as a preset, so no need to copy the code.
require("noice").setup({
presets = {
-- you can enable a preset by setting it to true, or a table that will override the preset config
-- you can also add custom presets that you can enable/disable with enabled=true
bottom_search = false, -- use a classic bottom cmdline for search
command_palette = false, -- position the cmdline and popupmenu together
long_message_to_split = false, -- long messages will be sent to a split
inc_rename = false, -- enables an input dialog for inc-rename.nvim
}
})
Show as a notify message
local noice = require("noice")
noice.setup({
routes = {
{
view = "notify",
filter = { event = "msg_showmode" },
},
},
})
Or show in the statusline
require("lualine").setup({
sections = {
lualine_x = {
{
require("noice").api.statusline.mode.get,
cond = require("noice").api.statusline.mode.has,
color = { fg = "#ff9e64" },
}
},
},
})
require("noice").setup({
views = {
cmdline_popup = {
position = {
row = 5,
col = "50%",
},
size = {
width = 60,
height = "auto",
},
},
popupmenu = {
relative = "editor",
position = {
row = 8,
col = "50%",
},
size = {
width = 60,
height = 10,
},
border = {
style = "rounded",
padding = { 0, 1 },
},
win_options = {
winhighlight = { Normal = "Normal", FloatBorder = "DiagnosticInfo" },
},
},
},
})
require("noice").setup({
cmdline = {
view = "cmdline",
},
})
require("noice").setup({
routes = {
{
filter = {
event = "msg_show",
kind = "",
find = "written",
},
opts = { skip = true },
},
},
})
require("noice").setup({
views = {
cmdline_popup = {
border = {
style = "none",
padding = { 2, 3 },
},
filter_options = {},
win_options = {
winhighlight = "NormalFloat:NormalFloat,FloatBorder:FloatBorder",
},
},
},
})
require("noice").setup({
cmdline = {
format = {
search_down = {
view = "cmdline",
},
search_up = {
view = "cmdline",
},
},
},
})
require("noice").setup({
routes = {
{
filter = {
event = "msg_show",
kind = "search_count",
},
opts = { skip = true },
},
},
})
require("noice").setup({
routes = {
{
filter = {
event = "msg_show",
kind = "",
find = "written",
},
opts = { skip = true },
},
},
})
require("noice").setup({
views = {
cmdline_popup = {
border = {
style = "none",
padding = { 2, 3 },
},
filter_options = {},
win_options = {
winhighlight = "NormalFloat:NormalFloat,FloatBorder:FloatBorder",
},
},
},
})
require("noice").setup({
routes = {
{
filter = {
event = "msg_show",
kind = "search_count",
},
opts = { skip = true },
},
},
})
require("noice").setup({
routes = {
{
filter = {
event = "lsp",
kind = "progress",
cond = function(message)
local client = vim.tbl_get(message.opts, "progress", "client")
return client == "lua_ls"
end,
},
opts = { skip = true },
},
},
})