summaryrefslogtreecommitdiff
path: root/config/nvim/lua/plugins/ui.lua
diff options
context:
space:
mode:
authorIgor Soarez <igor@soarez.org>2026-09-17 19:45:23 +0100
committerIgor Soarez <igor@soarez.org>2026-09-17 19:45:23 +0100
commit13cc065ec014b86369dfe4ad60d1a43fa06fd251 (patch)
tree684690c61b7b59758c2aac132c65b81c86de0608 /config/nvim/lua/plugins/ui.lua
dotfiles
Shell, editor and terminal configuration, the tools that go with them, and szecret, an age-based secret manager whose store lives elsewhere. History restarts here. What came before was not written to be read by anyone else, and carried machine names, addresses and an encrypted secret store; it is kept privately instead. What is left is meant to be safe on any machine, including one whose owner is not me: see CLAUDE.md for the rule it is written to.
Diffstat (limited to 'config/nvim/lua/plugins/ui.lua')
-rw-r--r--config/nvim/lua/plugins/ui.lua335
1 files changed, 335 insertions, 0 deletions
diff --git a/config/nvim/lua/plugins/ui.lua b/config/nvim/lua/plugins/ui.lua
new file mode 100644
index 0000000..d035789
--- /dev/null
+++ b/config/nvim/lua/plugins/ui.lua
@@ -0,0 +1,335 @@
+return {
+ {
+ "folke/snacks.nvim",
+ priority = 1000,
+ lazy = false,
+ ---@type snacks.Config
+ opts = {
+ indent = {
+ enabled = true,
+ animate = {
+ enabled = false,
+ },
+ },
+ -- Disable expensive features on very large / minified files
+ bigfile = { enabled = true },
+ -- Render a file before plugins fully load, for faster opening
+ quickfile = { enabled = true },
+ -- LSP reference highlighting under the cursor (CursorHold-based);
+ -- replaces the hand-rolled CursorMoved autocmd in init.lua
+ words = { enabled = true },
+ -- Treesitter scope detection: ii/ai indent text-objects + [i/]i jumps
+ scope = { enabled = true },
+ -- Unified gutter (signs+number+fold+git). The statuscolumn option
+ -- itself is set in init.lua.
+ statuscolumn = { enabled = true },
+ },
+ keys = {
+ { "<Leader>it", function()
+ if Snacks.indent.enabled then
+ Snacks.indent.disable()
+ else
+ Snacks.indent.enable()
+ end
+ end, desc = "Toggle indent guides" },
+ },
+ },
+ {
+ "nvim-lualine/lualine.nvim",
+ config = function()
+ local enable_web_dev_icons = vim.g.enable_web_dev_icons ~= 0
+ local lualine_custom_theme = require("lualine.themes.auto")
+ lualine_custom_theme.normal.c.bg = "none"
+ require("lualine").setup({
+ options = {
+ icons_enabled = enable_web_dev_icons,
+ theme = lualine_custom_theme,
+ component_separators = "|",
+ section_separators = { left = "", right = "" },
+ disabled_filetypes = {},
+ always_divide_middle = true,
+ globalstatus = true,
+ },
+ sections = {
+ lualine_a = { "mode" },
+ lualine_b = { "branch", "diff", "diagnostics" },
+ lualine_c = { "filename" },
+ lualine_x = { "encoding", "fileformat", "filetype" },
+ lualine_y = {
+ function()
+ return vim.fn.fnamemodify(vim.fn.getcwd(), ":t")
+ end,
+ },
+ lualine_z = { "progress", "location" },
+ },
+ inactive_sections = {
+ lualine_a = {},
+ lualine_b = {},
+ lualine_c = { "filename" },
+ lualine_x = { "location" },
+ lualine_y = {},
+ lualine_z = {},
+ },
+ tabline = {},
+ extensions = {},
+ })
+ end,
+ },
+ { "nvim-tree/nvim-web-devicons" },
+ { "nvim-mini/mini.icons", version = false },
+ {
+ "j-hui/fidget.nvim",
+ main = "fidget",
+ opts = {},
+ },
+ {
+ "romgrk/barbar.nvim",
+ version = "^1.0.0",
+ dependencies = {
+ "nvim-tree/nvim-web-devicons", -- for file icons
+ "lewis6991/gitsigns.nvim", -- optional for git status
+ },
+ init = function()
+ vim.g.barbar_auto_setup = false
+ end,
+ config = function()
+ require("barbar").setup({
+ -- Enable/disable animations
+ animation = true,
+ -- Enable/disable auto-hiding the tab bar when there is a single buffer
+ auto_hide = true,
+ -- Enable/disable current/total tabpages indicator (top right corner)
+ tabpages = true,
+ -- Enables/disable clickable tabs
+ clickable = true,
+ -- Configure icons on the bufferline
+ icons = {
+ -- Configure the base icons on the bufferline
+ buffer_index = false,
+ buffer_number = false,
+ button = "", -- Empty string disables close button
+ -- Enables / disables diagnostic symbols
+ diagnostics = {
+ [vim.diagnostic.severity.ERROR] = { enabled = true },
+ [vim.diagnostic.severity.WARN] = { enabled = true },
+ [vim.diagnostic.severity.INFO] = { enabled = false },
+ [vim.diagnostic.severity.HINT] = { enabled = false },
+ },
+ gitsigns = {
+ added = { enabled = true, icon = "+" },
+ changed = { enabled = true, icon = "~" },
+ deleted = { enabled = true, icon = "-" },
+ },
+ filetype = {
+ -- Sets the icon's highlight group.
+ -- If false, will use nvim-web-devicons colors
+ custom_colors = false,
+ -- Requires `nvim-web-devicons` if `true`
+ enabled = false,
+ },
+ separator = { left = "▎", right = "" },
+ -- Configure the icons on the bufferline when modified
+ modified = { button = "" },
+ -- Configure the icons on the bufferline based on the visibility of a buffer
+ pinned = { button = "📌" },
+ -- Configure the icons on the bufferline for various kinds of tabs
+ preset = "default",
+ -- Configure the icons on the bufferline for alternate layout
+ alternate = { filetype = { enabled = false } },
+ -- Configure the icons on the bufferline when the buffer is currently active
+ current = { buffer_index = false },
+ -- Configure the icons on the bufferline for inactive tabs
+ -- inactive = { button = "×" },
+ inactive = {},
+ -- Configure the icons on the bufferline for visible tabs
+ visible = { modified = { buffer_number = false } },
+ },
+ -- If true, new buffers will be inserted at the start/end of the list.
+ -- Default is to insert after current buffer.
+ insert_at_end = false,
+ insert_at_start = false,
+ -- Sets the maximum padding width with which to surround each tab
+ maximum_padding = 1,
+ -- Sets the minimum padding width with which to surround each tab
+ minimum_padding = 1,
+ -- Sets the maximum buffer name length
+ maximum_length = 30,
+ -- Sets the minimum buffer name length
+ minimum_length = 0,
+ -- If set, the letters for each buffer in buffer-pick mode will be
+ -- assigned based on their name. Otherwise or in case all letters are
+ -- already assigned, the behavior is to assign letters in order of
+ -- usability (see order below)
+ semantic_letters = true,
+ -- Sets the name of unnamed buffers. By default format is "[Buffer X]"
+ -- where X is the buffer number. But only a static string is accepted here.
+ no_name_title = nil,
+ -- Set the filetypes which barbar will offset itself for
+ sidebar_filetypes = {
+ NvimTree = { text = "Files", align = "left" },
+ },
+ })
+
+ -- Buffer navigation with <Leader> + number
+ for i = 1, 8 do
+ vim.keymap.set("n", "<Leader>" .. i, ":BufferGoto " .. i .. "<CR>")
+ end
+ vim.keymap.set("n", "<Leader>9", ":BufferLast<CR>", { desc = "Go to last buffer" })
+ vim.keymap.set("n", "<Leader>]", ":BufferNext<CR>")
+ vim.keymap.set("n", "<Leader>[", ":BufferPrevious<CR>")
+ -- vim.keymap.set("n", "<A-<>", ":BufferMovePrevious<CR>")
+ -- vim.keymap.set("n", "<A->>", ":BufferMoveNext<CR>")
+ -- vim.keymap.set("n", "<A-p>", ":BufferPin<CR>")
+ vim.keymap.set("n", "<Leader>x", ":BufferClose<CR>", { desc = "Close buffer" })
+ vim.keymap.set("n", "<Leader>X", ":BufferCloseAllButCurrent<CR>", { desc = "Close other buffers" })
+ end,
+ },
+ { "fweep/vim-zsh-path-completion" },
+ {
+ "nvim-tree/nvim-tree.lua",
+ cmd = { "NvimTreeToggle", "NvimTreeFindFile" },
+ keys = {
+ { "<Leader>/", ":NvimTreeToggle .<CR>", desc = "Toggle file tree" },
+ { "<Leader>?", ":NvimTreeFindFile<CR>", desc = "Find current file in tree" },
+ },
+ config = function()
+ vim.g.enable_web_dev_icons = true
+ local enable_web_dev_icons = vim.g.enable_web_dev_icons ~= 0
+ require("nvim-tree").setup({
+ actions = {
+ open_file = {
+ window_picker = {
+ enable = false,
+ },
+ },
+ },
+ renderer = {
+ highlight_git = true,
+ root_folder_label = false, -- Set to false to hide the root folder name, or a function to customize display
+ icons = {
+ show = {
+ file = enable_web_dev_icons,
+ folder = enable_web_dev_icons,
+ folder_arrow = enable_web_dev_icons,
+ git = false,
+ },
+ },
+ -- special_files = {},
+ },
+ view = {
+ -- signcolumn = 'no',
+ },
+ })
+ end,
+ },
+ {
+ "folke/noice.nvim",
+ event = "VeryLazy",
+ dependencies = {
+ -- if you lazy-load any plugin below, make sure to add proper `module="..."` entries
+ "MunifTanjim/nui.nvim",
+ -- OPTIONAL:
+ -- `nvim-notify` is only needed, if you want to use the notification view.
+ -- If not available, we use `mini` as the fallback
+ "rcarriga/nvim-notify",
+ },
+ config = function()
+ require("notify").setup({
+ background_colour = "#000000",
+ })
+
+ local noice = require("noice")
+ noice.setup({
+ messages = {
+ view = "mini",
+ view_error = "mini", -- view for errors
+ view_warn = "mini", -- view for warnings
+ view_search = false,
+ },
+ lsp = {
+ -- override markdown rendering so that **cmp** and other plugins use **Treesitter**
+ override = {
+ ["vim.lsp.util.convert_input_to_markdown_lines"] = true,
+ ["vim.lsp.util.stylize_markdown"] = true,
+ ["cmp.entry.get_documentation"] = true, -- requires hrsh7th/nvim-cmp
+ },
+ },
+ -- you can enable a preset for easier configuration
+ presets = {
+ -- bottom_search = true, -- use a classic bottom cmdline for search
+ command_palette = true, -- position the cmdline and popupmenu together
+ long_message_to_split = true, -- long messages will be sent to a split
+ inc_rename = false, -- enables an input dialog for inc-rename.nvim
+ lsp_doc_border = false, -- add a border to hover docs and signature help
+ },
+ routes = {
+ -- <C-g> buffer path → mini view, kept visible for 10s.
+ -- Must come first so it wins (and stops) before the generic
+ -- notify route below; route opts.timeout sets autohide.
+ {
+ view = "cmdline_popup",
+ filter = {
+ event = "notify",
+ cond = function(m)
+ return m.opts ~= nil and m.opts.buffer_path == true
+ end,
+ },
+ opts = { timeout = 10000 },
+ },
+
+ { view = "mini", filter = { event = "notify", find = "^Register" } },
+
+ -- 1) all normal Vim messages → mini
+ -- { filter = { event = "msg_show" }, view = "mini" },
+ -- 2) mode/recording messages → mini
+ -- { filter = { event = "msg_showmode" }, view = "mini" },
+ -- 3) anything sent via vim.notify() → mini
+ { filter = { event = "notify" }, view = "mini" },
+ -- 4) LSP progress to mini (leave hover/signature in their own views)
+ -- { filter = { event = "lsp", kind = "progress" }, view = "mini" },
+ },
+ })
+
+ vim.api.nvim_create_autocmd("RecordingEnter", {
+ group = vim.api.nvim_create_augroup("NoiceMacroNotification", { clear = true }),
+ callback = function()
+ _MACRO_RECORDING_STATUS = true
+ noice.notify(string.format("Register: %s", vim.fn.reg_recording()), vim.log.levels.INFO, {
+ title = "Recording macro",
+ view = "mini",
+ keep = function()
+ return _MACRO_RECORDING_STATUS
+ end,
+ })
+ end,
+ })
+ vim.api.nvim_create_autocmd("RecordingLeave", {
+ group = vim.api.nvim_create_augroup("NoiceMacroNotificationDismiss", { clear = true }),
+ callback = function()
+ _MACRO_RECORDING_STATUS = false
+ noice.notify(string.format("Register: %s", vim.fn.reg_recording()), vim.log.levels.INFO, {
+ title = "Saved macro",
+ view = "mini",
+ timeout = 2000,
+ })
+ end,
+ })
+
+ -- setup :Noice dismiss
+ vim.keymap.set("n", "<Leader>nd", ":Noice dismiss<CR>", { desc = "Dismiss notifications" })
+
+ -- <C-g>: show full buffer path. Emit a notify (instead of the native
+ -- msg_show) so noice's msg_show dedup can't drop repeated presses, and
+ -- tag it so the route below sends it to the mini view with a long timeout.
+ vim.keymap.set("n", "<C-g>", function()
+ local path = vim.fn.expand("%:p")
+ if path == "" then
+ path = "[No Name]"
+ end
+ vim.notify(path, vim.log.levels.INFO, { buffer_path = true })
+ end, { desc = "Show full buffer path" })
+ end,
+ },
+ -- Inlay hints are toggled natively via <Leader>dh (see init.lua); the
+ -- MysticalDevil/inlay-hints.nvim plugin is no longer needed on 0.10+.
+}