diff --git a/lua/plugins/lang/cmp.lua b/lua/plugins/lang/cmp.lua index e729f47..8044324 100644 --- a/lua/plugins/lang/cmp.lua +++ b/lua/plugins/lang/cmp.lua @@ -5,7 +5,64 @@ require('luasnip/loaders/from_vscode').lazy_load() local icons = require('lib.icons') local kind_icons = icons.kind -vim.api.nvim_set_hl(0, 'CmpItemKindCopilot', { fg = '#6CC644' }) + +local max_count = 15 + local rounded_border = true + + local function border(hl_name) + if rounded_border then + return { + { "╭", hl_name }, + { "─", hl_name }, + { "╮", hl_name }, + { "│", hl_name }, + { "╯", hl_name }, + { "─", hl_name }, + { "╰", hl_name }, + { "│", hl_name }, + } + else + return { + { "┌", hl_name }, + { "─", hl_name }, + { "┐", hl_name }, + { "│", hl_name }, + { "┘", hl_name }, + { "─", hl_name }, + { "└", hl_name }, + { "│", hl_name }, + } + end + end + + --   פּ ﯟ   some other good icons + local kind_icons = { + Text = "", + Method = "m", + Function = "", + Constructor = "", + Field = "", + Variable = "", + Class = "", + Interface = "", + Module = "", + Property = "", + Unit = "", + Value = "", + Enum = "", + Keyword = "", + Snippet = "", + Color = "", + File = "", + Reference = "", + Folder = "", + EnumMember = "", + Constant = "", + Struct = "", + Event = "", + Operator = "", + TypeParameter = "", + } cmp.setup({ completion = { @@ -16,6 +73,7 @@ cmp.setup({ luasnip.lsp_expand(args.body) end, }, + mapping = { [''] = cmp.mapping.select_prev_item(), [''] = cmp.mapping.select_next_item(), @@ -60,12 +118,6 @@ cmp.setup({ format = function(entry, vim_item) -- Kind icons vim_item.kind = kind_icons[vim_item.kind] - - if entry.source.name == 'copilot' then - vim_item.kind = icons.git.Octoface - vim_item.kind_hl_group = 'CmpItemKindCopilot' - end - vim_item.menu = ({ codeium = '[Codeium]', nvim_lsp = '[LSP]', @@ -90,16 +142,102 @@ cmp.setup({ }, window = { documentation = { - border = 'rounded', - winhighlight = 'NormalFloat:Pmenu,NormalFloat:Pmenu,CursorLine:PmenuSel,Search:None', + border = false, + --winhighlight = 'NormalFloat:Pmenu,NormalFloat:Pmenu,CursorLine:PmenuSel,Search:None', + scrollbar = false, }, completion = { - border = 'rounded', - winhighlight = 'NormalFloat:Pmenu,NormalFloat:Pmenu,CursorLine:PmenuSel,Search:None', + border = false, + --winhighlight = 'NormalFloat:Pmenu,NormalFloat:Pmenu,CursorLine:PmenuSel,Search:None', + max_height = 15, + scrollbar = false, }, - scrollbar = true, }, experimental = { - ghost_text = true, - }, + ghost_text = true + } }) + + -- Use buffer source for `/` and `?` (if you enabled `native_menu`, this won't work anymore). + cmp.setup.cmdline({'/','?'}, { + formatting = { + fields = { "kind", "abbr" }, + format = function(entry, vim_item) + -- Kind icons + vim_item.kind = string.format("%s", kind_icons[vim_item.kind]) + vim_item.menu = ({ + buffer = "(buffer)" + })[entry.source.name] + return vim_item + end, + }, + mapping = cmp.mapping.preset.cmdline(), + sources = { + { + name = 'buffer', + option = { max_item_count = max_count } + } + } + }) + + -- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore). + cmp.setup.cmdline(':', { + formatting = { + fields = { "kind", "abbr", "menu" }, + format = function(entry, vim_item) + -- Kind icons + vim_item.kind = string.format("%s", kind_icons[vim_item.kind]) + vim_item.menu = ({ + buffer = "(buffer)", + path = "(path)", + })[entry.source.name] + return vim_item + end, + }, + mapping = cmp.mapping.preset.cmdline(), + sources = cmp.config.sources({ + { + name = 'path', + option = { max_item_count = 10 } + } + }, + { + { + name = 'cmdline', + option = { max_item_count = 10 } + } + }) + }) + + cmp.setup.filetype("lua", { + sources = cmp.config.sources({ + { name = 'luasnip' }, -- For luasnip users. + { name = 'nvim_lsp' }, + { + name = "nvim_lua", + option = { max_item_count = max_count } + }, + { + name = 'buffer', + option = { keyword_length = 1 } + }, + { name = "path" }, + { name = "orgmode" }, + }), + }) + + cmp.setup.filetype("norg", { + sources = cmp.config.sources({ + { name = 'luasnip' }, -- For luasnip users. + { + name = 'neorg', + option = { max_item_count = max_count } + }, + { name = 'buffer', }, + { name = "path" }, + }) + }) + + + + diff --git a/lua/plugins/lang/copilot.lua b/lua/plugins/lang/copilot.lua deleted file mode 100644 index b5ad496..0000000 --- a/lua/plugins/lang/copilot.lua +++ /dev/null @@ -1,47 +0,0 @@ -local copilot = require('copilot') - -copilot.setup({ - panel = { - enabled = true, - auto_refresh = false, - keymap = { - jump_prev = '[[', - jump_next = ']]', - accept = '', - refresh = 'gr', - open = '', - }, - layout = { - position = 'bottom', - ratio = 0.4, - }, - }, - suggestion = { - enabled = true, - auto_trigger = true, - debounce = 75, - keymap = { - accept = '', - accept_word = false, - accept_line = false, - next = '', - prev = '', - dismiss = '', - }, - }, - filetypes = { - yaml = true, - markdown = true, - help = true, - gitcommit = true, - gitrebase = true, - hgcommit = true, - svn = true, - cvs = true, - ['.'] = true, - }, - copilot_node_command = 'node', -- Node.js version must be > 16.x - server_opts_overrides = {}, -}) - -require('copilot_cmp').setup() diff --git a/lua/plugins/list.lua b/lua/plugins/list.lua index 302530f..94edeb9 100644 --- a/lua/plugins/list.lua +++ b/lua/plugins/list.lua @@ -50,14 +50,23 @@ local plugins = { end, cmd = 'Dashboard', }, + --{ + -- 'gelguy/wilder.nvim', + -- + -- build = function() + -- vim.cmd([[silent UpdateRemotePlugins]]) + -- end, + -- config = load_config('ui.wilder'), + -- keys = { ':', '/', '?' }, + --}, { - 'gelguy/wilder.nvim', - - build = function() - vim.cmd([[silent UpdateRemotePlugins]]) - end, - config = load_config('ui.wilder'), - keys = { ':', '/', '?' }, + 'folke/noice.nvim', + event = 'VimEnter', + dependencies = { + 'MunifTanjim/nui.nvim', + 'rcarriga/nvim-notify', + }, + config = load_config('ui.noice'), }, { 'folke/zen-mode.nvim', diff --git a/lua/plugins/lock.json b/lua/plugins/lock.json index 2f2c8ed..2213c04 100644 --- a/lua/plugins/lock.json +++ b/lua/plugins/lock.json @@ -1,6 +1,7 @@ { - "LuaSnip": { "branch": "master", "commit": "8f3d3465ba5c7ade0a8adb41eca5736f291a3fa8" }, + "LuaSnip": { "branch": "master", "commit": "b152822e1a4bafb6bdf11a16cc26525cbd95ee00" }, "Navigator.nvim": { "branch": "master", "commit": "91d86506ac2a039504d5205d32a1d4bc7aa57072" }, + "auto-save.nvim": { "branch": "main", "commit": "5fe9ab0c42f0457f2a973e814a6352b8eeb04730" }, "ccc.nvim": { "branch": "main", "commit": "f388f1981d222967c741fe9927edf9ba5fa3bcbe" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, "cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" }, @@ -11,13 +12,13 @@ "co-author.nvim": { "branch": "main", "commit": "62fbb6d6a58339c968bcea92d0f097f4ea1efaa5" }, "codeium.vim": { "branch": "main", "commit": "31dd2962c81759be007895db6ce089feec397c86" }, "compiler.nvim": { "branch": "main", "commit": "cb14acd32ba9ea09d01bbe3493aefdc59b68965c" }, - "dashboard-nvim": { "branch": "master", "commit": "6d06924b562de6f0bb136edf1bf549afbf6b7d00" }, + "dashboard-nvim": { "branch": "master", "commit": "1c8b82c5b02bb890862538be2061e37ef801a99b" }, "dracula.nvim": { "branch": "main", "commit": "8d8bddb8814c3e7e62d80dda65a9876f97eb699c" }, "dressing.nvim": { "branch": "master", "commit": "5162edb1442a729a885c45455a07e9a89058be2f" }, "flash.nvim": { "branch": "main", "commit": "48817af25f51c0590653bbc290866e4890fe1cbe" }, "friendly-snippets": { "branch": "main", "commit": "d5f74ce4dfdd82848f3f4eac65fe6e29ac5df4c2" }, "gitlinker.nvim": { "branch": "master", "commit": "cc59f732f3d043b626c8702cb725c82e54d35c25" }, - "gitsigns.nvim": { "branch": "main", "commit": "035da036e68e509ed158414416c827d022d914bd" }, + "gitsigns.nvim": { "branch": "main", "commit": "790355f00af1fc2c330ea1b2b7f68d65f19b57c9" }, "hardtime.nvim": { "branch": "main", "commit": "eaf4bc31b86419c26ad7b3a142dd36ca545ca2e4" }, "harpoon": { "branch": "harpoon2", "commit": "0378a6c428a0bed6a2781d459d7943843f374bce" }, "indent-blankline.nvim": { "branch": "master", "commit": "3d08501caef2329aba5121b753e903904088f7e6" }, @@ -38,26 +39,27 @@ "neotest-jest": { "branch": "main", "commit": "514fd4eae7da15fd409133086bb8e029b65ac43f" }, "neotest-rspec": { "branch": "main", "commit": "201f4891b5a0edc2e5f12196f35726f4d4eca410" }, "nerdy.nvim": { "branch": "main", "commit": "1ad36242f40a8fd95ae5711258540a07a5dabb51" }, - "none-ls.nvim": { "branch": "main", "commit": "709a5e56f4273deca737d43355212ac94c1b5083" }, + "noice.nvim": { "branch": "main", "commit": "0cbe3f88d038320bdbda3c4c5c95f43a13c3aa12" }, + "none-ls.nvim": { "branch": "main", "commit": "f5632db2491fbe02b54f1a321a98548a8ba2bd15" }, "nui.nvim": { "branch": "main", "commit": "cbd2668414331c10039278f558630ed19b93e69b" }, "nvim-autopairs": { "branch": "master", "commit": "4f41e5940bc0443fdbe5f995e2a596847215cd2a" }, "nvim-cmp": { "branch": "main", "commit": "8f3c541407e691af6163e2447f3af1bd6e17f9a3" }, "nvim-dap": { "branch": "master", "commit": "6ae8a14828b0f3bff1721a35a1dfd604b6a933bb" }, "nvim-dap-ui": { "branch": "master", "commit": "5934302d63d1ede12c0b22b6f23518bb183fc972" }, - "nvim-lspconfig": { "branch": "master", "commit": "3224b099845c24ca456d1e77a9268a788f106f0b" }, - "nvim-nio": { "branch": "master", "commit": "7fa5545299fc7a48d5ec74d27f414b862060095f" }, + "nvim-lspconfig": { "branch": "master", "commit": "aa5f4f4ee10b2688fb37fa46215672441d5cd5d9" }, + "nvim-nio": { "branch": "master", "commit": "79e8968769d4422c08d514a413815bea6c1f67f9" }, "nvim-notify": { "branch": "master", "commit": "5371f4bfc1f6d3adf4fe9d62cd3a9d44356bfd15" }, - "nvim-spectre": { "branch": "master", "commit": "026394a8458d62c6b7b305c076ce675420dbaa4c" }, + "nvim-spectre": { "branch": "master", "commit": "4651801ba37a9407b7257287aec45b6653ffc5e9" }, "nvim-spider": { "branch": "main", "commit": "76819082ef964db1f67f92454e18ad28ae34b37b" }, - "nvim-tree.lua": { "branch": "master", "commit": "5a18b9827491aa1aea710bc9b85c6b63ed0dad14" }, - "nvim-treesitter": { "branch": "master", "commit": "c3ab6a59039293cc27cea8a07e74c2d0ce28e36c" }, - "nvim-treesitter-endwise": { "branch": "master", "commit": "156d5782b3a68845f824156e45fc5bb038211e7b" }, + "nvim-tree.lua": { "branch": "master", "commit": "347e1eb35264677f66a79466bb5e3d111968e12c" }, + "nvim-treesitter": { "branch": "master", "commit": "1a4274c9e1226fb4c2009f4c0c3521b1931b0c5c" }, + "nvim-treesitter-endwise": { "branch": "master", "commit": "8b34305ffc28bd75a22f5a0a9928ee726a85c9a6" }, "nvim-treesitter-refactor": { "branch": "master", "commit": "65ad2eca822dfaec2a3603119ec3cc8826a7859e" }, "nvim-treesitter-textobjects": { "branch": "master", "commit": "23b820146956b3b681c19e10d3a8bc0cbd9a1d4c" }, "nvim-treesitter-textsubjects": { "branch": "master", "commit": "9f9a6b307fb122f13708f78483222abd43b7bb3a" }, "nvim-ts-autotag": { "branch": "main", "commit": "531f48334c422222aebc888fd36e7d109cb354cd" }, "nvim-ts-context-commentstring": { "branch": "main", "commit": "a6382f744f584bbf71d0a563af789af7190aabda" }, - "nvim-web-devicons": { "branch": "master", "commit": "4f499a0e8cd64faa29b89446bdadde070dc0d397" }, + "nvim-web-devicons": { "branch": "master", "commit": "794bba734ec95eaff9bb82fbd112473be2087283" }, "oil.nvim": { "branch": "master", "commit": "f3a31eba24587bc038592103d8f7e64648292115" }, "overseer.nvim": { "branch": "master", "commit": "89942ad366c8a9bb93f82411de17dc7c644b4e3b" }, "plenary.nvim": { "branch": "master", "commit": "08e301982b9a057110ede7a735dd1b5285eb341f" }, @@ -71,12 +73,11 @@ "telescope-menufacture": { "branch": "main", "commit": "79376f887f589a4240267383e8abc0a31861325a" }, "telescope-symbols.nvim": { "branch": "master", "commit": "a6d0127a53d39b9fc2af75bd169d288166118aec" }, "telescope-undo.nvim": { "branch": "main", "commit": "d19e2edc8b18d03283bd91f67310ac300ad003ce" }, - "telescope.nvim": { "branch": "master", "commit": "35f94f0ef32d70e3664a703cefbe71bd1456d899" }, + "telescope.nvim": { "branch": "master", "commit": "2d0d057791854decb2c9b6a0b52d43f3900dff40" }, "termim.nvim": { "branch": "main", "commit": "2dba526e99c32a65db9599cfa90e85db13724a44" }, - "ts-node-action": { "branch": "master", "commit": "e37eb458378de5d994df459a53711b2546abef0f" }, + "ts-node-action": { "branch": "master", "commit": "6d3b60754fd87963d70eadaa2f77873b447eac26" }, "twilight.nvim": { "branch": "main", "commit": "8b7b50c0cb2dc781b2f4262a5ddd57571556d1e4" }, "vim-fugitive": { "branch": "master", "commit": "dac8e5c2d85926df92672bf2afb4fc48656d96c7" }, "which-key.nvim": { "branch": "main", "commit": "4433e5ec9a507e5097571ed55c02ea9658fb268a" }, - "wilder.nvim": { "branch": "master", "commit": "679f348dc90d80ff9ba0e7c470c40a4d038dcecf" }, "zen-mode.nvim": { "branch": "main", "commit": "78557d972b4bfbb7488e17b5703d25164ae64e6a" } } \ No newline at end of file diff --git a/lua/plugins/tools/harpoon.lua b/lua/plugins/tools/harpoon.lua index 9322a5f..0e97ba3 100644 --- a/lua/plugins/tools/harpoon.lua +++ b/lua/plugins/tools/harpoon.lua @@ -20,32 +20,3 @@ local function toggle_telescope(harpoon_files) :find() end -vim.keymap.set('n', 'ha', function() - harpoon:list():append() -end, { desc = 'Add Mark' }) -vim.keymap.set('n', 'hh', function() - toggle_telescope(harpoon:list()) -end, { desc = 'Telescope Marks' }) -vim.keymap.set('n', 'hm', function() - harpoon.ui:toggle_quick_menu(harpoon:list()) -end, { desc = 'Open UI' }) - -vim.keymap.set('n', '[h', function() - harpoon:list():prev() -end, { desc = 'Prev Mark' }) -vim.keymap.set('n', ']h', function() - harpoon:list():next() -end, { desc = 'Next Mark' }) - -vim.keymap.set('n', 'hk', function() - harpoon:list():prev() -end, { desc = 'Prev Mark' }) -vim.keymap.set('n', 'hj', function() - harpoon:list():next() -end, { desc = 'Next Mark' }) - -for i = 1, 9 do - vim.keymap.set('n', 'h' .. i, function() - harpoon:list():select(i) - end, { desc = 'Mark ' .. i }) -end diff --git a/lua/plugins/tools/telescope.lua b/lua/plugins/tools/telescope.lua index c510558..19753c3 100644 --- a/lua/plugins/tools/telescope.lua +++ b/lua/plugins/tools/telescope.lua @@ -163,5 +163,6 @@ require('telescope').load_extension('menufacture') require('telescope').load_extension('undo') require('telescope').load_extension('harpoon') require('telescope').load_extension('notify') +require('telescope').load_extension('noice') require('telescope').load_extension('refactoring') require('telescope').load_extension('file_browser') diff --git a/lua/plugins/tools/which-key.lua b/lua/plugins/tools/which-key.lua index 9d77e88..279c477 100644 --- a/lua/plugins/tools/which-key.lua +++ b/lua/plugins/tools/which-key.lua @@ -121,6 +121,7 @@ local mappings = { Q = { 'qa!', icons.ui.Power .. 'Force Quit!' }, w = { 'w', icons.ui.Save .. 'Save' }, x = { 'x', icons.ui.Pencil .. 'Write and Quit' }, + S = { 'ASToggle', icons.ui.Save .. 'AutoSave Toggle' }, c = { name = icons.ui.NeoVim .. 'Config', c = { 'CccConvert', 'Convert Color' }, @@ -187,6 +188,7 @@ local mappings = { q = { 'Telescope quickfix', 'Quickfix' }, s = { 'Telescope live_grep grep_open_files=true', 'Find in Open Files' }, u = { 'Telescope undo', 'Undo History' }, + U = { 'Telescope colorscheme', 'Colorscheme' }, ['"'] = { 'Telescope registers', 'Registers' }, ['.'] = { 'Telescope symbols', 'Emojis' }, [','] = { 'Nerdy', 'Nerd Glyphs' }, diff --git a/lua/plugins/ui/noice.lua b/lua/plugins/ui/noice.lua new file mode 100644 index 0000000..9edd01d --- /dev/null +++ b/lua/plugins/ui/noice.lua @@ -0,0 +1,265 @@ +local border_style = { + top_left = "┌", top = "─", top_right = "┐", + left = "│", right = "│", + bottom_left = "└", bottom = "─", bottom_right = "┘", +} +local rounded_border_style = { + top_left = "╭", top = "─", top_right = "╮", + left = "│", right = "│", + bottom_left = "╰", bottom = "─", bottom_right = "╯", +} +require("noice").setup({ + 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 = {}, -- global options for the cmdline. 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 + -- title: set to anything or empty string to hide + cmdline = { pattern = "^:", icon = " ", lang = "vim", title = " Cmdline " }, + search_down = { kind = "search", pattern = "^/", icon = "  ", lang = "regex", title = " Search Down " }, + search_up = { kind = "search", pattern = "^%?", icon = "  ", lang = "regex" , title = " Search Up " }, + filter = { pattern = "^:%s*!", icon = "  ", lang = "bash" , title = "Filter" }, + lua = { pattern = { "^:%s*lua%s+", "^:%s*lua%s*=%s*", "^:%s*=%s*" }, icon = "  ", lang = "lua", title = " Lua " }, + help = { pattern = "^:%s*he?l?p?%s+", icon = " ", title = " Help " }, + input = {}, -- Used by input() + -- lua = false, -- to disable a format, set to `false` + }, + }, + messages = { + -- NOTE: If you enable messages, then the cmdline is enabled automatically. + -- This is a current Neovim limitation. + enabled = true, -- enables the Noice messages UI + view = "mini", -- default view for messages + view_error = "notify", -- view for errors + view_warn = "notify", -- view for warnings + view_history = "messages", -- view for :messages + -- view_search = false, + view_search = "virtualtext", -- view for search count messages. Set to `false` to disable + }, + popupmenu = { + enabled = true, -- enables the Noice popupmenu UI + ---@type 'nui'|'cmp' + backend = "cmp", -- backend to use to show regular cmdline completions + ---@type NoicePopupmenuItemKind|false + -- Icons for completion item kinds (see defaults at noice.config.icons.kinds) + kind_icons = {}, -- set to `false` to disable icons + }, + -- default options for require('noice').redirect + -- see the section on Command Redirection + ---@type NoiceRouteConfig + redirect = { + view = "popup", + filter = { event = "msg_show" }, + }, + -- You can add any custom commands below that will be available with `:Noice command` + ---@type table + commands = { + history = { + -- options for the message history that you get with `:Noice` + view = "split", + opts = { enter = true, format = "details" }, + filter = { + any = { + { event = "notify" }, + { error = true }, + { warning = true }, + { event = "msg_show", kind = { "" } }, + { event = "lsp", kind = "message" }, + }, + }, + }, + -- :Noice last + 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 }, + }, + -- :Noice errors + errors = { + -- options for the message history that you get with `:Noice` + view = "popup", + opts = { enter = true, format = "details" }, + filter = { error = true }, + filter_opts = { reverse = true }, + }, + }, + notify = { + -- Noice can be used as `vim.notify` so you can route any notification like other messages + -- Notification messages have their level and other properties set. + -- event is always "notify" and kind can be any log level as a string + -- The default routes will forward notifications to nvim-notify + -- Benefit of using Noice for this is the routing and consistent history view + enabled = true, + view = "notify", + }, + lsp = { + progress = { + enabled = true, + -- Lsp Progress is formatted using the builtins for lsp_progress. See config.format.builtin + -- See the section on formatting for more details on how to customize. + --- @type NoiceFormat|string + format = "lsp_progress", + --- @type NoiceFormat|string + format_done = "lsp_progress_done", + throttle = 1000 / 30, -- frequency to update lsp progress message + view = "mini", + }, + override = { + -- override the default lsp markdown formatter with Noice + ["vim.lsp.util.convert_input_to_markdown_lines"] = true, + -- override the lsp markdown formatter with Noice + ["vim.lsp.util.stylize_markdown"] = true, + -- override cmp documentation with Noice (needs the other options to work) + ["cmp.entry.get_documentation"] = true, + }, + hover = { + enabled = true, + view = nil, -- when nil, use defaults from documentation + ---@type NoiceViewOptions + opts = {}, -- merged with defaults from documentation + }, + signature = { + enabled = true, + auto_open = { + enabled = true, + trigger = true, -- Automatically show signature help when typing a trigger character from the LSP + luasnip = true, -- Will open signature help when jumping to Luasnip insert nodes + throttle = 50, -- Debounce lsp signature help request by 50ms + }, + view = nil, -- when nil, use defaults from documentation + ---@type NoiceViewOptions + opts = {}, -- merged with defaults from documentation + }, + message = { + -- Messages shown by lsp servers + enabled = true, + view = "mini", + opts = {}, + }, + -- defaults for hover and signature help + documentation = { + view = "hover", + ---@type NoiceViewOptions + opts = { + lang = "markdown", + replace = true, + render = "plain", + format = { "{message}" }, + win_options = { concealcursor = "n", conceallevel = 3 }, + }, + }, + }, + markdown = { + hover = { + ["|(%S-)|"] = vim.cmd.help, -- vim help links + ["%[.-%]%((%S-)%)"] = require("noice.util").open, -- markdown links + }, + highlights = { + ["|%S-|"] = "@text.reference", + ["@%S+"] = "@parameter", + ["^%s*(Parameters:)"] = "@text.title", + ["^%s*(Return:)"] = "@text.title", + ["^%s*(See also:)"] = "@text.title", + ["{%S-}"] = "@parameter", + }, + }, + health = { + checker = true, -- Disable if you don't want health checks to run + }, + smart_move = { + -- noice tries to move out of the way of existing floating windows. + enabled = true, -- you can disable this behaviour here + -- add any filetypes here, that shouldn't trigger smart move. + excluded_filetypes = { "cmp_menu", "cmp_docs", "notify" }, + }, + ---@type NoicePresets + 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 = true, -- long messages will be sent to a split + inc_rename = true, -- enables an input dialog for inc-rename.nvim + lsp_doc_border = true, -- add a border to hover docs and signature help + }, + throttle = 1000 / 30, -- how frequently does Noice need to check for ui updates? This has no effect when in blocking mode. + ---@type NoiceConfigViews + views = { + cmdline_popup = { + position = { + row = "50%", + col = "50%", + }, + size = { + width = "40%", + height = "auto", + }, + border = { + style = rounded_border_style, + -- style = "none", + }, + filter_options = {}, + win_options = { + winhighlight = { Normal = "TelescopePromptNormal", FloatBorder = "DiagnosticInfo" }, + }, + }, + split = { + enter = true, + }, + notify = { + size = { + width = 30 + } + }, + mini = { + win_options = { + winblend = 0, + -- winhighlight = {} + } + }, + popupmenu = { + relative = "editor", + position = { + row = 8, + col = "50%", + }, + size = { + width = 60, + height = 10, + }, + border = { + style = rounded_border_style, + padding = { 0, 1 }, + }, + win_options = { + winhighlight = { Normal = "TelescopePromptNormal", FloatBorder = "DiagnosticInfo" }, + }, + }, + }, ---@see section on views + ---@type NoiceRouteConfig[] + routes = { + { + filter = { + event = "msg_show", + -- kind = "search_count", + find = "written" + }, + opts = { skip = true }, + }, + }, --- @see section on routes +}) +