Small collection of fancy components for the lualine.nvim plugin. The main purpose of this plugin is to simplify my personal lualine configuration. But if someone finds this helpful or useful at all... sharing is caring as they say.
For lazy.nvim:
{
"nvim-lualine/lualine.nvim",
dependencies = {
"nvim-tree/nvim-web-devicons",
"meuter/lualine-so-fancy.nvim",
},
opts = {
options = {
theme = "seoul256",
component_separators = { left = "│", right = "│" },
section_separators = { left = "", right = "" },
globalstatus = true,
refresh = {
statusline = 100,
},
},
sections = {
lualine_a = {
{ "fancy_mode", width = 3 }
},
lualine_b = {
{ "fancy_branch" },
{ "fancy_diff" },
},
lualine_c = {
{ "fancy_cwd", substitute_home = true }
},
lualine_x = {
{ "fancy_macro" },
{ "fancy_diagnostics" },
{ "fancy_searchcount" },
{ "fancy_location" },
},
lualine_y = {
{ "fancy_filetype", ts_icon = "" }
},
lualine_z = {
{ "fancy_lsp_servers" }
},
}
},
}
You will need a patched font including the latest codicons glyphs. The screenshot was taken using Fira Code Regular Nerd Font Complete, patched manually by yours truly and Windows Terminal.
fancy_branch
: same asbranch
but with different default icon.fancy_cwd
: displays the current working directory. By default, the$HOME
directory is substituted with~
. The default behaviour can be changed usingsubstitute_home=false
.fancy_diagnostics
: same asdiagnostics
but with different default symbols.fancy_diff
: same asdiff
but with different default synbols.fancy_filetype
: same asfiletype
but with a small tree icon if treesitter is available and running. The treesitter icon can be configured usingts_icon
.fancy_location
: same aslocation
bit with a small red pin icon by default.fancy_lsp_servers
: display the list of currently connected LSP servers and null-ls tools.fancy_macro
: displays the currently recording macros if any (useful if one usescmdheight=0
).fancy_mode
: same asmode
but within a fixed-width section to avoid other components changing places when switching to/from certain modes (len("NORMAL") != len("TERMINAL")
). Use thewidth
option to configure the width of the section (default is3
). Ifwidth
is smaller than the length of the mode, the mode is truncated, otherwise the mode is centered within the section.fancy_searchcount
: same assearchcount
but with a different default icon and without the brackets[]
.
All components can be customized similarly to the ones provided by lualine (icon
, color
, etc.).
If anyone would like to contribute with some fixes, improvements, extra components, pull-requests are welcome. Just keep in mind that I have a day-job, and may not be able get to them immediately, but I'll do my best 😅.