Files
lua-nvim/lua/cargdev/plugins/noice.lua
2026-01-13 20:33:43 -05:00

237 lines
6.0 KiB
Lua

return {
"folke/noice.nvim",
event = "VeryLazy",
dependencies = {
"MunifTanjim/nui.nvim",
"rcarriga/nvim-notify",
},
config = function()
require("notify").setup({
background_colour = "#1a1b26",
fps = 60,
icons = {
DEBUG = "",
ERROR = "",
INFO = "",
TRACE = "",
WARN = "",
},
level = 2,
minimum_width = 50,
render = "wrapped-compact",
stages = "fade_in_slide_out",
timeout = 3000,
top_down = true,
})
require("noice").setup({
cmdline = {
enabled = true,
view = "cmdline_popup",
opts = {},
format = {
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+", "^:%s*lua%s*=%s*", "^:%s*=%s*" }, icon = "", lang = "lua" },
help = { pattern = "^:%s*he?l?p?%s+", icon = "󰋖" },
input = { view = "cmdline_input", icon = "󰥻 " },
},
},
messages = {
enabled = true,
view = "notify",
view_error = "notify",
view_warn = "notify",
view_history = "messages",
view_search = "virtualtext",
},
popupmenu = {
enabled = true,
backend = "nui",
kind_icons = {},
},
redirect = {
view = "popup",
filter = { event = "msg_show" },
},
commands = {
history = {
view = "split",
opts = { enter = true, format = "details" },
filter = {
any = {
{ event = "notify" },
{ error = true },
{ warning = true },
{ event = "msg_show", kind = { "" } },
{ event = "lsp", kind = "message" },
},
},
},
last = {
view = "popup",
opts = { enter = true, format = "details" },
filter = {
any = {
{ event = "notify" },
{ error = true },
{ warning = true },
{ event = "msg_show", kind = { "" } },
{ event = "lsp", kind = "message" },
},
},
filter_opts = { count = 1 },
},
errors = {
view = "popup",
opts = { enter = true, format = "details" },
filter = { error = true },
filter_opts = { reverse = true },
},
},
notify = {
enabled = true,
view = "notify",
},
lsp = {
progress = {
enabled = false, -- Disable LSP progress notifications entirely
},
override = {
["vim.lsp.util.convert_input_to_markdown_lines"] = true,
["vim.lsp.util.stylize_markdown"] = true,
["cmp.entry.get_documentation"] = true,
},
hover = {
enabled = true,
silent = false,
view = nil,
opts = {},
},
signature = {
enabled = true,
auto_open = {
enabled = true,
trigger = true,
luasnip = true,
throttle = 50,
},
view = nil,
opts = {},
},
message = {
enabled = true,
view = "notify",
opts = {},
},
documentation = {
view = "hover",
opts = {
lang = "markdown",
replace = true,
render = "plain",
format = { "{message}" },
win_options = { concealcursor = "n", conceallevel = 3 },
},
},
},
markdown = {
hover = {
["|(%S-)|"] = vim.cmd.help,
["%[.-%]%((%S-)%)"] = require("noice.util").open,
},
highlights = {
["|%S-|"] = "@text.reference",
["@%S+"] = "@parameter",
["^%s*(Parameters:)"] = "@text.title",
["^%s*(Return:)"] = "@text.title",
["^%s*(See also:)"] = "@text.title",
["{%S-}"] = "@parameter",
},
},
health = {
checker = true,
},
smart_move = {
enabled = true,
excluded_filetypes = { "cmp_menu", "cmp_docs", "notify" },
},
presets = {
bottom_search = false,
command_palette = true,
long_message_to_split = true,
inc_rename = false,
lsp_doc_border = true,
},
throttle = 1000 / 30,
views = {
cmdline_popup = {
position = {
row = "50%",
col = "50%",
},
size = {
width = 60,
height = "auto",
},
border = {
style = "rounded",
padding = { 0, 1 },
},
win_options = {
winhighlight = {
Normal = "NormalFloat",
FloatBorder = "FloatBorder",
},
},
},
popupmenu = {
relative = "editor",
position = {
row = "55%",
col = "50%",
},
size = {
width = 60,
height = 10,
},
border = {
style = "rounded",
padding = { 0, 1 },
},
win_options = {
winhighlight = {
Normal = "NormalFloat",
FloatBorder = "FloatBorder",
},
},
},
mini = {
win_options = {
winblend = 0,
},
},
},
routes = {
{
filter = {
event = "msg_show",
kind = "",
find = "written",
},
opts = { skip = true },
},
{
filter = {
event = "msg_show",
kind = "search_count",
},
opts = { skip = true },
},
},
})
end,
}