repositories / dotfiles

dotfiles

bugabingas dorkfiles

owned by bugabinga

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

07febe59bcbca58dbfe32ead746c31fab74474fc

Oliver Jan Krylow <oliver@bugabinga.net> ·

unsigned

Browse filesCompare with HEAD

Changed files (65)

+2355 / −1028 text lines · all files grouped into 32 bars · 1 binary (striped old/new sizes in 64-byte units, not churn) · lines and sizes scale separately

Diff layout

.github/workflows/devskim.yml

Added
new file mode 100644

+34 / −0 text lines

1# This workflow uses actions that are not certified by GitHub.
2# They are provided by a third-party and are governed by
3# separate terms of service, privacy policy, and support
4# documentation.
5
6name: DevSkim
7
8on:
9 push:
10 branches: [ "trunk" ]
11 pull_request:
12 branches: [ "trunk" ]
13 schedule:
14 - cron: '28 3 * * 0'
16jobs:
17 lint:
18 name: DevSkim
19 runs-on: ubuntu-20.04
20 permissions:
21 actions: read
22 contents: read
23 security-events: write
24 steps:
25 - name: Checkout code
26 uses: actions/checkout@v3
28 - name: Run DevSkim scanner
29 uses: microsoft/DevSkim-Action@v1
31 - name: Upload DevSkim scan results to GitHub Security tab
32 uses: github/codeql-action/upload-sarif@v2
33 with:
34 sarif_file: devskim-results.sarif

.github/workflows/semgrep.yml

Added
new file mode 100644

+49 / −0 text lines

1# This workflow uses actions that are not certified by GitHub.
2# They are provided by a third-party and are governed by
3# separate terms of service, privacy policy, and support
4# documentation.
5
6# This workflow file requires a free account on Semgrep.dev to
7# manage rules, file ignores, notifications, and more.
8#
9# See https://semgrep.dev/docs
11name: Semgrep
13on:
14 push:
15 branches: [ "trunk" ]
16 pull_request:
17 # The branches below must be a subset of the branches above
18 branches: [ "trunk" ]
19 schedule:
20 - cron: '23 9 * * 0'
22permissions:
23 contents: read
25jobs:
26 semgrep:
27 permissions:
28 contents: read # for actions/checkout to fetch code
29 security-events: write # for github/codeql-action/upload-sarif to upload SARIF results
30 actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status
31 name: Scan
32 runs-on: ubuntu-latest
33 steps:
34 # Checkout project source
35 - uses: actions/checkout@v3
37 # Scan code using project's configuration on https://semgrep.dev/manage
38 - uses: returntocorp/semgrep-action@fcd5ab7459e8d91cb1777481980d1b18b4fc6735
39 with:
40 publishToken: ${{ secrets.SEMGREP_APP_TOKEN }}
41 publishDeployment: ${{ secrets.SEMGREP_DEPLOYMENT_ID }}
42 generateSarif: "1"
44 # Upload SARIF file generated in previous step
45 - name: Upload SARIF file
46 uses: github/codeql-action/upload-sarif@v2
47 with:
48 sarif_file: semgrep.sarif
49 if: always()

README.md

Modified

+46 / −114 text lines

1# bugabingas personal dotfiles, 33rd attempt
1# bugabinga neovim config
3Shared configuration files between some Linux and some Windows hosts.
3neovim configuration is scripting.
4scripting with lua + neovim api is programming.
5## bootstrapping a new host
6## project structure
71. Install git
81. Install a JDK
91. `git clone git@github.com:bugabinga/dotfiles`
101. `cd dotfiles`
111. `java bootstripper.java`
8init.lua
9: main entry point
10\
11lua/std
12: standard lib. can only depend on itself and neovim apis.
13\
14lua/bugabinga
15: config modules. in aggregation, defines all of the config. can depend on itself, std and plugins.
16\
17lua/bugabinga/plugins
18: third party plugins and their config glue integrating it into the config.
19\
20colors/nugu
21: color theme
22\
23ftplugin
24: file type specific config
13> Pay attention to already existing symlinks!
26----------
15## windows
28# ai poem
17Initial setup on windows is a little more sophisticated, because I am used to a developers environment.
30I am the bone of my code, bugs are my body and exceptions are my blood.
31I have created over a thousand bugs, unknown to testers, nor known to debuggers.
32Have withstood pain to create many programs, yet those hands will never hold a working program.
33So as I pray, Unlimited Bug Works.
191. Enable Developer Mode, so that it is allowed to make symlinks without admin permissions.
201. Install Build Tools with C++ Option (for Rust and cargo tools)
211. Install Git without internal SSH
221. Start ssh-agent service
231. Enable `UTF-8` in regional settings
35~ Shirou Emiya
25## rough goals
37---------
27- minimal amount of dependencies
28 This helps in setting up new host.
29 But it is really hard to achieve when hosts are allowed to be Windows and Linux AND [OpenBSD] ...
30 The current state is a compromise reached after some experimentation.
31- editing and applying configs is "natural"
32 Natural in this context is to mean: as if there was no dotfiles repository used for sharing.
33 This is achieved by sym-linking the files from the dotfiles repository into their normal locations.
34 So when it comes time to edit a config file, you can stay blissfully unaware of the dotfiles repository.
39# todo
36## handling per host differences
38There are two classes of differences in configurations between platforms (specifically Linux and Windows in my case).
40### differing locations of config files
42For example, [NeoVim] stores its configuration at `~/.config/nvim` in Linux and at `~/AppData/Roaming/nvim` in Windows.
43In order to handle theses differences each host gets its own symlink file with the naming pattern `(hostname).symlinks`.
44The format of this file is:
46```txt
47path to configuration file/directory relative to dotfiles root
48absolute path of symlink on host
49```
51Each symlink path pair is to be delimited by a newline.
52Example:
54```txt
55neovim
56~/.config/nvim
58foo/bar.conf
59~/.config/foobar.conf
60```
62This file will be parsed by [bootstripper] in order to create those symlinks.
64### differing values in configuration files
66Most often, these come down to different paths of stuff, that get referred to in config files.
67For example, [topgrade], an abstraction over a bunch of package managers and updaters, might want to know the location of your git repositories, so it can pull them for you.
68Some programs, e.g. [NeoVim], have rich configuration languages that are powerful enough for you to resolve those differences with conditionals.
69However some programs, e.g. [topgrade], offer only declarative configuration languages, which make it impossible to resolve this problem in the config.
70I tried solving this problem with some kind of a templating engine.
71But I quickly gave up on that, because it was too annoying to manage.
72Specifically, editing configuration stopped being "natural", meaning you cannot simply open and edit the file at the location you expect the config to be anymore.
73This natural flow is the reason symlinks are used.
74With templating in the mix, an intermediary step is necessary, between editing and applying config.
75Too much work.
76Instead, I use the `(hostname).symlink` files to resolve such cases.
77That means, that config files are completely independent per host, and as such some duplication of configuration occurs.
78A tradeoff well worth it in my opinion.
80## WIP:secrets
82Secrets are encrypted and saved as file into the `tresor` folder.
83The name of these file is a random UUID, which I map to their original purpose somewhere else.
84Those secret files are decrypted either by [bootstripper] or on demand in my scripts.
86## the trouble with bootstrapping dotfiles
88Most of my previous attempts at managing my configuration files failed because it is tricky to share them between Windows and Unix systems.
89If all my hosts were Unix(y), I would write a POSIX shell script and be done with it.
90But that does not work for Windows.
92Since I find it important to be able to setup my configuration files on any fresh new host, it is important to have as few dependencies as possible.
93However, with Windows in the mix, this is pretty hard, so I settled on a compromise: JDK.
95Things I tried in the past to solve this problem:
97- dotfiles managers (e.g. [chezmoi])
98 > too much work
99- writing a bootstrap/installer with [cosmopolitan]
100 > extremely cool tech. unfortunately I am not a C programmer so I struggled a lot.
101 > also, the resulting binary rewrites itself on first run. How do I keep a file version controlled that is allowed to change on first use, but should not result in a new modification...?
102 > furthermore, managing the [cosmopolitan] toolchain for windows made extra work.
103- use POSIX shell for Unix, use PowerShell for Windows
104 > too much work. maintaining the same program in 2 different languages ... depressing not because you have to write twice, but because you have to test twice.
105- Pretend Windows is Unix by only interfacing with it through [WSL].
106 > Windows is not Unix. [WSL] is cute, even useful for cross-compilation and testing. But when I am on Windows I want to use Windows, when I am on Linux I want to use Linux. Fighting the platform constantly is too tiring.
108Things I have not tried (yet?):
110- Use a language with a pleasant cross-compile story ([golang], [Rust], [ziglang]) and version control a binary for those platforms I care about.
111- Use [PowerShell Core] and maybe a script per platform to install it. This could be nice if [PowerShell Core] would replace [PowerShell Windows] and it was my main shell.
113[NeoVim]: https://neovim.io/
114[topgrade]: https://github.com/r-darwish/topgrade
115[bootstripper]: https://github.com/bugabinga/dotfiles/blob/trunk/bootstripper.java
116[chezmoi]: https://github.com/twpayne/chezmoi
117[golang]: https://golang.org/
118[Rust]: https://www.rust-lang.org/
119[ziglang]: https://ziglang.org/
120[WSL]: https://docs.microsoft.com/en-us/windows/wsl/about
121[PowerShell Core]: https://github.com/PowerShell/PowerShell
122[PowerShell Windows]: https://de.wikipedia.org/wiki/PowerShell
123[OpenBSD]: https://www.openbsd.org/
124[cosmopolitan]: https://github.com/jart/cosmopolitan
41* kill lush
42* write plugin to parse lsp settings locally and apply them
43* is there a use case for a plugin that parses local plugin configuration overrides?
44* kill custom lsp stuff in favor of lspconfig and try neoconf + nvim-java
45* does status bar fail to display if lsp fails to load?
46* pandoc with lua filters for diagrams for generating documents and previewing --> https://github.com/tex/vimpreviewpandoc
47* use gen.ai to generate docs
48* learn marks and refactor mark.lua
49* use ltex-ls for markdown, code comments and commit messages
50* create a floating window that shows plugins, that have commands, as reminder
51* setup DAP
52* add nu-check to nvim-lint
53* create facade over vim.api.nvim_create_user_command
54* create skeleton-plugin for default file content based on file type
55* add support for Java multi line string in autopairs
56* nvim spell for camel case words

env.nu

Added
new file mode 100644

+48 / −0 text lines

1# GLOBAL VARIABLES
2
3$env.WIN32 = ( $nu.os-info.name =~ "windows" )
4$env.NURC_DIR = ( $nu.config-path | path expand | path dirname )
5$env.DOTFILES = ( $env.NURC_DIR | path join ".." | path expand )
6$env.WORKSPACE = if $env.WIN32 { "W:/" } else { "~/Workspace" | path expand }
7$env.NOTES = if $env.WIN32 { "N:/" } else { "~/Notes" | path expand }
8
9if ($env | get -i TERM_PROGRAM) == WezTerm {
10 $env.TERM = "wezterm"
11 if not $env.WIN32 {
12 $env.TERMCAP = ~./termcap/w/wezterm
13 }
14}
16# theme for ls and other programs, that use LS_COLORS
17$env.LS_COLORS = (try { vivid generate alabaster_dark | into string } catch {""})
19# Specifies how environment variables are:
20# - converted from a string to a value on Nushell startup (from_string)
21# - converted from a value back to a string when running external commands (to_string)
22# Note: The conversions happen *after* config.nu is loaded
23$env.ENV_CONVERSIONS = {
24 "PATH": {
25 from_string: { |s| $s | split row (char esep) }
26 to_string: { |v| $v | str join (char esep) }
27 }
28 "Path": {
29 from_string: { |s| $s | split row (char esep) }
30 to_string: { |v| $v | str join (char esep) }
31 }
32}
34# Directories to search for scripts when calling source or use
35$env.NU_LIB_DIRS = [
36 ($nu.config-path | path dirname | path join 'modules'),
37 ($nu.config-path | path dirname | path join 'completions')
38]
40if $env.WIN32 {
41 # TODO: insert scoop cargo path here
42 # $env.CARGO_HOME = ( '~/.cargo' | path expand )
43 $env.Path = ( $env.Path | prepend '' )
44} else {
45 $env.CARGO_HOME = ( '~/.cargo' | path expand )
46 $env.PATH = ( $env.PATH | prepend ( $env.CARGO_HOME | path join 'bin') )
47 $env.PATH = ( $env.PATH | prepend ( '~/.local/bin'| path expand ) )
48}

lua/bugabinga/plugins/heirline.lua

Added
new file mode 100644

+680 / −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 tag = 'v1.0.3',
12 event = 'BufEnter',
13 dependencies = {
14 'nvim-tree/nvim-web-devicons',
15 'lewis6991/gitsigns.nvim',
16 },
17 config = function ()
18 local heirline = require 'heirline'
19 local conditions = require 'heirline.conditions'
20 local utils = require 'heirline.utils'
22 local nugu = require 'bugabinga.nugu.palette'
23 heirline.load_colors( nugu )
25 auto 'reload_heirline_colors' {
26 description = 'Reload dark/light nugu colors for Heirline',
27 events = 'ColorScheme',
28 command = function () utils.on_colorscheme( nugu ) end,
29 }
31 local vi_mode = {
32 init = function ( self )
33 self.mode = vim.fn.mode( 1 ) -- :h mode()
34 end,
36 static = {
37 mode_names = {
38 n = icon.normal,
39 no = icon.normal .. '?',
40 nov = icon.normal .. '?',
41 noV = icon.normal .. '?',
42 ['no\22'] = icon.normal .. '?',
43 niI = icon.normal .. 'i',
44 niR = icon.normal .. 'r',
45 niV = icon.normal .. 'v',
46 nt = icon.normal .. 't',
47 v = icon.visual,
48 vs = icon.visual .. 's',
49 V = icon.visual .. '_',
50 Vs = icon.visual .. 's',
51 ['\22'] = '^' .. icon.visual,
52 ['\22s'] = '^' .. icon.visual,
53 s = icon.select,
54 S = icon.select .. '_',
55 ['\19'] = '^' .. icon.select,
56 i = icon.insert,
57 ic = icon.insert .. 'c',
58 ix = icon.insert .. 'x',
59 R = icon.replace,
60 Rc = icon.replace .. 'c',
61 Rx = icon.replace .. 'x',
62 Rv = icon.replace .. 'v',
63 Rvc = icon.replace .. 'v',
64 Rvx = icon.replace .. 'v',
65 c = icon.command,
66 cv = icon.command .. 'x',
67 r = icon.pending,
68 rm = icon.pending .. 'm',
69 ['r?'] = icon.pending .. '?',
70 ['!'] = icon.exclaim,
71 t = icon.terminal,
72 },
73 mode_colors = {
74 n = 'ui_normal',
75 i = 'ui_accent',
76 v = 'ui_important_global',
77 V = 'ui_important_global',
78 ['\22'] = 'ui_important_global',
79 c = 'ui_important_global',
80 s = 'ui_important_global',
81 S = 'ui_important_global',
82 ['\19'] = 'ui_important_global',
83 R = 'ui_important_global',
84 r = 'ui_important_global',
85 ['!'] = 'ui_important_global',
86 t = 'ui_important_global',
87 },
88 },
90 provider = function ( self )
91 local mode_name = self.mode_names[self.mode]
92 return ' ' .. icon.vim .. ' %3(' .. mode_name .. '%) '
93 end,
95 hl = function ( self )
96 local mode = self.mode:sub( 1, 1 ) -- get only the first mode character
97 return { fg = self.mode_colors[mode], bold = true, }
98 end,
100 update = {
101 'ModeChanged',
102 pattern = '*:*',
103 callback = vim.schedule_wrap( function () vim.cmd.redrawstatus() end ),
104 },
105 }
107 local file_icon = {
108 init = function ( self )
109 local filename = self.filename
110 local extension = vim.fn.fnamemodify( filename, ':e' )
111 self.icon = require 'nvim-web-devicons'.get_icon_color( filename, extension, { default = true, } )
112 end,
113 provider = function ( self )
114 return self.icon and (self.icon .. ' ')
115 end,
116 hl = 'DefaultIcon',
117 }
119 local file_name = {
120 init = function ( self )
121 self.lfilename = vim.fs.normalize( vim.fn.fnamemodify( self.filename, ':.' ) )
122 if self.lfilename == '' then self.lfilename = NEW_FILE end
123 end,
125 flexible = 2,
127 {
128 provider = function ( self )
129 return self.lfilename
130 end,
131 },
132 {
133 provider = function ( self )
134 return vim.fs.normalize( vim.fn.pathshorten( self.lfilename ) )
135 end,
136 },
137 }
139 local file_flags = {
140 {
141 condition = function ()
142 return vim.bo.modified
143 end,
144 provider = string.format( ' %s ', icon.modified ),
145 hl = 'Comment',
146 },
147 {
148 condition = function ()
149 return not vim.bo.modifiable or vim.bo.readonly
150 end,
151 provider = string.format( ' %s ', icon.lock ),
152 hl = 'ErrorMsg',
153 },
154 }
156 local file_name_block = {
157 init = function ( self )
158 self.filename = vim.fs.normalize( vim.api.nvim_buf_get_name( 0 ) )
159 end,
161 file_icon,
162 { provider = ' ', },
163 file_name,
164 file_flags,
165 { provider = '%<', }, -- this means that the statusline is cut here when there's not enough space
166 }
168 local file_type = {
169 provider = function ()
170 return icon.file .. ' ' .. string.upper( vim.bo.filetype )
171 end,
172 }
174 local file_encoding = {
175 provider = function ()
176 local enc = (vim.bo.fenc ~= '' and vim.bo.fenc) or vim.o.enc -- :h 'enc'
177 return enc ~= 'utf-8' and enc:upper()
178 end,
179 }
181 local file_format = {
182 static = {
183 dos = icon.newline .. icon.carriage_return,
184 unix = icon.newline,
185 mac = icon.carriage_return,
186 },
187 provider = function ( self )
188 local fileformat = vim.bo.fileformat
189 return self[fileformat]
190 end,
191 }
193 local file_size = {
194 provider = function ()
195 -- stackoverflow, compute human readable file size
196 -- i want to see vim opening a 1EiB file 󰱯
197 local suffix = { 'b', 'k', 'M', 'G', 'T', 'P', 'E', }
198 local fsize = vim.fn.getfsize( vim.api.nvim_buf_get_name( 0 ) )
199 fsize = (fsize < 0 and 0) or fsize
200 if fsize < 1024 then
201 return fsize .. suffix[1]
202 end
203 local i = math.floor( (math.log( fsize ) / math.log( 1024 )) )
204 return string.format( '%.2g%s', fsize / math.pow( 1024, i ), suffix[i + 1] )
205 end,
206 }
208 local file_last_modified = {
209 provider = function ()
210 local ftime = vim.fn.getftime( vim.api.nvim_buf_get_name( 0 ) )
211 if ftime > 0 then
212 local timeago = require 'std.timeago'
213 return timeago.format( ftime )
214 end
215 end,
216 }
218 local lsp_active = {
219 condition = conditions.lsp_attached,
220 -- FIXME: updates from parent components do not seem to update children,
221 -- if those have their own updates?
222 update = { 'LspAttach', 'LspDetach', 'BufEnter', 'BufLeave', },
224 provider = function ()
225 local names = {}
226 for _, client in pairs( vim.lsp.get_clients { bufnr = 0, } ) do
227 table.insert( names, client.name )
228 end
229 return icon.lsp .. ' ' .. table.concat( names, ' ' )
230 end,
231 }
233 local diagnostic_enabled = {
234 init = function ( self )
235 self.icon = vim.diagnostic.is_disabled() and icon.toggle_off or icon.toggle_on
236 end,
237 provider = function ( self )
238 return icon.diagnostic .. ' ' .. self.icon
239 end,
240 }
242 local diagnostic = {
243 condition = conditions.has_diagnostics,
245 static = {
246 error_icon = icon.error,
247 warn_icon = icon.warn,
248 info_icon = icon.info,
249 hint_icon = icon.hint,
250 },
252 init = function ( self )
253 self.errors = #vim.diagnostic.get( 0, { severity = vim.diagnostic.severity.ERROR, } )
254 self.warnings = #vim.diagnostic.get( 0, { severity = vim.diagnostic.severity.WARN, } )
255 self.hints = #vim.diagnostic.get( 0, { severity = vim.diagnostic.severity.HINT, } )
256 self.info = #vim.diagnostic.get( 0, { severity = vim.diagnostic.severity.INFO, } )
257 end,
259 update = { 'DiagnosticChanged', 'BufEnter', },
261 {
262 provider = function ( self )
263 -- 0 is just another output, we can decide to print it or not!
264 return self.errors > 0 and (self.error_icon .. ' ' .. self.errors .. ' ')
265 end,
266 hl = 'DiagnosticError',
267 },
268 {
269 provider = function ( self )
270 return self.warnings > 0 and (self.warn_icon .. ' ' .. self.warnings .. ' ')
271 end,
272 hl = 'DiagnosticWarn',
273 },
274 {
275 provider = function ( self )
276 return self.info > 0 and (self.info_icon .. ' ' .. self.info .. ' ')
277 end,
278 hl = 'DiagnosticInfo',
279 },
280 {
281 provider = function ( self )
282 return self.hints > 0 and (self.hint_icon .. ' ' .. self.hints)
283 end,
284 hl = 'DiagnosticHint',
285 },
286 }
288 local is_svn_repo = function ()
289 local svn_dir = vim.fs.find( '.svn', {
290 upward = true,
291 stop = vim.uv.os_homedir(),
292 path = vim.fs.dirname( vim.api.nvim_buf_get_name( 0 ) ),
293 type = 'directory',
294 } )
296 return not vim.tbl_isempty( svn_dir )
297 end
299 local svn_get_relative_url = function ()
300 -- FIXME: replace with vim.system
301 local job = require 'plenary.job'
302 local relative_url = { '[ERR]', }
304 job:new {
305 command = 'svn',
306 args = { 'info', '--show-item', 'relative-url', '--no-newline', },
307 on_exit = function ( current_job, exit_code )
308 if exit_code == 0 then relative_url = current_job:result() end
309 end,
310 }:sync()
312 return relative_url[1]
313 end
315 local svn = {
316 condition = is_svn_repo,
318 update = 'BufEnter',
320 init = function ( self )
321 self.relative_url = svn_get_relative_url()
322 end,
324 {
325 provider = function ( self )
326 return icon.subversion .. ' ' .. icon.branch .. ' ' .. self.relative_url
327 end,
328 },
330 }
332 local git = {
333 condition = conditions.is_git_repo,
335 init = function ( self )
336 self.status_dict = vim.b.gitsigns_status_dict
337 end,
339 {
340 provider = function ( self )
341 return icon.git .. ' ' .. icon.branch .. ' ' .. self.status_dict.head .. ' '
342 end,
343 },
344 {
345 provider = function ( self )
346 local count = self.status_dict.added or 0
347 return count > 0 and (icon.diff_add .. ' ' .. count .. ' ')
348 end,
349 hl = 'DiffAdd',
350 },
351 {
352 provider = function ( self )
353 local count = self.status_dict.removed or 0
354 return count > 0 and (icon.diff_remove .. ' ' .. count .. ' ')
355 end,
356 hl = 'DiffDelete',
357 },
358 {
359 provider = function ( self )
360 local count = self.status_dict.changed or 0
361 return count > 0 and (icon.diff_change .. ' ' .. count .. ' ')
362 end,
363 hl = 'DiffChange',
364 },
365 }
367 local work_dir = {
368 init = function ( self )
369 self.icon = (vim.fn.haslocaldir( 0 ) == 1 and icon['local'] or '') .. ' ' .. icon.global .. ' '
370 self.cwd = vim.fs.normalize( vim.uv.cwd() ):gsub( vim.fs.normalize( vim.uv.os_homedir() ), '~' )
371 end,
373 flexible = 1,
375 {
376 provider = function ( self )
377 return self.icon .. self.cwd
378 end,
379 },
380 {
381 provider = function ( self )
382 local cwd = vim.fn.pathshorten( self.cwd )
383 return self.icon .. cwd
384 end,
385 },
386 {
387 provider = '',
388 },
389 }
391 local help_file_name = {
392 condition = function ()
393 return vim.bo.filetype == 'help'
394 end,
395 provider = function ()
396 local filename = vim.api.nvim_buf_get_name( 0 )
397 return vim.fn.fnamemodify( filename, ':t' )
398 end,
399 hl = 'Question',
400 }
402 local terminal_name = {
403 provider = function ()
404 local name, _ = vim.api.nvim_buf_get_name( 0 ):gsub( '.*:', '' )
405 local basename = vim.fs.basename( name )
406 return icon.terminal .. ' ' .. (basename or 'noname')
407 end,
408 hl = 'Bold',
409 }
411 local togglers = {
412 provider = function ()
413 local togglers = require 'bugabinga.options.togglers'
414 return tostring( togglers )
415 end,
416 }
418 local macro_recording = {
419 condition = function ()
420 return vim.fn.reg_recording() ~= '' and vim.o.cmdheight == 0
421 end,
422 provider = icon.macro .. ' ',
423 hl = 'PreProc',
424 utils.surround( { '░▒▓ ', ' ▓▒░', }, nil, {
425 provider = function ()
426 return vim.fn.reg_recording()
427 end,
428 hl = 'Bold',
429 } ),
430 update = {
431 'RecordingEnter',
432 'RecordingLeave',
433 },
434 }
436 local lazy = {
437 condition = function ()
438 local ok, lazy_status = pcall( require, 'lazy.status' )
439 return ok and lazy_status.has_updates()
440 end,
441 update = { 'User', pattern = 'LazyUpdate', },
442 provider = function () return ' ' .. icon.lazy .. ' ' .. require 'lazy.status'.updates() .. ' ' end,
443 on_click = {
444 callback = function () require 'lazy'.update() end,
445 name = 'update_plugins',
446 },
447 }
449 local align = { provider = '%=', }
450 local space = { provider = ' ', }
452 local default_statusline = {
453 vi_mode, macro_recording, align,
454 work_dir, space, git, svn, align,
455 diagnostic_enabled, space, diagnostic, space, lsp_active, align,
456 togglers, align,
457 lazy, space, file_encoding, space, file_format, space, file_type, space, file_size, space, file_last_modified,
458 }
460 local special_statusline = {
461 condition = function ()
462 return conditions.buffer_matches {
463 buftype = ignored.buftypes,
464 filetype = ignored.filetypes,
465 }
466 end,
468 file_type,
469 space,
470 help_file_name,
471 align,
472 }
474 local terminal_statusline = {
476 condition = function ()
477 return conditions.buffer_matches { buftype = { 'terminal', }, }
478 end,
480 { condition = conditions.is_active, vi_mode, space, },
481 file_type,
482 space,
483 terminal_name,
484 align,
485 }
487 local inactive_statusline = {
488 condition = conditions.is_not_active,
489 file_type,
490 space,
491 file_name,
492 align,
493 }
495 local statuslines = {
496 hl = function ()
497 if conditions.is_active() then
498 return 'StatusLine'
499 else
500 return 'StatusLineNC'
501 end
502 end,
504 fallthrough = false,
506 special_statusline,
507 terminal_statusline,
508 inactive_statusline,
509 default_statusline,
510 }
512 local winbars = {
513 hl = function ()
514 if conditions.is_active() then
515 return 'Winbar'
516 else
517 return 'WinbarNC'
518 end
519 end,
521 fallthrough = false,
523 {
524 condition = function ()
525 return conditions.buffer_matches { buftype = { 'terminal', }, }
526 end,
528 file_type,
529 space,
530 terminal_name,
531 },
533 file_name_block,
534 }
536 local tabline_buffer_number = {
537 provider = function ( self )
538 return '(' .. tostring( self.bufnr ) .. ')'
539 end,
540 hl = function ( self )
541 if self.is_active then
542 return { fg = utils.get_highlight 'TabLineSel'.fg, }
543 elseif not vim.api.nvim_buf_is_loaded( self.bufnr ) then
544 return { fg = utils.get_highlight 'StatusLineNc'.fg, }
545 else
546 return { fg = utils.get_highlight 'TabLine'.fg, }
547 end
548 end,
549 }
551 local tabline_file_name = {
552 provider = function ( self )
553 local name = self.file_name
554 return name == '' and NEW_FILE or vim.fs.normalize( vim.fn.fnamemodify( name, ':t' ) )
555 end,
556 hl = function ( self ) return { bold = self.is_active or self.is_visible, italic = true, } end,
557 }
559 local tabline_file_flags = {
560 {
561 condition = function ( self ) return vim.api.nvim_get_option_value( 'modified', { buf = self.bufnr, } ) end,
562 provider = icon.modified .. ' ',
563 },
564 {
565 condition = function ( self )
566 return not vim.api.nvim_get_option_value( 'modifiable', { buf = self.bufnr, } ) or
567 vim.api.nvim_get_option_value( 'readonly', { buf = self.bufnr, } )
568 end,
569 provider = function ( self )
570 if vim.api.nvim_get_option_value( 'buftype', { buf = self.bufnr, } ) == 'terminal' then
571 return icon.terminal
572 else
573 return icon.lock
574 end
575 end,
576 },
577 hl = 'Bold',
578 }
580 local tabline_file_name_block = {
581 init = function ( self )
582 self.file_name = vim.api.nvim_buf_get_name( self.bufnr )
583 end,
585 hl = function ( self )
586 if self.is_active then
587 return 'TabLineSel'
588 elseif not vim.api.nvim_buf_is_loaded( self.bufnr ) then
589 return { fg = utils.get_highlight 'StatusLineNc'.fg, }
590 else
591 return 'TabLine'
592 end
593 end,
595 on_click = {
596 callback = function ( _, minwid, _, button )
597 if button == 'm' then --m = middle click
598 vim.schedule( function ()
599 vim.api.nvim_buf_delete( minwid, { force = false, } )
600 vim.cmd.redrawtabline()
601 end )
602 else
603 vim.api.nvim_win_set_buf( 0, minwid )
604 end
605 end,
606 minwid = function ( self ) return self.bufnr end,
607 name = 'heirline_tabline_buffer_callback',
608 },
610 file_icon,
611 { provider = ' ', },
612 tabline_file_name,
613 tabline_buffer_number,
614 tabline_file_flags,
615 }
617 local tabline_buffer_block = utils.surround(
618 {
619 ' ' .. icon.slant_left,
620 icon.slant_right .. ' ',
621 },
622 function ( self )
623 if self.is_active then
624 return utils.get_highlight 'TabLine'.bg
625 else
626 return utils.get_highlight 'TabLineFill'.bg
627 end
628 end,
629 { tabline_file_name_block, }
630 )
632 local buffer_line = utils.make_buflist(
633 tabline_buffer_block,
634 { provider = icon.arrow_left .. ' ', hl = 'TabLine', },
635 { provider = ' ' .. icon.arrow_right, hl = 'TabLine', }
636 )
638 local tabpage = {
639 provider = function ( self )
640 return '%' .. self.tabnr .. 'T ' .. self.tabpage .. ' %T'
641 end,
642 hl = function ( self )
643 if self.is_active then
644 return 'TabLineSel'
645 else
646 return 'TabLine'
647 end
648 end,
649 }
651 local tab_pages = {
652 { provider = '%=', },
653 utils.make_tablist( tabpage ),
654 }
656 local tabline = { buffer_line, tab_pages, }
658 -- local statuscolumn = {}
660 heirline.setup {
661 statusline = statuslines,
662 winbar = winbars,
663 tabline = tabline,
664 -- statuscolumn = statuscolumn,
666 opts = {
667 colors = nugu,
668 disable_winbar_cb = function ( args )
669 return conditions.buffer_matches(
670 {
671 buftype = ignored.buftypes,
672 filetype = ignored.filetypes,
673 },
674 args.buf )
675 end,
676 },
677 }
678 end,
679 },
680}

neovim/.editorconfig

Modified

+4 / −4 text lines

1717max_line_length = 120
1919# optional crlf/lf/cr/auto, if it is 'auto', in windows it is crlf other platforms are lf
20# in neovim the value 'auto' is not a valid option, please use 'unset'
20# in neovim the value 'auto' is not a valid option, please use 'unset'
2121end_of_line = lf
2323# none/ comma / semicolon / only_kv_colon
2424table_separator_style = comma
2626#optional keep/never/always/smart
27trailing_table_separator = keep
27trailing_table_separator = always
2929# keep/remove/remove_table_only/remove_string_only
3030call_arg_parentheses = remove
105105# [line space]
107107# The following configuration supports four expressions
108# keep
109# fixed(n)
108# keep
109# fixed(n)
110110# min(n)
111111# max(n)
112112# for eg. min(2)

neovim/README.md

Modified

+9 / −3 text lines

3939# todo
41* replace nugu with nugu_fresh
42* write plugin to parse lsp settings locally and apply them
43* is there a use case for a plugin that parses local plugin configuration overrides?
44* kill custom lsp stuff in favor of lspconfig and try neoconf + nvim-java
45* does status bar fail to display if lsp fails to load?
4146* pandoc with lua filters for diagrams for generating documents and previewing --> https://github.com/tex/vimpreviewpandoc
4247* use gen.ai to generate docs
4348* learn marks and refactor mark.lua
4449* use ltex-ls for markdown, code comments and commit messages
50* create a floating window that shows plugins, that have commands, as reminder
4551* setup DAP
4652* add nu-check to nvim-lint
4753* create facade over vim.api.nvim_create_user_command
48* create skelleton-plugin for default file content based on file type
49* add support for Java mutliline string in autopairs
50* nvim spell for camelcase words
54* create skeleton-plugin for default file content based on file type
55* add support for Java multi line string in autopairs
56* nvim spell for camel case words

neovim/colors/nugu_fresh.lua

Added
new file mode 100644

+580 / −0 text lines

1--- bugabingas color theme `nugu` for neovim
2
3-- Reset all highlights if another colorscheme was previously set
4if vim.g.colors_name ~= nil then vim.cmd [[ highlight clear ]] end
5
6-- follow convention for others to be able to query current colorscheme
7vim.g.colors_name = 'nugu_fresh'
8
9local palette = {
10 debug = { light = '#3dd45d', dark = '#3dd45d', },
11 error = { light = '#740523', dark = '#f27a9a', },
12 info = { light = '#4187a7', dark = '#e7f0f3', },
13 warning = { light = '#a7802d', dark = '#f1e8d6', },
15 content_normal = { light = '#494949', dark = '#cfcfcf', },
16 content_backdrop = { light = '#e3e3e3', dark = '#131313', },
17 content_accent = { light = '#800080', dark = '#800080', },
18 content_minor = { light = '#878787', dark = '#727272', },
19 content_focus = { light = '#646464', dark = '#a5bdb6', },
20 content_unfocus = { light = '#c9c9c9', dark = '#3f4543', },
21 content_important_global = { light = '#48256e', dark = '#8e58cc', },
22 content_important_local = { light = '#643398', dark = '#7a3bc3', },
24 ui_normal = { light = '#929292', dark = '#e2e2e2', },
25 ui_backdrop = { light = '#f9f9f9', dark = '#000000', },
26 ui_accent = { light = '#d43dd4', dark = '#7a067a', },
27 ui_minor = { light = '#d0d0d0', dark = '#424242', },
28 ui_focus = { light = '#646464', dark = '#788984', },
29 ui_unfocus = { light = '#c9c9c9', dark = '#121212', },
30 ui_important_global = { light = '#9170b5', dark = '#5f368d', },
31 ui_important_local = { light = '#ae95c8', dark = '#4c2b72', },
32}
34local function choose( variants )
35 ---@diagnostic disable-next-line: undefined-field
36 if vim.opt.background:get() == 'dark' then
37 return variants.dark
38 else
39 return variants.light
40 end
41end
43local debug = choose( palette.debug )
44local error = choose( palette.error )
45local info = choose( palette.info )
46local warning = choose( palette.warning )
48local content_normal = choose( palette.content_normal )
49local content_backdrop = choose( palette.content_backdrop )
50local content_accent = choose( palette.content_accent )
51local content_minor = choose( palette.content_minor )
52local content_focus = choose( palette.content_focus )
53local content_unfocus = choose( palette.content_unfocus )
54local content_important_global = choose( palette.content_important_global )
55local content_important_local = choose( palette.content_important_local )
57local ui_normal = choose( palette.ui_normal )
58local ui_backdrop = choose( palette.ui_backdrop )
59local ui_accent = choose( palette.ui_accent )
60local ui_minor = choose( palette.ui_minor )
61local ui_focus = choose( palette.ui_focus )
62local ui_unfocus = choose( palette.ui_unfocus )
63local ui_important_global = choose( palette.ui_important_global )
64local ui_important_local = choose( palette.ui_important_local )
66vim.g.terminal_color_0 = ui_backdrop -- black
67vim.g.terminal_color_1 = content_accent -- maroon
68vim.g.terminal_color_2 = info -- green
69vim.g.terminal_color_3 = ui_focus -- olive
70vim.g.terminal_color_4 = content_important_local -- navy
71vim.g.terminal_color_5 = content_important_global -- purple
72vim.g.terminal_color_6 = ui_focus -- teal
73vim.g.terminal_color_7 = content_normal -- silver
75vim.g.terminal_color_8 = ui_minor -- grey
76vim.g.terminal_color_9 = error -- red
77vim.g.terminal_color_10 = info -- lime
78vim.g.terminal_color_11 = content_focus -- yellow
79vim.g.terminal_color_12 = ui_important_local -- blue
80vim.g.terminal_color_13 = ui_accent -- fuchsia
81vim.g.terminal_color_14 = ui_important_global -- aqua
82vim.g.terminal_color_15 = ui_normal -- white
84local set_group_properties = function ( self, properties )
85 vim.validate {
86 properties = { properties, 'table', },
87 -- • fg (or foreground): color name or "#RRGGBB", see note.
88 ['properties.fg'] = { properties.fg, 'string', true, },
89 -- • bg (or background): color name or "#RRGGBB", see note.
90 ['properties.bg'] = { properties.bg, 'string', true, },
91 -- • sp (or special): color name or "#RRGGBB"
92 ['properties.sp'] = { properties.sp, 'string', true, },
93 -- • blend: integer between 0 and 100
94 ['properties.blend'] = { properties.blend, 'number', true, },
95 -- • bold: boolean
96 ['properties.bold'] = { properties.bold, 'boolean', true, },
97 -- • standout: boolean
98 ['properties.standout'] = { properties.standout, 'boolean', true, },
99 -- • underline: boolean
100 ['properties.underline'] = { properties.underline, 'boolean', true, },
101 -- • undercurl: boolean
102 ['properties.undercurl'] = { properties.undercurl, 'boolean', true, },
103 -- • underdotted: boolean
104 ['properties.underdotted'] = { properties.underdotted, 'boolean', true, },
105 -- • underdashed: boolean
106 ['properties.underdashed'] = { properties.underdashed, 'boolean', true, },
107 -- • strikethrough: boolean
108 ['properties.strikethrough'] = { properties.strikethrough, 'boolean', true, },
109 -- • italic: boolean
110 ['properties.italic'] = { properties.italic, 'boolean', true, },
111 -- • reverse: boolean
112 ['properties.reverse'] = { properties.reverse, 'boolean', true, },
113 -- • nocombine: boolean
114 ['properties.nocombine'] = { properties.nocombine, 'boolean', true, },
115 -- • default: Don't override existing definition |:hi-default|
116 ['properties.default'] = { properties.default, 'boolean', true, },
117 -- • ctermfg: Sets foreground of cterm color |ctermfg|
118 ['properties.ctermfg'] = { properties.ctermfg, 'string', true, },
119 -- • ctermbg: Sets background of cterm color |ctermbg|
120 ['properties.ctermbg'] = { properties.ctermbg, 'string', true, },
121 -- • cterm: cterm attribute map, like |highlight-args|. If not set, cterm attributes will match those from the attribute map documented above.
122 ['properties.cterm'] = { properties.cterm, 'table', true, },
123 -- • force: if true force update the highlight group when it exists.
124 ['properties.force'] = { properties.force, 'boolean', true, },
125 }
126 -- vim.print( 'SET GROUP PROPERTIES', self, properties )
127 for key, value in pairs( properties ) do
128 self[key] = value
129 end
130end
132local new_group = function ()
133 return setmetatable( {}, {
134 __call = set_group_properties,
135 } )
136end
138local add_group = function ( self, key )
139 if not self.groups[key] then
140 self.groups[key] = new_group()
141 end
142 return self.groups[key]
143end
145local link_group = function ( self, key, value )
146 -- vim.print( 'linking group', self, key, value )
147 local group = add_group( self, key )
148 for name, link_group in pairs( self.groups ) do
149 if link_group == value then
150 -- vim.print( 'found group to link ' .. name .. ' to ' .. key )
151 group.link = name
152 return group
153 end
154 end
155end
157local _ = setmetatable( { groups = {}, }, {
158 __index = add_group,
159 __newindex = link_group,
160} )
162_.Debug { fg = ui_normal, bg = debug, bold = true, }
163_.Normal { fg = content_normal, bg = content_backdrop, }
164_.NotifyBackground { bg = ui_backdrop, }
165_.Comment { fg = content_important_global, }
166_.LineNr { fg = ui_minor, bg = content_backdrop, }
167_.CursorLineNr { fg = ui_focus, bg = ui_backdrop, }
168_.Search { bg = content_unfocus, }
169_.IncSearch { fg = content_focus, }
170_.CurSearch { fg = content_normal, bg = content_important_global, }
171_.NormalFloat { fg = ui_normal, bg = ui_backdrop, }
172_.FloatBorder { fg = _.NormalFloat.bg, bg = _.NormalFloat.bg, }
173_.ColorColumn { fg = ui_important_global, bg = _.Normal.bg, }
174_.Conceal { fg = content_focus, bg = _.Normal.bg, }
175_.Cursor { bg = ui_accent, }
176-- _.lCursor = _.Cursor
177-- _.CursorIM = _.Cursor
178_.Directory { fg = _.Normal.fg, }
179_.DiffAdd { fg = content_focus, }
180_.DiffDelete { fg = content_focus, strikethrough = true, }
181_.DiffChange { fg = content_important_global, }
182_.DiffText { fg = content_normal, bg = content_important_local, }
183_.EndOfBuffer = _.Normal
184-- _.TermCursor = _.Cursor
185-- _.TermCursorNC = _.Cursor
186_.ErrorMsg { fg = error, }
187_.VertSplit { fg = ui_important_global, bg = _.LineNr.bg, }
188_.Folded = _.Conceal
189_.FoldColumn = _.LineNr
190_.SignColumn = _.LineNr
191_.ModeMsg { bold = true, }
192_.MsgArea = _.Normal
193_.MsgSeparator = _.Debug
194_.MoreMsg = _.Normal
195_.NonText { fg = content_unfocus, }
196_.Whitespace = _.NonText
197_.NormalNC = _.Normal
198_.Pmenu = _.NormalFloat
199_.PmenuSel { fg = ui_important_local, sp = ui_important_local, bg = _.Pmenu.bg, bold = true, underline = true, }
200_.PmenuSbar { bg = ui_unfocus, }
201_.PmenuThumb { bg = ui_minor, }
202_.Question { fg = ui_important_local, bold = true, }
203_.QuickFixLine = _.PmenuSel
204_.SpecialKey { fg = error, bg = content_unfocus, bold = true, }
205_.SpellBad { fg = error, undercurl = true, }
206_.SpellCap = _.SpellBad
207_.SpellLocal = _.SpellBad
208_.SpellRare = _.SpellBad
209_.StatusLine { fg = ui_focus, bg = ui_unfocus, }
210_.StatusLineNC { fg = ui_normal, bg = ui_unfocus, }
211_.Winbar { fg = ui_focus, bg = _.StatusLine.bg, }
212_.WinbarNC { fg = ui_minor, bg = _.LineNr.bg, }
213_.Title { fg = content_important_global, sp = content_important_global, bold = true, underline = true, }
214_.TabLine = _.StatusLine
215_.TabLineFill { fg = _.TabLine.fg, bg = content_backdrop, }
216_.TabLineSel { fg = ui_important_global, bg = ui_unfocus, }
217_.Visual { bg = content_unfocus, }
218_.VisualNOS { bg = ui_unfocus, }
219_.WarningMsg { fg = warning, bold = true, }
220_.WildMenu = _.Debug
222_.String { fg = content_important_local, italic = true, }
223_.Constant = _.String
224_.Character = _.String
225_.Number = _.String
226_.Boolean = _.String
227_.Float = _.String
229_.Identifier = _.Normal
230_.MutableVariable = _.Debug
231_.Function = _.Normal
233_.Statement { fg = content_minor, }
234_.Conditional = _.Statement
235_.Repeat = _.Statement
236_.Label = _.Statement
237_.Operator = _.Statement
238_.Keyword = _.Statement
239_.Exception = _.Statement
241_.PreProc { fg = content_important_global, bg = content_unfocus, bold = true, }
242_.Include = _.PreProc
243_.Define = _.PreProc
244_.Macro = _.PreProc
245_.PreCondit = _.PreProc
247_.Type = _.Statement
248_.StorageClass = _.Statement
249_.Structure = _.Statement
250_.Typedef = _.Statement
252_.Special { fg = content_normal, italic = true, bold = true, }
253_.SpecialChar = _.Special
254_.Tag = _.Special
255_.Delimiter { fg = content_minor, }
256_.SpecialComment = _.Special
258_.Underlined { sp = content_normal, underline = true, }
259_.Bold { bold = true, }
260_.Italic { italic = true, }
262_.Ignore { fg = _.Normal.bg, bg = _.Normal.bg, }
264_.Error { fg = error, }
265_.Todo { fg = content_important_global, sp = content_important_global, bold = true, underdouble = true, }
266_.DiagnosticUnnecessary { fg = ui_focus, }
267_.DiagnosticDeprecated { fg = ui_important_global, sp = ui_important_global, strikethrough = true, }
268_.DiagnosticError { fg = error, }
269_.DiagnosticWarn { fg = warning, }
270_.DiagnosticInfo { fg = info, }
271_.DiagnosticHint { fg = ui_important_local, }
272_.DiagnosticOk { fg = ui_minor, }
274_.DiagnosticVirtualTextError = _.DiagnosticError
275_.DiagnosticVirtualTextWarn = _.DiagnosticWarn
276_.DiagnosticVirtualTextInfo = _.DiagnosticInfo
277_.DiagnosticVirtualTextHint = _.DiagnosticHint
278_.DiagnosticVirtualOkHint = _.DiagnosticOk
279_.DiagnosticUnderlineError { fg = _.DiagnosticError.fg, sp = _.DiagnosticError.fg, underdouble = true, }
280_.DiagnosticUnderlineWarn { fg = _.DiagnosticWarn.fg, sp = _.DiagnosticWarn.fg, underline = true, }
281_.DiagnosticUnderlineInfo { fg = _.DiagnosticInfo.fg, sp = _.DiagnosticInfo.fg, underdashed = true, }
282_.DiagnosticUnderlineHint { fg = _.DiagnosticHint.fg, sp = _.DiagnosticHint.fg, italic = true, underdotted = true, }
283_.DiagnosticUnderlineOk { fg = _.DiagnosticOk.fg, italic = true, }
284_.DiagnosticSignError = _.DiagnosticError
285_.DiagnosticSignWarn = _.DiagnosticWarn
286_.DiagnosticSignInfo = _.DiagnosticInfo
287_.DiagnosticSignHint = _.DiagnosticHint
288_.DiagnosticSignOk = _.DiagnosticOk
290_.LspReferenceText { sp = content_unfocus, underline = true, }
291_.LspReferenceRead = _.LspReferenceText
292_.LspReferenceWrite = _.LspReferenceText
293_.LspInlayHint { fg = content_minor, bg = _.Normal.bg, }
295_['@text.literal'] = _.Comment
296_['@text.reference'] = _.Identifier
297_['@text.title'] = _.Title
298_['@text.underline'] = _.Underlined
299_['@text.todo'] = _.Todo
300_['@comment'] = _.Comment
301_['@punctuation'] = _.Delimiter
302_['@constant'] = _.Constant
303_['@constant.builtin'] = _.Special
304_['@constant.macro'] = _.Define
305_['@define'] = _.Define
306_['@macro'] = _.Macro
307_['@string'] = _.String
308_['@string.escape'] = _.SpecialChar
309_['@string.special'] = _.SpecialChar
310_['@character'] = _.Character
311_['@character.special'] = _.SpecialChar
312_['@number'] = _.Number
313_['@boolean'] = _.Boolean
314_['@float'] = _.Float
315_['@function'] = _.Function
316_['@function.builtin'] = _.Special
317_['@function.macro'] = _.Macro
318_['@parameter'] = _.Identifier
319_['@method'] = _.Function
320_['@field'] = _.Identifier
321_['@property'] = _.Identifier
322_['@constructor'] = _.Special
323_['@conditional'] = _.Conditional
324_['@repeat'] = _.Repeat
325_['@label'] = _.Label
326_['@operator'] = _.Operator
327_['@keyword'] = _.Keyword
328_['@keyword.return'] { fg = _.Keyword.fg, bg = _.Keyword.bg, underline = true, bold = true, }
329_['@exception'] = _.Exception
330_['@variable'] = _.Identifier
331_['@type'] = _.Type
332_['@type.definition'] = _.Typedef
333_['@storageclass'] = _.StorageClass
334_['@structure'] = _.Structure
335_['@namespace'] = _.Identifier
336_['@include'] = _.Include
337_['@preproc'] = _.PreProc
338_['@debug'] = _.Debug
339_['@tag'] = _.Tag
341_['@lsp.type.namespace'] = _['@namespace']
342_['@lsp.type.type'] = _['@type']
343_['@lsp.type.class'] = _['@type']
344_['@lsp.type.enum'] = _['@type']
345_['@lsp.type.interface'] = _['@type']
346_['@lsp.type.struct'] = _['@structure']
347_['@lsp.type.parameter'] = _['@parameter']
348_['@lsp.type.variable'] = _['@variable']
349_['@lsp.type.property'] = _['@property']
350_['@lsp.type.enumMember'] = _['@constant']
351_['@lsp.type.function'] = _['@function']
352_['@lsp.type.method'] = _['@method']
353_['@lsp.type.macro'] = _['@macro']
354_['@lsp.type.decorator'] = _['@function']
356_.LazyButton = _.NormalFloat
357_.LazyButton { sp = _.NormalFloat.fg, bold = true, }
358_.LazyButtonActive { fg = ui_focus, sp = _.NormalFloat.fg, bg = ui_important_local, bold = true, }
359_.LazyComment = _.Keyword
360_.LazyCommit = _.LazyComment
361_.LazyCommitIssue = _.LazyComment
362_.LazyCommitScope = _.LazyComment
363_.LazyCommitScope { italic = true, }
364_.LazyCommitType = _.LazyCommitScope
365_.LazyDimmed { fg = _.NormalFloat.fg, }
366_.LazyDir { fg = _.NormalFloat.fg, }
367_.LazyH1 = _.Bold
368_.LazyH2 = _.LazyH1
369_.LazyLocal {}
370_.LazyNoCond = _.WarningMsg
371_.LazyNormal = _.NormalFloat
372_.LazyProgressDone { fg = _.Search.bg, bg = _.Cursor.bg, bold = true, }
373_.LazyProgressTodo { fg = _.LazyProgressDone.bg, bg = _.LazyProgressDone.fg, bold = true, }
374_.LazyProp = _.LazyComment
375_.LazyReasonCmd = _.NormalFloat
376_.LazyReasonEvent = _.NormalFloat
377_.LazyReasonFt = _.NormalFloat
378_.LazyReasonImport = _.NormalFloat
379_.LazyReasonKeys = _.NormalFloat
380_.LazyReasonPlugin = _.NormalFloat
381_.LazyReasonRuntime = _.NormalFloat
382_.LazyReasonSource = _.NormalFloat
383_.LazyReasonStart = _.NormalFloat
384_.LazySpecial { fg = _.ColorColumn.fg, }
385_.LazyTaskError = _.ErrorMsg
386_.LazyTaskOutput = _.Debug
387_.LazyUrl { sp = _.NormalFloat.fg, italic = true, underline = true, }
388_.LazyValue { italic = true, }
390-- _.NoiceCmdline = _.NormalFloat
391-- _.NoiceCmdlineIcon { fg = ui_accent, }
392-- _.NoiceCmdlineIconCalculator = _.NoiceCmdlineIcon
393-- _.NoiceCmdlineIconCmdline = _.NoiceCmdlineIcon
394-- _.NoiceCmdlineIconFilter = _.NoiceCmdlineIcon
395-- _.NoiceCmdlineIconHelp = _.NoiceCmdlineIcon
396-- _.NoiceCmdlineIconIncRename = _.NoiceCmdlineIcon
397-- _.NoiceCmdlineIconInput = _.NoiceCmdlineIcon
398-- _.NoiceCmdlineIconLua = _.NoiceCmdlineIcon
399-- _.NoiceCmdlineIconSearch = _.NoiceCmdlineIcon
400--
401-- _.NoiceCmdlinePopup = _.NormalFloat
402-- _.NoiceCmdlinePopupBorder = _.FloatBorder
403-- _.NoiceCmdlinePopupBorderCalculator = _.NoiceCmdlinePopupBorder
404-- _.NoiceCmdlinePopupBorderCmdline = _.NoiceCmdlinePopupBorder
405-- _.NoiceCmdlinePopupBorderFilter = _.NoiceCmdlinePopupBorder
406-- _.NoiceCmdlinePopupBorderHelp = _.NoiceCmdlinePopupBorder
407-- _.NoiceCmdlinePopupBorderIncRename = _.NoiceCmdlinePopupBorder
408-- _.NoiceCmdlinePopupBorderInput = _.NoiceCmdlinePopupBorder
409-- _.NoiceCmdlinePopupBorderLua = _.NoiceCmdlinePopupBorder
410-- _.NoiceCmdlinePopupBorderSearch = _.NoiceCmdlinePopupBorder
411-- _.NoiceCmdlinePopupTitle = _.NoiceCmdlinePopup
412-- _.NoiceCmdlinePrompt = _.NoiceCmdlinePopup
413-- _.NoiceCompletionItemKindDefault { fg = ui_normal, }
414-- _.NoiceCompletionItemKindClass = _.NoiceCompletionItemKindDefault
415-- _.NoiceCompletionItemKindColor = _.NoiceCompletionItemKindDefault
416-- _.NoiceCompletionItemKindConstant = _.NoiceCompletionItemKindDefault
417-- _.NoiceCompletionItemKindConstructor = _.NoiceCompletionItemKindDefault
418-- _.NoiceCompletionItemKindEnum = _.NoiceCompletionItemKindDefault
419-- _.NoiceCompletionItemKindEnumMember = _.NoiceCompletionItemKindDefault
420-- _.NoiceCompletionItemKindField = _.NoiceCompletionItemKindDefault
421-- _.NoiceCompletionItemKindFile = _.NoiceCompletionItemKindDefault
422-- _.NoiceCompletionItemKindFolder = _.NoiceCompletionItemKindDefault
423-- _.NoiceCompletionItemKindFunction = _.NoiceCompletionItemKindDefault
424-- _.NoiceCompletionItemKindInterface = _.NoiceCompletionItemKindDefault
425-- _.NoiceCompletionItemKindKeyword = _.NoiceCompletionItemKindDefault
426-- _.NoiceCompletionItemKindMethod = _.NoiceCompletionItemKindDefault
427-- _.NoiceCompletionItemKindModule = _.NoiceCompletionItemKindDefault
428-- _.NoiceCompletionItemKindProperty = _.NoiceCompletionItemKindDefault
429-- _.NoiceCompletionItemKindSnippet = _.NoiceCompletionItemKindDefault
430-- _.NoiceCompletionItemKindStruct = _.NoiceCompletionItemKindDefault
431-- _.NoiceCompletionItemKindText = _.NoiceCompletionItemKindDefault
432-- _.NoiceCompletionItemKindUnit = _.NoiceCompletionItemKindDefault
433-- _.NoiceCompletionItemKindValue = _.NoiceCompletionItemKindDefault
434-- _.NoiceCompletionItemKindVariable = _.NoiceCompletionItemKindDefault
435-- _.NoiceCompletionItemMenu = _.NoiceCompletionItemKindDefault
436-- _.NoiceCompletionItemWord = _.NoiceCompletionItemKindDefault
437--
438-- _.NoiceConfirm = _.NormalFloat
439-- _.NoiceConfirmBorder = _.FloatBorder
440-- _.NoiceFormatConfirm = _.LazyButton
441-- _.NoiceFormatConfirmDefault = _.LazyButtonActive
442--
443-- _.NoiceCursor = _.Cursor
444--
445-- _.NoiceFormatDate = _.NonText
446-- _.NoiceFormatEvent = _.NonText
447-- _.NoiceFormatKind = _.NonText
448-- _.NoiceFormatLevelDebug { fg = _.Debug.bg, }
449-- _.NoiceFormatLevelError = _.DiagnosticError
450-- _.NoiceFormatLevelInfo = _.DiagnosticInfo
451-- _.NoiceFormatLevelOff { fg = content_minor, }
452-- _.NoiceFormatLevelTrace = _.DiagnosticHint
453-- _.NoiceFormatLevelWarn = _.DiagnosticWarn
454-- _.NoiceFormatProgressDone = _.LazyProgressDone
455-- _.NoiceFormatProgressTodo = _.LazyProgressTodo
456-- _.NoiceFormatTitle = _.Title
457--
458-- _.NoiceLspProgressClient = _.Debug
459-- _.NoiceLspProgressSpinner = _.Debug
460-- _.NoiceLspProgressTitle = _.Debug
461--
462-- _.NoiceMini = _.DiagnosticInfo
463--
464-- _.NoicePopup = _.NormalFloat
465-- _.NoicePopupBorder = _.FloatBorder
466--
467-- _.NoicePopupmenu = _.Pmenu
468-- _.NoicePopupmenuBorder = _.FloatBorder
469-- _.NoicePopupmenuMatch = _.Bold
470-- _.NoicePopupmenuSelected = _.PmenuSel
471--
472-- _.NoiceScrollbar = _.PmenuSbar
473-- _.NoiceScrollbarThumb = _.PmenuThumb
474--
475-- _.NoiceSplit = _.Normal
476-- _.NoiceSplitBorder = _.FloatBorder
477-- _.NoiceVirtualText { fg = ui_important_global, bg = ui_unfocus, }
478-- _.NotifyERRORBorder { fg = _.DiagnosticError.fg, bg = _.FloatBorder.bg, }
479-- _.NotifyWARNBorder { fg = _.DiagnosticWarn.fg, bg = _.FloatBorder.bg, }
480-- _.NotifyINFOBorder { fg = _.DiagnosticInfo.fg, bg = _.FloatBorder.bg, }
481-- _.NotifyDEBUGBorder { fg = _.Debug.bg, bg = _.FloatBorder.bg, }
482-- _.NotifyTRACEBorder { fg = _.DiagnosticHint.fg, bg = _.FloatBorder.bg, }
483--
484-- _.NotifyERRORIcon { fg = _.DiagnosticError.fg, }
485-- _.NotifyWARNIcon { fg = _.DiagnosticWarn.fg, }
486-- _.NotifyINFOIcon { fg = _.DiagnosticInfo.fg, }
487-- _.NotifyDEBUGIcon { fg = _.Debug.bg, }
488-- _.NotifyTRACEIcon { fg = _.DiagnosticHint.fg, }
489--
490-- _.NotifyERRORTitle { fg = _.DiagnosticError.fg, }
491-- _.NotifyWARNTitle { fg = _.DiagnosticWarn.fg, }
492-- _.NotifyINFOTitle { fg = _.DiagnosticInfo.fg, }
493-- _.NotifyDEBUGTitle { fg = _.Debug.bg, }
494-- _.NotifyTRACETitle { fg = _.DiagnosticHint.fg, }
495--
496-- _.NotifyERRORBody = _.NormalFloat
497-- _.NotifyWARNBody = _.NormalFloat
498-- _.NotifyINFOBody = _.NormalFloat
499-- _.NotifyDEBUGBody = _.NormalFloat
500-- _.NotifyTRACEBody = _.NormalFloat
502_.TelescopeSelectionCaret = _.PmenuSel
503_.TelescopeSelection = _.PmenuSel
504_.TelescopeMultiSelection { fg = content_normal, bg = ui_important_local, }
506_.FlashBackdrop {}
507_.FlashMatch = _.IncSearch
508_.FlashCurrent = _.CurSearch
509_.FlashLabel { fg = ui_accent, bg = ui_backdrop, }
511_.GitSignsAdd { fg = _.DiffAdd.fg, bg = _.LineNr.bg, }
512_.GitSignsChange { fg = _.DiffChange.fg, bg = _.LineNr.bg, }
513_.GitSignsDelete { fg = _.DiffDelete.fg, bg = _.LineNr.bg, }
515_.GitSignsChangedelete = _.GitSignsChange
516_.GitSignsTopdelete = _.GitSignsDelete
517_.GitSignsUntracked = _.GitSignsAdd
519_.GitSignsAddNr = _.GitSignsAdd
520_.GitSignsChangeNr = _.GitSignsChange
521_.GitSignsDeleteNr = _.GitSignsDelete
523_.GitSignsChangedeleteNr = _.GitSignsChange
524_.GitSignsTopdeleteNr = _.GitSignsDelete
525_.GitSignsUntrackedNr = _.GitSignsAdd
527_.GitSignsAddLn = _.GitSignsAdd
528_.GitSignsChangeLn = _.GitSignsChange
529_.GitSignsChangedeleteLn = _.GitSignsChange
530_.GitSignsUntrackedLn = _.GitSignsAdd
532_.GitSignsAddPreview = _.GitSignsAdd
533_.GitSignsDeletePreview = _.GitSignsDelete
535_.GitSignsCurrentLineBlame = _.NonText
536_.GitSignsAddInline = _.GitSignsAdd
537_.GitSignsDeleteInline = _.GitSignsDelete
538_.GitSignsChangeInline = _.GitSignsChange
540_.GitSignsAddLnInline = _.DiffText
541_.GitSignsDeleteLnInline = _.DiffText
542_.GitSignsChangeLnInline = _.DiffText
544_.GitSignsDeleteVirtLn = _.GitSignsDelete
545_.GitSignsDeleteVirtLnInLine = _.DiffText
546_.GitSignsVirtLnum { fg = _.LineNr.fg, }
548_.WhichKey { fg = ui_important_global, }
549_.WhichKeyGroup { fg = ui_important_local, }
550_.WhichKeySeparator { fg = ui_minor, }
551_.WhichKeyDesc { fg = ui_normal, }
552_.WhichKeyFloat = _.NormalFloat
553_.WhichKeyBorder = _.FloatBorder
554_.WhichKeyValue = _.Comment
556_.IblIndent = _.Whitespace
557_.IblWhitespace = _.Whitespace
558_.IblScope { fg = ui_focus, bg = _.Normal.bg, }
560_.Hlargs { fg = content_important_local, }
562_.MiniStarterCurrent { fg = ui_normal, bg = ui_accent, }
563_.MiniStarterFooter = _.Keyword
564_.MiniStarterHeader = _.Comment
565_.MiniStarterInactive { fg = content_unfocus, }
566_.MiniStarterItem = _.Normal
567_.MiniStarterItemBullet = _.Whitespace
568_.MiniStarterItemPrefix { fg = content_focus, }
569_.MiniStarterSection { fg = content_important_global, underline = true, }
570_.MiniStarterQuery { fg = content_normal, bg = content_accent, }
572--TODO: Oil highlights
574for name, group in pairs( _.groups ) do
575 local namespace = 0
576 -- vim.print( namespace, name, group )
577 vim.api.nvim_set_hl( namespace, name, group )
578end
580-- vim.print( 'ALL HIGHLIGHTS', _ )

neovim/init.lua

Modified

+3 / −3 text lines

99-- ▀ ▀
1111-- setup debug mode
12-- local debug = require 'std.debug'
13-- debug.toggle()
12-- require 'std.debug'.toggle()
14vim.cmd.colorscheme 'nugu_fresh'
1516local ok, loaded
3738-- setup lsp clients
3839ok, loaded = pcall( require, 'bugabinga.lsp' )
3940if not ok then vim.print( 'error while loading lsp', loaded ) end

neovim/lazy-lock.json

Modified

+23 / −32 text lines

11{
2 "Comment.nvim": { "branch": "master", "commit": "0236521ea582747b58869cb72f70ccfa967d2e89" },
3 "LuaSnip": { "branch": "master", "commit": "8ae1dedd988eb56441b7858bd1e8554dfadaa46d" },
2 "Comment.nvim": { "branch": "master", "commit": "e51f2b142d88bb666dcaa77d93a07f4b419aca70" },
43 "actions-preview.nvim": { "branch": "master", "commit": "5072b1b1065a6b22bdd46b5c21780a91d6a08071" },
54 "auto-dark-mode.nvim": { "branch": "master", "commit": "e328dc463d238cb7d690fb4daf068eba732a5a14" },
65 "better-escape.nvim": { "branch": "master", "commit": "7e86edafb8c7e73699e0320f225464a298b96d12" },
7 "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
8 "cmp-emoji": { "branch": "main", "commit": "0acd702358230abeb6576769f7116e766bca28a0" },
9 "cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" },
10 "cmp-nvim-lsp-document-symbol": { "branch": "main", "commit": "f0f53f704c08ea501f9d222b23491b0d354644b0" },
11 "cmp-nvim-lsp-signature-help": { "branch": "main", "commit": "3d8912ebeb56e5ae08ef0906e3a54de1c66b92f1" },
12 "cmp-omni": { "branch": "main", "commit": "4ef610bbd85a5ee4e97e09450c0daecbdc60de86" },
13 "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
14 "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" },
156 "diffview.nvim": { "branch": "main", "commit": "3dc498c9777fe79156f3d32dddd483b8b3dbd95f" },
16 "dressing.nvim": { "branch": "master", "commit": "6f212262061a2120e42da0d1e87326e8a41c0478" },
7 "dressing.nvim": { "branch": "master", "commit": "18e5beb3845f085b6a33c24112b37988f3f93c06" },
8 "fidget.nvim": { "branch": "main", "commit": "4e854f3299e21d1c18279add340428a97520fc44" },
179 "flash.nvim": { "branch": "main", "commit": "48817af25f51c0590653bbc290866e4890fe1cbe" },
18 "friendly-snippets": { "branch": "main", "commit": "dcd4a586439a1c81357d5b9d26319ae218cc9479" },
19 "gen.nvim": { "branch": "main", "commit": "85a739cea06148a56d52f26b01d63de6671ce4ce" },
20 "gitsigns.nvim": { "branch": "main", "commit": "2c2463dbd82eddd7dbab881c3a62cfbfbe3c67ae" },
10 "gen.nvim": { "branch": "main", "commit": "2cb643b1a827bcdfc665a37d5f8174249d2d5bf5" },
11 "gitsigns.nvim": { "branch": "main", "commit": "6ef8c54fb526bf3a0bc4efb0b2fe8e6d9a7daed2" },
2112 "glow.nvim": { "branch": "main", "commit": "238070a686c1da3bccccf1079700eb4b5e19aea4" },
2213 "heirline.nvim": { "branch": "master", "commit": "03cff30d7e7d3ba6fdc00925f015822f79cef908" },
2314 "hlargs.nvim": { "branch": "main", "commit": "0f2dbf02ff948e8fc8ebe07b215f3174a12bbe3c" },
15 "hyper.nvim": { "branch": "main", "commit": "b84fb39e703b1dd487d20c4faf028ee51374c88b" },
2416 "indent-blankline.nvim": { "branch": "master", "commit": "821a7acd88587d966f7e464b0b3031dfe7f5680c" },
2517 "lazy.nvim": { "branch": "main", "commit": "83493db50a434a4c5c648faf41e2ead80f96e478" },
26 "lspkind.nvim": { "branch": "master", "commit": "1735dd5a5054c1fb7feaf8e8658dbab925f4f0cf" },
27 "lush.nvim": { "branch": "main", "commit": "2e8d34e748642621d761a65e3c2a198154b914e8" },
18 "lush.nvim": { "branch": "main", "commit": "bc12f010b34cfeefac35720656eb777753b165d9" },
2819 "mason-tool-installer.nvim": { "branch": "main", "commit": "1212fb6082b7177dde17ea65e429e027835aeb40" },
29 "mason.nvim": { "branch": "main", "commit": "3b5068f0fc565f337d67a2d315d935f574848ee7" },
20 "mason.nvim": { "branch": "main", "commit": "c43eeb5614a09dc17c03a7fb49de2e05de203924" },
3021 "mini.align": { "branch": "main", "commit": "f845218c5fea89e49074e48270dc5e1b9511a0f9" },
3122 "mini.bracketed": { "branch": "main", "commit": "65c7dfb51e832de9e279e5d5b0741e7af6755ab5" },
3223 "mini.colors": { "branch": "main", "commit": "f64963332f7fcb45c8dfcc243f682a9a0fb9935d" },
3324 "mini.starter": { "branch": "main", "commit": "ce222a5b6de50a9963c1eb62aa16ec6d5efca7ee" },
3425 "mkdir.nvim": { "branch": "main", "commit": "c55d1dee4f099528a1853b28bb28caa802eba217" },
35 "neodev.nvim": { "branch": "main", "commit": "84e0290f5600e8b89c0dfcafc864f45496a53400" },
3626 "neogen": { "branch": "main", "commit": "b95347a588401a755eadd17482edc1662876bd58" },
3727 "nrpattern.nvim": { "branch": "master", "commit": "f862ce687761078ef3155688151c55f69d28453e" },
38 "nui.nvim": { "branch": "main", "commit": "756c59f46057cd2d43619cd3a6d4e01b2aa60295" },
28 "nui.nvim": { "branch": "main", "commit": "3dc46d725f7b94bee5117c0a699b57b1902b5d65" },
3929 "nvim-autopairs": { "branch": "master", "commit": "c6139ca0d5ad7af129ea6c89cb4c56093f2c034a" },
40 "nvim-cmp": { "branch": "main", "commit": "04e0ca376d6abdbfc8b52180f8ea236cbfddf782" },
4130 "nvim-colorizer.lua": { "branch": "master", "commit": "85855b38011114929f4058efc97af1059ab3e41d" },
4231 "nvim-genghis": { "branch": "main", "commit": "8613fc1b43db6cc761733b3630eabff9e86296f7" },
4332 "nvim-gomove": { "branch": "main", "commit": "2b44ae7ac0804f4e3959228122f7c85bef1964e3" },
4433 "nvim-jdtls": { "branch": "master", "commit": "a4746791876166dc146eae573a1b49d24a6652e7" },
4534 "nvim-lastplace": { "branch": "main", "commit": "0bb6103c506315044872e0f84b1f736c4172bb20" },
35 "nvim-lsp-file-operations": { "branch": "master", "commit": "223aca86b737dc66e9c51ebcda8788a8d9cc6cf2" },
36 "nvim-navbuddy": { "branch": "master", "commit": "f137a3466a6cd1965cdcc5398daff54e66eebbe5" },
37 "nvim-navic": { "branch": "master", "commit": "8649f694d3e76ee10c19255dece6411c29206a54" },
4638 "nvim-neoclip.lua": { "branch": "main", "commit": "798cd0592a81c185465db3a091a0ff8a21af60fd" },
4739 "nvim-spectre": { "branch": "master", "commit": "e7db8ebca7fd0a604027ebf85acee52f6642c91c" },
4840 "nvim-surround": { "branch": "main", "commit": "84a26afce16cffa7e3322cfa80a42cddf60616eb" },
49 "nvim-tree.lua": { "branch": "master", "commit": "041dbd18f440207ad161503a384e7c82d575db66" },
50 "nvim-treesitter": { "branch": "master", "commit": "488bec03254207b1dd071be8cb1fb78434b6e777" },
51 "nvim-treesitter-textobjects": { "branch": "master", "commit": "b7a0bfa3e93697ca5b61b15df633404bf8f45883" },
41 "nvim-tree.lua": { "branch": "master", "commit": "707b24af91a1d05823099ed8c5450796290466ba" },
42 "nvim-treesitter": { "branch": "master", "commit": "f197a15b0d1e8d555263af20add51450e5aaa1f0" },
43 "nvim-treesitter-textobjects": { "branch": "master", "commit": "d2a4ffc22d9d38d44edb73da007b3cf43451e9b4" },
5244 "nvim-ts-autotag": { "branch": "main", "commit": "531f48334c422222aebc888fd36e7d109cb354cd" },
5345 "nvim-ts-context-commentstring": { "branch": "main", "commit": "7ab799a9792f7cf3883cf28c6a00ad431f3d382a" },
54 "nvim-web-devicons": { "branch": "master", "commit": "75df79feb02d5e0ec114e447453775d4d291ea03" },
46 "nvim-web-devicons": { "branch": "master", "commit": "cb0c967c9723a76ccb1be0cc3a9a10e577d2f6ec" },
5547 "nvim-window": { "branch": "main", "commit": "e7f5d60eeec8ff37af7be4c9a99f65edf67fc574" },
56 "oil.nvim": { "branch": "master", "commit": "18dfd2458dc741fea683357a17aaa95870b25a3c" },
57 "persistence.nvim": { "branch": "main", "commit": "4982499c1636eac254b72923ab826ee7827b3084" },
48 "oil.nvim": { "branch": "master", "commit": "32e18df30f937e02135398c270b72a4d24b40120" },
49 "persistence.nvim": { "branch": "main", "commit": "ad538bfd5336f1335cdb6fd4e0b0eebfa6e12f32" },
5850 "playground": { "branch": "master", "commit": "ba48c6a62a280eefb7c85725b0915e021a1a0749" },
5951 "plenary.nvim": { "branch": "master", "commit": "f7adfc4b3f4f91aab6caebf42b3682945fbc35be" },
60 "schemastore.nvim": { "branch": "main", "commit": "b788bde023f9fbc2eb86e89d32c0bf98a60ae406" },
61 "specs.nvim": { "branch": "main", "commit": "2743e412bbe21c9d73954c403d01e8de7377890d" },
52 "schemastore.nvim": { "branch": "main", "commit": "4d798fd5b692c8fce77268aba8f6f926b0c9f835" },
53 "specs.nvim": { "branch": "main", "commit": "e929006d3f6bb8e43f03e13ac364c67236eb5299" },
6254 "speedtyper.nvim": { "branch": "main", "commit": "2d158eed4c753995b0501a3a7a72464fbb213e3d" },
6355 "ssr.nvim": { "branch": "main", "commit": "bb323ba621ac647b4ac5638b47666e3ef3c279e1" },
6456 "substitute.nvim": { "branch": "main", "commit": "17ffaeb5a1dc2dbef39cf0865d8a4b6000836714" },
65 "symbols-outline.nvim": { "branch": "master", "commit": "564ee65dfc9024bdde73a6621820866987cbb256" },
6657 "telescope-symbols.nvim": { "branch": "master", "commit": "a6d0127a53d39b9fc2af75bd169d288166118aec" },
6758 "telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" },
6859 "telescope-zoxide": { "branch": "main", "commit": "68966349aa1b8e9ade403e18479ecf79447389a7" },
69 "telescope.nvim": { "branch": "0.1.x", "commit": "d90956833d7c27e73c621a61f20b29fdb7122709" },
70 "todo-comments.nvim": { "branch": "main", "commit": "833d8dd8b07eeda37a09e99460f72a02616935cb" },
60 "telescope.nvim": { "branch": "master", "commit": "6312868392331c9c0f22725041f1ec2bef57c751" },
61 "todo-comments.nvim": { "branch": "main", "commit": "8febc60a76feefd8203077ef78b6a262ea1a41f9" },
7162 "toggleterm.nvim": { "branch": "main", "commit": "193786e0371e3286d3bc9aa0079da1cd41beaa62" },
7263 "tree-sitter-nu": { "branch": "main", "commit": "c5b7816043992b1cdc1462a889bc74dc08576fa6" },
7364 "treesj": { "branch": "main", "commit": "60e27280030f9cd8dfb6ceb335922c6ff76682cc" },
7465 "twilight.nvim": { "branch": "main", "commit": "8b7b50c0cb2dc781b2f4262a5ddd57571556d1e4" },
7566 "virt-column.nvim": { "branch": "master", "commit": "b62b4ef0774d19452d4ed18e473e824c7a756f2f" },
76 "which-key.nvim": { "branch": "main", "commit": "4433e5ec9a507e5097571ed55c02ea9658fb268a" },
67 "which-key.nvim": { "branch": "main", "commit": "ce741eb559c924d72e3a67d2189ad3771a231414" },
7768 "zen-mode.nvim": { "branch": "main", "commit": "78557d972b4bfbb7488e17b5703d25164ae64e6a" }
7869}No final newline

neovim/lua/bugabinga/diagnostic.lua

Modified

+1 / −0 text lines

7070sign { name = 'DiagnosticSignHint', text = diagnostic_icons.hint }
7171sign { name = 'DiagnosticSignInfo', text = diagnostic_icons.info }
73-- TODO: move to togglers
7374map.normal {
7475 description = 'Toggle diagnostics',
7576 category = 'diagnostic',

neovim/lua/bugabinga/lazy.lua

Modified

+30 / −30 text lines

1local win32 = vim.loop.os_uname().sysname:match'Win'
1local win32 = vim.loop.os_uname().sysname:match 'Win'
22local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim'
3if not vim.loop.fs_stat(lazypath) then
3if not vim.loop.fs_stat( lazypath ) then
44 vim.fn.system {
55 'git',
66 'clone',
1010 lazypath,
1111 }
1212end
13vim.opt.rtp:prepend(lazypath)
13vim.opt.rtp:prepend( lazypath )
1515-- prevents lazy from setting up its highlights.
1616-- those will be setup manually later.
17require('lazy.view.colors').did_setup = true
17require 'lazy.view.colors'.did_setup = true
1919local lazy = require 'lazy'
20local icon = require'std.icon'
20local icon = require 'std.icon'
22lazy.setup('bugabinga.plugins', {
22lazy.setup( 'bugabinga.plugins', {
2323 defaults = {
2424 lazy = true,
2525 -- version = '*',
2626 },
2727 install = {
2828 missing = true,
29 colorscheme = { 'nugu', 'quiet' },
29 colorscheme = { 'nugu_fresh', 'quiet', },
3030 },
3131 checker = {
3232 enabled = not win32,
3333 notify = false,
3434 },
3535 ui = {
36 size = { width = 0.69 , heigth = 0.69 },
36 size = { width = 0.69, heigth = 0.69, },
3737 border = vim.g.border_style,
3838 icons = {
3939 lazy = icon.lazy,
4242 },
4343 },
4444 custom_keys = {
45 ["<localleader>l"] = function(plugin)
46 require("lazy.util").float_term("gitui", {
45 ['<localleader>l'] = function ( plugin )
46 require 'lazy.util'.float_term( 'gitui', {
4747 cwd = plugin.dir,
48 })
48 } )
4949 end,
50 ["<localleader>t"] = function(plugin)
51 require("lazy.util").float_term(nil, {
50 ['<localleader>t'] = function ( plugin )
51 require 'lazy.util'.float_term( nil, {
5252 cwd = plugin.dir,
53 })
53 } )
5454 end,
5555 },
56 change_detection = { notify = false },
56 change_detection = { notify = false, },
5757 performance = {
5858 rtp = {
5959 disabled_plugins = {
8383 },
8484 dev = {
8585 fallback = true,
86 patterns = { 'bugabinga' },
87 path = win32 and 'W:/' or '~/Workspace'
86 patterns = { 'bugabinga', },
87 path = win32 and 'W:/' or '~/Workspace',
8888 },
89})
89} )
9191local map = require 'std.map'
9393local lazy_cmds = vim.iter {
94 { 'Show', '' , lazy.show } ,
95 { 'Install', 'i', lazy.install },
96 { 'Update', 'u', lazy.update },
97 { 'Sync', 's', lazy.sync },
98 { 'Clean', 'x', lazy.clean },
99 { 'Check', 'c', lazy.check },
100 { 'Log', 'l', lazy.log },
101 { 'Restore', 'r', lazy.restore },
102 { 'Profile', 'p', lazy.profile },
103 { 'Debug', 'd', lazy.debug },
94 { 'Show', '', lazy.show, },
95 { 'Install', 'i', lazy.install, },
96 { 'Update', 'u', lazy.update, },
97 { 'Sync', 's', lazy.sync, },
98 { 'Clean', 'x', lazy.clean, },
99 { 'Check', 'c', lazy.check, },
100 { 'Log', 'l', lazy.log, },
101 { 'Restore', 'r', lazy.restore, },
102 { 'Profile', 'p', lazy.profile, },
103 { 'Debug', 'd', lazy.debug, },
106106local base_key = '<leader>z'
108lazy_cmds:each(function(cmd)
108lazy_cmds:each( function ( cmd )
109109 map.normal {
110110 name = cmd[1] .. ' plugins',
111111 category = 'plugins',
112112 keys = base_key .. cmd[2],
113113 command = cmd[3],
114114 }
115end)
115end )

neovim/lua/bugabinga/lsp/clients/archlinux.lua

Deleted
deleted file mode 100644

+0 / −10 text lines

1local project = require'std.project'
2
3return {
4 name = 'pkgbuild-language-server',
5 command = 'pkgbuild-language-server',
6 filetypes = { 'PKGBUILD' },
7 root_dir = project.find_vcs_project_root,
8 single_file_support = true,
9 workspaces = false,
10}

neovim/lua/bugabinga/lsp/clients/init.lua

Modified

+14 / −14 text lines

11return {
2 require'bugabinga.lsp.clients.java',
3 require'bugabinga.lsp.clients.lua',
4 require'bugabinga.lsp.clients.json',
5 require'bugabinga.lsp.clients.archlinux',
6 require'bugabinga.lsp.clients.asm',
7 require'bugabinga.lsp.clients.bash',
8 require'bugabinga.lsp.clients.c',
9 require'bugabinga.lsp.clients.graphviz',
10 require'bugabinga.lsp.clients.markdown',
11 require'bugabinga.lsp.clients.rust',
12 require'bugabinga.lsp.clients.toml',
13 require'bugabinga.lsp.clients.vim',
14 require'bugabinga.lsp.clients.xml',
15 require'bugabinga.lsp.clients.zig',
2 require 'bugabinga.lsp.clients.java',
3 require 'bugabinga.lsp.clients.lua',
4 require 'bugabinga.lsp.clients.json',
5 require 'bugabinga.lsp.clients.asm',
6 require 'bugabinga.lsp.clients.bash',
7 require 'bugabinga.lsp.clients.c',
8 require 'bugabinga.lsp.clients.graphviz',
9 require 'bugabinga.lsp.clients.markdown',
10 require 'bugabinga.lsp.clients.nu',
11 require 'bugabinga.lsp.clients.rust',
12 require 'bugabinga.lsp.clients.toml',
13 require 'bugabinga.lsp.clients.vim',
14 require 'bugabinga.lsp.clients.xml',
15 require 'bugabinga.lsp.clients.zig',

neovim/lua/bugabinga/lsp/clients/java.lua

Modified

+10 / −15 text lines

11local table = require 'std.table'
22local project = require 'std.project'
33local auto = require 'std.auto'
4local map = require'std.map'
4local map = require 'std.map'
66local create_shared_config_path = function ( base_path, syntax_server )
77 local os_config
5454local create_jdtls_command = function ( syntax_server )
5555 local mason_registry = require 'mason-registry'
56 local jdtls_package_path = mason_registry.get_package('jdtls'):get_install_path()
56 local jdtls_package_path = mason_registry.get_package 'jdtls':get_install_path()
5757 local shared_config_path = create_shared_config_path( jdtls_package_path, syntax_server )
5858 local launcher_jar = find_launcher_jar( jdtls_package_path )
5959 local data_dir = create_data_dir()
9494 local jdk17 = {
9595 name = 'JavaSE-17',
9696 }
97 local jdk19 = {
98 name = 'JavaSE-19',
99 }
10097 local jdk21 = {
10198 name = 'JavaSE-21',
10299 }
104 if host == 'pop-os' then
105 jdk11.path = '/usr/lib/jvm/java-11-openjdk-amd64'
106 jdk17.path = '/usr/lib/jvm/java-17-openjdk-amd64'
107 jdk19.path = '/usr/lib/jvm/java-19-openjdk-amd64'
108 jdk21.path = '/home/oli/.jdks/openjdk-21'
101 if host == 'velma' then
102 jdk11.path = '/usr/lib64/jvm/java-11-openjdk-11'
103 jdk17.path = '/usr/lib64/jvm/java-17-openjdk-17'
104 jdk21.path = '/usr/lib64/jvm/java-21-openjdk-21'
109105 elseif host == 'NB-00718' then
110106 jdk11.path = 'C:/Users/okr/scoop/apps/openjdk11'
111107 jdk17.path = 'C:/Users/okr/scoop/apps/openjdk17'
112 jdk19.path = 'C:/Users/okr/scoop/apps/openjdk19'
113108 jdk21.path = 'C:/Users/okr/scoop/apps/openjdk21'
114109 else
115110 vim.notify 'missing jdk paths in java settings for lsp'
116111 end
118 return { jdk11, jdk17, jdk19, jdk21 }
113 return { jdk11, jdk17, jdk21 }
119114end
121116local java_settings = {
221216 description = 'Extract Variable',
222217 category = 'jdlts',
223218 keys = '<leader>ljv',
224 command = function() jdtls.extract_variable(true) end,
219 command = function () jdtls.extract_variable( true ) end,
225220 }
227222 map.visual {
228223 description = 'Extract Constant',
229224 category = 'jdlts',
230225 keys = '<leader>ljc',
231 command = function() jdtls.extract_constant(true) end,
226 command = function () jdtls.extract_constant( true ) end,
232227 }
234229 map.visual {
235230 description = 'Extract Method',
236231 category = 'jdlts',
237232 keys = '<leader>ljm',
238 command = function() jdtls.extract_method(true) end,
233 command = function () jdtls.extract_method( true ) end,
239234 }
241236 auto 'refresh_codelens' {

neovim/lua/bugabinga/lsp/clients/lua.lua

Modified

+2 / −3 text lines

44 name = 'LuaLS',
55 filetypes = 'lua',
66 command = 'lua-language-server',
7 root_dir = project.find_lua_project_root ,
7 root_dir = project.find_lua_project_root,
88 single_file_support = true,
99 workspaces = true,
1010 settings = {
1111 Lua = {
1212 addonManager = { enable = false },
13 completion = { callSnippet = 'Both', postfix = '.' },
13 completion = { callSnippet = 'Disable', postfix = '.' },
1414 diagnostics = { globals = { 'vim' }, workspaceRate = 50 },
1515 hint = { enable = true, setType = true },
1616 telemetry = { enable = false },
1818 workspace = { checkThirdParty = false, }
1919 },
2020 },
21 before_init = require 'neodev.lsp'.before_init,

neovim/lua/bugabinga/lsp/clients/nu.lua

Added
new file mode 100644

+10 / −0 text lines

1local project = require 'std.project'
2
3return {
4 name = 'nulsp',
5 command = { 'nu', '--lsp' },
6 filetypes = { 'nu' },
7 root_dir = project.find_project_root,
8 single_file_support = true,
9 workspaces = false,
10}

neovim/lua/bugabinga/lsp/clients/zig.lua

Modified

+2 / −2 text lines

1local project = require'std.project'
1local project = require 'std.project'
33return {
44 name = 'zls',
5 command = 'zls',
5 command = 'zls',
66 filetypes = { 'zig', 'zir' },
77 root_dir = project.find_zig_project_root,
88 single_file_support = true,

neovim/lua/bugabinga/lsp/init.lua

Modified

+90 / −39 text lines

3636end
3838local expand_command = function ( command )
39 vim.validate { command = { command, { 'string', 'table' } } }
41 debug.print( 'expanding command', command )
39 vim.validate { command = { command, { 'string', 'table', }, }, }
4341 if type( command ) == 'table' then
4442 command[1] = expand_path( command[1] )
4947end
5149local lsp_start = function ( file_type_event )
50 debug.print 'trying to start lsp'
5251 local match = file_type_event.match
5453 local matches_to_ignore = ignored.filetypes
55 debug.print( 'filetypes to ignore', ignored.filetypes)
56 if vim.iter( ignored.filetypes):find( match ) then return end
54 debug.print( 'filetypes to ignore', ignored.filetypes, 'current filetype', match )
55 if vim.iter( ignored.filetypes ):find( match ) then return end
5857 local bufnr = file_type_event.buf
59 local buftype = vim.api.nvim_get_option_value( 'buftype', { buf = bufnr } )
60 if vim.iter(ignored.buftypes):find(buftype) then return end
58 local buftype = vim.api.nvim_get_option_value( 'buftype', { buf = bufnr, } )
59 debug.print( 'buftypes to ignore', ignored.buftypes, 'current buftype', buftype )
60 if vim.iter( ignored.buftypes ):find( buftype ) then return end
6262 local buffer_path = vim.api.nvim_buf_get_name( bufnr )
6666 local potential_client_configs = vim.iter( lsp_client_configs )
6767 :map( function ( config )
6868 vim.validate {
69 ['config'] = { config, 'table' },
70 ['config.name'] = { config.name, 'string' },
71 ['config.filetypes'] = { config.filetypes, { 'string', 'table' } },
72 ['config.command'] = { config.command, { 'string', 'table' } },
73 ['config.environment'] = { config.environment, 'table', true },
74 ['config.root_dir'] = { config.root_dir, 'function', 'string' },
75 ['config.single_file_support'] = { config.single_file_support, 'boolean', true },
76 ['config.settings'] = { config.settings, 'table', true },
77 ['config.workspaces'] = { config.workspaces, 'boolean', true },
78 ['config.before_init'] = { config.before_init, 'function', true },
79 ['config.init_options'] = { config.init_options, 'table', true },
80 ['config.capabilities'] = { config.capabilities, 'table', true },
81 ['config.custom_start'] = { config.custom_start, 'function', true },
69 ['config'] = { config, 'table', },
70 ['config.name'] = { config.name, 'string', },
71 ['config.filetypes'] = { config.filetypes, { 'string', 'table', }, },
72 ['config.command'] = { config.command, { 'string', 'table', }, },
73 ['config.environment'] = { config.environment, 'table', true, },
74 ['config.root_dir'] = { config.root_dir, 'function', 'string', },
75 ['config.single_file_support'] = { config.single_file_support, 'boolean', true, },
76 ['config.settings'] = { config.settings, 'table', true, },
77 ['config.workspaces'] = { config.workspaces, 'boolean', true, },
78 ['config.before_init'] = { config.before_init, 'function', true, },
79 ['config.init_options'] = { config.init_options, 'table', true, },
80 ['config.capabilities'] = { config.capabilities, 'table', true, },
81 ['config.custom_start'] = { config.custom_start, 'function', true, },
8282 }
8383 -- normalize scalar values to its vector alternative for easier processing later on
8484 -- this mutates the lsp client configs! careful!
85 config.command = type( config.command ) == 'string' and { expand_command( config.command ) } or
85 config.command = type( config.command ) == 'string' and { expand_command( config.command ), } or
8686 expand_command( config.command )
8787 config.environment = config.environment or {}
88 config.filetypes = type( config.filetypes ) == 'string' and { config.filetypes } or config.filetypes
88 config.filetypes = type( config.filetypes ) == 'string' and { config.filetypes, } or config.filetypes
8989 config.single_file_support = config.single_file_support == nil and false or config.single_file_support
9090 config.workspaces = config.workspaces == nil and false or config.workspaces
9191 config.capabilities = config.capabilities or {}
9999 :totable()
101101 debug.print( 'POTENTIAL CLIENTS',
102 vim.iter( potential_client_configs ):map( function ( config ) return { name = config.name, command = config.command } end )
103 :totable() )
102 vim.iter( potential_client_configs ):map( function ( config )
103 return {
104 name = config.name,
105 command =
106 config.command,
107 }
108 end )
109 :totable() )
105111 if table.is_empty( potential_client_configs ) then
106112 debug.print( 'found no lsp client for', buffer_path )
115121 for _, config in ipairs( potential_client_configs ) do
116122 local root_dir = type( config.root_dir ) == 'string' and config.root_dir or config.root_dir( buffer_path )
117123 local capabilities = vim.lsp.protocol.make_client_capabilities()
118 local cmp_capabilities = require 'cmp_nvim_lsp'.default_capabilities()
119 capabilities = table.extend( 'force', capabilities, cmp_capabilities, config.capabilities )
120 debug.print( 'lsp capabilities', capabilities, config.capabilities, cmp_capabilities )
124 capabilities = table.extend( 'force', capabilities, config.capabilities )
122126 debug.print( 'starting command:', config.command )
141145 on_exit = function ( code, signal, client_id ) vim.print( 'LSP CLIENT EXIT', code, signal, client_id ) end,
142146 on_attach = function ( client, bufnr ) debug.print( 'LSP CLIENT ATTACH', client, bufnr ) end,
143147 trace = 'off',
144 flags = { allow_incremental_sync = true, debounce_text_changes = 250, exit_timeout = 200 },
148 flags = { allow_incremental_sync = true, debounce_text_changes = 250, exit_timeout = 200, },
145149 root_dir = root_dir,
146150 }
181185 end,
182186 } )
184 debug.print( 'ATTACHING LSP CLIENT', client_id )
188 debug.print( 'ATTACHING LSP CLIENT', config.name )
185189 end
186190end
219223 vim.bo[bufnr].omnifunc = 'v:lua.vim.lsp.omnifunc'
220224 end
226 if client.server_capabilities.documentSymbolProvider then
227 local ok, navic = pcall( require, 'nvim-navic' )
228 if ok then
229 vim.notify 'navic ready'
230 navic.attach( client, bufnr )
231 else
232 vim.notify 'nvim-navic not found. could not attach to lsp client.'
233 end
234 local ok, navbuddy = pcall( require, 'nvim-navbuddy' )
235 if ok then
236 vim.notify 'navbuddy ready'
237 navbuddy.attach( client, bufnr )
238 else
239 vim.notify 'nvim-navbuddy not found. could not attach to lsp client.'
240 end
241 end
222243 if client.server_capabilities.documentHighlightProvider then
223244 -- the timer has application lifetime. no need to close
224245 local delay = 300
234255 },
235256 {
236257 description = 'Remove highlight from symbol under cursor on move',
237 events = { 'CursorMoved', 'InsertEnter' },
258 events = { 'CursorMoved', 'InsertEnter', },
238259 buffer = bufnr,
239260 command = debounced_clear,
240 }
261 },
241262 }
242263 end
257278 description = 'Show hover documentation above cursor.',
258279 category = 'lsp',
259280 buffer = bufnr,
260 keys = { 'K', '<leader>lk' },
281 keys = { 'K', '<leader>lk', },
261282 command = vim.lsp.buf.hover,
262283 } )
321342 description = 'Rename symbol under cursor.',
322343 category = 'lsp',
323344 buffer = bufnr,
324 keys = { '<f2>', '<leader>ln' },
345 keys = { '<f2>', '<leader>ln', },
325346 command = vim.lsp.buf.rename,
326347 } )
327348end
373394 description = 'Semantic Tokens from the LSP',
374395 events = 'LspTokenUpdate',
375396 command = token_update,
376 }
397 },
379400local lsp_info = function ( command )
380 local all_or_current = command.args and command.args == 'all' and {} or { bufnr = 0 }
401 local all_or_current = command.args and command.args == 'all' and {} or { bufnr = 0, }
381402 local active_clients = vim.lsp.get_clients( all_or_current )
383404 local infos = vim.iter( active_clients )
406427end
408429local lsp_info_extended = function ( command )
409 local all_or_current = command.args and command.args == 'all' and {} or { bufnr = 0 }
430 local all_or_current = command.args and command.args == 'all' and {} or { bufnr = 0, }
410431 local active_clients = vim.lsp.get_clients( all_or_current )
411432 ui.show_tree( active_clients )
412433end
414435user_command( 'LspInfo', lsp_info, {
415436 nargs = '?',
416 complete = function () return { 'all' } end,
437 complete = function () return { 'all', } end,
417438 desc = 'Shows basic information about running LSP clients.',
418439} )
420441user_command( 'LspInfoExtended', lsp_info_extended, {
421442 nargs = '?',
422 complete = function () return { 'all' } end,
443 complete = function () return { 'all', } end,
423444 desc = 'Shows detailed information about running LSP clients.',
424445} )
426--TODO: lsp restart, lsp exit
447-- TODO: lsp restart, lsp exit
449-- TODO: move to std.icons.lua
450local completion_icons = {
451 Class = ' ',
452 Color = ' ',
453 Constant = ' ',
454 Constructor = ' ',
455 Enum = ' ',
456 EnumMember = ' ',
457 Field = '󰄶 ',
458 File = ' ',
459 Folder = ' ',
460 Function = ' ',
461 Interface = '󰜰',
462 Keyword = '󰌆 ',
463 Method = 'ƒ ',
464 Module = '󰏗 ',
465 Property = ' ',
466 Snippet = '󰘍 ',
467 Struct = ' ',
468 Text = ' ',
469 Unit = ' ',
470 Value = '󰎠 ',
471 Variable = ' ',
472}
474local completion_kinds = vim.lsp.protocol.CompletionItemKind
475for i, kind in ipairs( completion_kinds ) do
476 completion_kinds[i] = completion_icons[kind] or kind
477end
428479return setmetatable( _, {} )

neovim/lua/bugabinga/lsp/lightbulb.lua

Modified

+1 / −1 text lines

44local lb_name = 'mariasolos/lightbulb'
55local lb_namespace = vim.api.nvim_create_namespace( lb_name )
6local lb_icon = require 'std.icon'.hint
6local lb_icon = require 'std.icon'.hint
77local lb_group = vim.api.nvim_create_augroup( lb_name, { clear = true } )
88local code_action_method = vim.lsp.protocol.Methods.textDocument_codeAction
99local timer = vim.uv.new_timer()

neovim/lua/bugabinga/nugu/init.lua

Modified

+3 / −2 text lines

9292 Whitespace { NonText },
9393 NormalNC { Normal },
9494 Pmenu { NormalFloat },
95 PmenuSel { fg = ui_important_local, sp = ui_important_local, bg = Pemnu.bg, gui = 'bold underline' },
95 PmenuSel { fg = ui_important_local, sp = ui_important_local, bg = Pmenu.bg, gui = 'bold underline' },
9696 PmenuSbar { bg = ui_unfocus },
9797 PmenuThumb { bg = ui_minor },
9898 Question { fg = ui_important_local, gui = 'bold' },
276276 LazyCommitScope { LazyComment, gui = 'italic' },
277277 LazyCommitType { LazyCommitScope },
278278 LazyDimmed { fg = NormalFloat.fg },
279 LazyDir { N.fgormalFloat },
279 LazyDir { fg = NormalFloat.fg },
280280 LazyH1 { Bold },
281281 LazyH2 { LazyH1 },
282282 LazyLocal {},
471471 IblScope { fg = ui_focus, bg = Normal.bg },
473473 Hlargs { fg = content_important_local },
474475 MiniStarterCurrent { fg = ui_accent.readable(), bg = ui_accent }, -- current item.
475476 MiniStarterFooter { Keyword }, -- footer units.
476477 MiniStarterHeader { Comment }, -- header units.

neovim/lua/bugabinga/options/behaviour.lua

Modified

+12 / −11 text lines

1local debug = require 'std.debug'
12local auto = require 'std.auto'
34-- How many milliseconds must pass before neovim decides I was "idle"
67vim.opt.timeoutlen = 250
89-- wrap line movements, when start/end is reached
9vim.opt.whichwrap:append'<'
10vim.opt.whichwrap:append'>'
11vim.opt.whichwrap:append'['
12vim.opt.whichwrap:append']'
13vim.opt.whichwrap:append'h'
14vim.opt.whichwrap:append'l'
10vim.opt.whichwrap:append '<'
11vim.opt.whichwrap:append '>'
12vim.opt.whichwrap:append '['
13vim.opt.whichwrap:append ']'
14vim.opt.whichwrap:append 'h'
15vim.opt.whichwrap:append 'l'
1617-- Tabs and Spaces, i like 'em 2 spaces wide
1718-- only insert spaces for tabs if language configuration explicitly declares so
2728vim.opt.wrap = false
2930-- do not keep distance to borders while scrolling
30vim.opt.scrolloff = 999
31vim.opt.sidescrolloff = 999
31vim.opt.scrolloff = 0
32vim.opt.sidescrolloff = 0
3334-- try to guess indentation based on context
3435vim.opt.smartindent = true
99100 if table.contains( ignored.filetypes, filetype ) then return end
100101 local buftype = vim.api.nvim_buf_get_option( buffer, 'buftype' )
101102 if table.contains( ignored.buftypes, buftype ) then return end
102 local root = vim.fs.normalize(project.find_root_by_filetype( file, filetype ))
103 local cwd = vim.fs.normalize(vim.uv.cwd())
103 local root = vim.fs.normalize( project.find_root_by_filetype( file, filetype ) )
104 local cwd = vim.fs.normalize( vim.uv.cwd() )
104105 if root and cwd ~= root then
105106 vim.uv.chdir( root )
106107 vim.notify( 'Changed root directory to ' .. root .. ' from ' .. cwd )
107 -- vim.print( buffer, file, vim.inspect( filetype ), vim.inspect( buftype ) )
108 debug.print( buffer, file, vim.inspect( filetype ), vim.inspect( buftype ) )
108109 end
109110 end,

neovim/lua/bugabinga/options/keymaps.lua

Modified

+13 / −12 text lines

66 keys = '<space>',
77 command = '<nop>',
88}
9
109vim.g.mapleader = ' '
1110vim.g.maplocalleader = ' '
13-- disable default ENTER binding
14map {
15 keys = '<enter>',
16 command = '<nop>',
17}
1912-- insert newline under or above in normal mode
2013map.normal {
2114 description = 'Insert newline under cursor',
2215 category = 'editing',
23 keys = '<C-enter>',
16 keys = '<leader>o',
2417 command = function ()
2518 local current_buffer = 0
2619 local current_line = vim.api.nvim_win_get_cursor( current_buffer )[1]
3326map.normal {
3427 description = 'Insert newline above cursor',
3528 category = 'editing',
36 keys = '<C-S-enter>',
29 keys = '<leader>O',
3730 command = function ()
3831 local current_buffer = 0
3932 local current_line = vim.api.nvim_win_get_cursor( current_buffer )[1] - 1
4033 local strict_indexing = false
4134 local newline = { '' }
4236 vim.api.nvim_buf_set_lines( current_buffer, current_line, current_line, strict_indexing, newline )
4337 end,
10195 command = function () return vim.fn.pumvisible() == 1 and '<C-n>' or '<tab>' end,
98--TODO make global
99local win32 = vim.loop.os_uname().sysname:match 'Win'
100local wsl2 = vim.loop.os_uname().release:match 'WSL2'
104102local function open_link_under_cursor()
105103 ---@diagnostic disable-next-line: missing-parameter
106104 local file_under_cursor = vim.fn.expand '<cfile>'
109107 if file_under_cursor and file_under_cursor:match '%a+://.+' then
110108 vim.system(
111109 ---@diagnostic disable-next-line: assign-type-mismatch
112 { 'firefox', file_under_cursor },
110 (win32 or wsl2) and { 'cmd.exe', '/C', 'start', 'msedge', file_under_cursor }
111 or { 'firefox', file_under_cursor },
113112 { text = true },
114113 function ( completed )
115114 if completed.code == 0 then
116 vim.notify( 'Openend ' .. file_under_cursor )
115 vim.schedule( function () vim.notify( 'Opened ' .. file_under_cursor ) end )
117116 else
118117 error( 'Failed to open ' .. file_under_cursor .. ' because: ' .. completed.stderr )
119118 end
120119 end
121120 )
121 else
122 vim.notify 'Found no url under cursor !'
122123 end
123124end
190191 vim.lsp.buf.format { async = false }
192193 -- TODO: run makeprg
193 vim.cmd [[silent make]]
194 -- vim.cmd [[silent make]]
195196 -- save
196197 vim.cmd [[wa]]

neovim/lua/bugabinga/options/ui.lua

Modified

+2 / −0 text lines

9696vim.opt.shortmess:append 'c'
9797-- hide vim intro screen
9898vim.opt.shortmess:append 'I'
99-- truncate messages at end
100vim.opt.shortmess:append 't'
100102-- show cmd window to prevent jitter ui
101103vim.opt.cmdheight = 1

neovim/lua/bugabinga/plugins/autopairs.lua

Modified

+2 / −14 text lines

33return {
44 'windwp/nvim-autopairs',
55 event = 'InsertEnter',
6 dependencies = {
7 'hrsh7th/nvim-cmp'
6 opts = {
7 disable_filetype = ignored.filetypes,
88 },
9 config = function ()
10 local autopairs = require 'nvim-autopairs'
11 autopairs.setup {
12 disable_filetype = ignored.filetypes,
13 }
14 local cmp_autopairs = require 'nvim-autopairs.completion.cmp'
15 local cmp = require 'cmp'
16 cmp.event:on(
17 'confirm_done',
18 cmp_autopairs.on_confirm_done()
19 )
20 end
219}

neovim/lua/bugabinga/plugins/cmp.lua

Deleted
deleted file mode 100644

+0 / −117 text lines

1---@diagnostic disable: missing-fields
2
3return {
4 'hrsh7th/nvim-cmp',
5 event = 'InsertEnter',
6 dependencies = {
7 'hrsh7th/cmp-buffer',
8 'hrsh7th/cmp-nvim-lsp',
9 'hrsh7th/cmp-path',
10 'hrsh7th/cmp-nvim-lsp-document-symbol',
11 'hrsh7th/cmp-nvim-lsp-signature-help',
12 'hrsh7th/cmp-emoji',
13 { 'L3MON4D3/LuaSnip', version = '2.*', build = 'make install_jsregexp' },
14 'saadparwaiz1/cmp_luasnip',
15 'rafamadriz/friendly-snippets',
16 'onsails/lspkind.nvim',
17 },
18 config = function ()
19 local cmp = require 'cmp'
20 local luasnip = require 'luasnip'
21 local lspkind = require 'lspkind'
23 require 'luasnip.loaders.from_vscode'.lazy_load()
25 cmp.setup {
26 performance = {
27 debounce = 150,
28 throttle = 300,
29 fetching_timeout = 400,
30 },
31 completion = {
32 autocomplete = false,
33 completeopt = 'menu,menuone,preview,noselect',
34 },
35 window = {
36 completion = cmp.config.window.bordered(),
37 documentation = cmp.config.window.bordered(),
38 },
39 experimental = {
40 ghost_text = true,
41 },
42 formatting = {
43 format = lspkind.cmp_format {
44 mode = 'symbol',
45 maxwidth = 75,
46 ellipsis_char = '…',
47 with_text = true,
48 menu = {
49 nvim_lsp_signature_help = '[sig]',
50 nvim_lsp = '[lsp]',
51 nvim_lsp_document_symbol = '[sym]',
52 luasnip = '[snip]',
53 path = '[path]',
54 emoji = '[emo]',
55 buffer = '[buf]',
56 }
57 },
58 },
59 -- experimental = { ghost_text = true, },
60 preselect = cmp.PreselectMode.None,
61 snippet = { expand = function ( args ) luasnip.lsp_expand( args.body ) end },
62 mapping = {
63 ['<c-p>'] = cmp.mapping.select_prev_item(),
64 ['<c-n>'] = cmp.mapping.select_next_item(),
65 ['<c-k>'] = cmp.mapping.select_prev_item(),
66 ['<c-j>'] = cmp.mapping.select_next_item(),
67 ['<tab>'] = cmp.mapping( function ( fallback )
68 if cmp.visible() then
69 cmp.select_next_item()
70 elseif luasnip.expand_or_locally_jumpable() then
71 luasnip.expand_or_jump()
72 else
73 fallback()
74 end
75 end, { 'i', 's' } ),
76 ['<s-tab>'] = cmp.mapping( function ( fallback )
77 if cmp.visible() then
78 cmp.select_prev_item()
79 elseif luasnip.locally_jumpable( -1 ) then
80 luasnip.jump( -1 )
81 else
82 fallback()
83 end
84 end, { 'i', 's' } ),
85 ['<c-b>'] = cmp.mapping.scroll_docs( -2 ),
86 ['<c-f>'] = cmp.mapping.scroll_docs( 2 ),
87 ['<c-u>'] = cmp.mapping.scroll_docs( -4 ),
88 ['<c-d>'] = cmp.mapping.scroll_docs( 4 ),
89 ['<c-space>'] = cmp.mapping.complete {},
90 ['<esc>'] = cmp.mapping.abort(),
91 ['<cr>'] = cmp.mapping.confirm {
92 behaviour = cmp.ConfirmBehavior.Replace,
93 select = true,
94 }
95 },
96 sources = cmp.config.sources {
97 { name = 'nvim_lsp_signature_help' },
98 { name = 'nvim_lsp' },
99 { name = 'nvim_lsp_document_symbol' },
100 { name = 'luasnip' },
101 { name = 'path' },
102 { name = 'emoji' },
103 { name = 'buffer', keyword_length = 3 },
104 }
105 }
107 cmp.setup.filetype( 'gitcommit', {
108 sources = cmp.config.sources {
109 { name = 'git' },
110 },
111 {
112 { name = 'buffer' },
113 { name = 'path' },
114 }
115 } )
116 end,
117}

neovim/lua/bugabinga/plugins/comment.lua

Modified

+15 / −14 text lines

1return {{
2 'numToStr/Comment.nvim',
3 keys = {
4 { "gc", mode = { "n", "v" }, desc = "Comment toggle linewise" },
5 { "gb", mode = { "n", "v" }, desc = "Comment toggle blockwise" },
6 },
7 dependencies = {
8 "JoosepAlviste/nvim-ts-context-commentstring",
9 },
10 opts = function()
11 local commentstring_avail, commentstring = pcall(require, "ts_context_commentstring.integrations.comment_nvim")
12 return commentstring_avail and commentstring and { pre_hook = commentstring.create_pre_hook() } or {}
13 end,
14}}
1return { {
2 'numToStr/Comment.nvim',
3 tag = 'v0.8.0',
4 keys = {
5 { 'gc', mode = { 'n', 'v', }, desc = 'Comment toggle linewise', },
6 { 'gb', mode = { 'n', 'v', }, desc = 'Comment toggle blockwise', },
7 },
8 dependencies = {
9 'JoosepAlviste/nvim-ts-context-commentstring',
10 },
11 opts = function ()
12 local commentstring_avail, commentstring = pcall( require, 'ts_context_commentstring.integrations.comment_nvim' )
13 return commentstring_avail and commentstring and { pre_hook = commentstring.create_pre_hook(), } or {}
14 end,
15}, }

neovim/lua/bugabinga/plugins/dressing.lua

Modified

+2 / −1 text lines

11return {
22 'stevearc/dressing.nvim',
3 opts = {}
3 lazy = false,
4 opts = {},
45}

neovim/lua/bugabinga/plugins/fidget.lua

Added
new file mode 100644

+19 / −0 text lines

1local debug = require 'std.debug'
2
3return {
4 'j-hui/fidget.nvim',
5 version = '1.4.0',
6 lazy = false,
7 opts = {
8 progress = {
9 suppress_on_insert = false, -- Suppress new messages while in insert mode
10 lsp = {
11 log_handler = debug.get, -- Log `$/progress` handler invocations (for debugging)
12 },
13 },
14 notification = {
15 filter = debug.get and vim.log.levels.DEBUG,
16 override_vim_notify = true, -- Automatically override vim.notify() with Fidget
17 },
18 },
19}

neovim/lua/bugabinga/plugins/flash.lua

Modified

+6 / −5 text lines

11return {
22 'folke/flash.nvim',
3 tag = 'v1.18.2',
34 event = 'VeryLazy',
45 opts = {
5 highlight = { backdrop = false },
6 modes = { char = { highlight = { backdrop = false, } },
6 highlight = { backdrop = false, },
7 modes = { char = { highlight = { backdrop = false, }, },
78 },
89 },
910 keys = {
1011 {
1112 '<cr>',
12 mode = { 'n', 'x', 'o' },
13 mode = { 'n', 'x', 'o', },
1314 function () require 'flash'.jump() end,
1415 desc = 'Flash',
1516 },
1617 {
1718 '<s-cr>',
18 mode = { 'n', 'o', 'x' },
19 mode = { 'n', 'o', 'x', },
1920 function () require 'flash'.treesitter() end,
2021 desc =
21 'Flash Treesitter'
22 'Flash Treesitter',
2223 },
2324 },

neovim/lua/bugabinga/plugins/genghis.lua

Modified

+12 / −11 text lines

1616 },
1717 dependencies = {
1818 'stevearc/dressing.nvim',
19 'hrsh7th/nvim-cmp',
20 'hrsh7th/cmp-omni',
2119 },
2220 config = function ()
23 require 'genghis' -- no setup needed
24 local cmp = require 'cmp'
25 cmp.setup.filetype(
26 'DressingInput',
27 ---@diagnostic disable-next-line: missing-fields
28 {
29 sources = cmp.config.sources { { name = 'omni' } }
30 }
31 )
21 local genghis = require 'genghis' -- no setup needed
22 local keymap = vim.keymap.set
23 keymap( 'n', '<leader>yp', genghis.copyFilepath )
24 keymap( 'n', '<leader>yn', genghis.copyFilename )
25 keymap( 'n', '<leader>cx', genghis.chmodx )
26 keymap( 'n', '<leader>rf', genghis.renameFile )
27 keymap( 'n', '<leader>mf', genghis.moveAndRenameFile )
28 keymap( 'n', '<leader>mc', genghis.moveToFolderInCwd )
29 keymap( 'n', '<leader>nf', genghis.createNewFile )
30 keymap( 'n', '<leader>yf', genghis.duplicateFile )
31 keymap( 'n', '<leader>df', genghis.trashFile )
32 keymap( 'x', '<leader>x', genghis.moveSelectionToNewFile )
3233 end,

neovim/lua/bugabinga/plugins/gitsigns.lua

Modified

+12 / −11 text lines

33return {
44 'lewis6991/gitsigns.nvim',
5 tag = 'v0.7',
56 event = 'VeryLazy',
67 opts = {
78 signs = {
8 add = { text = '│' },
9 change = { text = '│' },
10 delete = { text = '_' },
11 topdelete = { text = '‾' },
12 changedelete = { text = '~' },
13 untracked = { text = '┆' },
9 add = { text = '│', },
10 change = { text = '│', },
11 delete = { text = '_', },
12 topdelete = { text = '‾', },
13 changedelete = { text = '~', },
14 untracked = { text = '┆', },
1415 },
1516 preview_config = {
1617 border = vim.g.border_style,
5253 category = 'git',
5354 keys = '<leader>hs',
5455 buffer = bufnr,
55 command = function () gitsigns.stage_hunk { vim.fn.line '.', vim.fn.line 'v' } end,
56 command = function () gitsigns.stage_hunk { vim.fn.line '.', vim.fn.line 'v', } end,
5657 }
5859 map.normal {
6869 category = 'git',
6970 keys = '<leader>hr',
7071 buffer = bufnr,
71 command = function () gitsigns.reset_hunk { vim.fn.line '.', vim.fn.line 'v' } end,
72 command = function () gitsigns.reset_hunk { vim.fn.line '.', vim.fn.line 'v', } end,
7273 }
7475 map.normal {
108109 category = 'git',
109110 keys = '<leader>hb',
110111 buffer = bufnr,
111 command = function () gitsigns.blame_line { full = true } end,
112 command = function () gitsigns.blame_line { full = true, } end,
112113 }
114115 map.normal {
148149 category = 'git',
149150 keys = 'ih',
150151 buffer = bufnr,
151 command = ':<C-U>Gitsigns select_hunk<CR>'
152 command = ':<C-U>Gitsigns select_hunk<CR>',
152153 }
153154 end,
154 }
155 },

neovim/lua/bugabinga/plugins/heirline.lua

Modified

+266 / −164 text lines

33local auto = require 'std.auto'
44local ignored = require 'std.ignored'
6local NEW_FILE = '~new~'
6local NEW_FILE = '~untitled~'
88return {
99 {
1010 'rebelot/heirline.nvim',
11 tag = 'v1.0.3',
1112 event = 'BufEnter',
1213 dependencies = {
1314 'nvim-tree/nvim-web-devicons',
1415 'lewis6991/gitsigns.nvim',
16 'SmiteshP/nvim-navic',
1517 },
1618 config = function ()
1719 local heirline = require 'heirline'
2729 command = function () utils.on_colorscheme( nugu ) end,
2830 }
30 local vi_mode = {
32 local vi_mode = {
3133 init = function ( self )
3234 self.mode = vim.fn.mode( 1 ) -- :h mode()
3335 end,
8385 r = 'ui_important_global',
8486 ['!'] = 'ui_important_global',
8587 t = 'ui_important_global',
86 }
88 },
8789 },
8991 provider = function ( self )
9496 hl = function ( self )
9597 local mode = self.mode:sub( 1, 1 ) -- get only the first mode character
96 return { fg = self.mode_colors[mode], bold = true }
98 return { fg = self.mode_colors[mode], bold = true, }
9799 end,
99101 update = {
103105 },
104106 }
106 local file_icon = {
108 local file_icon = {
107109 init = function ( self )
108110 local filename = self.filename
109111 local extension = vim.fn.fnamemodify( filename, ':e' )
110 self.icon = require 'nvim-web-devicons'.get_icon_color( filename, extension, { default = true } )
112 self.icon = require 'nvim-web-devicons'.get_icon_color( filename, extension, { default = true, } )
111113 end,
112114 provider = function ( self )
113115 return self.icon and (self.icon .. ' ')
115117 hl = 'DefaultIcon',
116118 }
118 local file_name = {
120 local file_name = {
119121 init = function ( self )
120122 self.lfilename = vim.fs.normalize( vim.fn.fnamemodify( self.filename, ':.' ) )
121123 if self.lfilename == '' then self.lfilename = NEW_FILE end
135137 },
136138 }
138 local file_flags = {
140 local file_flags = {
139141 {
140142 condition = function ()
141143 return vim.bo.modified
152154 },
153155 }
155 local file_name_block = {
157 local file_name_block = {
156158 init = function ( self )
157159 self.filename = vim.fs.normalize( vim.api.nvim_buf_get_name( 0 ) )
158160 end,
160162 file_icon,
161 { provider = ' ' },
163 { provider = ' ', },
162164 file_name,
163165 file_flags,
164 { provider = '%<' } -- this means that the statusline is cut here when there's not enough space
166 { provider = '%<', }, -- this means that the statusline is cut here when there's not enough space
165167 }
167 local file_type = {
169 local file_type = {
168170 provider = function ()
169171 return icon.file .. ' ' .. string.upper( vim.bo.filetype )
170172 end,
171173 }
173 local file_encoding = {
175 local file_encoding = {
174176 provider = function ()
175177 local enc = (vim.bo.fenc ~= '' and vim.bo.fenc) or vim.o.enc -- :h 'enc'
176178 return enc ~= 'utf-8' and enc:upper()
177179 end,
178180 }
180 local file_format = {
182 local file_format = {
181183 static = {
182184 dos = icon.newline .. icon.carriage_return,
183185 unix = icon.newline,
186188 provider = function ( self )
187189 local fileformat = vim.bo.fileformat
188190 return self[fileformat]
189 end
191 end,
190192 }
192 local file_size = {
194 local file_size = {
193195 provider = function ()
194196 -- stackoverflow, compute human readable file size
195197 -- i want to see vim opening a 1EiB file 󰱯
196 local suffix = { 'b', 'k', 'M', 'G', 'T', 'P', 'E' }
198 local suffix = { 'b', 'k', 'M', 'G', 'T', 'P', 'E', }
197199 local fsize = vim.fn.getfsize( vim.api.nvim_buf_get_name( 0 ) )
198200 fsize = (fsize < 0 and 0) or fsize
199201 if fsize < 1024 then
204206 end,
205207 }
207 local file_last_modified = {
209 local file_last_modified = {
208210 provider = function ()
209211 local ftime = vim.fn.getftime( vim.api.nvim_buf_get_name( 0 ) )
210212 if ftime > 0 then
214216 end,
215217 }
217 local lsp_active = {
219 local lsp_active = {
218220 condition = conditions.lsp_attached,
219 update = { 'LspAttach', 'LspDetach', 'BufEnter' },
221 -- FIXME: updates from parent components do not seem to update children,
222 -- if those have their own updates?
223 update = { 'LspAttach', 'LspDetach', 'BufEnter', 'BufLeave', },
221225 provider = function ()
222226 local names = {}
223 for _, client in pairs( vim.lsp.get_clients { bufnr = 0 } ) do
227 for _, client in pairs( vim.lsp.get_clients { bufnr = 0, } ) do
224228 table.insert( names, client.name )
225229 end
226230 return icon.lsp .. ' ' .. table.concat( names, ' ' )
227231 end,
228232 }
230 local diagnostic_enabled = {
234 local navic = {
235 condition = function () return require 'nvim-navic'.is_available() end,
236 static = {
237 -- create a type highlight map
238 type_hl = {
239 File = 'Directory',
240 Module = '@include',
241 Namespace = '@namespace',
242 Package = '@include',
243 Class = '@structure',
244 Method = '@method',
245 Property = '@property',
246 Field = '@field',
247 Constructor = '@constructor',
248 Enum = '@field',
249 Interface = '@type',
250 Function = '@function',
251 Variable = '@variable',
252 Constant = '@constant',
253 String = '@string',
254 Number = '@number',
255 Boolean = '@boolean',
256 Array = '@field',
257 Object = '@type',
258 Key = '@keyword',
259 Null = '@comment',
260 EnumMember = '@field',
261 Struct = '@structure',
262 Event = '@keyword',
263 Operator = '@operator',
264 TypeParameter = '@type',
265 },
266 -- bit operation dark magic, see below...
267 enc = function ( line, col, winnr )
268 return bit.bor( bit.lshift( line, 16 ), bit.lshift( col, 6 ), winnr )
269 end,
270 -- line: 16 bit (65535); col: 10 bit (1023); winnr: 6 bit (63)
271 dec = function ( c )
272 local line = bit.rshift( c, 16 )
273 local col = bit.band( bit.rshift( c, 6 ), 1023 )
274 local winnr = bit.band( c, 63 )
275 return line, col, winnr
276 end,
277 },
278 init = function ( self )
279 local data = require 'nvim-navic'.get_data() or {}
280 local children = {}
281 -- create a child for each level
282 for i, d in ipairs( data ) do
283 -- encode line and column numbers into a single integer
284 local pos = self.enc( d.scope.start.line, d.scope.start.character, self.winnr )
285 local child = {
286 {
287 provider = d.icon,
288 hl = self.type_hl[d.type],
289 },
290 {
291 -- escape `%`s (elixir) and buggy default separators
292 provider = d.name:gsub( '%%', '%%%%' ):gsub( '%s*->%s*', '' ),
293 -- highlight icon only or location name as well
294 hl = self.type_hl[d.type],
296 on_click = {
297 -- pass the encoded position through minwid
298 minwid = pos,
299 callback = function ( _, minwid )
300 -- decode
301 local line, col, winnr = self.dec( minwid )
302 vim.api.nvim_win_set_cursor( vim.fn.win_getid( winnr ), { line, col, } )
303 end,
304 name = 'heirline_navic',
305 },
306 },
307 }
308 -- add a separator only if needed
309 if #data > 1 and i < #data then
310 table.insert( child, {
311 provider = ' > ',
312 -- hl = { fg = 'bright_fg', },
313 } )
314 end
315 table.insert( children, child )
316 end
317 -- instantiate the new child, overwriting the previous one
318 self.child = self:new( children, 1 )
319 end,
320 -- evaluate the children containing navic components
321 provider = function ( self )
322 return self.child:eval()
323 end,
324 -- hl = { fg = 'gray', },
325 update = 'CursorMoved',
326 }
328 local diagnostic_enabled = {
231329 init = function ( self )
232330 self.icon = vim.diagnostic.is_disabled() and icon.toggle_off or icon.toggle_on
233331 end,
236334 end,
237335 }
239 local diagnostic = {
337 local diagnostic = {
240338 condition = conditions.has_diagnostics,
242340 static = {
247345 },
249347 init = function ( self )
250 self.errors = #vim.diagnostic.get( 0, { severity = vim.diagnostic.severity.ERROR } )
251 self.warnings = #vim.diagnostic.get( 0, { severity = vim.diagnostic.severity.WARN } )
252 self.hints = #vim.diagnostic.get( 0, { severity = vim.diagnostic.severity.HINT } )
253 self.info = #vim.diagnostic.get( 0, { severity = vim.diagnostic.severity.INFO } )
348 self.errors = #vim.diagnostic.get( 0, { severity = vim.diagnostic.severity.ERROR, } )
349 self.warnings = #vim.diagnostic.get( 0, { severity = vim.diagnostic.severity.WARN, } )
350 self.hints = #vim.diagnostic.get( 0, { severity = vim.diagnostic.severity.HINT, } )
351 self.info = #vim.diagnostic.get( 0, { severity = vim.diagnostic.severity.INFO, } )
254352 end,
256 update = { 'DiagnosticChanged', 'BufEnter' },
354 update = { 'DiagnosticChanged', 'BufEnter', 'BufLeave', },
258356 {
259357 provider = function ( self )
282380 },
283381 }
285 local is_svn_repo = function ()
383 local is_svn_repo = function ()
286384 local svn_dir = vim.fs.find( '.svn', {
287385 upward = true,
288386 stop = vim.uv.os_homedir(),
293391 return not vim.tbl_isempty( svn_dir )
294392 end
296 local svn_get_relative_url = function ()
394 local svn_get_relative_url = function ()
297395 -- FIXME: replace with vim.system
298396 local job = require 'plenary.job'
299 local relative_url = { '[ERR]' }
397 local relative_url = { '[ERR]', }
301399 job:new {
302400 command = 'svn',
303 args = { 'info', '--show-item', 'relative-url', '--no-newline' },
401 args = { 'info', '--show-item', 'relative-url', '--no-newline', },
304402 on_exit = function ( current_job, exit_code )
305403 if exit_code == 0 then relative_url = current_job:result() end
306404 end,
309407 return relative_url[1]
310408 end
312 local svn = {
410 local svn = {
313411 condition = is_svn_repo,
315413 update = 'BufEnter',
327425 }
329 local git = {
427 local git = {
330428 condition = conditions.is_git_repo,
332430 init = function ( self )
361459 },
362460 }
364 local work_dir = {
462 local work_dir = {
365463 init = function ( self )
366464 self.icon = (vim.fn.haslocaldir( 0 ) == 1 and icon['local'] or '') .. ' ' .. icon.global .. ' '
367465 self.cwd = vim.fs.normalize( vim.uv.cwd() ):gsub( vim.fs.normalize( vim.uv.os_homedir() ), '~' )
382480 },
383481 {
384482 provider = '',
385 }
483 },
386484 }
388 local help_file_name = {
486 local help_file_name = {
389487 condition = function ()
390488 return vim.bo.filetype == 'help'
391489 end,
396494 hl = 'Question',
397495 }
399 local terminal_name = {
497 local terminal_name = {
400498 provider = function ()
401499 local name, _ = vim.api.nvim_buf_get_name( 0 ):gsub( '.*:', '' )
402500 local basename = vim.fs.basename( name )
405503 hl = 'Bold',
406504 }
408 local togglers = {
506 local togglers = {
409507 provider = function ()
410508 local togglers = require 'bugabinga.options.togglers'
411509 return tostring( togglers )
412510 end,
413511 }
415 local macro_recording = {
513 local macro_recording = {
416514 condition = function ()
417515 return vim.fn.reg_recording() ~= '' and vim.o.cmdheight == 0
418516 end,
419517 provider = icon.macro .. ' ',
420518 hl = 'PreProc',
421 utils.surround( { '░▒▓ ', ' ▓▒░' }, nil, {
519 utils.surround( { '░▒▓ ', ' ▓▒░', }, nil, {
422520 provider = function ()
423521 return vim.fn.reg_recording()
424522 end,
427525 update = {
428526 'RecordingEnter',
429527 'RecordingLeave',
430 }
528 },
431529 }
433 local lazy = {
531 local lazy = {
434532 condition = function ()
435533 local ok, lazy_status = pcall( require, 'lazy.status' )
436534 return ok and lazy_status.has_updates()
437535 end,
438 update = { 'User', pattern = 'LazyUpdate' },
536 update = { 'User', pattern = 'LazyUpdate', },
439537 provider = function () return ' ' .. icon.lazy .. ' ' .. require 'lazy.status'.updates() .. ' ' end,
440538 on_click = {
441539 callback = function () require 'lazy'.update() end,
443541 },
444542 }
446 local align = { provider = '%=' }
447 local space = { provider = ' ' }
544 local align = { provider = '%=', }
545 local space = { provider = ' ', }
449 local default_statusline = {
450 vi_mode, macro_recording, align,
451 work_dir, space, git, svn, align,
452 diagnostic_enabled, space, diagnostic, space, lsp_active, align,
453 togglers, align,
454 lazy, space, file_encoding, space, file_format, space, file_type, space, file_size, space, file_last_modified,
547 local default_statusline = {
548 vi_mode, macro_recording, work_dir, space, git, svn, align,
549 diagnostic, space, lsp_active, align,
550 togglers, space, space, diagnostic_enabled, space, lazy, space,
551 file_encoding, space, file_format, space, file_type, space, file_size, space, file_last_modified,
455552 }
457 local special_statusline = {
554 local special_statusline = {
458555 condition = function ()
459556 return conditions.buffer_matches {
460557 buftype = ignored.buftypes,
465562 file_type,
466563 space,
467564 help_file_name,
468 align
565 align,
469566 }
471 local terminal_statusline = {
568 local terminal_statusline = {
473570 condition = function ()
474 return conditions.buffer_matches { buftype = { 'terminal' } }
571 return conditions.buffer_matches { buftype = { 'terminal', }, }
475572 end,
477 { condition = conditions.is_active, vi_mode, space },
574 { condition = conditions.is_active, vi_mode, space, },
478575 file_type,
479576 space,
480577 terminal_name,
481578 align,
482579 }
484 local inactive_statusline = {
581 local inactive_statusline = {
485582 condition = conditions.is_not_active,
486583 file_type,
487584 space,
489586 align,
490587 }
492 local statuslines = {
589 local statuslines = {
493590 hl = function ()
494591 if conditions.is_active() then
495592 return 'StatusLine'
506603 default_statusline,
507604 }
509 local winbars = {
606 local winbars = {
510607 hl = function ()
511608 if conditions.is_active() then
512609 return 'Winbar'
520617 {
521618 condition = function ()
522 return conditions.buffer_matches { buftype = { 'terminal' } }
619 return conditions.buffer_matches { buftype = { 'terminal', }, }
523620 end,
525622 file_type,
527624 terminal_name,
528625 },
530 file_name_block,
531 }
533 local tabline_buffer_number = {
534 provider = function ( self )
535 return '(' .. tostring( self.bufnr ) .. ')'
536 end,
537 hl = function ( self )
538 if self.is_active then
539 return { fg = utils.get_highlight 'TabLineSel'.fg }
540 elseif not vim.api.nvim_buf_is_loaded( self.bufnr ) then
541 return { fg = 'ui_normal' }
542 else
543 return { fg = utils.get_highlight 'TabLine'.fg }
544 end
545 end,
546 }
548 local tabline_file_name = {
549 provider = function ( self )
550 local name = self.file_name
551 return name == '' and NEW_FILE or vim.fs.normalize( vim.fn.fnamemodify( name, ':t' ) )
552 end,
553 hl = function ( self ) return { bold = self.is_active or self.is_visible, italic = true } end,
554 }
556 local tabline_file_flags = {
557627 {
558 condition = function ( self ) return vim.api.nvim_get_option_value( 'modified', { buf = self.bufnr } ) end,
559 provider = icon.modified .. ' ',
628 file_name_block,
629 space,
630 navic,
560631 },
561 {
562 condition = function ( self )
563 return not vim.api.nvim_get_option_value( 'modifiable', { buf = self.bufnr } ) or
564 vim.api.nvim_get_option_value( 'readonly', { buf = self.bufnr } )
565 end,
566 provider = function ( self )
567 if vim.api.nvim_get_option_value( 'buftype', { buf = self.bufnr } ) == 'terminal' then
568 return icon.terminal
569 else
570 return icon.lock
571 end
572 end,
573 },
574 hl = 'Bold',
575632 }
577 local tabline_file_name_block = {
578 init = function ( self )
579 self.file_name = vim.api.nvim_buf_get_name( self.bufnr )
580 end,
634 -- local tabline_buffer_number = {
635 -- provider = function ( self )
636 -- return '(' .. tostring( self.bufnr ) .. ')'
637 -- end,
638 -- hl = function ( self )
639 -- if self.is_active then
640 -- return { fg = utils.get_highlight 'TabLineSel'.fg, }
641 -- elseif not vim.api.nvim_buf_is_loaded( self.bufnr ) then
642 -- return { fg = utils.get_highlight 'StatusLineNc'.fg, }
643 -- else
644 -- return { fg = utils.get_highlight 'TabLine'.fg, }
645 -- end
646 -- end,
647 -- }
582 hl = function ( self )
583 if self.is_active then
584 return 'TabLineSel'
585 elseif not vim.api.nvim_buf_is_loaded( self.bufnr ) then
586 return { fg = 'ui_normal' }
587 else
588 return 'TabLine'
589 end
590 end,
649 -- local tabline_file_name = {
650 -- provider = function ( self )
651 -- local name = self.file_name
652 -- return name == '' and NEW_FILE or vim.fs.normalize( vim.fn.fnamemodify( name, ':t' ) )
653 -- end,
654 -- hl = function ( self ) return { bold = self.is_active or self.is_visible, italic = true, } end,
655 -- }
592 on_click = {
593 callback = function ( _, minwid, _, button )
594 if button == 'm' then --m = middle click
595 vim.schedule( function ()
596 vim.api.nvim_buf_delete( minwid, { force = false } )
597 vim.cmd.redrawtabline()
598 end )
599 else
600 vim.api.nvim_win_set_buf( 0, minwid )
601 end
602 end,
603 minwid = function ( self ) return self.bufnr end,
604 name = 'heirline_tabline_buffer_callback',
605 },
657 -- local tabline_file_flags = {
658 -- {
659 -- condition = function ( self ) return vim.api.nvim_get_option_value( 'modified', { buf = self.bufnr, } ) end,
660 -- provider = icon.modified .. ' ',
661 -- },
662 -- {
663 -- condition = function ( self )
664 -- return not vim.api.nvim_get_option_value( 'modifiable', { buf = self.bufnr, } ) or
665 -- vim.api.nvim_get_option_value( 'readonly', { buf = self.bufnr, } )
666 -- end,
667 -- provider = function ( self )
668 -- if vim.api.nvim_get_option_value( 'buftype', { buf = self.bufnr, } ) == 'terminal' then
669 -- return icon.terminal
670 -- else
671 -- return icon.lock
672 -- end
673 -- end,
674 -- },
675 -- hl = 'Bold',
676 -- }
607 file_icon,
608 { provider = ' ' },
609 tabline_file_name,
610 tabline_buffer_number,
611 tabline_file_flags,
612 }
678 -- local tabline_file_name_block = {
679 -- init = function ( self )
680 -- self.file_name = vim.api.nvim_buf_get_name( self.bufnr )
681 -- end,
682 --
683 -- hl = function ( self )
684 -- if self.is_active then
685 -- return 'TabLineSel'
686 -- elseif not vim.api.nvim_buf_is_loaded( self.bufnr ) then
687 -- return { fg = utils.get_highlight 'StatusLineNc'.fg, }
688 -- else
689 -- return 'TabLine'
690 -- end
691 -- end,
692 --
693 -- on_click = {
694 -- callback = function ( _, minwid, _, button )
695 -- if button == 'm' then --m = middle click
696 -- vim.schedule( function ()
697 -- vim.api.nvim_buf_delete( minwid, { force = false, } )
698 -- vim.cmd.redrawtabline()
699 -- end )
700 -- else
701 -- vim.api.nvim_win_set_buf( 0, minwid )
702 -- end
703 -- end,
704 -- minwid = function ( self ) return self.bufnr end,
705 -- name = 'heirline_tabline_buffer_callback',
706 -- },
707 --
708 -- file_icon,
709 -- { provider = ' ', },
710 -- tabline_file_name,
711 -- tabline_buffer_number,
712 -- tabline_file_flags,
713 -- }
614 local tabline_buffer_block = utils.surround(
615 {
616 ' ' .. icon.slant_left,
617 icon.slant_right .. ' ',
618 },
619 function ( self )
620 if self.is_active then
621 return utils.get_highlight 'TabLineSel'.bg
622 else
623 return utils.get_highlight 'TabLine'.bg
624 end
625 end,
626 { tabline_file_name_block }
627 )
715 -- local tabline_buffer_block = utils.surround(
716 -- {
717 -- ' ' .. icon.slant_left,
718 -- icon.slant_right .. ' ',
719 -- },
720 -- function ( self )
721 -- if self.is_active then
722 -- return utils.get_highlight 'TabLine'.bg
723 -- else
724 -- return utils.get_highlight 'TabLineFill'.bg
725 -- end
726 -- end,
727 -- { tabline_file_name_block, }
728 -- )
629 local buffer_line = utils.make_buflist(
630 tabline_buffer_block,
631 { provider = icon.arrow_left .. ' ', hl = 'TabLineFill' },
632 { provider = ' ' .. icon.arrow_right, hl = 'TabLineFill' }
633 )
730 -- local buffer_line = utils.make_buflist(
731 -- tabline_buffer_block,
732 -- { provider = icon.arrow_left .. ' ', hl = 'TabLine', },
733 -- { provider = ' ' .. icon.arrow_right, hl = 'TabLine', }
734 -- )
635 local tabpage = {
736 local tabpage = {
636737 provider = function ( self )
637738 return '%' .. self.tabnr .. 'T ' .. self.tabpage .. ' %T'
638739 end,
639740 hl = function ( self )
640 if not self.is_active then
641 return 'TabLine'
642 else
741 if self.is_active then
643742 return 'TabLineSel'
743 else
744 return 'TabLine'
644745 end
645746 end,
646747 }
648 local tab_pages = {
649 { provider = '%=' },
749 local tab_pages = {
750 { provider = '%=', },
650751 utils.make_tablist( tabpage ),
651752 }
653 local tabline = { buffer_line, tab_pages }
754 -- local tabline = { buffer_line, tab_pages, }
655756 -- local statuscolumn = {}
657758 heirline.setup {
658759 statusline = statuslines,
659760 winbar = winbars,
660 tabline = tabline,
761 tabline = tab_pages,
762 -- tabline = tabline,
661763 -- statuscolumn = statuscolumn,
663765 opts = {

neovim/lua/bugabinga/plugins/hlargs.lua

Modified

+19 / −18 text lines

11return {
2 'm-demare/hlargs.nvim',
3 event = 'BufRead',
4 opts = {
5 paint_arg_declarations = true,
6 paint_arg_usages = true,
7 paint_catch_blocks = {
8 declarations = true,
9 usages = true,
10 },
11 extras = { named_parameter = true },
12 excluded_argnames = {
13 declarations = {},
14 usages = { lua = {} },
15 },
16 },
17 dependencies = {
18 'nvim-treesitter/nvim-treesitter'
19 },
2 'm-demare/hlargs.nvim',
3 event = { 'BufRead', 'BufLeave', 'BufEnter', 'SessionLoadPost', },
4 opts = {
5 -- highlight = { 'Hlargs', },
6 paint_arg_declarations = true,
7 paint_arg_usages = true,
8 paint_catch_blocks = {
9 declarations = true,
10 usages = true,
11 },
12 extras = { named_parameter = true, },
13 excluded_argnames = {
14 declarations = {},
15 usages = { lua = {}, },
16 },
17 },
18 dependencies = {
19 'nvim-treesitter/nvim-treesitter',
20 },

neovim/lua/bugabinga/plugins/hyper.lua

Added
new file mode 100644

+8 / −0 text lines

1return {
2 'wet-sandwich/hyper.nvim',
3 tag = '0.1.0',
4 dependencies = {
5 'nvim-lua/plenary.nvim',
6 },
7 cmd = 'Hyper',
8}

neovim/lua/bugabinga/plugins/indent_blankline.lua

Modified

+3 / −2 text lines

1local icon = require'std.icon'
1local icon = require 'std.icon'
33return {
44 'lukas-reineke/indent-blankline.nvim',
5 tag = 'v3.5.3',
56 main = 'ibl',
6 event = { 'BufReadPost', 'BufNew' },
7 event = { 'BufReadPost', 'BufNew', },
78 config = function ()
89 local ibl = require 'ibl'

neovim/lua/bugabinga/plugins/lush.lua

Modified

+4 / −1 text lines

11return {
22 {
33 'rktjmp/lush.nvim',
4 -- tag = 'v2.0.1',
5 -- we rely on injects.sym for better treesitter support
46 branch = 'main',
57 lazy = false,
68 priority = 1000,
79 config = function ()
8 vim.cmd.colorscheme 'nugu'
10 -- disabled to find theming issues with heirline
11 -- vim.cmd.colorscheme 'nugu'
912 end,
1013 },

neovim/lua/bugabinga/plugins/mason.lua

Modified

+8 / −7 text lines

11return {
2 "williamboman/mason.nvim",
3 cmd = { 'Mason', 'MasonUpdate', 'MasonInstall', 'MasonUninstall', 'MasonUninstallAll', 'MasonLog' },
2 'williamboman/mason.nvim',
3 tag = 'v1.10.0',
4 cmd = { 'Mason', 'MasonUpdate', 'MasonInstall', 'MasonUninstall', 'MasonUninstallAll', 'MasonLog', },
45 opts = {
56 ui = {
67 border = vim.g.border_style,
78 width = 0.69,
89 height = 0.69,
9 }
10 },
1011 },
1112 dependencies = {
1213 {
1314 'WhoIsSethDaniel/mason-tool-installer.nvim',
1415 lazy = false,
15 cmd = { "MasonToolsInstall", "MasonToolsInstallSync", "MasonToolsUpdate", "MasonToolsUpdateSync", "MasonToolsClean" },
16 cmd = { 'MasonToolsInstall', 'MasonToolsInstallSync', 'MasonToolsUpdate', 'MasonToolsUpdateSync', 'MasonToolsClean', },
1617 opts = {
1718 ensure_installed = {
1819 'lua-language-server',
2526 'lemminx',
2627 'marksman',
2728 },
28 }
29 }
30 }
29 },
30 },
31 },

neovim/lua/bugabinga/plugins/navic.lua

Added
new file mode 100644

+6 / −0 text lines

1return {
2 'SmiteshP/nvim-navic',
3 opts = {
4
5 }
6}

neovim/lua/bugabinga/plugins/neodev.lua

Deleted
deleted file mode 100644

+0 / −6 text lines

1return {
2 'folke/neodev.nvim',
3 opts = {
4 lspconfig = false,
5 },
6}

neovim/lua/bugabinga/plugins/persistence.lua

Modified

+9 / −9 text lines

1local map = require'std.map'
1local map = require 'std.map'
33return {
44 'folke/persistence.nvim',
5 event = "BufReadPre",
6 opts = { },
7 config = function(_, opts)
8 local persistence = require'persistence'
9 persistence.setup(opts)
5 tag = 'v2.0.0',
6 event = 'BufReadPre',
7 opts = {},
8 config = function ( _, opts )
9 local persistence = require 'persistence'
10 persistence.setup( opts )
1112 map.normal {
1213 description = 'Restore session for current directory',
1314 category = 'history',
1415 keys = '<F4>',
15 command = function() persistence.load() end,
16 command = function () persistence.load() end,
1617 }
1819 map.normal {
1920 description = 'Restore last session',
2021 category = 'history',
2122 keys = '<F4><F4>',
22 command = function() persistence.load{last= true} end,
23 command = function () persistence.load { last = true, } end,
2324 }
2525 end,

neovim/lua/bugabinga/plugins/specs.lua

Modified

+36 / −35 text lines

1local map = require'std.map'
2local ignored = require'std.ignored'
1local map = require 'std.map'
2local ignored = require 'std.ignored'
4return {{
5 'edluffy/specs.nvim',
6 keys = { '<leader><leader>', '<leader><leader><leader>' },
7 config = function()
8 local specs = require'specs'
4return { {
5 'KevinSilvester/specs.nvim',
6 keys = { '<leader><leader>', '<leader><leader><leader>' },
7 config = function ()
8 local specs = require 'specs'
10 specs.setup{
11 show_jumps = true,
12 min_jump = 30,
13 popup = {
14 delay_ms = 10, -- delay before popup displays
15 inc_ms = 10, -- time increments used for fade/resize effects
16 blend = 10, -- starting blend, between 0-100 (fully transparent), see :h winblend
17 width = 10,
18 winhl = "Cursor",
19 fader = specs.exp_fader,
20 resizer = specs.shrink_resizer
21 },
22 ignore_filetypes = ignored.filetypes_kv,
23 ignore_buftypes = ignored.buftypes_kv,
24 }
10 specs.setup {
11 show_jumps = true,
12 min_jump = 30,
13 popup = {
14 delay_ms = 10, -- delay before popup displays
15 inc_ms = 10, -- time increments used for fade/resize effects
16 blend = 10, -- starting blend, between 0-100 (fully transparent), see :h winblend
17 width = 10,
18 winhl = 'Cursor',
19 fader = specs.exp_fader,
20 resizer = specs.shrink_resizer
21 },
22 ignore_filetypes = ignored.filetypes_kv,
23 ignore_buftypes = ignored.buftypes_kv,
24 }
26 map.normal {
27 description = 'Find cursor!',
28 category = 'fun',
29 keys = '<leader><leader>',
30 command = specs.show_specs,
31 }
26 map.normal {
27 description = 'Find cursor!',
28 category = 'fun',
29 keys = '<leader><leader>',
30 command = specs.show_specs,
31 }
33 map.normal {
33 map.normal {
3434 description = 'Find cursor, for real!',
35 category = 'fun',
36 keys = '<leader><leader><leader>',
37 command = function()
38 specs.show_specs{ width = 69, delay_ms = 69, inc_ms = 42}
35 category = 'fun',
36 keys = '<leader><leader><leader>',
37 command = function ()
38 specs.show_specs { width = 69, delay_ms = 69, inc_ms = 42 }
3939 end,
4040 }
41 end,
42}}No final newline
41 end,
42} }

neovim/lua/bugabinga/plugins/starter.lua

Modified

+4 / −2 text lines

5252 pattern = 'LazyVimStarted',
5353 once = true,
5454 command = vim.schedule_wrap( function ()
55 startuptime = require 'lazy'.stats().startuptime
56 starter.refresh()
55 if vim.bo.filetype == "starter" then
56 startuptime = require 'lazy'.stats().startuptime
57 starter.refresh()
58 end
5759 end ),
5860 }

neovim/lua/bugabinga/plugins/symbols-outline.lua

Modified

+11 / −3 text lines

11return {
2 'simrat39/symbols-outline.nvim',
3 cmd = 'SymbolsOutline',
4 opts = {},
2 'SmiteshP/nvim-navbuddy',
3 cmd = 'NavBuddy',
4 dependencies = {
5 'SmiteshP/nvim-navic',
6 'MunifTanjim/nui.nvim',
7 },
8 opts = {
9 window = {
10 border = vim.g.border_style,
11 },
12 },
513}

neovim/lua/bugabinga/plugins/telescope.lua

Modified

+12 / −12 text lines

55require 'bugabinga.health'.add_dependency
66{
77 name = 'ripgrep',
8 name_of_executable = 'rg'
8 name_of_executable = 'rg',
99}
1010 {
1111 name = 'find-fd',
12 name_of_executable = 'fd'
12 name_of_executable = 'fd',
1313 }
1515return {
1616 'nvim-telescope/telescope.nvim',
17 branch = '0.1.x',
17 tag = '0.1.6',
1818 cmd = 'Telescope',
1919 event = 'VeryLazy',
2020 dependencies = {
3030 local actions = require 'telescope.actions'
3131 local themes = require 'telescope.themes'
33 local ivy = themes.get_ivy { hidden = true, layout_config = { preview_width = 0.69 } }
34 local dropdown = themes.get_dropdown { layout_config = { width = 0.69 } }
35 local cursor = themes.get_cursor { layout_config = { preview_width = 0.42, width = 0.69 } }
33 local ivy = themes.get_ivy { hidden = true, layout_config = { preview_width = 0.69, }, }
34 local dropdown = themes.get_dropdown { layout_config = { width = 0.69, }, }
35 local cursor = themes.get_cursor { layout_config = { preview_width = 0.42, width = 0.69, }, }
3737 telescope.setup {
3838 defaults = {
39 path_display = { 'truncate' },
39 path_display = { 'truncate', },
4040 sorting_strategy = 'ascending',
4141 layout_config = {
42 horizontal = { prompt_position = 'bottom', preview_width = 0.69 },
43 vertical = { mirror = false },
42 horizontal = { prompt_position = 'bottom', preview_width = 0.69, },
43 vertical = { mirror = false, },
4444 width = 0.69,
4545 height = 0.42,
4646 preview_cutoff = 124,
6969 ['<c-p>'] = actions.move_selection_previous,
7070 ['<c-s>'] = actions.file_split,
7171 },
72 n = { q = actions.close },
72 n = { q = actions.close, },
7373 },
7474 },
7575 pickers = {
8383 buffers = cursor,
8484 },
8585 extensions = {
86 ['ui-select'] = { cursor },
87 zoxide = { prompt_title = 'Navigate deez nuts!' },
86 ['ui-select'] = { cursor, },
87 zoxide = { prompt_title = 'Navigate deez nuts!', },
8888 },
8989 }

neovim/lua/bugabinga/plugins/todo-comments.lua

Modified

+2 / −1 text lines

11return {
22 'folke/todo-comments.nvim',
3 dependencies = { 'nvim-lua/plenary.nvim' },
3 tag = 'v1.1.0',
4 dependencies = { 'nvim-lua/plenary.nvim', },
45 event = 'BufReadPost',
56 opts = {},
67}

neovim/lua/bugabinga/plugins/toggleterm.lua

Modified

+7 / −6 text lines

99 name_of_executable = 'mdcat',
1010 }
1111 {
12 name_of_executable = 'dot'
12 name_of_executable = 'dot',
1313 }
1515return {
1616 'akinsho/toggleterm.nvim',
17 tag = 'v2.10.0',
1718 keys = {
1819 '<F7>',
1920 '<F8>',
4849 toggleterm.setup( opts )
5051 local set_terminal_keymaps = function ()
51 local local_to_buffer = { buffer = 0 }
52 local local_to_buffer = { buffer = 0, }
5253 map.terminal {
5354 description = 'Quit insert mode',
5455 category = 'terminal',
6970 description = 'Open vertical Terminal',
7071 category = 'terminal',
7172 keys = '<F8>',
72 command = '<CMD>exe v:count1 . "ToggleTerm size=60 direction=vertical"<CR>'
73 command = '<CMD>exe v:count1 . "ToggleTerm size=60 direction=vertical"<CR>',
7374 }
7576 map.normal {
7677 description = 'Open horizontal Terminal',
7778 category = 'terminal',
7879 keys = '<F9>',
79 command = '<CMD>exe v:count1 . "ToggleTerm size=20 direction=horizontal"<CR>'
80 command = '<CMD>exe v:count1 . "ToggleTerm size=20 direction=horizontal"<CR>',
8081 }
8283 local Terminal = require 'toggleterm.terminal'.Terminal
99100 command = toggle_gitui,
100101 }
102 vim.api.nvim_create_user_command( 'Gitui', toggle_gitui, { desc = 'Toggle Gitui' } )
103 end
103 vim.api.nvim_create_user_command( 'Gitui', toggle_gitui, { desc = 'Toggle Gitui', } )
104 end,

neovim/lua/bugabinga/plugins/tree.lua

Modified

+7 / −0 text lines

33return {
44 'nvim-tree/nvim-tree.lua',
5 version = 'v1.0',
6 lazy = false,
57 cmd = 'NvimTreeOpen',
68 keys = '<leader>e',
9 dependencies = {
10 'nvim-tree/nvim-web-devicons',
11 'antosha417/nvim-lsp-file-operations',
12 },
713 init = function ()
814 -- disable netrw at the very start of your init.lua
915 vim.g.loaded_netrw = 1
2531 dotfiles = false,
2632 },
2733 }
34 require 'lsp-file-operations'.setup()
2936 map.normal {
3037 description = 'Toggle Tree File Explorer',

neovim/lua/bugabinga/plugins/treesitter.lua

Modified

+56 / −55 text lines

33require 'bugabinga.health'.add_dependency
44{
55 name = 'CMake',
6 name_of_executable = 'cmake'
7}
8{
9 name_of_executable = 'make'
10}
11{
12 name_of_executable = 'zig'
13}
14{
15 name = 'TreeSitter CLI',
16 name_of_executable = 'tree-sitter'
17}
18{
19 name_of_executable = 'tar'
6 name_of_executable = 'cmake',
207}
8 {
9 name_of_executable = 'make',
10 }
11 {
12 name_of_executable = 'zig',
13 }
14 {
15 name = 'TreeSitter CLI',
16 name_of_executable = 'tree-sitter',
17 }
18 {
19 name_of_executable = 'tar',
20 }
2222return {
2323 'nvim-treesitter/nvim-treesitter',
24 branch = 'master',
25 event = { 'BufReadPre', 'BufNewFile' },
24 tag = 'v0.9.2',
25 -- branch = 'master',
26 event = { 'BufReadPre', 'BufNewFile', },
2627 build = function ()
27 require 'nvim-treesitter.install'.update { with_sync = true }
28 require 'nvim-treesitter.install'.update { with_sync = true, }
2829 end,
2930 dependencies = {
3031 'windwp/nvim-ts-autotag',
3839 local parsers = require 'nvim-treesitter.parsers'
4041 install.prefer_git = false
41 install.compilers = { 'zig', 'clang', 'gcc', 'cl', 'cc', vim.fn.getenv 'CC' }
42 install.compilers = { 'zig', 'clang', 'gcc', 'cl', 'cc', vim.fn.getenv 'CC', }
4344 ---@diagnostic disable-next-line: missing-fields
4445 configs.setup {
7071 'zig',
7172 },
73 ignore_install = { 'oil' },
74 ignore_install = { 'oil', },
7576 auto_install = true,
77 autotag = { enable = true },
78 autotag = { enable = true, },
7980 highlight = {
8081 enable = true,
9899 },
99100 },
101 indent = { enable = true },
102 indent = { enable = true, },
103104 playground = {
104105 enable = true,
124125 enable = true,
125126 lookahead = true,
126127 keymaps = {
127 ['af'] = { query = '@call.outer', desc = 'outer function call' },
128 ['if'] = { query = '@call.inner', desc = 'inner function call' },
128 ['af'] = { query = '@call.outer', desc = 'outer function call', },
129 ['if'] = { query = '@call.inner', desc = 'inner function call', },
130 ['am'] = { query = '@function.outer', desc = 'outer function definition' },
131 ['im'] = { query = '@function.inner', desc = 'inner function definition' },
131 ['am'] = { query = '@function.outer', desc = 'outer function definition', },
132 ['im'] = { query = '@function.inner', desc = 'inner function definition', },
133 ['aa'] = { query = '@assignment.outer', desc = 'outer assignment' },
134 ['ia'] = { query = '@assignment.inner', desc = 'inner assignment' },
134 ['aa'] = { query = '@assignment.outer', desc = 'outer assignment', },
135 ['ia'] = { query = '@assignment.inner', desc = 'inner assignment', },
136137 -- l overwrites builtin. i have no good idea for better binding. use ia instead.
137138 -- ['la'] = { query = '@assignment.lhs', desc = 'left hand side of assignment'},
138139 -- ['ra'] = { query = '@assignment.rhs', desc = 'right hand side of assignment'},
140 ['ac'] = { query = '@class.outer', desc = 'outer class' },
141 ['ic'] = { query = '@class.inner', desc = 'inner class' },
141 ['ac'] = { query = '@class.outer', desc = 'outer class', },
142 ['ic'] = { query = '@class.inner', desc = 'inner class', },
143 ['ao'] = { query = '@conditional.outer', desc = 'outer conditional' },
144 ['io'] = { query = '@conditional.inner', desc = 'inner conditional' },
144 ['ao'] = { query = '@conditional.outer', desc = 'outer conditional', },
145 ['io'] = { query = '@conditional.inner', desc = 'inner conditional', },
146 ['al'] = { query = '@loop.outer', desc = 'outer loop' },
147 ['il'] = { query = '@loop.inner', desc = 'inner loop' },
147 ['al'] = { query = '@loop.outer', desc = 'outer loop', },
148 ['il'] = { query = '@loop.inner', desc = 'inner loop', },
149150 -- this overwrites the built-in 'paragraph' object
150 ['ap'] = { query = '@parameter.outer', desc = 'outer parameter' },
151 ['ip'] = { query = '@parameter.inner', desc = 'inner parameter' },
151 ['ap'] = { query = '@parameter.outer', desc = 'outer parameter', },
152 ['ip'] = { query = '@parameter.inner', desc = 'inner parameter', },
153 ['at'] = { query = '@comment.outer', desc = 'outer comment' },
154 ['at'] = { query = '@comment.outer', desc = 'outer comment', },
155 ['as'] = { query = '@scope', query_group = 'locals', desc = 'language scope' },
156 ['as'] = { query = '@scope', query_group = 'locals', desc = 'language scope', },
156157 },
157158 selection_modes = {
158159 ['@parameter.outer'] = 'v',
166167 swap = {
167168 enable = true,
168169 swap_next = {
169 ['<leader>spn'] = { query = '@parameter.inner', desc = 'Swap parameter with next' },
170 ['<leader>spn'] = { query = '@parameter.inner', desc = 'Swap parameter with next', },
170171 },
171172 swap_previous = {
172 ['<leader>spp'] = { query = '@parameter.inner', desc = 'Swap parameter with previous' },
173 ['<leader>spp'] = { query = '@parameter.inner', desc = 'Swap parameter with previous', },
173174 },
174175 },
178179 border = vim.g.border_style,
179180 floating_preview_opts = {},
180181 peek_definition_code = {
181 ['<leader>lpf'] = { query = '@function.outer', desc = 'Peek definition of outer function.' },
182 ['<leader>lpc'] = { query = '@class.outer', desc = 'Peek definition of outer class.' },
182 ['<leader>lpf'] = { query = '@function.outer', desc = 'Peek definition of outer function.', },
183 ['<leader>lpc'] = { query = '@class.outer', desc = 'Peek definition of outer class.', },
183184 },
184185 },
187188 enable = true,
188189 set_jumps = true,
189190 goto_next = {
190 [']f'] = { query = '@call.outer', desc = 'Goto next function call' },
191 [']m'] = { query = '@fucntion.outer', desc = 'Goto next function definition' },
192 [']c'] = { query = '@class.outer', desc = 'Goto next class' },
193 [']o'] = { query = '@conditional.outer', desc = 'Goto next conditional' },
194 [']p'] = { query = '@parameter.outer', desc = 'Goto next parameter' },
191 [']f'] = { query = '@call.outer', desc = 'Goto next function call', },
192 [']m'] = { query = '@fucntion.outer', desc = 'Goto next function definition', },
193 [']c'] = { query = '@class.outer', desc = 'Goto next class', },
194 [']o'] = { query = '@conditional.outer', desc = 'Goto next conditional', },
195 [']p'] = { query = '@parameter.outer', desc = 'Goto next parameter', },
195196 },
196197 goto_previous = {
197 ['[f'] = { query = '@call.outer', desc = 'Goto previous function call' },
198 ['[m'] = { query = '@function.outer', desc = 'Goto previous function definition' },
199 ['[c'] = { query = '@class.outer', desc = 'goto previous class' },
200 ['[o'] = { query = '@conditional.outer', desc = 'Goto previous conditional' },
201 ['[p'] = { query = '@parameter.outer', desc = 'Goto previous parameter' },
202 }
198 ['[f'] = { query = '@call.outer', desc = 'Goto previous function call', },
199 ['[m'] = { query = '@function.outer', desc = 'Goto previous function definition', },
200 ['[c'] = { query = '@class.outer', desc = 'goto previous class', },
201 ['[o'] = { query = '@conditional.outer', desc = 'Goto previous conditional', },
202 ['[p'] = { query = '@parameter.outer', desc = 'Goto previous parameter', },
203 },
203204 },
204 }
205 },
205206 }
207208 ---@diagnostic disable-next-line: inject-field
208209 parsers.get_parser_configs().just = {
209210 install_info = {
210211 url = 'https://github.com/IndianBoy42/tree-sitter-just', -- local path or git repo
211 files = { 'src/parser.c', 'src/scanner.cc' },
212 files = { 'src/parser.c', 'src/scanner.cc', },
212213 branch = 'main',
213214 },
214 maintainers = { '@IndianBoy42' },
215 maintainers = { '@IndianBoy42', },
215216 }
216217 end,

neovim/lua/bugabinga/plugins/treesj.lua

Modified

+19 / −17 text lines

1local map = require'std.map'
1local map = require 'std.map'
33return {
4 'Wansmer/treesj',
5 keys = '<C-j>',
6 dependencies = { 'nvim-treesitter/nvim-treesitter' },
7 config = function()
8 local treesj = require'treesj'
4 'Wansmer/treesj',
5 keys = '<C-j>',
6 dependencies = { 'nvim-treesitter/nvim-treesitter' },
7 opts = {
8 use_default_keymaps = false,
9 },
10 config = function ( _, opts )
11 local treesj = require 'treesj'
12 treesj.setup( opts )
10 treesj.setup {
11 use_default_keymaps = false,
12 }
14 map.normal {
15 description = 'Toggle Tree Join/Split',
16 category = 'editing',
17 -- WARN: <C-j> produces the same keycode as <C-enter> on some terminals
18 keys = '<C-j>',
19 command = treesj.toggle,
20 }
21 end,
22}
14 map.normal {
15 description = 'Toggle Tree Join/Split',
16 category = 'editing',
17 keys = '<C-j>',
18 command = treesj.toggle,
19 }
20 end,
21}No final newline

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

Modified

+4 / −3 text lines

33return {
44 {
55 'lukas-reineke/virt-column.nvim',
6 event = { 'BufReadPost', 'BufNew' },
6 tag = 'v2.0.2',
7 event = { 'BufReadPost', 'BufNew', },
78 opts = {
89 -- FIXME: I have visual redrawing bugs right now.
910 enabled = false,
10 char = { '░', '▒', '▓' },
11 char = { '░', '▒', '▓', },
1112 exclude = {
1213 filetypes = ignored.filetypes,
1314 buftypes = ignored.buftypes,
14 }
15 },
1516 },
1617 },

neovim/lua/bugabinga/plugins/whichkey.lua

Modified

+14 / −13 text lines

44return {
55 'folke/which-key.nvim',
6 tag = 'v1.6.0',
67 event = 'VeryLazy',
78 init = function ()
89 vim.o.timeout = true
2425 border = vim.g.border_style,
2526 winblend = vim.o.winblend,
2627 },
27 layout = { align = 'center' },
28 layout = { align = 'center', },
2829 disable = {
2930 buftypes = ignored.buftypes,
30 }
31 },
3132 },
3233 config = function ( _, opts )
3334 local wk = require 'which-key'
3940 -- use category as prefix?
4041 wk.register {
4142 ['<leader>'] = {
42 m = { name = 'mark', _ = 'which_key_ignore' },
43 h = { name = 'hunk', _ = 'which_key_ignore' },
44 l = { name = 'lsp', _ = 'which_key_ignore' },
45 r = { name = 'refactor', _ = 'which_key_ignore' },
43 m = { name = 'mark', _ = 'which_key_ignore', },
44 h = { name = 'hunk', _ = 'which_key_ignore', },
45 l = { name = 'lsp', _ = 'which_key_ignore', },
46 r = { name = 'refactor', _ = 'which_key_ignore', },
4647 s = {
4748 name = 'swap',
4849 _ = 'which_key_ignore',
4950 {
50 p = { name = 'parameter', _ = 'which_key_ignore' },
51 p = { name = 'parameter', _ = 'which_key_ignore', },
5152 },
5253 },
5354 t = {
5455 name = 'toggle',
5556 _ = 'which_key_ignore',
5657 {
57 o = { name = 'options', _ = 'which_key_ignore' },
58 }
58 o = { name = 'options', _ = 'which_key_ignore', },
59 },
5960 },
60 z = { name = 'lazy', _ = 'which_key_ignore' },
61 [' '] = { name = 'fun', _ = 'which_key_ignore' },
62 }
61 z = { name = 'lazy', _ = 'which_key_ignore', },
62 [' '] = { name = 'fun', _ = 'which_key_ignore', },
63 },
6364 }
64 end
65 end,

neovim/lua/bugabinga/ui.lua

Modified

+5 / −5 text lines

1local display = require 'std.display'
2
31local NuiPopup = require 'nui.popup'
42local NuiText = require 'nui.text'
53local NuiLine = require 'nui.line'
3028 show_tree = function ( tree )
3129 local popup = get_nui_popup()
3230 local bufnr = popup.bufnr
33 local text, _ = display( tree )
31 local text = vim.inspect( tree )
3533 local line_number = 1
36 for line in text:gmatch '[^\r\n]+' do
34 local namespace = -1
35 for line in text:gmatch '[^\r\n]+' do
3736 local nui_line = NuiLine()
3837 nui_line:append( NuiText( line, 'NormalFloat' ) )
39 nui_line:render( bufnr, -1, line_number )
39 nui_line:render( bufnr, namespace, line_number )
4040 line_number = line_number + 1
4141 end

neovim/lua/std/debug.lua

Modified

+5 / −4 text lines

66 return vim.g.bugabinga_debug_mode
77end
9local function print_debug( ... )
9local function print_debug( message, ... )
1010 if is_debug_mode() then
11 vim.print( ... )
11 -- TODO: pipe messages into custom debug buffer and file
12 vim.print( message, ... )
1213 end
1314end
1516local function toggle_debug_mode()
1617 vim.g.bugabinga_debug_mode = not vim.g.bugabinga_debug_mode
17 vim.notify( 'Toggled debug mode to ' .. tostring(is_debug_mode()) )
18 vim.notify( 'Toggled debug mode to ' .. tostring( is_debug_mode() ) )
1819end
20vim.api.nvim_create_user_command( 'Debug', toggle_debug_mode ,{})
21vim.api.nvim_create_user_command( 'Debug', toggle_debug_mode, {} )
2223return {
2324 print = print_debug,

neovim/lua/std/display.lua

Deleted
deleted file mode 100644

+0 / −44 text lines

1local icon = require'std.icon'
2local table = require'std.table'
3
4local function display(value)
5 if value == nil then
6 return 'nil', 'Special'
7 end
8
9 local value_type = type(value)
11 if value_type == 'string' then
12 return icon.quot_left .. ' ' .. value .. ' ' .. icon.quot_right, 'String'
13 end
15 if value_type == 'number' then
16 return icon.hash .. ' ' .. tostring(value), 'Number'
17 end
19 if value_type == 'boolean' then
20 local mark = value and icon.checkbox_mark or icon.checkbox_unmark
21 return mark, 'Boolean'
22 end
24 if value_type == 'userdata' then
25 local ud = icon.user .. icon.data
26 return ud .. ' ' .. tostring(value), 'Identifier'
27 end
29 if value_type == 'thread' then
30 local thread = icon.thread
31 return thread .. ' ' .. tostring(value), 'Identifier'
32 end
34 if value_type == 'function' then
35 local fn = icon['function']
36 return fn .. ' ' .. tostring(value), 'Function'
37 end
39 if value_type == 'table' then
40 return table.deep_concat(value, {render_value = display}), 'Identifier'
41 end
42end
44return display

neovim/lua/std/icon.lua

Modified

+5 / −5 text lines

66 arrow_right = '',
77 branch = '',
88 carriage_return = '␍',
9 checkbox_mark = '',
9 checkbox_mark = '',
1010 checkbox_unmark = '',
1111 command = '󰘳',
12 close = '',
12 close = '',
1313 block = '█',
1414 data = '',
1515 diagnostic = '⊙',
2626 global = '󱥔',
2727 group = '',
2828 hash = '',
29 hint = '󰊪',
29 hint = '',
3030 info = '󰩖',
3131 insert = '',
3232 lazy = '󰄻',
4141 normal = 'Ν',
4242 pending = '',
4343 precedes = '❮',
44 quot_left = '󰝗',
45 quot_right = '󰉾',
44 quot_left = '"',
45 quot_right = '"',
4646 replace = '',
4747 select = '󰒉',
4848 space = '·',

neovim/lua/std/ignored.lua

Modified

+0 / −1 text lines

2121local buftypes = {
22 '',
2322 'acwrite',
2423 'help',
2524 'neotree',

neovim/lua/std/map.lua

Modified

+13 / −13 text lines

3232local bind = function ( self, map )
3333 vim.validate {
34 map = { map, 'table' },
35 ['map.keys'] = { map.keys, { 'string', 'table' } },
36 ['map.command'] = { map.command, { 'function', 'string' } },
34 map = { map, 'table', },
35 ['map.keys'] = { map.keys, { 'string', 'table', }, },
36 ['map.command'] = { map.command, { 'function', 'string', }, },
3737 }
3939 local keys = map.keys
5050 desc = map.description,
5151 } )
53 if vim.tbl_isempty( self.mode ) then self.mode[1] = available_modes.normal_visual_select_operator_pending end
53 if vim.tbl_isempty( self.modes ) then self.modes[1] = available_modes.normal_visual_select_operator_pending end
5555 if type( keys ) == 'table' then
5656 for _, key in ipairs( keys ) do
57 vim.keymap.set( self.mode, key, command, options )
57 vim.keymap.set( self.modes, key, command, options )
5858 end
5959 else
60 vim.keymap.set( self.mode, keys, command, options )
60 vim.keymap.set( self.modes, keys, command, options )
6161 end
63 self.mode = {}
63 self.modes = {}
6565 return function ()
66 local delete_options = options.buffer and { buffer = options.buffer } or {}
66 local delete_options = options.buffer and { buffer = options.buffer, } or {}
6767 if type( keys ) == 'table' then
6868 for _, key in ipairs( keys ) do
69 vim.keymap.del( self.mode, key, delete_options )
69 vim.keymap.del( self.modes, key, delete_options )
7070 end
7171 else
72 vim.keymap.del( self.mode, keys, delete_options )
72 vim.keymap.del( self.modes, keys, delete_options )
7373 end
7474 end
7575end
7777local add_mode = function ( self, key )
7878 local new_mode = available_modes[key]
7979 if new_mode == nil then error( 'unknown keymap mode requested: ' .. key ) end
80 if not self.mode[new_mode] then
81 table.insert( self.mode, new_mode )
80 if not self.modes[new_mode] then
81 table.insert( self.modes, new_mode )
8282 end
8383 return self
8484end
8686--- @overload fun(map:table): function
8787local map = setmetatable(
8888 {
89 mode = {},
89 modes = {},
9090 },
9191 {
9292 __index = add_mode,

neovim/lua/std/project.lua

Modified

+66 / −61 text lines

99local cache = {}
1010local hasher = vim.fn.sha256
1111local markers_to_string = function ( markers )
12 return table.deep_concat( markers, {
13 prefix = '',
14 suffix = '',
15 row_delimiter = '',
16 key_value_delimiter = '',
17 fill = '',
18 newline = '',
19 } )
12 return vim.inspect( markers )
2013end
2114local create_hash = function ( path, markers )
2215 local path_hash = hasher( path )
3932--- number of max loop iterations when searching for markers
4033local MAX_TRAVERSAL_COUNT = 100
35--- the weight of a project marker, when the likelyhood is low
36local MAYBE = 1
37--- the weight of a project marker, when the likelyhood is high
38local LIKELY = 2
39--- the weight of a project marker, when the likelyhood is 100%
40local DEFINITLY = 3
4242--- Determines the path to a root directory, starting from the given path.
4343-- Markers have a name and weight.
4444-- Each name is checked for existence in all directories up to the root.
5656-- local project = require'std.project'
5757-- local current_buffer = vim.api.nvim_buf_get_name(0)
5858-- local markers = {
59-- { name = ".git", weight = 1 },
60-- { name = "README", weight = 2 },
61-- { naem = "Makefile", weight = 3 },
59-- { name = ".git", weight = MAYEB },
60-- { name = "README", weight = LIKELY },
61-- { naem = "Makefile", weight = DEFINITLY },
6262-- }
6363-- local root = project.find_root(current_buffer, markers, vim.uv.os_homedir())
6464-- print(root) -- /home/user/workspace/some_project
7171---@return string? # Directory, that contains the `markers` and lies on the path from `path` to `stop`.
7272local function find_root( path, markers, stop )
7373 validate {
74 path = { path, 'string', true },
75 markers = { markers, 'table' },
76 stop = { stop, 'string', true },
74 path = { path, 'string', true, },
75 markers = { markers, 'table', },
76 stop = { stop, 'string', true, },
7777 }
7979 path = path or dirname( vim.api.nvim_buf_get_name( 0 ) )
8888 local cache_hit = cache_get( path, markers )
8989 if cache_hit then
90 -- vim.print("CACHE HIT", cache_hit)
90 debug.print( 'CACHE HIT', cache_hit )
9191 return cache_hit
9292 end
135135 local project_root = nil
136136 local max_likelyhood = 0
137137 -- the project root is most likely the directory with the highest marker count
138 -- and lowest distance to current buffer.
138 -- and highest distance to current buffer.
139139 -- because if there are markers further away from the buffer than other markers,
140140 -- then it is most likely a nested project structure (multi-module).
141141 -- in those cases we are looking for the root project folder, instead the nearest
142142 -- child project root folder.
143143 for _, score in ipairs( directory_scores ) do
144 local likelihood = score.marker_count + 1 / score.distance_to_buffer_file
144 local likelihood = score.marker_count + score.distance_to_buffer_file
145145 if likelihood > max_likelyhood then
146146 max_likelyhood = likelihood
147147 project_root = score.path
162162local function find_project_root( path, markers )
163163 -- define some language-independent markers
164164 local default_markers = {
165 { name = '.git', weight = 1 },
166 { name = '.gitignore', weight = 1 },
167 { name = '.svn', weight = 1 },
168 { name = 'justfile', weight = 1 },
169 { name = 'Jenkinsfile', weight = 1 },
170 { name = '.editorconfig', weight = 1 },
171 { name = 'LICENSE', weight = 1 },
172 { name = 'LICENSE.md', weight = 1 },
173 { name = 'LICENSE.txt', weight = 1 },
174 { name = 'COPYING', weight = 1 },
175 { name = 'README', weight = 1 },
176 { name = 'README.md', weight = 1 },
177 { name = 'Makefile', weight = 1 },
178 { name = 'flake.nix', weight = 1 },
179 { name = 'flake.nix', weight = 1 },
165 { name = '.git', weight = LIKELY, },
166 { name = '.gitignore', weight = LIKELY, },
167 { name = '.svn', weight = LIKELY, },
168 { name = 'justfile', weight = LIKELY, },
169 { name = 'Jenkinsfile', weight = MAYBE, },
170 { name = '.editorconfig', weight = MAYBE, },
171 { name = 'LICENSE', weight = MAYBE, },
172 { name = 'LICENSE.md', weight = MAYBE, },
173 { name = 'LICENSE.txt', weight = MAYBE, },
174 { name = 'COPYING', weight = MAYBE, },
175 { name = 'README', weight = MAYBE, },
176 { name = 'README.md', weight = MAYBE, },
177 { name = 'Makefile', weight = LIKELY, },
178 { name = 'flake.nix', weight = MAYBE, },
179 { name = 'flake.nix', weight = MAYBE, },
180 { name = '.project_model', weight = DEFINITLY, },
180181 }
182183 markers = markers or {}
190191local function find_java_project_root( path )
191192 local java_markers = {
192 { name = '.idea', weight = 2 },
193 { name = '.classpath', weight = 2 },
194 { name = '.settings', weight = 2 },
195 { name = '.project', weight = 2 },
196 { name = 'target', weight = 2 },
197 { name = 'pom.xml', weight = 2 },
198 { name = 'mvnw', weight = 3 },
199 { name = '.mvn', weight = 3 },
200 { name = 'mvnw.cmd', weight = 3 },
201 { name = 'build.gradle', weight = 2 },
202 { name = 'gradle.properties', weight = 3 },
203 { name = 'settings.gradle', weight = 3 },
204 { name = 'gradlew', weight = 3 },
205 { name = 'gradlew.bat', weight = 3 },
193 { name = '.idea', weight = LIKELY, },
194 { name = '.classpath', weight = LIKELY, },
195 { name = '.settings', weight = LIKELY, },
196 { name = '.project', weight = LIKELY, },
197 { name = 'target', weight = LIKELY, },
198 { name = 'pom.xml', weight = LIKELY, },
199 { name = 'mvnw', weight = DEFINITLY, },
200 { name = '.mvn', weight = DEFINITLY, },
201 { name = 'mvnw.cmd', weight = DEFINITLY, },
202 { name = 'build.gradle', weight = DEFINITLY, },
203 { name = 'gradle.properties', weight = DEFINITLY, },
204 { name = 'settings.gradle', weight = DEFINITLY, },
205 { name = 'gradlew', weight = DEFINITLY, },
206 { name = 'gradlew.bat', weight = DEFINITLY, },
206207 }
207208 return find_root( path, java_markers )
208209end
210211local lua_markers = {
211 { name = '.luarc.json', weight = 1 },
212 { name = '.luarc.jsonc', weight = 1 },
213 { name = '.luacheckrc', weight = 1 },
214 { name = '.stylua.toml', weight = 1 },
215 { name = 'stylua.toml', weight = 1 },
216 { name = 'selene.toml', weight = 1 },
217 { name = 'selene.yml', weight = 1 },
218 { name = 'neovim.yml', weight = 1 },
219 { name = 'lua', weight = 1 },
212 { name = '.luarc.json', weight = MAYBE, },
213 { name = '.luarc.jsonc', weight = MAYBE, },
214 { name = '.luacheckrc', weight = MAYBE, },
215 { name = '.stylua.toml', weight = MAYBE, },
216 { name = 'stylua.toml', weight = MAYBE, },
217 { name = 'selene.toml', weight = MAYBE, },
218 { name = 'selene.yml', weight = MAYBE, },
219 { name = 'neovim.yml', weight = MAYBE, },
220 { name = 'lua', weight = MAYBE, },
222223local find_lua_project_root = function ( path )
224225end
226227local zig_markers = {
227 { name = 'build.zig', weight = 3 },
228 { name = 'zls.build.json', weight = 3 },
229 { name = 'zig-cache', weight = 1 },
230 { name = 'zig-out', weight = 1 },
228 { name = 'build.zig', weight = DEFINITLY, },
229 { name = 'zls.build.json', weight = DEFINITLY, },
230 { name = 'zig-cache', weight = MAYBE, },
231 { name = 'zig-out', weight = MAYBE, },
233234local find_zig_project_root = function ( path )
237238local find_rust_project_root = function ( path )
238239 local markers = {
239 { name = 'Cargo.toml', weight = 3 },
240 { name = 'Cargo.toml', weight = DEFINITLY, },
240241 }
241242 local cargo_crate_dir = find_root( path, markers )
242243 if cargo_crate_dir == nil then return nil end
251252 vim.fs.joinpath( cargo_crate_dir, 'Cargo.toml' ),
252253 }
254 local result = vim.system( cmd, { text = true } ):wait()
255 local result = vim.system( cmd, { text = true, } ):wait()
255256 local cargo_workspace_root
257258 if result.code == 0 then
279280 return rooter and rooter( path ) or fallback_rooter( path )
280281end
283--- @return table parsed configuration as could be found in the `.project_model` file in the root directory. Empty otherwise.
284local parse_project_configuration = function ()
285end
282287return {
283288 find_root = find_root,
284289 find_root_by_filetype = find_root_by_filetype,

neovim/lua/std/table/deep_concat.lua

Deleted
deleted file mode 100644

+0 / −68 text lines

1return function( some_table, options)
2 options = options or {}
3
4 vim.validate{
5 some_table = { some_table, 'table'},
6 [ 'options.prefix' ] = {options.prefix, 'string', true},
7 [ 'options.suffix' ] = {options.suffix, 'string', true},
8 [ 'options.fill' ] = {options.fill, 'string', true},
9 [ 'options.key_value_delimiter' ] = {options.key_value_delimiter, 'string', true},
10 [ 'options.row_delimiter' ] = {options.row_delimiter, 'string', true},
11 [ 'options.newline' ] = {options.newline, 'string', true},
12 [ 'options.render_key' ] = {options.render_key, 'function', true},
13 [ 'options.render_value' ] = {options.render_value, 'function', true},
14 }
16 local prefix = options.prefix or '⎨'
17 local suffix = options.suffix or '⎬'
18 local key_value_delimiter = options.key_value_delimiter or ' ≔ '
19 local row_delimiter = options.row_delimiter or ','
20 local fill = options.fill or ' '
21 local newline = options.newline or '\n'
22 local render_key = options.render_key or function(key) return type(key) == 'number' and ('['..key..']') or key end
23 local render_value = options.render_value or function(value) return tostring(value):gsub('\n','') end
24 local string_builder = {}
25 local append = function(thing) table.insert(string_builder, thing) end
27 local function deep_concat_table (tbl, level)
28 level = level or 0
29 if newline then append(fill:rep(level)) end
30 append(prefix)
31 append(newline)
32 for key, value in pairs(tbl) do
33 local next_level = level + 1
34 if newline then append(fill:rep(next_level)) end
35 append(render_key(key))
36 append(key_value_delimiter)
37 if type(value) == 'table' then
38 if vim.tbl_isempty(value) then
39 append(prefix)
40 append(suffix)
41 elseif vim.tbl_count(value) == 1 then
42 append(prefix)
43 append(fill)
44 -- single iteration for loop to get key name
45 for k,v in pairs(value) do
46 append(render_key(k))
47 append(key_value_delimiter)
48 append(render_value(v))
49 end
50 append(fill)
51 append(suffix)
52 else
53 append(newline)
54 deep_concat_table(value, next_level)
55 end
56 else
57 append(render_value(value))
58 end
59 append(row_delimiter)
60 append(newline)
61 end
62 append(newline)
63 if newline then append(fill:rep(level)) end
64 append (suffix)
65 end
66 deep_concat_table(some_table)
67 return table.concat(string_builder)
68end

neovim/lua/std/table/init.lua

Modified

+4 / −5 text lines

11--- Facade over various table functions in lua, neovim and some of my own.
22return {
3 deep_concat = require'std.table.deep_concat',
4 deep_copy = require'std.table.deep_copy',
5 join = require'std.table.join',
3 deep_copy = require 'std.table.deep_copy',
4 join = require 'std.table.join',
7 add_reverse_lookup = vim.tbl_add_reverse_lookup,
8 contains = vim.tbl_contains,
6 add_reverse_lookup = vim.tbl_add_reverse_lookup,
7 contains = vim.tbl_contains,
98 count = vim.tbl_count,
109 deep_extend = vim.tbl_deep_extend,
1110 extend = vim.tbl_extend,

neovim/neovim/lua/bugabinga/plugins/lush.lua

Added
new file mode 100644

+14 / −0 text lines

1return {
2 {
3 'rktjmp/lush.nvim',
4 -- tag = 'v2.0.1',
5 -- we rely on injects.sym for better treesitter support
6 branch = 'main',
7 -- lazy = false,
8 -- priority = 1000,
9 config = function ()
10 -- disabled to find theming issues with heirline
11 -- vim.cmd.colorscheme 'nugu'
12 end,
13 },
14}

neovim/spell/nerd.utf-8.add

Modified

+5 / −0 text lines

1919insoft
2020KKG5
2121KKG6
22lspconfig
23neoconf
24lsp
25autopairs
26cterm/!

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

Modified

Binary size (old → new): 278 → 340 bytes.

nushell/env.nu

Modified

+9 / −0 text lines

66$env.WORKSPACE = if $env.WIN32 { "W:/" } else { "~/Workspace" | path expand }
77$env.NOTES = if $env.WIN32 { "N:/" } else { "~/Notes" | path expand }
9if not (which nvim | is-empty) {
10 $env.EDITOR = 'nvim'
11 $env.GIT_EDITOR = 'nvim'
12}
14if not (which neovide | is-empty) {
15 $env.VISUAL = 'neovide'
16}
918if ($env | get -i TERM_PROGRAM) == WezTerm {
1019 $env.TERM = "wezterm"
1120 if not $env.WIN32 {