repositories / dotfiles

dotfiles

bugabingas dorkfiles

owned by bugabinga

Merge branch 'trunk' of https://github.com/bugabinga/dotfiles into trunk

67154c32f0927e5fbcd19d5e3ed85d18abb04fdf

Oliver Jan Krylow <oliver@bugabinga.net> ·

unsigned

Browse filesCompare with HEAD

Changed files (25)

+1042 / −141 text lines · 1 binary (striped old/new sizes in 64-byte units, not churn) · lines and sizes scale separately

Diff layout

fedora.symlinks

Modified

+3 / −0 text lines

7979fonts
8080~/.local/share/fonts
82neovide
83~/.config/neovide

neovide/config.toml

Added
new file mode 100644

+39 / −0 text lines

1fork = true
2frame = "none"
3maximized = true
4tabs = true
5theme = "auto"
6wsl = true
7
8[font]
9size = 15.0
10edging = "supixelantialias"
11hinting = "none"
13[[font.normal]]
14family = "Cousine"
15style = "Regular"
16[[font.normal]]
17family = "Symbols Nerd Font Mono"
18style = "Regular"
20[[font.bold]]
21family = "Fantasque Sans Mono"
22style = "Bold"
23[[font.bold]]
24family = "Symbols Nerd Font Mono"
25style = "Bold"
27[[font.italic]]
28family = "Victor Mono"
29style = "Oblique"
30[[font.italic]]
31family = "Symbols Nerd Font Mono"
32style = "Oblique"
34[[font.bold_italic]]
35family = "Victor Mono"
36style = "Bold Italic"
37[[font.bold_italic]]
38family = "Symbols Nerd Font Mono"
39style = "Bold Italic"

neovim/README.md

Modified

+3 / −6 text lines

3939# todo
41* figure out desirable cmp key maps
4142* try loading lsp async for better startup perf
42* check out vim-dadbod for sql workflows
4343* navic highlights do not fit winbar
44* add nu-check to nvim-lint
45* add nu lsp
4446* make highlights more visible when expanding snippets
4547* cursor restore position on (session?) load jumps one location to somewhere
4648 after correct location
4749* check out `vim.snippet`
4850* use `vim.base64` in wezterm plugin
4951* integrate language tool?
50* refactor mark.lua
5152* adapt config to respect `vim.g.nerdfont` (std.constants?)
5253* Do I want multiple LSPs per buffer?
5354 In case of markdown and text it seems useful, for code it seems like a
5455 headache...
55* use ltex-ls for markdown, code comments and commit messages
5656* flesh out 'const.lua', move to std?
5757* nvim spell for camel case words
58* add nu-check to nvim-lint
5958* create skeleton-plugin for default file content based on file type
6059 (BufNewFile?)
6160* make lsp config extensible, so that plugin configs can hook into it (e.g.
6261 on_attach)
63* split parts of config into plugins
6462* add support for Java multi line string in autopairs
65* try Termdebug with gdb

neovim/lazy-lock.json

Modified

+3 / −4 text lines

11{
22 "Comment.nvim": { "branch": "master", "commit": "e51f2b142d88bb666dcaa77d93a07f4b419aca70" },
33 "LuaSnip": { "branch": "master", "commit": "03c8e67eb7293c404845b3982db895d59c0d1538" },
4 "actions-preview.nvim": { "branch": "master", "commit": "9f52a01c374318e91337697ebed51c6fae57f8a4" },
54 "better-escape.nvim": { "branch": "master", "commit": "bb197e51a91a635deb88630813c3bfc284413697" },
65 "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
76 "cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" },
1413 "dressing.nvim": { "branch": "master", "commit": "c5775a888adbc50652cb370073fcfec963eca93e" },
1514 "flash.nvim": { "branch": "main", "commit": "7bb4a9c75d1e20cd24185afedeaa11681829ba23" },
1615 "glow.nvim": { "branch": "main", "commit": "238070a686c1da3bccccf1079700eb4b5e19aea4" },
16 "heirline.nvim": { "branch": "master", "commit": "0d797435e54645a5f98bad7ad6046aac1ef95c1e" },
1717 "indent-blankline.nvim": { "branch": "master", "commit": "3fe94b8034dd5241cb882bb73847303b58857ecf" },
1818 "lazy.nvim": { "branch": "main", "commit": "48b52b5cfcf8f88ed0aff8fde573a5cc20b1306d" },
19 "lazydev.nvim": { "branch": "main", "commit": "491452cf1ca6f029e90ad0d0368848fac717c6d2" },
2019 "lspkind.nvim": { "branch": "master", "commit": "cff4ae321a91ee3473a92ea1a8c637e3a9510aec" },
21 "luvit-meta": { "branch": "main", "commit": "ce76f6f6cdc9201523a5875a4471dcfe0186eb60" },
2220 "mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" },
2321 "mini.bracketed": { "branch": "main", "commit": "833d66df6e0588222312a963780c6ec42ed7437d" },
2422 "mini.bufremove": { "branch": "main", "commit": "1ee294a97e091d3cf967974df622c0d887890dc2" },
23 "mini.diff": { "branch": "main", "commit": "24d46798be8a358d38d3adc92c7ebcbb2d6f67e0" },
2524 "mkdir.nvim": { "branch": "main", "commit": "c55d1dee4f099528a1853b28bb28caa802eba217" },
2625 "neogen": { "branch": "main", "commit": "e932ba918b56723436b77aa3efb844a11b2851ab" },
2726 "nrpattern.nvim": { "branch": "master", "commit": "f862ce687761078ef3155688151c55f69d28453e" },
4948 "qf_helper.nvim": { "branch": "master", "commit": "fa3c2f3f2706e2c9984409c9c14b5993302ddfa7" },
5049 "schemastore.nvim": { "branch": "main", "commit": "bfe74baf72ca8964a211286fed864f30c672f19b" },
5150 "specs.nvim": { "branch": "main", "commit": "8a108c8b37dec1b184a1d3d76c6cf867bfbe9636" },
52 "speedtyper.nvim": { "branch": "main", "commit": "d73b3d2bdd574dd9c2e39e3558a4fe26f081d885" },
5351 "ssr.nvim": { "branch": "main", "commit": "7c95cfa5836508f08ae833a4b31d2ed265560f64" },
5452 "substitute.nvim": { "branch": "main", "commit": "97f49d16f8eea7967d41db4f657dd63af53eeba1" },
5553 "telescope-fzf-native.nvim": { "branch": "main", "commit": "cf48d4dfce44e0b9a2e19a008d6ec6ea6f01a83b" },
5856 "telescope.nvim": { "branch": "master", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" },
5957 "text-case.nvim": { "branch": "main", "commit": "e898cfd46fa6cde0e83abb624a16e67d2ffc6457" },
6058 "todo-comments.nvim": { "branch": "main", "commit": "313b04e5b02d29ab9275c9295ff5e2b73921b0eb" },
59 "tree-sitter-nu": { "branch": "main", "commit": "91ada3c0bed7d2963f6bbe2a57d68d77e67c5f07" },
6160 "treesj": { "branch": "main", "commit": "0d81326b5afd36babe7dd480aabbb0b05f33e688" },
6261 "twilight.nvim": { "branch": "main", "commit": "1584c0b0a979b71fd86b18d302ba84e9aba85b1b" },
6362 "venn.nvim": { "branch": "main", "commit": "b09c2f36ddf70b498281845109bedcf08a7e0de0" },

neovim/lua/bugabinga/options/ui.lua

Modified

+7 / −4 text lines

124124vim.opt.smoothscroll = true
126126-- cursor
127vim.opt.guicursor = 'n-v-c-sm:block-Cursor,i-ci-ve:ver25-blinkon250,r-cr:hor20,o:hor50'
127-- vim.opt.guicursor = 'n-v-c-sm:block-Cursor,i-ci-ve:ver25-blinkon250,r-cr:hor20,o:hor50'
129129-- font
130vim.opt.guifont = 'Cousine,Symbols Nerd Font Mono:h15:#e-subpixelantialias:#h-none'
130-- vim.opt.guifont = 'Cousine,Symbols Nerd Font Mono:h15:#e-subpixelantialias:#h-none'
132132-- neovide only options
133133if vim.g.neovide then
134 -- vim.g.neovide_profiler = false
134 vim.g.neovide_profiler = false
135135 -- interpret all touch events as scroll events
136136 vim.g.neovide_touch_deadzone = 0.0
137137 -- after this timeout, start a visual selection
138 vim.g.neovide_underline_stroke_scale = 2.5
138139 vim.g.neovide_touch_drag_timeout = 0.69
139 vim.g.neovide_padding_top = 0
140 vim.g.neovide_padding_top = 8
140141 vim.g.neovide_padding_left = 8
141142 vim.g.neovide_padding_bottom = 0
142143 vim.g.neovide_padding_right = 0
143144 vim.g.neovide_hide_mouse_when_typing = true
144145 vim.g.neovide_refresh_rate_idle = 5
146 vim.g.neovide_theme = 'auto'
147 vim.g.experimental_layer_grouping = true
145148end

neovim/lua/bugabinga/plugins/actions-preview.lua

Deleted
deleted file mode 100644

+0 / −27 text lines

1local map = require 'std.map'
2
3map.normal.visual {
4 description = 'Open Code Actions Preview...',
5 category = 'lsp',
6 keys = '<leader>la',
7 command = function () require 'actions-preview'.code_actions() end,
8}
9
10return {
11 'aznhe21/actions-preview.nvim',
12 opts = {
13 telescope = {
14 sorting_strategy = 'ascending',
15 layout_strategy = 'vertical',
16 layout_config = {
17 width = 0.69,
18 height = 0.42,
19 prompt_position = 'top',
20 preview_cutoff = 21,
21 preview_height = function ( _, _, max_lines )
22 return max_lines - 16
23 end,
24 },
25 },
26 },
27}

neovim/lua/bugabinga/plugins/autopairs.lua

Modified

+2 / −0 text lines

55 event = 'InsertEnter',
66 opts = {
77 disable_filetype = ignored.filetypes,
8 check_ts = true,
9 enable_check_bracket_line = true,
810 },
911}

neovim/lua/bugabinga/plugins/comment.lua

Modified

+3 / −2 text lines

1return { {
1return {
22 'numToStr/Comment.nvim',
33 version = '0.*',
4 lazy = false,
45 keys = {
56 { 'gc', mode = { 'n', 'v', }, desc = 'Comment toggle linewise', },
67 { 'gb', mode = { 'n', 'v', }, desc = 'Comment toggle blockwise', },
1213 local commentstring_avail, commentstring = pcall( require, 'ts_context_commentstring.integrations.comment_nvim' )
1314 return commentstring_avail and commentstring and { pre_hook = commentstring.create_pre_hook(), } or {}
1415 end,
15}, }
16}

neovim/lua/bugabinga/plugins/commentstring.lua

Modified

+0 / −1 text lines

11return {
22 'JoosepAlviste/nvim-ts-context-commentstring',
3 lazy = false,
43 init = function ()
54 vim.g.skip_ts_context_commentstring_module = true
65 end,

neovim/lua/bugabinga/plugins/conform.lua

Modified

+2 / −4 text lines

1717 command = format,
20user_command.Format
21'Format the current buffer' (
22 format
23 )
20user_command.Format 'Format the current buffer' ( format )
2522return {
2623 'stevearc/conform.nvim',
3330 toml = { 'taplo', },
3431 sh = { 'shfmt', },
3532 just = { 'just', },
33 nu = { 'nufmt', },
3634 zig = { 'zigfmt', },
3735 -- Use the "*" file type to run formatters on all file types.
3836 ['*'] = { 'injected', 'typos', },

neovim/lua/bugabinga/plugins/heirline.lua

Added
new file mode 100644

+816 / −0 text lines

1---@diagnostic disable: param-type-mismatch
2local icon = require 'std.icon'
3local auto = require 'std.auto'
4local ignored = require 'std.ignored'
5
6local NEW_FILE = '~untitled~'
7
8return {
9 {
10 'rebelot/heirline.nvim',
11 version = '1.*',
12 event = 'VeryLazy',
13 dependencies = {
14 'nvim-tree/nvim-web-devicons',
15 { 'echasnovski/mini.diff', lazy = true, },
16 { 'SmiteshP/nvim-navic', lazy = true, },
17 },
18 config = function ()
19 local heirline = require 'heirline'
20 local conditions = require 'heirline.conditions'
21 local utils = require 'heirline.utils'
23 local nugu = require 'bugabinga.nugu.palette'
24 heirline.load_colors( nugu )
26 auto 'reload_heirline_colors' {
27 description = 'Reload dark/light nugu colors for Heirline',
28 events = 'ColorScheme',
29 command = function ()
30 utils.on_colorscheme( nugu )
31 end,
32 }
34 local vi_mode = {
35 init = function ( self )
36 self.mode = vim.fn.mode( 1 ) -- :h mode()
37 end,
39 static = {
40 mode_names = {
41 n = icon.normal,
42 no = icon.normal .. '?',
43 nov = icon.normal .. '?',
44 noV = icon.normal .. '?',
45 ['no\22'] = icon.normal .. '?',
46 niI = icon.normal .. 'i',
47 niR = icon.normal .. 'r',
48 niV = icon.normal .. 'v',
49 nt = icon.normal .. 't',
50 v = icon.visual,
51 vs = icon.visual .. 's',
52 V = icon.visual .. '_',
53 Vs = icon.visual .. 's',
54 ['\22'] = '^' .. icon.visual,
55 ['\22s'] = '^' .. icon.visual,
56 s = icon.select,
57 S = icon.select .. '_',
58 ['\19'] = '^' .. icon.select,
59 i = icon.insert,
60 ic = icon.insert .. 'c',
61 ix = icon.insert .. 'x',
62 R = icon.replace,
63 Rc = icon.replace .. 'c',
64 Rx = icon.replace .. 'x',
65 Rv = icon.replace .. 'v',
66 Rvc = icon.replace .. 'v',
67 Rvx = icon.replace .. 'v',
68 c = icon.command,
69 cv = icon.command .. 'x',
70 r = icon.pending,
71 rm = icon.pending .. 'm',
72 ['r?'] = icon.pending .. '?',
73 ['!'] = icon.exclaim,
74 t = icon.terminal,
75 },
76 mode_colors = {
77 n = 'ui_normal',
78 i = 'ui_accent',
79 v = 'ui_important_global',
80 V = 'ui_important_global',
81 ['\22'] = 'ui_important_global',
82 c = 'ui_important_global',
83 s = 'ui_important_global',
84 S = 'ui_important_global',
85 ['\19'] = 'ui_important_global',
86 R = 'ui_important_global',
87 r = 'ui_important_global',
88 ['!'] = 'ui_important_global',
89 t = 'ui_important_global',
90 },
91 },
93 provider = function ( self )
94 local mode_name = self.mode_names[self.mode]
95 return ' ' .. icon.vim .. ' %3(' .. mode_name .. '%) '
96 end,
98 hl = function ( self )
99 local mode = self.mode:sub( 1, 1 ) -- get only the first mode character
100 return { fg = self.mode_colors[mode], bold = true, }
101 end,
103 update = {
104 'ModeChanged',
105 pattern = '*:*',
106 callback = vim.schedule_wrap( function ()
107 vim.cmd.redrawstatus()
108 end ),
109 },
110 }
112 local file_icon = {
113 init = function ( self )
114 local filename = self.filename
115 local extension = vim.fn.fnamemodify( filename, ':e' )
116 self.icon = require 'nvim-web-devicons'.get_icon_color( filename, extension, { default = true, } )
117 end,
118 provider = function ( self )
119 return self.icon and (self.icon .. ' ')
120 end,
121 hl = 'DefaultIcon',
122 }
124 local file_name = {
125 init = function ( self )
126 self.lfilename = vim.fs.normalize( vim.fn.fnamemodify( self.filename, ':.' ) )
127 if self.lfilename == '' then
128 self.lfilename = NEW_FILE
129 end
130 end,
132 flexible = 2,
134 {
135 provider = function ( self )
136 return self.lfilename
137 end,
138 },
139 {
140 provider = function ( self )
141 return vim.fs.normalize( vim.fn.pathshorten( self.lfilename ) )
142 end,
143 },
144 }
146 local file_flags = {
147 {
148 condition = function ()
149 return vim.bo.modified
150 end,
151 provider = string.format( ' %s ', icon.modified ),
152 hl = 'Comment',
153 },
154 {
155 condition = function ()
156 return not vim.bo.modifiable or vim.bo.readonly
157 end,
158 provider = string.format( ' %s ', icon.lock ),
159 hl = 'ErrorMsg',
160 },
161 }
163 local file_name_block = {
164 init = function ( self )
165 self.filename = vim.fs.normalize( vim.api.nvim_buf_get_name( 0 ) )
166 end,
168 file_icon,
169 { provider = ' ', },
170 file_name,
171 file_flags,
172 { provider = '%<', }, -- this means that the statusline is cut here when there's not enough space
173 }
175 local file_type = {
176 provider = function ()
177 return icon.file .. ' ' .. string.upper( vim.bo.filetype )
178 end,
179 }
181 local file_encoding = {
182 provider = function ()
183 local enc = (vim.bo.fenc ~= '' and vim.bo.fenc) or vim.o.enc -- :h 'enc'
184 return enc ~= 'utf-8' and enc:upper()
185 end,
186 }
188 local file_format = {
189 static = {
190 dos = icon.newline .. icon.carriage_return,
191 unix = icon.newline,
192 mac = icon.carriage_return,
193 },
194 provider = function ( self )
195 local fileformat = vim.bo.fileformat
196 return self[fileformat]
197 end,
198 }
200 local file_size = {
201 provider = function ()
202 -- stackoverflow, compute human readable file size
203 -- i want to see vim opening a 1EiB file 󰱯
204 local suffix = { 'b', 'k', 'M', 'G', 'T', 'P', 'E', }
205 local fsize = vim.fn.getfsize( vim.api.nvim_buf_get_name( 0 ) )
206 fsize = (fsize < 0 and 0) or fsize
207 if fsize < 1024 then
208 return fsize .. suffix[1]
209 end
210 local i = math.floor( (math.log( fsize ) / math.log( 1024 )) )
211 return string.format( '%.2g%s', fsize / math.pow( 1024, i ), suffix[i + 1] )
212 end,
213 }
215 local file_last_modified = {
216 provider = function ()
217 local ftime = vim.fn.getftime( vim.api.nvim_buf_get_name( 0 ) )
218 if ftime > 0 then
219 local timeago = require 'std.timeago'
220 return timeago.format( ftime )
221 end
222 end,
223 }
225 local lsp_active = {
226 condition = conditions.lsp_attached,
227 -- FIXME: updates from parent components do not seem to update children,
228 -- if those have their own updates?
229 update = { 'LspAttach', 'LspDetach', 'BufEnter', 'BufLeave', },
231 provider = function ()
232 local names = {}
233 for _, client in pairs( vim.lsp.get_clients { bufnr = 0, } ) do
234 table.insert( names, client.name )
235 end
236 return icon.lsp .. ' ' .. table.concat( names, ' ' )
237 end,
238 }
240 local navic = {
241 condition = function ()
242 local ok, navic = pcall( require, 'nvim-navic' )
243 return ok and navic.is_available()
244 end,
245 static = {
246 -- create a type highlight map
247 type_hl = {
248 File = 'Directory',
249 Module = '@include',
250 Namespace = '@namespace',
251 Package = '@include',
252 Class = '@structure',
253 Method = '@method',
254 Property = '@property',
255 Field = '@field',
256 Constructor = '@constructor',
257 Enum = '@field',
258 Interface = '@type',
259 Function = '@function',
260 Variable = '@variable',
261 Constant = '@constant',
262 String = '@string',
263 Number = '@number',
264 Boolean = '@boolean',
265 Array = '@field',
266 Object = '@type',
267 Key = '@keyword',
268 Null = '@comment',
269 EnumMember = '@field',
270 Struct = '@structure',
271 Event = '@keyword',
272 Operator = '@operator',
273 TypeParameter = '@type',
274 },
275 -- bit operation dark magic, see below...
276 enc = function ( line, col, winnr )
277 return bit.bor( bit.lshift( line, 16 ), bit.lshift( col, 6 ), winnr )
278 end,
279 -- line: 16 bit (65535); col: 10 bit (1023); winnr: 6 bit (63)
280 dec = function ( c )
281 local line = bit.rshift( c, 16 )
282 local col = bit.band( bit.rshift( c, 6 ), 1023 )
283 local winnr = bit.band( c, 63 )
284 return line, col, winnr
285 end,
286 },
287 init = function ( self )
288 local data = require 'nvim-navic'.get_data() or {}
289 local children = {}
290 -- create a child for each level
291 for i, d in ipairs( data ) do
292 -- encode line and column numbers into a single integer
293 local pos = self.enc( d.scope.start.line, d.scope.start.character, self.winnr )
294 local child = {
295 {
296 provider = d.icon,
297 hl = self.type_hl[d.type],
298 },
299 {
300 -- escape `%`s (elixir) and buggy default separators
301 provider = d.name:gsub( '%%', '%%%%' ):gsub( '%s*->%s*', '' ),
302 -- highlight icon only or location name as well
303 hl = self.type_hl[d.type],
305 on_click = {
306 -- pass the encoded position through minwid
307 minwid = pos,
308 callback = function ( _, minwid )
309 -- decode
310 local line, col, winnr = self.dec( minwid )
311 vim.api.nvim_win_set_cursor( vim.fn.win_getid( winnr ), { line, col, } )
312 end,
313 name = 'heirline_navic',
314 },
315 },
316 }
317 -- add a separator only if needed
318 if #data > 1 and i < #data then
319 table.insert( child, {
320 provider = ' > ',
321 -- hl = { fg = 'bright_fg', },
322 } )
323 end
324 table.insert( children, child )
325 end
326 -- instantiate the new child, overwriting the previous one
327 self.child = self:new( children, 1 )
328 end,
329 -- evaluate the children containing navic components
330 provider = function ( self )
331 return self.child:eval()
332 end,
333 -- hl = { fg = 'gray', },
334 update = 'CursorMoved',
335 }
337 local diagnostic_enabled = {
338 init = function ( self )
339 self.icon = (not vim.diagnostic.is_enabled()) and icon.toggle_off or icon.toggle_on
340 end,
341 provider = function ( self )
342 return icon.diagnostic .. ' ' .. self.icon
343 end,
344 }
346 local diagnostic = {
347 condition = conditions.has_diagnostics,
349 static = {
350 error_icon = icon.error,
351 warn_icon = icon.warn,
352 info_icon = icon.info,
353 hint_icon = icon.hint,
354 },
356 init = function ( self )
357 self.errors = #vim.diagnostic.get( 0, { severity = vim.diagnostic.severity.ERROR, } )
358 self.warnings = #vim.diagnostic.get( 0, { severity = vim.diagnostic.severity.WARN, } )
359 self.hints = #vim.diagnostic.get( 0, { severity = vim.diagnostic.severity.HINT, } )
360 self.info = #vim.diagnostic.get( 0, { severity = vim.diagnostic.severity.INFO, } )
361 end,
363 update = { 'DiagnosticChanged', 'BufEnter', 'BufLeave', },
365 {
366 provider = function ( self )
367 -- 0 is just another output, we can decide to print it or not!
368 return self.errors > 0 and (self.error_icon .. ' ' .. self.errors .. ' ')
369 end,
370 hl = 'DiagnosticError',
371 },
372 {
373 provider = function ( self )
374 return self.warnings > 0 and (self.warn_icon .. ' ' .. self.warnings .. ' ')
375 end,
376 hl = 'DiagnosticWarn',
377 },
378 {
379 provider = function ( self )
380 return self.info > 0 and (self.info_icon .. ' ' .. self.info .. ' ')
381 end,
382 hl = 'DiagnosticInfo',
383 },
384 {
385 provider = function ( self )
386 return self.hints > 0 and (self.hint_icon .. ' ' .. self.hints)
387 end,
388 hl = 'DiagnosticHint',
389 },
390 }
392 local is_svn_repo = function ()
393 local svn_dir = vim.fs.find( '.svn', {
394 upward = true,
395 stop = vim.uv.os_homedir(),
396 path = vim.fs.dirname( vim.api.nvim_buf_get_name( 0 ) ),
397 type = 'directory',
398 } )
400 return not vim.tbl_isempty( svn_dir )
401 end
403 local svn_get_relative_url = function ()
404 -- FIXME: replace with vim.system
405 local job = require 'plenary.job'
406 local relative_url = { '[ERR]', }
408 job
409 :new {
410 command = 'svn',
411 args = { 'info', '--show-item', 'relative-url', '--no-newline', },
412 on_exit = function ( current_job, exit_code )
413 if exit_code == 0 then
414 relative_url = current_job:result()
415 end
416 end,
417 }
418 :sync()
420 return relative_url[1]
421 end
423 local svn = {
424 condition = is_svn_repo,
426 update = 'BufEnter',
428 init = function ( self )
429 self.relative_url = svn_get_relative_url()
430 end,
432 {
433 provider = function ( self )
434 return icon.subversion .. ' ' .. icon.branch .. ' ' .. self.relative_url
435 end,
436 },
437 }
439 local git = {
440 condition = conditions.is_git_repo,
442 init = function ( self )
443 self.status_dict = vim.b.minidiff_summary
444 end,
446 {
447 provider = function ( self )
448 return icon.git .. ' ' .. icon.branch .. ' ' .. self.status_dict.source_name .. ' '
449 end,
450 },
451 {
452 provider = function ( self )
453 local count = self.status_dict.add or 0
454 return count > 0 and (icon.diff_add .. ' ' .. count .. ' ')
455 end,
456 hl = 'DiffAdd',
457 },
458 {
459 provider = function ( self )
460 local count = self.status_dict.delete or 0
461 return count > 0 and (icon.diff_remove .. ' ' .. count .. ' ')
462 end,
463 hl = 'DiffDelete',
464 },
465 {
466 provider = function ( self )
467 local count = self.status_dict.change or 0
468 return count > 0 and (icon.diff_change .. ' ' .. count .. ' ')
469 end,
470 hl = 'DiffChange',
471 },
472 }
474 local work_dir = {
475 init = function ( self )
476 self.icon = (vim.fn.haslocaldir( 0 ) == 1 and icon['local'] or '') .. ' ' .. icon.global .. ' '
477 self.cwd = vim.fs.normalize( vim.uv.cwd() ):gsub( vim.fs.normalize( vim.uv.os_homedir() ), '~' )
478 end,
480 flexible = 1,
482 {
483 provider = function ( self )
484 return self.icon .. self.cwd
485 end,
486 },
487 {
488 provider = function ( self )
489 local cwd = vim.fn.pathshorten( self.cwd )
490 return self.icon .. cwd
491 end,
492 },
493 {
494 provider = '',
495 },
496 }
498 local help_file_name = {
499 condition = function ()
500 return vim.bo.filetype == 'help'
501 end,
502 provider = function ()
503 local filename = vim.api.nvim_buf_get_name( 0 )
504 return vim.fn.fnamemodify( filename, ':t' )
505 end,
506 hl = 'Question',
507 }
509 local terminal_name = {
510 provider = function ()
511 local name, _ = vim.api.nvim_buf_get_name( 0 ):gsub( '.*:', '' )
512 local basename = vim.fs.basename( name )
513 return icon.terminal .. ' ' .. (basename or 'noname')
514 end,
515 hl = 'Bold',
516 }
518 local togglers = {
519 provider = function ()
520 local togglers = require 'bugabinga.options.togglers'
521 return tostring( togglers )
522 end,
523 }
525 local macro_recording = {
526 condition = function ()
527 return vim.fn.reg_recording() ~= '' and vim.o.cmdheight == 0
528 end,
529 provider = icon.macro .. ' ',
530 hl = 'PreProc',
531 utils.surround( { '░▒▓ ', ' ▓▒░', }, nil, {
532 provider = function ()
533 return vim.fn.reg_recording()
534 end,
535 hl = 'Bold',
536 } ),
537 update = {
538 'RecordingEnter',
539 'RecordingLeave',
540 },
541 }
543 local lazy = {
544 condition = function ()
545 local ok, lazy_status = pcall( require, 'lazy.status' )
546 return ok and lazy_status.has_updates()
547 end,
548 update = { 'User', pattern = 'LazyUpdate', },
549 provider = function ()
550 return ' ' .. icon.lazy .. ' ' .. require 'lazy.status'.updates() .. ' '
551 end,
552 on_click = {
553 callback = function ()
554 require 'lazy'.update()
555 end,
556 name = 'update_plugins',
557 },
558 }
560 local align = { provider = '%=', }
561 local space = { provider = ' ', }
563 local default_statusline = {
564 vi_mode,
565 macro_recording,
566 work_dir,
567 space,
568 git,
569 svn,
570 align,
571 diagnostic,
572 space,
573 lsp_active,
574 align,
575 togglers,
576 space,
577 space,
578 diagnostic_enabled,
579 space,
580 lazy,
581 space,
582 file_encoding,
583 space,
584 file_format,
585 space,
586 file_type,
587 space,
588 file_size,
589 space,
590 file_last_modified,
591 }
593 local special_statusline = {
594 condition = function ()
595 return conditions.buffer_matches {
596 buftype = ignored.buftypes,
597 filetype = ignored.filetypes,
598 }
599 end,
601 file_type,
602 space,
603 help_file_name,
604 align,
605 }
607 local terminal_statusline = {
609 condition = function ()
610 return conditions.buffer_matches { buftype = { 'terminal', }, }
611 end,
613 { condition = conditions.is_active, vi_mode, space, },
614 file_type,
615 space,
616 terminal_name,
617 align,
618 }
620 local inactive_statusline = {
621 condition = conditions.is_not_active,
622 file_type,
623 space,
624 file_name,
625 align,
626 }
628 local statuslines = {
629 hl = function ()
630 if conditions.is_active() then
631 return 'StatusLine'
632 else
633 return 'StatusLineNC'
634 end
635 end,
637 fallthrough = false,
639 special_statusline,
640 terminal_statusline,
641 inactive_statusline,
642 default_statusline,
643 }
645 local winbars = {
646 hl = function ()
647 if conditions.is_active() then
648 return 'Winbar'
649 else
650 return 'WinbarNC'
651 end
652 end,
654 fallthrough = false,
656 {
657 condition = function ()
658 return conditions.buffer_matches { buftype = { 'terminal', }, }
659 end,
661 file_type,
662 space,
663 terminal_name,
664 },
666 {
667 file_name_block,
668 space,
669 navic,
670 },
671 }
673 -- local tabline_buffer_number = {
674 -- provider = function ( self )
675 -- return '(' .. tostring( self.bufnr ) .. ')'
676 -- end,
677 -- hl = function ( self )
678 -- if self.is_active then
679 -- return { fg = utils.get_highlight 'TabLineSel'.fg, }
680 -- elseif not vim.api.nvim_buf_is_loaded( self.bufnr ) then
681 -- return { fg = utils.get_highlight 'StatusLineNc'.fg, }
682 -- else
683 -- return { fg = utils.get_highlight 'TabLine'.fg, }
684 -- end
685 -- end,
686 -- }
688 -- local tabline_file_name = {
689 -- provider = function ( self )
690 -- local name = self.file_name
691 -- return name == '' and NEW_FILE or vim.fs.normalize( vim.fn.fnamemodify( name, ':t' ) )
692 -- end,
693 -- hl = function ( self ) return { bold = self.is_active or self.is_visible, italic = true, } end,
694 -- }
696 -- local tabline_file_flags = {
697 -- {
698 -- condition = function ( self ) return vim.api.nvim_get_option_value( 'modified', { buf = self.bufnr, } ) end,
699 -- provider = icon.modified .. ' ',
700 -- },
701 -- {
702 -- condition = function ( self )
703 -- return not vim.api.nvim_get_option_value( 'modifiable', { buf = self.bufnr, } ) or
704 -- vim.api.nvim_get_option_value( 'readonly', { buf = self.bufnr, } )
705 -- end,
706 -- provider = function ( self )
707 -- if vim.api.nvim_get_option_value( 'buftype', { buf = self.bufnr, } ) == 'terminal' then
708 -- return icon.terminal
709 -- else
710 -- return icon.lock
711 -- end
712 -- end,
713 -- },
714 -- hl = 'Bold',
715 -- }
717 -- local tabline_file_name_block = {
718 -- init = function ( self )
719 -- self.file_name = vim.api.nvim_buf_get_name( self.bufnr )
720 -- end,
721 --
722 -- hl = function ( self )
723 -- if self.is_active then
724 -- return 'TabLineSel'
725 -- elseif not vim.api.nvim_buf_is_loaded( self.bufnr ) then
726 -- return { fg = utils.get_highlight 'StatusLineNc'.fg, }
727 -- else
728 -- return 'TabLine'
729 -- end
730 -- end,
731 --
732 -- on_click = {
733 -- callback = function ( _, minwid, _, button )
734 -- if button == 'm' then --m = middle click
735 -- vim.schedule( function ()
736 -- vim.api.nvim_buf_delete( minwid, { force = false, } )
737 -- vim.cmd.redrawtabline()
738 -- end )
739 -- else
740 -- vim.api.nvim_win_set_buf( 0, minwid )
741 -- end
742 -- end,
743 -- minwid = function ( self ) return self.bufnr end,
744 -- name = 'heirline_tabline_buffer_callback',
745 -- },
746 --
747 -- file_icon,
748 -- { provider = ' ', },
749 -- tabline_file_name,
750 -- tabline_buffer_number,
751 -- tabline_file_flags,
752 -- }
754 -- local tabline_buffer_block = utils.surround(
755 -- {
756 -- ' ' .. icon.slant_left,
757 -- icon.slant_right .. ' ',
758 -- },
759 -- function ( self )
760 -- if self.is_active then
761 -- return utils.get_highlight 'TabLine'.bg
762 -- else
763 -- return utils.get_highlight 'TabLineFill'.bg
764 -- end
765 -- end,
766 -- { tabline_file_name_block, }
767 -- )
769 -- local buffer_line = utils.make_buflist(
770 -- tabline_buffer_block,
771 -- { provider = icon.arrow_left .. ' ', hl = 'TabLine', },
772 -- { provider = ' ' .. icon.arrow_right, hl = 'TabLine', }
773 -- )
775 local tabpage = {
776 provider = function ( self )
777 return '%' .. self.tabnr .. 'T ' .. self.tabpage .. ' %T'
778 end,
779 hl = function ( self )
780 if self.is_active then
781 return 'TabLineSel'
782 else
783 return 'TabLine'
784 end
785 end,
786 }
788 local tab_pages = {
789 { provider = '%=', },
790 utils.make_tablist( tabpage ),
791 }
793 -- local tabline = { buffer_line, tab_pages, }
795 -- local statuscolumn = {}
797 heirline.setup {
798 statusline = statuslines,
799 winbar = winbars,
800 tabline = tab_pages,
801 -- tabline = tabline,
802 -- statuscolumn = statuscolumn,
804 opts = {
805 colors = nugu,
806 disable_winbar_cb = function ( args )
807 return conditions.buffer_matches( {
808 buftype = ignored.buftypes,
809 filetype = ignored.filetypes,
810 }, args.buf )
811 end,
812 },
813 }
814 end,
815 },
816}

neovim/lua/bugabinga/plugins/last-place.lua

Modified

+6 / −8 text lines

11local ignored = require 'std.ignored'
33return {
4 {
5 'ethanholz/nvim-lastplace',
6 event = { 'VimEnter', 'SessionLoadPost', },
7 opts = {
8 lastplace_ignore_buftype = ignored.buftypes,
9 lastplace_ignore_filetype = ignored.filetypes,
10 lastplace_open_folds = true,
11 },
4 'ethanholz/nvim-lastplace',
5 lazy = false,
6 opts = {
7 lastplace_ignore_buftype = ignored.buftypes,
8 lastplace_ignore_filetype = ignored.filetypes,
9 lastplace_open_folds = true,
1210 },

neovim/lua/bugabinga/plugins/lazydev.lua

Deleted
deleted file mode 100644

+0 / −29 text lines

1return {
2 {
3 'folke/lazydev.nvim',
4 ft = 'lua', -- only load on lua files
5 opts = {
6 library = {
7 'lazy.nvim',
8 -- See the configuration section for more details
9 -- Load luvit types when the `vim.uv` word is found
10 { path = 'luvit-meta/library', words = { 'vim%.uv', }, },
11 -- Load the wezterm types when the `wezterm` module is required
12 -- Needs `justinsgithub/wezterm-types` to be installed
13 { path = 'wezterm-types', mods = { 'wezterm', }, },
14 },
15 },
16 },
17 { 'Bilal2453/luvit-meta', lazy = true, }, -- optional `vim.uv` typings
18 { -- optional completion source for require statements and module annotations
19 'hrsh7th/nvim-cmp',
20 opts = function ( _, opts )
21 opts.sources = opts.sources or {}
22 table.insert( opts.sources, {
23 name = 'lazydev',
24 group_index = 0, -- set group index to 0 to skip loading LuaLS completions
25 } )
26 end,
27 },
28 -- { "folke/neodev.nvim", enabled = false }, -- make sure to uninstall or disable neodev.nvim
29}

neovim/lua/bugabinga/plugins/lint.lua

Modified

+11 / −15 text lines

55 ft = {
66 'lua',
77 'sh',
8 'vim',
8 'nu',
99 },
1010 opts = {
1111 linters_by_ft = {
1212 lua = { 'selene', },
13 sh = { 'shellcheck', },
14 -- TODO make this linter
15 -- nu = { 'nu-check', },
13 sh = { 'shellcheck', 'dotenv_linter', },
14 systemd = { 'systemd-analyze', },
1615 },
17 linters = {},
16 linters = { },
1817 },
1918 config = function ( _, opts )
2019 local lint = require 'lint'
2524 local timer = assert( uv.new_timer() )
2625 local DEBOUNCE_MS = 500
2726 local aug = vim.api.nvim_create_augroup( 'Lint', { clear = true, } )
28 vim.api.nvim_create_autocmd( { 'BufEnter', 'BufWritePost', 'TextChanged', 'InsertLeave', }, {
27 vim.api.nvim_create_autocmd( { 'BufWritePost', }, {
2928 group = aug,
3029 callback = function ()
3130 local bufnr = vim.api.nvim_get_current_buf()
3231 timer:stop()
33 timer:start(
34 DEBOUNCE_MS,
35 0,
36 vim.schedule_wrap( function ()
37 if vim.api.nvim_buf_is_valid( bufnr ) then
38 vim.api.nvim_buf_call( bufnr, function () lint.try_lint( nil, { ignore_errors = true, } ) end )
39 end
40 end )
32 timer:start( DEBOUNCE_MS, 0,
33 vim.schedule_wrap( function ()
34 if vim.api.nvim_buf_is_valid( bufnr ) then
35 vim.api.nvim_buf_call( bufnr, function () lint.try_lint( nil, { ignore_errors = true, } ) end )
36 end
37 end )
4138 )
4239 end,
4340 } )
44 lint.try_lint( nil, { ignore_errors = true, } )
4541 end,

neovim/lua/bugabinga/plugins/speedtyper.lua

Deleted
deleted file mode 100644

+0 / −7 text lines

1return {
2 {
3 'NStefan002/speedtyper.nvim',
4 cmd = 'Speedtyper',
5 opts = {}
6 }
7}

neovim/lua/bugabinga/plugins/ssr.lua

Modified

+22 / −22 text lines

44local open_ssr = function () prequire 'ssr'.open() end
66map.normal.visual {
7 description = 'Open structural search and replace',
8 category = 'refactoring',
9 keys = '<leader>rr',
10 command = open_ssr,
7 description = 'Open structural search and replace',
8 category = 'refactoring',
9 keys = '<leader>rr',
10 command = open_ssr,
1313user_command.StructuralSearchAndReplace
1414'Open structural search and replace view' (
15 open_ssr
16 )
15 open_ssr
16 )
1818return {
19 'cshuaimin/ssr.nvim',
20 opts = {
21 border = vim.g.border_style,
22 min_width = 69,
23 min_height = 42,
24 max_width = 3 * 69,
25 max_height = 3 * 42,
26 adjust_window = true,
27 keymaps = {
28 close = 'q',
29 next_match = 'n',
30 prev_match = 'N',
31 replace_confirm = '<cr>',
32 replace_all = '<c-cr>',
33 },
34 },
19 'cshuaimin/ssr.nvim',
20 opts = {
21 border = vim.g.border_style,
22 min_width = 69,
23 min_height = 42,
24 max_width = 3 * 69,
25 max_height = 3 * 42,
26 adjust_window = true,
27 keymaps = {
28 close = 'q',
29 next_match = 'n',
30 prev_match = 'N',
31 replace_confirm = '<cr>',
32 replace_all = '<c-cr>',
33 },
34 },

neovim/lua/bugabinga/plugins/treesitter.lua

Modified

+3 / −11 text lines

1010 -- version = '0.9.*',
1111 -- branch = 'main', -- next gen version
1212 branch = 'master',
13 event = 'VeryLazy',
14 init = function ( plugin )
15 -- PERF: add nvim-treesitter queries to the rtp and it's custom query predicates early
16 -- This is needed because a bunch of plugins no longer `require("nvim-treesitter")`, which
17 -- no longer trigger the **nvim-treesitter** module to be loaded in time.
18 -- Luckily, the only things that those plugins need are the custom queries, which we make available
19 -- during startup.
20 require 'lazy.core.loader'.add_to_rtp( plugin )
21 require 'nvim-treesitter.query_predicates'
22 end,
13 lazy = false,
2314 build = function ()
2415 require 'nvim-treesitter.install'.update { with_sync = true, }
2516 end,
2920 'windwp/nvim-ts-autotag',
3021 'RRethy/nvim-treesitter-endwise',
3122 'nvim-treesitter/nvim-treesitter-context',
23 'nushell/tree-sitter-nu',
3224 },
3325 config = function ()
3426 local install = require 'nvim-treesitter.install'
3527 local configs = require 'nvim-treesitter.configs'
3729 install.prefer_git = false
38 install.compilers = { 'zig', 'clang', 'gcc', 'cl', 'cc', vim.fn.getenv 'CC', }
30 install.compilers = { 'zig cc', 'clang', 'gcc', 'cl', 'cc', vim.fn.getenv 'CC', }
4032 local should_disable = function ( _, bufnr )
4133 local max_filesize = 5 * 1024 * 1024 --MiB

neovim/lua/bugabinga/plugins/virt-column.lua

Modified

+2 / −1 text lines

11local ignored = require 'std.ignored'
2local icon = require 'std.icon'
34return {
45 'lukas-reineke/virt-column.nvim',
56 version = '2.*',
67 event = 'VeryLazy',
78 opts = {
8 char = { '┆', '╎', '│', },
9 char = { icon.vertical_bar },
910 exclude = {
1011 filetypes = ignored.filetypes,
1112 buftypes = ignored.buftypes,

neovim/spell/nerd.utf-8.add

Modified

+5 / −0 text lines

7474FKs
7575FIXMEs
7676JSpecify
77aerc
78yazi
79magit
80gitu
81sk

neovim/spell/nerd.utf-8.add.spl

Modified

Binary size (old → new): 1187 → 1218 bytes.

nushell/login.nu

Modified

+11 / −0 text lines

55use ssh-keygen-ed.nu
66use md.nu
77use start.nu
8use timer.nu
9
10if $env.WIN32 {
11 use refreshenv.nu *
12}
914source ($nu.default-config-dir | path join 'aliases.nu')
1116# must be done, after defining config, since zoxide mutates it
1217# this will fail if zoxide is not installed yet
1318source ($nu.default-config-dir | path join "zoxide.nu")
20source ($nu.default-config-dir | path join "scripts/direnv.nu")
22todo commands
23print (char nl)
24todo

nushell/scripts/direnv.nu

Added
new file mode 100644

+26 / −0 text lines

1def direnv [] {
2 [
3 {
4 condition: {|before, after| ($before != $after) and ($after | path join '.env' | path exists) }
5 code: r#'
6 open .env
7 | lines
8 | parse --regex '\s*(?P<k>.+?)\s*=\s*?(?P<v>.+)?\s*'
9 | reduce --fold {} {|x, acc| $acc | upsert $x.k $x.v}
10 | load-env
11 '#
12 }
13 ]
14}
16export-env {
17 $env.config = ( $env.config | upsert hooks.env_change.PWD { |config|
18 let o = ($config | get -i hooks.env_change.PWD)
19 let val = (direnv)
20 if $o == null {
21 $val
22 } else {
23 $o | append $val
24 }
25 })
26}

nushell/scripts/refreshenv.nu

Added
new file mode 100644

+9 / −0 text lines

1def --env refreshenv [] {
2 let user_path = registry query --hkcu environment | where name == Path | get value | split row ';' |
3 where { |x| $x != '' }
4 let sys_path = registry query --hklm 'SYSTEM\CurrentControlSet\Control\Session Manager\Environment' | where name == Path | get value |
5 split row ';' | where { |x| $x != '' }
6
7 let out = $user_path ++ $sys_path ++ $env.path | uniq --ignore-case
8 $env.path = $out
9}

nushell/scripts/timer.nu

Added
new file mode 100644

+63 / −0 text lines

1export def main [ input: string ] {
2
3 if (which tclock | is-empty) {
4 error make {
5 msg: "The program `tclock` is required!"
6 }
7 }
8
9 if ( $input | is-empty ) {
10 error make {
11 msg: "timer needs a duration or time"
12 label: {
13 span: (metadata $input).span
14 }
15 help: "try 'timer 5min' for example"
16 }
17 }
19 let duration = try { $input | into duration --unit sec }
21 if ($duration != null) {
22 start_with_duration ( $duration | into string | str replace sec s)
23 return
24 }
26 let time = try { $input | into datetime }
28 if ($time != null) {
29 start_with_time $time
30 return
31 }
33 error make {
34 msg: "The input given is neiter a duration nor a time."
35 label: {
36 span: (metadata $input).span
37 }
38 help: "Consult `help into duration` and `help into datetime` for valid input."
39 }
40}
42export def beep [] {
43 notify --summary "timer finished" --body "timer is done!" --app-name timer
45 for idx in 1..6 {
46 seq (random float 100..500) 50 (random float 500..1000) | each { sound make --amplify ( $idx | into float ) $in 144ms }
47 }
48}
50def start_with_duration [ duration: string ] {
51 run-external tclock timer '--paused' '--no-millis' '--duration' $duration '--execute' 'nu --commands "use timer.nu; timer beep"'
52}
54def pad [] {
55 fill --width 2 --character 0 --alignment right
56}
58def start_with_time [ time: datetime ] {
59 let time = ($time | into record)
60 let time = $"($time.year)-($time.month|pad)-($time.day|pad)T($time.hour|pad):($time.minute|pad):($time.second|pad)($time.timezone)"
61 run-external tclock countdown '--title' Timer '--time' $time
62 # FIXME: Why can countdown not execute external cmd?
63}

tools/tools.csv

Modified

+6 / −0 text lines

88cargo-update;cargo-install-update
99choose
1010du-dust; dust
11dotenv-linter
1112eva
1213eza; eza; --features vendored-openssl,vendored-libgit2
1314fend
1415fd-find;fd
1516git-delta;delta
1617gitu;gitu; --locked
18gitoxide
1719hck
1820hexyl
1921hyperfine
3436mdsh
3537monolith
3638# netscanner
39neovide;neovide; --git https://github.com/neovide/neovide
3740nu;nu; --locked
3841neovide; neovide; --git https://github.com/neovide/neovide
42nu_plugin_audio_hook; nu_plugin_audio_hook; --git https://github.com/FMotalleb/nu_plugin_audio_hook.git --features all-decoders
43nu_plugin_skim
44nu_plugin_desktop_notifications
3945ouch
4046pastel
4147pueue;pueue;--locked