add lualine plugin
This commit is contained in:
@@ -47,7 +47,7 @@ local function smart_buffer_switch(current)
|
||||
local current_index = nil
|
||||
for index, buffer in ipairs(buffers) do
|
||||
if buffer.bufnr == current then
|
||||
current_index = i
|
||||
current_index = index
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
@@ -62,7 +62,7 @@ vim.opt.pumborder = vim.g.ui.popupborder
|
||||
vim.opt.splitbelow = true
|
||||
vim.opt.splitright = true
|
||||
-- hide mode, displayed in lualine
|
||||
-- vim.opt.showmode = false
|
||||
vim.opt.showmode = false
|
||||
vim.opt.shortmess:append("S")
|
||||
-- enable visual bell
|
||||
vim.opt.visualbell = true
|
||||
@@ -75,7 +75,7 @@ vim.opt.backspace = { "indent", "eol", "start" }
|
||||
vim.opt.preserveindent = true
|
||||
vim.opt.smartindent = true
|
||||
vim.opt.breakindent = true
|
||||
vim.opt.breakindentopt:append({ min = 20, shift = -2, sbr = ture, list = -1 })
|
||||
vim.opt.breakindentopt:append({ min = 20, shift = -2, sbr = true, list = -1 })
|
||||
-- tab settings
|
||||
vim.opt.expandtab = false
|
||||
vim.opt.shiftround = true
|
||||
@@ -91,7 +91,7 @@ vim.opt.matchpairs:append({ "<:>" })
|
||||
|
||||
vim.opt.hlsearch = true
|
||||
vim.opt.ignorecase = true
|
||||
vim.opt.inccommand = split
|
||||
vim.opt.inccommand = "split"
|
||||
vim.opt.incsearch = true
|
||||
vim.opt.smartcase = true
|
||||
|
||||
@@ -108,8 +108,8 @@ vim.opt.swapfile = true
|
||||
|
||||
-- Performance settings
|
||||
|
||||
vim.opt.updatetime = 1000
|
||||
vim.opt.timeoutlen = 300
|
||||
vim.opt.updatetime = 1000 -- after this idle time, write backup, swap files etc.
|
||||
vim.opt.timeoutlen = 500 -- timeout to wait for key combinations to complete.
|
||||
|
||||
|
||||
-- Mouse and Clipboard settings
|
||||
|
||||
@@ -66,5 +66,9 @@ vim.g.ui = {
|
||||
sign_info = "I",
|
||||
sign_hint = "H",
|
||||
},
|
||||
component_separators = { left = "│", right = "│" },
|
||||
section_separators = { left = "▒", right = "▒" },
|
||||
window = "",
|
||||
not_overline = "\u{0305}",
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,3 +31,4 @@
|
||||
]]
|
||||
|
||||
require("plugins/catppuccin")
|
||||
require("plugins/lualine")
|
||||
|
||||
@@ -0,0 +1,154 @@
|
||||
--[[
|
||||
|
||||
|
||||
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣠⣴⣾⣷⣦⣄⡀
|
||||
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣠⣴⣾⣿⣿⣿⣿⣿⣿⣿⣿⣷⣦⣄⡀
|
||||
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣠⣴⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣦⣄⡀
|
||||
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡀⠚⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠗⢀
|
||||
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⣤⣄⡉⠓⠦⣌⡙⠻⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠟⢋⣡⠴⠚⢉⣠⣤⣀
|
||||
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣤⣶⣿⣿⣿⣿⣿⣷⣦⣄⡉⠓⠦⣌⡙⠻⢿⣿⣿⣿⣿⣿⣿⡿⠟⢋⣡⠴⠚⢉⣠⣴⣾⣿⣿⣿⣿⣿⣶⣤
|
||||
⠀⠀⠀⠀⠀⠀⠀⠀⠐⣦⣄⡉⠛⠿⣿⣿⣿⣿⣿⣿⣿⣷⣦⣄⡉⠓⠦⣌⡙⠻⠟⢋⣡⠴⠚⢉⣠⣴⣾⣿⣿⣿⣿⣿⣿⣿⠿⠛⢉⣠⣴⠂
|
||||
⠀⠀⠀⠀⢀⣠⣴⣆⡈⠻⢿⣿⣷⣦⣄⡉⠛⠿⣿⣿⣿⣿⣿⣿⣿⣷⣦⣄⡉⠃⠘⢉⣠⣴⣾⣿⣿⣿⣿⣿⣿⣿⠿⠛⢉⣠⣴⣾⣿⡿⠟⢁⣰⣦⣄⡀
|
||||
⠀⠀⠐⠾⣿⣿⣿⣿⣿⣷⣦⣌⡙⠻⢿⣿⣷⣦⣄⡉⠛⠿⣿⣿⣿⣿⣿⣿⣿⣷⣾⣿⣿⣿⣿⣿⣿⣿⠿⠛⢉⣠⣴⣾⣿⡿⠟⢋⣡⣴⣾⣿⣿⣿⣿⣿⠷⠂
|
||||
⠀⢸⣷⣦⣄⡉⠛⠿⣿⣿⣿⣿⣿⣷⣦⣌⡙⠻⢿⣿⣷⣦⣄⡉⠛⠿⣿⣿⣿⣿⣿⣿⣿⣿⠿⠛⢉⣠⣴⣾⣿⡿⠟⢋⣡⣴⣾⣿⣿⣿⣿⣿⠿⠛⢉⣠⣴⣾⡇
|
||||
⠀⢸⣿⣿⣿⣿⣷⣦⣄⡉⠛⠿⣿⣿⣿⣿⣿⣷⣦⣌⡙⠻⢿⣿⣷⣦⣄⡉⠛⠿⠿⠛⢉⣠⣴⣾⣿⡿⠟⢋⣡⣴⣾⣿⣿⣿⣿⣿⠿⠛⢉⣠⣴⣾⣿⣿⣿⣿⡇
|
||||
⠀⠀⠉⠛⠿⣿⣿⣿⣿⣿⣷⣦⣄⡉⠛⠿⣿⣿⣿⣿⣿⣷⣦⣌⡙⠻⢿⣿⣷⡆⢰⣾⣿⡿⠟⢋⣡⣴⣾⣿⣿⣿⣿⣿⠿⠛⢉⣠⣴⣾⣿⣿⣿⣿⣿⠿⠛⠉
|
||||
⠀⠀⠀⠀⠀⠀⠉⠛⠿⣿⣿⣿⣿⣿⣷⣦⣄⡉⠛⠿⣿⣿⣿⣿⣿⣷⣦⣌⡙⠃⠘⢋⣡⣴⣾⣿⣿⣿⣿⣿⠿⠛⢉⣠⣴⣾⣿⣿⣿⣿⣿⠿⠛⠉
|
||||
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠛⠿⣿⣿⣿⣿⣿⣷⣦⣄⡉⠛⠿⣿⣿⣿⣿⣿⣷⣾⣿⣿⣿⣿⣿⠿⠛⢉⣠⣴⣾⣿⣿⣿⣿⣿⠿⠛⠉
|
||||
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠛⠿⣿⣿⣿⣿⣿⣷⣦⣄⡉⠛⠿⣿⣿⣿⣿⠿⠛⢉⣠⣴⣾⣿⣿⣿⣿⣿⠿⠛⠉
|
||||
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠛⠿⣿⣿⣿⣿⣿⣷⣦⣄⡉⢉⣠⣴⣾⣿⣿⣿⣿⣿⠿⠛⠉
|
||||
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠛⠿⣿⣿⣿⣿⡇⢸⣿⣿⣿⣿⠿⠛⠉
|
||||
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠛⠿⡇⢸⠿⠛⠉
|
||||
|
||||
__ _ _
|
||||
/ _|___ ___| |_ __ _ ___| | __
|
||||
| ||_ /____/ __| __/ _` |/ __| |/ /
|
||||
| _/ /_____\__ \ || (_| | (__| <
|
||||
|_|/___| |___/\__\__,_|\___|_|\_\
|
||||
|
||||
Neovim v0.12 configuration
|
||||
(C) Frank Zechert 2026
|
||||
]]
|
||||
|
||||
vim.pack.add({
|
||||
{ src = "https://github.com/nvim-tree/nvim-web-devicons" },
|
||||
{ src = "https://github.com/nvim-lualine/lualine.nvim" }
|
||||
})
|
||||
|
||||
local function expandtabs()
|
||||
if not vim.bo.expandtab then
|
||||
return string.format("%s %d", vim.g.ui.listchars.leadtab, vim.bo.tabstop)
|
||||
else
|
||||
local width = vim.bo.shiftwidth
|
||||
if width == 0 then
|
||||
width = vim.bo.tabstop
|
||||
end
|
||||
return string.format("%s %d", vim.g.ui.listchars.nbsp, width)
|
||||
end
|
||||
end
|
||||
|
||||
local function windownumber()
|
||||
return string.format("%s %s", vim.g.ui.symbols.window, vim.fn.winnr())
|
||||
end
|
||||
|
||||
local function treesitter_status()
|
||||
local ok, parser = pcall(vim.treesitter.get_parser, 0)
|
||||
if not ok or not parser then
|
||||
return "T"..vim.g.ui.symbols.not_overline
|
||||
else
|
||||
return "T"
|
||||
end
|
||||
end
|
||||
|
||||
local function lsp_status()
|
||||
local clients = vim.lsp.get_clients({bufnr = 0})
|
||||
if #clients == 0 then
|
||||
-- no LSP is attached
|
||||
return "L"..vim.g.ui.symbols.not_overline
|
||||
end
|
||||
|
||||
local lsp_names = {}
|
||||
for _, client in ipairs(clients) do
|
||||
local roots = {}
|
||||
if client.workspace_folders then
|
||||
for _, workspace_folder in ipairs(client.workspace_folders) do
|
||||
table.insert(roots, workspace_folder.name or workspace_folder.uri or "")
|
||||
end
|
||||
end
|
||||
local has_root = (roots and #roots > 0)
|
||||
local root_flag = has_root and "+R" or ""
|
||||
table.insert(lsp_names, string.format("%s%s", client.name, root_flag))
|
||||
end
|
||||
return string.format("L: %s", table.concat(lsp_names, ", "))
|
||||
end
|
||||
|
||||
|
||||
require('lualine').setup({
|
||||
options = {
|
||||
component_separators = vim.g.ui.symbols.component_separators,
|
||||
section_separators = vim.g.ui.symbols.section_separators,
|
||||
globalstatus = false,
|
||||
refresh = {
|
||||
refresh_time = 33, -- ~30 fps
|
||||
}
|
||||
},
|
||||
sections = {
|
||||
lualine_a = { "mode" },
|
||||
lualine_b = { "searchcount", "selectioncount" },
|
||||
lualine_c = {
|
||||
{ "filename", file_status = true, newfile_status = true, path = 1 },
|
||||
},
|
||||
lualine_x = {
|
||||
"encoding",
|
||||
{ "fileformat", icons_enabled = true, symbols = { unix = "LF", dos = "CRLF", mac = "CR" } },
|
||||
expandtabs,
|
||||
"filesize"
|
||||
},
|
||||
lualine_y = {},
|
||||
lualine_z = { "location", "progress" },
|
||||
},
|
||||
inactive_sections = {
|
||||
lualine_a = {},
|
||||
lualine_b = {},
|
||||
lualine_c = {
|
||||
{ "filename", file_status = true, newfile_status = true, path = 1 },
|
||||
},
|
||||
lualine_x = {
|
||||
"encoding",
|
||||
{ "fileformat", icons_enabled = true, symbols = { unix = "LF", dos = "CRLF", mac = "CR" } },
|
||||
expandtabs,
|
||||
"filesize",
|
||||
},
|
||||
lualine_y = {},
|
||||
lualine_z = { "location", "progress" },
|
||||
},
|
||||
tabline = {
|
||||
lualine_a = {
|
||||
{ "buffers", mode = 2, use_mode_colors = true },
|
||||
},
|
||||
lualine_b = {},
|
||||
lualine_c = {},
|
||||
lualine_x = {},
|
||||
lualine_y = {},
|
||||
lualine_z = {
|
||||
{ "tabs", mode = 0, use_mode_colors = true },
|
||||
},
|
||||
},
|
||||
winbar = {
|
||||
lualine_a = { windownumber },
|
||||
lualine_b = { "filename", "filetype" },
|
||||
lualine_c = { "diagnostics" },
|
||||
lualine_x = { treesitter_status, lsp_status },
|
||||
lualine_y = { "branch", "diff" },
|
||||
lualine_z = {},
|
||||
},
|
||||
inactive_winbar = {
|
||||
lualine_a = { windownumber },
|
||||
lualine_b = {},
|
||||
lualine_c = {},
|
||||
lualine_x = {},
|
||||
lualine_y = {},
|
||||
lualine_z = {},
|
||||
}
|
||||
|
||||
})
|
||||
Reference in New Issue
Block a user