REFACTOR: Minimized bar even more

This commit is contained in:
2026-10-10 00:59:03 -04:00
parent 5e8d29a82b
commit 1356ec1860
8 changed files with 264 additions and 389 deletions
@@ -51,4 +51,4 @@ vim.keymap.set('n', '<leader>xx', ':Trouble diagnostics toggle<cr>')
vim.keymap.set('n', '<leader>zz', function() vim.keymap.set('n', '<leader>zz', function()
Snacks.zen() Snacks.zen()
end) end)
vim.keymap.set('n', '<leader>mp', ':Vellum<cr>', { desc = 'Markdown preview' }) -- vim.keymap.set('n', '<leader>mp', ':Vellum<cr>', { desc = 'Markdown preview' })
@@ -39,7 +39,7 @@ vim.opt.wrapscan = true -- begin search from top of the file when nothng is foun
vim.opt.cursorline = true -- enable cursorline vim.opt.cursorline = true -- enable cursorline
vim.opt.cursorlineopt = { 'screenline', 'number' } -- cursorline look vim.opt.cursorlineopt = { 'screenline', 'number' } -- cursorline look
vim.opt.foldmethod = 'indent' vim.opt.foldmethod = 'indent'
vim.opt.foldcolumn = '1' vim.opt.foldcolumn = '0'
vim.opt.foldenable = false vim.opt.foldenable = false
vim.opt.shortmess = 'aFI' -- abbreviates messages and prevents file name being echoed when opened vim.opt.shortmess = 'aFI' -- abbreviates messages and prevents file name being echoed when opened
vim.opt.ignorecase = false -- ignore cases when searching vim.opt.ignorecase = false -- ignore cases when searching
@@ -48,7 +48,7 @@ vim.opt.smartindent = false -- smarter indentation
vim.opt.smarttab = true -- make tab behaviour smarter vim.opt.smarttab = true -- make tab behaviour smarter
vim.opt.laststatus = 3 vim.opt.laststatus = 3
vim.opt.showmode = false vim.opt.showmode = false
vim.opt.cmdheight = 0 -- vim.opt.cmdheight = 0
vim.opt.smoothscroll = true vim.opt.smoothscroll = true
vim.opt.spell = true vim.opt.spell = true
vim.diagnostic.config({ vim.diagnostic.config({
@@ -4,10 +4,7 @@ require('DarthMooMancer.plugins.kanso')
require('DarthMooMancer.plugins.mini-nvim') require('DarthMooMancer.plugins.mini-nvim')
require('DarthMooMancer.plugins.polydev') require('DarthMooMancer.plugins.polydev')
require('DarthMooMancer.plugins.treesitter') require('DarthMooMancer.plugins.treesitter')
require('DarthMooMancer.plugins.incline')
require('DarthMooMancer.plugins.mason') require('DarthMooMancer.plugins.mason')
require('DarthMooMancer.plugins.noice')
require('DarthMooMancer.plugins.snacks') require('DarthMooMancer.plugins.snacks')
require('DarthMooMancer.plugins.trouble') require('DarthMooMancer.plugins.trouble')
require('DarthMooMancer.plugins.conform') require('DarthMooMancer.plugins.conform')
require('DarthMooMancer.plugins.vellum')
@@ -22,14 +22,52 @@ require('incline').setup({
padding = 0, padding = 0,
margin = { horizontal = 0, vertical = 0 }, margin = { horizontal = 0, vertical = 0 },
}, },
ignore = {
floating_wins = false,
wintypes = function(winid, wintype)
-- Check if snacks.zen is active anywhere in this tabpage
for _, w in ipairs(vim.api.nvim_tabpage_list_wins(0)) do
if vim.w[w].snacks_main then
return true -- Hide from ALL windows during Zen mode
end
end
-- Default incline behavior (ignore non-normal windows)
return wintype ~= ''
end,
},
render = function(props) render = function(props)
-- 1. Count normal splits in the current tabpage
local wins = vim.api.nvim_tabpage_list_wins(0)
local normal_splits = 0
for _, win in ipairs(wins) do
-- Also check for snacks.zen here as an immediate guard
if vim.w[win].snacks_main then
return ''
end
local config = vim.api.nvim_win_get_config(win)
if config.relative == '' then
normal_splits = normal_splits + 1
end
end
-- Hide if 2 or fewer normal splits are open (requires 3+)
if normal_splits <= 2 then
return ''
end
-- 2. Build the visual statusline
local filename = local filename =
vim.fn.fnamemodify(vim.api.nvim_buf_get_name(props.buf), ':t') vim.fn.fnamemodify(vim.api.nvim_buf_get_name(props.buf), ':t')
if filename == '' then if filename == '' then
filename = '[No Name]' filename = '[No Name]'
end end
local ft_icon, ft_color = devicons.get_icon_color(filename) local ft_icon, ft_color = devicons.get_icon_color(filename)
local modified = vim.bo[props.buf].modified local modified = vim.bo[props.buf].modified
local res = { local res = {
ft_icon and { ft_icon and {
' ', ' ',
@@ -42,6 +80,7 @@ require('incline').setup({
{ filename, gui = modified and 'bold,italic' or 'bold' }, { filename, gui = modified and 'bold,italic' or 'bold' },
guibg = 'none', guibg = 'none',
} }
if props.focused then if props.focused then
for _, item in ipairs(navic.get_data(props.buf) or {}) do for _, item in ipairs(navic.get_data(props.buf) or {}) do
table.insert(res, { table.insert(res, {
@@ -51,6 +90,7 @@ require('incline').setup({
}) })
end end
end end
table.insert(res, ' ') table.insert(res, ' ')
return res return res
end, end,
@@ -0,0 +1,25 @@
vim.pack.add({
'https://github.com/sphamba/smear-cursor.nvim',
})
-- require('smear_cursor').setup({
-- matrix_pixel_threshold = 0.5,
-- stiffness = 0.8, -- 0.6 [0, 1]
-- trailing_stiffness = 0.6, -- 0.45 [0, 1]
-- stiffness_insert_mode = 0.7, -- 0.5 [0, 1]
-- trailing_stiffness_insert_mode = 0.7, -- 0.5 [0, 1]
-- damping = 0.95, -- 0.85 [0, 1]
-- damping_insert_mode = 0.95, -- 0.9 [0, 1]
-- distance_stop_animating = 0.5, -- 0.1 > 0
-- time_interval = 7,
-- })
--
require('smear_cursor').setup({
stiffness = 0.8, -- 0.6 [0, 1]
trailing_stiffness = 0.6, -- 0.45 [0, 1]
stiffness_insert_mode = 0.7, -- 0.5 [0, 1]
trailing_stiffness_insert_mode = 0.7, -- 0.5 [0, 1]
damping = 0.95, -- 0.85 [0, 1]
damping_insert_mode = 0.95, -- 0.9 [0, 1]
distance_stop_animating = 0.5, -- 0.1 > 0
})
@@ -6,6 +6,28 @@ require('snacks').setup({
}, },
animate = { enabled = true }, animate = { enabled = true },
input = { enabled = true }, input = { enabled = true },
-- scroll = {
-- enabled = true,
-- animate = {
-- -- duration = { step = 5, total = 120 },
-- duration = { step = 2, total = 60 },
-- easing = 'linear',
-- },
-- -- faster animation when repeating scroll after delay
-- animate_repeat = {
-- -- delay = 100, -- delay in ms before using the repeat animation
-- delay = 40, -- delay in ms before using the repeat animation
-- -- duration = { step = 2, total = 40 },
-- duration = { step = 1, total = 20 },
-- easing = 'linear',
-- },
-- -- what buffers to animate
-- filter = function(buf)
-- return vim.g.snacks_scroll ~= false
-- and vim.b[buf].snacks_scroll ~= false
-- and vim.bo[buf].buftype ~= 'terminal'
-- end,
-- },
picker = { picker = {
enabled = true, enabled = true,
prompt = '', prompt = '',
@@ -29,7 +51,7 @@ require('snacks').setup({
toggles = { toggles = {
dim = false, dim = false,
diagnostics = true, diagnostics = true,
inlay_hints = true, inlay_hints = false,
}, },
}, },
}) })
@@ -1,416 +1,203 @@
local function derive_hl(name, opts) local has_devicons, devicons = pcall(require, 'nvim-web-devicons')
local base = opts.base and vim.api.nvim_get_hl(0, { name = opts.base }) local uv, api, b = vim.uv or vim.loop, vim.api, vim.b
or {} local SEV = vim.diagnostic.severity
local fg = opts.fg and vim.api.nvim_get_hl(0, { name = opts.fg }) or {}
local bg = opts.bg and vim.api.nvim_get_hl(0, { name = opts.bg }) or {} local function setup_highlights()
vim.api.nvim_set_hl( local bg = api.nvim_get_hl(0, { name = 'StatusLine' }).bg or 'none'
0,
name, local function set(name, link, bold)
{ fg = fg.fg or base.fg, bg = bg.bg or base.bg, bold = opts.bold } local hl = api.nvim_get_hl(0, { name = link, link = false })
) api.nvim_set_hl(0, name, { fg = hl.fg, bg = bg, bold = bold or false })
end
set('StatusLineFilename', 'Normal', true)
set('StatusLineMod', 'WarningMsg', true)
set('StatusLineRO', 'ErrorMsg', true)
set('StatusDiagError', 'DiagnosticError', true)
set('StatusDiagWarn', 'DiagnosticWarn', false)
set('StatusDiagHint', 'DiagnosticHint', false)
set('StatusLspSpinner', 'DiagnosticWarn', true)
set('StatusLspLoading', 'DiagnosticInfo', false)
set('StatusLspReady', 'Comment', false)
end end
local function setup_statusline_highlights() api.nvim_create_autocmd({ 'ColorScheme', 'FocusGained', 'VimEnter' }, {
local st = vim.api.nvim_get_hl(0, { name = 'StatusLine' }) callback = function()
for name, link in pairs({ setup_highlights()
Normal = 'Type', vim.cmd('redrawstatus')
Insert = 'String', end,
Visual = 'Statement', })
Command = 'PreProc', setup_highlights()
Replace = 'WarningMsg',
Terminal = 'Special', local function update_file_info(buf)
}) do local path = api.nvim_buf_get_name(buf)
local c = vim.api.nvim_get_hl(0, { name = link }) if path == '' then
vim.api.nvim_set_hl( b[buf].stl_file_info = ' %#StatusLineFilename#[No Name]%*'
0, return
'StatusMode' .. name, end
{ bg = c.fg, fg = st.bg or '#191724', bold = true }
local fname = path:match('([^/\\]+)$') or path
local icon = ''
if has_devicons then
local ic, hl = devicons.get_icon(
fname,
path:match('%.([^./\\]+)$'),
{ default = true }
) )
end if ic then
icon = '%#' .. hl .. '#' .. ic .. ' %*'
derive_hl('StatusGit', { base = 'CursorLine', fg = 'Normal' })
derive_hl('StatusCursor', { base = 'CursorLine', fg = 'Normal' })
derive_hl(
'StatusLspWorking',
{ base = 'StatusLine', fg = 'DiagnosticInfo' }
)
derive_hl('StatusLspReady', { base = 'StatusLine', fg = 'Constant' })
derive_hl('StatusLspNone', { base = 'StatusLine', fg = 'NonText' })
derive_hl(
'StatusDiagError',
{ base = 'StatusLine', fg = 'DiagnosticError' }
)
derive_hl('StatusDiagWarn', { base = 'StatusLine', fg = 'DiagnosticWarn' })
derive_hl('StatusDiagHint', { base = 'StatusLine', fg = 'DiagnosticHint' })
derive_hl('StatusCursor', { base = 'CursorLine', fg = 'Normal' })
derive_hl('StatusGitAdded', { base = 'StatusLine', fg = 'DiagnosticOk' })
derive_hl(
'StatusGitRemoved',
{ base = 'StatusLine', fg = 'DiagnosticError' }
)
derive_hl('StatusRecording', { base = 'StatusLine', fg = 'WarningMsg' })
end
vim.api.nvim_create_autocmd('ColorScheme', {
callback = setup_statusline_highlights,
})
setup_statusline_highlights()
local modes = {
n = { ' NORM ', 'StatusModeNormal' },
i = { ' INS ', 'StatusModeInsert' },
v = { ' VIS ', 'StatusModeVisual' },
V = { ' V-LINE ', 'StatusModeVisual' },
['\22'] = { ' V-BLK ', 'StatusModeVisual' },
['\19'] = { ' V-BLK ', 'StatusModeVisual' },
s = { ' VIS ', 'StatusModeVisual' },
S = { ' V-LINE ', 'StatusModeVisual' },
R = { ' REPL ', 'StatusModeReplace' },
c = { ' CMD ', 'StatusModeCommand' },
r = { ' PROMPT ', 'StatusModeCommand' },
t = { ' TERM ', 'StatusModeTerminal' },
['!'] = { ' SHELL ', 'StatusModeCommand' },
}
local mode_statusline =
{ default = { '%#StatusModeNormal# ?? %*', 'StatusModeNormal' } }
for k, v in pairs(modes) do
mode_statusline[k] = { '%#' .. v[2] .. '#' .. v[1] .. '%*', v[2] }
end
local redraw_scheduled = false
local function schedule_redraw()
if redraw_scheduled then
return
end
redraw_scheduled = true
vim.schedule(function()
redraw_scheduled = false
vim.cmd.redrawstatus()
end)
end
local function refresh_status(buf)
local b = vim.b[buf]
local l, r = '', ''
if b.git_branch and b.git_branch ~= '' then
l = l .. '%#StatusGit# ' .. b.git_branch .. ' %*'
end
if b.git_diff then
if b.git_diff.added > 0 then
l = l .. '%#StatusGitAdded# +' .. b.git_diff.added .. '%*'
end
if b.git_diff.removed > 0 then
l = l .. '%#StatusGitRemoved# -' .. b.git_diff.removed .. '%*'
end end
end end
if b.recording then b[buf].stl_file_info = ' '
r = r .. '%#StatusRecording# ' .. b.recording .. ' %*' .. icon
end .. '%#StatusLineFilename#'
if b.diag_str then .. fname
r = r .. b.diag_str .. '%*'
end
if b.lsp_icon and b.lsp_icon ~= '' then
r = r
.. '%#'
.. b.lsp_hl
.. '#'
.. b.lsp_icon
.. (b.lsp_name or '')
.. ' %*'
end
b.status_left, b.status_right = l, r
end end
local lsp_states = { local function update_lsp_clients(buf)
none = { '', 'StatusLspNone' }, local clients = vim.lsp.get_clients({ bufnr = buf })
starting = { '', 'StatusLspNone' },
working = { ' 󰄬 ', 'StatusLspWorking' },
ready = { ' 󰄭 ', 'StatusLspReady' },
}
local active_progress = {}
local function refresh_lsp(buf)
local state, clients = 'ready', vim.lsp.get_clients({ bufnr = buf })
if #clients == 0 then if #clients == 0 then
state, vim.b[buf].lsp_name = 'none', '' b[buf].stl_lsp_ready = ''
else
local names = {}
for _, c in ipairs(clients) do
names[#names + 1] = c.name
local p = active_progress[c.id]
if p and p.is_starting and state ~= 'working' then
state = 'starting'
elseif p and next(p.tokens) then
state = 'working'
end
end
vim.b[buf].lsp_name = table.concat(names, '/')
end
if vim.b[buf].lsp_state == state then
return return
end end
vim.b[buf].lsp_state = state
vim.b[buf].lsp_icon, vim.b[buf].lsp_hl = local names = {}
lsp_states[state][1], lsp_states[state][2] for i = 1, #clients do
refresh_status(buf) names[i] = clients[i].name
schedule_redraw() end
b[buf].stl_lsp_ready = '%#StatusLspReady#󰄭 '
.. table.concat(names, '/')
.. '%* '
end end
vim.api.nvim_create_autocmd({ 'LspAttach', 'LspDetach' }, { local active_tokens = {}
callback = function(ev) local spinner_frames =
local cid = ev.data.client_id { '⠋', '⠙', '⠹', '⠸', '⠼', '⠴', '⠦', '⠧', '⠇', '⠏' }
if ev.event == 'LspAttach' then local current_job, spinner_timer = nil, nil
local p = active_progress[cid] or { tokens = {} }
active_progress[cid] = p local function sync_spinner()
if not p.is_starting and not next(p.tokens) then current_job = nil
p.is_starting = true for _, tokens in pairs(active_tokens) do
p.timer_id = (p.timer_id or 0) + 1 for _, msg in pairs(tokens) do
local current_id = p.timer_id current_job = msg
vim.defer_fn(function() break
local curr = active_progress[cid]
if
curr
and curr.is_starting
and curr.timer_id == current_id
then
curr.is_starting = nil
if vim.api.nvim_buf_is_valid(ev.buf) then
refresh_lsp(ev.buf)
end
end
end, 500) -- 500ms grace period to wait for LspProgress
end
elseif ev.event == 'LspDetach' then
active_progress[cid] = nil
end end
refresh_lsp(ev.buf) if current_job then
break
end
end
if current_job and not spinner_timer then
spinner_timer = uv.new_timer()
spinner_timer:start(
0,
100,
vim.schedule_wrap(function()
if current_job then
vim.cmd('redrawstatus')
elseif spinner_timer then
spinner_timer:stop()
spinner_timer:close()
spinner_timer = nil
end
end)
)
elseif not current_job and spinner_timer then
spinner_timer:stop()
spinner_timer:close()
spinner_timer = nil
vim.cmd('redrawstatus')
end
end
local group = api.nvim_create_augroup('MinimalStatusline', { clear = true })
api.nvim_create_autocmd({ 'BufEnter', 'BufFilePost' }, {
group = group,
callback = function(ev)
update_file_info(ev.buf)
update_lsp_clients(ev.buf)
end, end,
}) })
vim.api.nvim_create_autocmd('LspProgress', { api.nvim_create_autocmd('DiagnosticChanged', {
group = group,
callback = function(ev) callback = function(ev)
local cid = ev.data.client_id if ev.buf == api.nvim_get_current_buf() then
local p = active_progress[cid] or { tokens = {} } vim.cmd('redrawstatus')
active_progress[cid] = p end
end,
})
if p.is_starting then api.nvim_create_autocmd({ 'LspAttach', 'LspDetach' }, {
p.is_starting = nil group = group,
p.timer_id = (p.timer_id or 0) + 1 -- Invalidate pending start timer safely callback = function(ev)
if ev.event == 'LspDetach' then
active_tokens[ev.data.client_id] = nil
sync_spinner()
end
update_lsp_clients(ev.buf)
vim.cmd('redrawstatus')
end,
})
api.nvim_create_autocmd('LspProgress', {
group = group,
callback = function(ev)
local val = ev.data.params.value
if type(val) ~= 'table' then
return
end end
local val = type(ev.data.params.value) == 'table' local client_id = ev.data.client_id
and ev.data.params.value local token = ev.data.params.token or 'default'
or {} active_tokens[client_id] = active_tokens[client_id] or {}
local kind = val.kind or ev.match
local token = ev.data.params.token or 'fallback'
if kind == 'begin' or (kind == 'report' and val.percentage ~= 100) then if
p.tokens[token] = true val.kind == 'end'
elseif or (val.kind == 'report' and val.percentage == 100)
kind == 'end' or (kind == 'report' and val.percentage == 100)
then then
p.tokens[token] = nil active_tokens[client_id][token] = nil
end
local client = vim.lsp.get_client_by_id(ev.data.client_id)
if client then
for _, win in ipairs(vim.api.nvim_list_wins()) do
local buf = vim.api.nvim_win_get_buf(win)
if client.attached_buffers[buf] then
refresh_lsp(buf)
end
end
end
end,
})
local BRANCH_ICON = ''
local branch_jobs = {}
local diff_jobs = {}
local git_root_cache = {}
local function get_git_root(buf, file)
local dir = vim.fs.dirname(file)
if git_root_cache[dir] ~= nil then
return git_root_cache[dir]
end
local root = vim.fs.root(buf, '.git') or dir
git_root_cache[dir] = root
return root
end
local function refresh_branch(buf)
local file = vim.api.nvim_buf_get_name(buf)
if file == '' or vim.bo[buf].buftype ~= '' then
vim.b[buf].git_branch = ''
return
end
local cwd = get_git_root(buf, file)
if branch_jobs[buf] then
branch_jobs[buf]:kill(9)
end
branch_jobs[buf] = vim.system(
{ 'git', 'branch', '--show-current' },
{ text = true, cwd = cwd },
vim.schedule_wrap(function(out)
branch_jobs[buf] = nil
if not vim.api.nvim_buf_is_valid(buf) then
return
end
local branch = (out.code == 0 and out.stdout or ''):gsub('%s+', '')
vim.b[buf].git_branch = branch ~= '' and (BRANCH_ICON .. branch)
or ''
refresh_status(buf)
schedule_redraw()
end)
)
end
local function refresh_diff(buf, force)
local file = vim.api.nvim_buf_get_name(buf)
if file == '' or vim.bo[buf].buftype ~= '' then
vim.b[buf].git_diff = nil
return
end
if
not force
and vim.b[buf].git_diff_fetched
and not vim.bo[buf].modified
then
return
end
local cwd = get_git_root(buf, file)
if diff_jobs[buf] then
diff_jobs[buf]:kill(9)
end
diff_jobs[buf] = vim.system(
{ 'git', 'diff', '--numstat', 'HEAD', '--', file },
{ text = true, cwd = cwd },
vim.schedule_wrap(function(out)
diff_jobs[buf] = nil
if not vim.api.nvim_buf_is_valid(buf) then
return
end
vim.b[buf].git_diff_fetched = true
if out.code ~= 0 or out.stdout == '' then
vim.b[buf].git_diff = nil
else
local added, removed = out.stdout:match('(%d+)%s+(%d+)')
if added and removed then
vim.b[buf].git_diff = {
added = tonumber(added) or 0,
removed = tonumber(removed) or 0,
}
else
vim.b[buf].git_diff = nil
end
end
refresh_status(buf)
schedule_redraw()
end)
)
end
local function refresh_diag(buf)
local c, s = vim.diagnostic.count(buf), vim.diagnostic.severity
local e, w, h = c[s.ERROR] or 0, c[s.WARN] or 0, c[s.HINT] or 0
vim.b[buf].diag_str = (e > 0 and '%#StatusDiagError# E' .. e .. ' %*' or '')
.. (w > 0 and '%#StatusDiagWarn# W' .. w .. ' %*' or '')
.. (h > 0 and '%#StatusDiagHint# H' .. h .. ' %*' or '')
refresh_status(buf)
schedule_redraw()
end
local grp = vim.api.nvim_create_augroup('StatuslineEvents', { clear = true })
local current_mode = 'n'
vim.api.nvim_create_autocmd('ModeChanged', {
group = grp,
pattern = '*:*',
callback = function()
current_mode = vim.api.nvim_get_mode().mode
schedule_redraw()
end,
})
vim.api.nvim_create_autocmd({ 'BufEnter', 'BufNewFile' }, {
group = grp,
callback = function(ev)
if vim.bo[ev.buf].buftype == '' then
refresh_branch(ev.buf)
refresh_diff(ev.buf, false)
end
refresh_lsp(ev.buf)
refresh_diag(ev.buf)
end,
})
vim.api.nvim_create_autocmd('FocusGained', {
group = grp,
callback = function()
local buf = vim.api.nvim_get_current_buf()
if vim.bo[buf].buftype == '' then
refresh_branch(buf)
end
end,
})
vim.api.nvim_create_autocmd('BufWritePost', {
group = grp,
callback = function(ev)
refresh_diff(ev.buf, true)
end,
})
vim.api.nvim_create_autocmd('DiagnosticChanged', {
group = grp,
callback = function(ev)
refresh_diag(ev.buf)
end,
})
vim.api.nvim_create_autocmd({ 'RecordingEnter', 'RecordingLeave' }, {
group = grp,
callback = function(ev)
if ev.event == 'RecordingEnter' then
vim.b[ev.buf].recording = 'Rec @' .. vim.fn.reg_recording()
else else
vim.b[ev.buf].recording = nil local msg = (val.title and val.title ~= '' and val.title)
or val.message
or 'Loading...'
if val.title and val.message and val.message ~= '' then
msg = val.title .. ' ' .. val.message
end
active_tokens[client_id][token] = msg
end end
refresh_status(ev.buf)
sync_spinner()
end, end,
}) })
function _G.__statusline() function MinimalStatusline()
local current_win = vim.api.nvim_get_current_win() local cur_buf = api.nvim_get_current_buf()
local win_id = vim.g.statusline_winid or current_win local vars = b[cur_buf]
local is_active = win_id == current_win
local buf = vim.api.nvim_win_get_buf(win_id)
local b = vim.b[buf]
if not is_active then local c = vim.diagnostic.count(cur_buf)
return '%#StatusLineNC# ' local e, w, h = c[SEV.ERROR] or 0, c[SEV.WARN] or 0, c[SEV.HINT] or 0
.. (b.status_left or '') local diags = ''
.. '%=' if e > 0 or w > 0 or h > 0 then
.. (b.status_right or '') diags = (e > 0 and ('%#StatusDiagError#E' .. e .. '%* ') or '')
.. ' %#StatusLineNC# %l:%-2c ' .. (w > 0 and ('%#StatusDiagWarn#W' .. w .. '%* ') or '')
.. (h > 0 and ('%#StatusDiagHint#H' .. h .. '%*') or '')
end end
local m = current_mode local right = current_job
local key = (m == '\22' or m == '\19') and m or m:sub(1, 1) and ('%#StatusLspSpinner#' .. spinner_frames[(math.floor(
local md = mode_statusline[key] or mode_statusline.default uv.now() / 100
) % 10) + 1] .. '%* %#StatusLspLoading#' .. current_job .. '%* ')
or (vars.stl_lsp_ready or '')
return md[1] return (vars.stl_file_info or '')
.. (b.status_left or '') .. '%#StatusLineMod#%m%*%#StatusLineRO#%r%* %='
.. diags
.. '%=' .. '%='
.. (b.status_right or '') .. right
.. '%#StatusCursor# %l:%-2c %#'
.. md[2]
.. '# %p%% %*'
end end
vim.o.statusline = '%!v:lua.__statusline()' vim.opt.laststatus = 3
vim.opt.statusline = '%!v:lua.MinimalStatusline()'
+4
View File
@@ -74,6 +74,10 @@
"rev": "2b30e36fade3272081f7166bc0ec614b0b7da1c9", "rev": "2b30e36fade3272081f7166bc0ec614b0b7da1c9",
"src": "https://git.moomancer.xyz/DarthMooMancer/polydev.git" "src": "https://git.moomancer.xyz/DarthMooMancer/polydev.git"
}, },
"smear-cursor.nvim": {
"rev": "f6cb57c342268177f719acc3968b9d8de3ecc969",
"src": "https://github.com/sphamba/smear-cursor.nvim"
},
"snacks.nvim": { "snacks.nvim": {
"rev": "882c996cf28183f4d63640de0b4c02ec886d01f2", "rev": "882c996cf28183f4d63640de0b4c02ec886d01f2",
"src": "https://github.com/folke/snacks.nvim" "src": "https://github.com/folke/snacks.nvim"