repositories / dotfiles

dotfiles

bugabingas dorkfiles

owned by bugabinga

neovim: adds winbar plugin

4351bacfaec289cf91a28f5f40361ec3dd161341

Oliver Jan Krylow <oliver@bugabinga.net> ·

unsigned

Browse filesCompare with HEAD

Changed files (5)

neovim/init.lua

Modified
80 80 require 'bugabinga.terminal'
81 81 require 'bugabinga.textobjects'
82 82 require 'bugabinga.virtual_column'
83 +require 'bugabinga.winbar'
84 85 require 'bugabinga.incubator'

neovim/lua/bugabinga/nugu/init.lua

Modified
262 262 _.LspInlayHint { fg = content_minor, bg = _.Normal.bg }
263 263 _.LspSignatureActiveParameter = _.Debug
265 --- NeoTreeGitAdded File name when the git status is added.
266 -_.NeoTreeGitAdded = _.DiffAdd
267 --- NeoTreeGitConflict File name when the git status is conflict.
268 -_.NeoTreeGitConflict = _.DiffChange
269 --- NeoTreeGitDeleted File name when the git status is deleted.
270 -_.NeoTreeGitDeleted = _.DiffDelete
271 --- NeoTreeGitIgnored File name when the git status is ignored.
272 --- NeoTreeGitModified File name when the git status is modified.
273 -_.NeoTreeGitModified = _.DiffChange
274 --- NeoTreeGitUnstaged Used for git unstaged symbol.
275 -_.NeoTreeGitUnstaged = _.DiffChange
276 --- NeoTreeGitUntracked File name when the git status is untracked.
277 -_.NeoTreeGitUntracked = _.DiffChange
278 --- NeoTreeGitStaged Used for git staged symbol.
279 -_.NeoTreeGitStaged = _.DiffText
281 265 _.MiniHipatternsFixme { fg = ui_backdrop, bg = _.DiagnosticError.fg, bold = true, underline = true }
282 266 _.MiniHipatternsHack { fg = ui_backdrop, bg = _.DiagnosticWarn.fg, bold = true, underline = true }
283 267 _.MiniHipatternsTodo { fg = ui_backdrop, bg = _.DiagnosticHint.fg, bold = true, underline = true }

neovim/lua/bugabinga/winbar.lua

Added
new file mode 100644
1 +local puk = require 'std.puk'
2 +local ignored = require 'std.ignored'
3 +local icon = require 'std.icon'
5 +local function get_diagnostic_label(bufnr)
6 + local icons = {
7 + Error = icon.error,
8 + Warn = icon.warn,
9 + Info = icon.info,
10 + Hint = icon.hint,
11 + }
13 + local label = {}
14 + for severity, icon_txt in pairs(icons) do
15 + local n = #vim.diagnostic.get(bufnr, { severity = vim.diagnostic.severity[string.upper(severity)] })
16 + if n > 0 then
17 + table.insert(label, { icon_txt .. ' ' .. n .. ' ', group = 'DiagnosticSign' .. severity })
18 + end
19 + end
20 + return label
21 +end
23 +puk.defer 'incline' (function(incline)
24 + incline.setup {
25 + ignore = {
26 + filetypes = ignored.filetypes
27 + },
28 + debounce_threshold = { falling = 500, rising = 250 },
29 + highlight = {
30 + groups = {
31 + InclineNormal = { default = true, guifg = "NONE", guibg = "NONE" },
32 + InclineNormalNC = { default = true, guifg = "NONE", guibg = "NONE" },
33 + },
34 + },
35 + window = {
36 + placement = {
37 + horizontal = 'center',
38 + vertical = 'top'
39 + },
40 + padding = 2,
41 + margin = {
42 + horizontal = 0,
43 + vertical = 0,
44 + }
45 + },
46 + render = function(properties)
47 + local bufnr = properties.buf
48 + local focused = properties.focused
49 + local buffer_full_name = vim.api.nvim_buf_get_name(bufnr)
50 + local buffer_name = vim.fn.fnamemodify(buffer_full_name, ':t')
51 + local filename = (buffer_name and buffer_name ~= '') and buffer_name or '[scratch]'
52 + local diagnostics = get_diagnostic_label(bufnr)
53 + local highlight = focused and 'Normal' or 'NonText'
54 + local modified_highlight = vim.api.nvim_get_option_value("modified", { buf = bufnr }) and "Title" or highlight
55 + local filetype_icon, icon_highlight = MiniIcons.get('file', buffer_name) ---@diagnostic disable-line: undefined-global
57 + local buffer = {
58 + { filetype_icon, group = icon_highlight },
59 + { " " },
60 + { filename, group = modified_highlight },
61 + }
63 + if #diagnostics > 0 then
64 + table.insert(diagnostics, { "| ", group = highlight })
65 + end
66 + for _, segment in ipairs(buffer) do
67 + table.insert(diagnostics, segment)
68 + end
69 + return diagnostics
70 + end,
71 + }
72 +end)

neovim/lua/std/ignored.lua

Modified
13 13 'help',
14 14 'minipick',
15 15 'ivy',
16 + 'incline',
16 17 'lazy',
17 18 'man',
18 19 'neo-tree',

neovim/puk.plugins.nuon

Modified
302 302 master,
303 303 "84fe677aa940605ef248f36c0ea23561690c95eb",
305 - ]
305 + ],
307 + incline,
308 + github,
309 + "b0o/incline.nvim",
310 + main,
311 + "0fd2d5a27504dba7fdc507a53275f22c081fe640",
312 + null