Skip to main content

UI

nvim-notify​

Better vim.notify()

opts = {
stages = "static",
timeout = 3000,
max_height = function()
return math.floor(vim.o.lines * 0.75)
end,
max_width = function()
return math.floor(vim.o.columns * 0.75)
end,
on_open = function(win)
vim.api.nvim_win_set_config(win, { zindex = 100 })
end,
}

bufferline.nvim​

This is what powers LazyVim's fancy-looking tabs, which include filetype icons and close buttons.

opts = {
options = {
-- stylua: ignore
close_command = function(n) LazyVim.ui.bufremove(n) end,
-- stylua: ignore
right_mouse_command = function(n) LazyVim.ui.bufremove(n) end,
diagnostics = "nvim_lsp",
always_show_bufferline = false,
diagnostics_indicator = function(_, _, diag)
local icons = LazyVim.config.icons.diagnostics
local ret = (diag.error and icons.Error .. diag.error .. " " or "")
.. (diag.warning and icons.Warn .. diag.warning or "")
return vim.trim(ret)
end,
offsets = {
{
filetype = "neo-tree",
text = "Neo-tree",
highlight = "Directory",
text_align = "left",
},
},
---@param opts bufferline.IconFetcherOpts
get_element_icon = function(opts)
return LazyVim.config.icons.ft[opts.filetype]
end,
},
}

lualine.nvim​

statusline

opts = function()
-- PERF: we don't need this lualine require madness đŸ€·
local lualine_require = require("lualine_require")
lualine_require.require = require

local icons = LazyVim.config.icons

vim.o.laststatus = vim.g.lualine_laststatus

local opts = {
options = {
theme = "auto",
globalstatus = vim.o.laststatus == 3,
disabled_filetypes = { statusline = { "dashboard", "alpha", "ministarter" } },
},
sections = {
lualine_a = { "mode" },
lualine_b = { "branch" },

lualine_c = {
LazyVim.lualine.root_dir(),
{
"diagnostics",
symbols = {
error = icons.diagnostics.Error,
warn = icons.diagnostics.Warn,
info = icons.diagnostics.Info,
hint = icons.diagnostics.Hint,
},
},
{ "filetype", icon_only = true, separator = "", padding = { left = 1, right = 0 } },
{ LazyVim.lualine.pretty_path() },
},
lualine_x = {
-- stylua: ignore
{
function() return require("noice").api.status.command.get() end,
cond = function() return package.loaded["noice"] and require("noice").api.status.command.has() end,
color = function() return LazyVim.ui.fg("Statement") end,
},
-- stylua: ignore
{
function() return require("noice").api.status.mode.get() end,
cond = function() return package.loaded["noice"] and require("noice").api.status.mode.has() end,
color = function() return LazyVim.ui.fg("Constant") end,
},
-- stylua: ignore
{
function() return "ï‘Ż " .. require("dap").status() end,
cond = function() return package.loaded["dap"] and require("dap").status() ~= "" end,
color = function() return LazyVim.ui.fg("Debug") end,
},
-- stylua: ignore
{
require("lazy.status").updates,
cond = require("lazy.status").has_updates,
color = function() return LazyVim.ui.fg("Special") end,
},
{
"diff",
symbols = {
added = icons.git.added,
modified = icons.git.modified,
removed = icons.git.removed,
},
source = function()
local gitsigns = vim.b.gitsigns_status_dict
if gitsigns then
return {
added = gitsigns.added,
modified = gitsigns.changed,
removed = gitsigns.removed,
}
end
end,
},
},
lualine_y = {
{ "progress", separator = " ", padding = { left = 1, right = 0 } },
{ "location", padding = { left = 0, right = 1 } },
},
lualine_z = {
function()
return "ïș " .. os.date("%R")
end,
},
},
extensions = { "neo-tree", "lazy" },
}

-- do not add trouble symbols if aerial is enabled
-- And allow it to be overriden for some buffer types (see autocmds)
if vim.g.trouble_lualine and LazyVim.has("trouble.nvim") then
local trouble = require("trouble")
local symbols = trouble.statusline({
mode = "symbols",
groups = {},
title = false,
filter = { range = true },
format = "{kind_icon}{symbol.name:Normal}",
hl_group = "lualine_c_normal",
})
table.insert(opts.sections.lualine_c, {
symbols and symbols.get,
cond = function()
return vim.b.trouble_lualine ~= false and symbols.has()
end,
})
end

return opts
end

indent-blankline.nvim​

indent guides for Neovim

opts = function()
LazyVim.toggle.map("<leader>ug", {
name = "Indention Guides",
get = function()
return require("ibl.config").get_config(0).enabled
end,
set = function(state)
require("ibl").setup_buffer(0, { enabled = state })
end,
})

return {
indent = {
char = "│",
tab_char = "│",
},
scope = { show_start = false, show_end = false },
exclude = {
filetypes = {
"help",
"alpha",
"dashboard",
"neo-tree",
"Trouble",
"trouble",
"lazy",
"mason",
"notify",
"toggleterm",
"lazyterm",
},
},
}
end

noice.nvim​

Highly experimental plugin that completely replaces the UI for messages, cmdline and the popupmenu.

opts = {
lsp = {
override = {
["vim.lsp.util.convert_input_to_markdown_lines"] = true,
["vim.lsp.util.stylize_markdown"] = true,
["cmp.entry.get_documentation"] = true,
},
},
routes = {
{
filter = {
event = "msg_show",
any = {
{ find = "%d+L, %d+B" },
{ find = "; after #%d+" },
{ find = "; before #%d+" },
},
},
view = "mini",
},
},
presets = {
bottom_search = true,
command_palette = true,
long_message_to_split = true,
},
}

mini.icons​

icons

opts = {
file = {
[".keep"] = { glyph = "󰊱", hl = "MiniIconsGrey" },
["devcontainer.json"] = { glyph = "", hl = "MiniIconsAzure" },
},
filetype = {
dotenv = { glyph = "", hl = "MiniIconsYellow" },
},
}

nui.nvim​

ui components

opts = nil

dashboard-nvim​

opts = function()
local logo = [[
██╗ █████╗ ███████╗██╗ ██╗██╗ ██╗██╗███╗ ███╗ Z
██║ ██╔══██╗╚══███╔╝╚██╗ ██╔╝██║ ██║██║████╗ ████║ Z
██║ ███████║ ███╔╝ ╚████╔╝ ██║ ██║██║██╔████╔██║ z
██║ ██╔══██║ ███╔╝ ╚██╔╝ ╚██╗ ██╔╝██║██║╚██╔╝██║ z
███████╗██║ ██║███████╗ ██║ ╚████╔╝ ██║██║ ╚═╝ ██║
╚══════╝╚═╝ ╚═╝╚══════╝ ╚═╝ ╚═══╝ ╚═╝╚═╝ ╚═╝
]]

logo = string.rep("\n", 8) .. logo .. "\n\n"

local opts = {
theme = "doom",
hide = {
-- this is taken care of by lualine
-- enabling this messes up the actual laststatus setting after loading a file
statusline = false,
},
config = {
header = vim.split(logo, "\n"),
-- stylua: ignore
center = {
{ action = 'lua LazyVim.pick()()', desc = " Find File", icon = " ", key = "f" },
{ action = "ene | startinsert", desc = " New File", icon = " ", key = "n" },
{ action = 'lua LazyVim.pick("oldfiles")()', desc = " Recent Files", icon = " ", key = "r" },
{ action = 'lua LazyVim.pick("live_grep")()', desc = " Find Text", icon = "ï€ą ", key = "g" },
{ action = 'lua LazyVim.pick.config_files()()', desc = " Config", icon = "ïŁ ", key = "c" },
{ action = 'lua require("persistence").load()', desc = " Restore Session", icon = " ", key = "s" },
{ action = "LazyExtras", desc = " Lazy Extras", icon = "îȘŒ ", key = "x" },
{ action = "Lazy", desc = " Lazy", icon = "ó°’Č ", key = "l" },
{ action = function() vim.api.nvim_input("<cmd>qa<cr>") end, desc = " Quit", icon = " ", key = "q" },
},
footer = function()
local stats = require("lazy").stats()
local ms = (math.floor(stats.startuptime * 100 + 0.5) / 100)
return { "⚡ Neovim loaded " .. stats.loaded .. "/" .. stats.count .. " plugins in " .. ms .. "ms" }
end,
},
}

for _, button in ipairs(opts.config.center) do
button.desc = button.desc .. string.rep(" ", 43 - #button.desc)
button.key_format = " %s"
end

-- open dashboard after closing lazy
if vim.o.filetype == "lazy" then
vim.api.nvim_create_autocmd("WinClosed", {
pattern = tostring(vim.api.nvim_get_current_win()),
once = true,
callback = function()
vim.schedule(function()
vim.api.nvim_exec_autocmds("UIEnter", { group = "dashboard" })
end)
end,
})
end

return opts
end