repositories / dotfiles

dotfiles

bugabingas dorkfiles

owned by bugabinga

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

167763b05b69480c12d237866f84f35a5d794ef6

Oliver Krylow <o.krylow@isp-insoft.de> ·

unsigned

Browse filesCompare with HEAD

Changed files (94)

.github/workflows/devskim.yml

Added
new file mode 100644
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.
6 +name: DevSkim
8 +on:
9 + push:
10 + branches: [ "trunk" ]
11 + pull_request:
12 + branches: [ "trunk" ]
13 + schedule:
14 + - cron: '28 3 * * 0'
16 +jobs:
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
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.
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
11 +name: Semgrep
13 +on:
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'
22 +permissions:
23 + contents: read
25 +jobs:
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
1 -# bugabingas personal dotfiles, 33rd attempt
1 +# bugabinga neovim config
3 -Shared configuration files between some Linux and some Windows hosts.
3 +neovim configuration is scripting.
4 +scripting with lua + neovim api is programming.
5 -## bootstrapping a new host
6 +## project structure
7 -1. Install git
8 -1. Install a JDK
9 -1. `git clone git@github.com:bugabinga/dotfiles`
10 -1. `cd dotfiles`
11 -1. `java bootstripper.java`
8 +init.lua
9 +: main entry point
11 +lua/std
12 +: standard lib. can only depend on itself and neovim apis.
14 +lua/bugabinga
15 +: config modules. in aggregation, defines all of the config. can depend on itself, std and plugins.
17 +lua/bugabinga/plugins
18 +: third party plugins and their config glue integrating it into the config.
20 +colors/nugu
21 +: color theme
23 +ftplugin
24 +: file type specific config
13 -> Pay attention to already existing symlinks!
26 +----------
15 -## windows
28 +# ai poem
17 -Initial setup on windows is a little more sophisticated, because I am used to a developers environment.
30 +I am the bone of my code, bugs are my body and exceptions are my blood.
31 +I have created over a thousand bugs, unknown to testers, nor known to debuggers.
32 +Have withstood pain to create many programs, yet those hands will never hold a working program.
33 +So as I pray, Unlimited Bug Works.
19 -1. Enable Developer Mode, so that it is allowed to make symlinks without admin permissions.
20 -1. Install Build Tools with C++ Option (for Rust and cargo tools)
21 -1. Install Git without internal SSH
22 -1. Start ssh-agent service
23 -1. 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
38 -There are two classes of differences in configurations between platforms (specifically Linux and Windows in my case).
40 -### differing locations of config files
42 -For example, [NeoVim] stores its configuration at `~/.config/nvim` in Linux and at `~/AppData/Roaming/nvim` in Windows.
43 -In order to handle theses differences each host gets its own symlink file with the naming pattern `(hostname).symlinks`.
44 -The format of this file is:
46 -```txt
47 -path to configuration file/directory relative to dotfiles root
48 -absolute path of symlink on host
49 -```
51 -Each symlink path pair is to be delimited by a newline.
52 -Example:
54 -```txt
55 -neovim
56 -~/.config/nvim
58 -foo/bar.conf
59 -~/.config/foobar.conf
60 -```
62 -This file will be parsed by [bootstripper] in order to create those symlinks.
64 -### differing values in configuration files
66 -Most often, these come down to different paths of stuff, that get referred to in config files.
67 -For 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.
68 -Some programs, e.g. [NeoVim], have rich configuration languages that are powerful enough for you to resolve those differences with conditionals.
69 -However some programs, e.g. [topgrade], offer only declarative configuration languages, which make it impossible to resolve this problem in the config.
70 -I tried solving this problem with some kind of a templating engine.
71 -But I quickly gave up on that, because it was too annoying to manage.
72 -Specifically, editing configuration stopped being "natural", meaning you cannot simply open and edit the file at the location you expect the config to be anymore.
73 -This natural flow is the reason symlinks are used.
74 -With templating in the mix, an intermediary step is necessary, between editing and applying config.
75 -Too much work.
76 -Instead, I use the `(hostname).symlink` files to resolve such cases.
77 -That means, that config files are completely independent per host, and as such some duplication of configuration occurs.
78 -A tradeoff well worth it in my opinion.
80 -## WIP:secrets
82 -Secrets are encrypted and saved as file into the `tresor` folder.
83 -The name of these file is a random UUID, which I map to their original purpose somewhere else.
84 -Those secret files are decrypted either by [bootstripper] or on demand in my scripts.
86 -## the trouble with bootstrapping dotfiles
88 -Most of my previous attempts at managing my configuration files failed because it is tricky to share them between Windows and Unix systems.
89 -If all my hosts were Unix(y), I would write a POSIX shell script and be done with it.
90 -But that does not work for Windows.
92 -Since 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.
93 -However, with Windows in the mix, this is pretty hard, so I settled on a compromise: JDK.
95 -Things 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.
108 -Things 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

cargo/config.toml

Modified
1 1 [build]
2 2 # enable a cache for crates between builds
3 - rustc-wrapper = "sccache"
3 +rustc-wrapper = "sccache"
4 4 # since we only care for builds for our own machine, let's benefit from thise juicy modern cpu features
5 5 rustflags = ["-C", "target-cpu=native"]
14 14 [target.x86_64-unknown-linux-gnu]
15 15 # not sure why that is necessary, but without it, rustc seems to pass wrong arguments to mold.
16 16 linker = "clang"
17 -rustflags = ["-C", "link-arg=--ld-path=/usr/bin/mold"]
17 +rustflags = ["-C", "link-arg=--ld-path=mold"]

config.nu

Deleted
deleted file mode 100644
1 -# Nushell Config File
2 -use table.nu *
3 -use os.nu *
4 -use prompt.nu *
5 -use aliases.nu *
6 -use todo.nu
7 -use openssl.nu *
8 -use pacnew.nu
9 -use syncthing.nu
11 -# for more information on themes see
12 -# https://github.com/nushell/nushell/blob/main/docs/How_To_Coloring_and_Theming.md
13 -let default_theme = {
14 - # color for nushell primitives
15 - separator: white
16 - leading_trailing_space_bg: { attr: n } # no fg, no bg, attr non effectively turns this off
17 - header: green_bold
18 - empty: blue
19 - bool: white
20 - int: white
21 - filesize: white
22 - duration: white
23 - date: white
24 - range: white
25 - float: white
26 - string: white
27 - nothing: white
28 - binary: white
29 - cellpath: white
30 - row_index: green_bold
31 - record: white
32 - list: white
33 - block: white
34 - hints: dark_gray
36 - # shapes are used to change the cli syntax highlighting
37 - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: b}
38 - shape_binary: purple_bold
39 - shape_bool: light_cyan
40 - shape_int: purple_bold
41 - shape_float: purple_bold
42 - shape_range: yellow_bold
43 - shape_internalcall: cyan_bold
44 - shape_external: cyan
45 - shape_externalarg: green_bold
46 - shape_literal: blue
47 - shape_operator: yellow
48 - shape_signature: green_bold
49 - shape_string: green
50 - shape_string_interpolation: cyan_bold
51 - shape_datetime: cyan_bold
52 - shape_list: cyan_bold
53 - shape_table: blue_bold
54 - shape_record: cyan_bold
55 - shape_block: blue_bold
56 - shape_filepath: cyan
57 - shape_globpattern: cyan_bold
58 - shape_variable: purple
59 - shape_flag: blue_bold
60 - shape_custom: green
61 - shape_nothing: light_cyan
64 -# The default config record. This is where much of your global configuration is setup.
65 -$env.config = {
66 - show_banner: false
67 - table: {
68 - mode: light # basic, compact, compact_double, light, thin, with_love, rounded, reinforced, heavy, none, other
69 - }
70 - ls: {
71 - use_ls_colors: true
72 - clickable_links: true
73 - }
74 - rm: {
75 - always_trash: true
76 - }
77 - color_config: $default_theme
78 - use_grid_icons: true
79 - footer_mode: "auto" # always, never, number_of_rows, auto
80 - completions: {
82 - quick: true # set this to false to prevent auto-selecting completions when only one remains
83 - partial: true # set this to false to prevent partial filling of the prompt
84 - }
85 - float_precision: 2
86 - use_ansi_coloring: true
87 - filesize: {
88 - metric: false
89 - format: "auto" # b, kb, kib, mb, mib, gb, gib, tb, tib, pb, pib, eb, eib, zb, zib, auto
90 - }
91 - edit_mode: emacs # emacs, vi
92 - history: {
93 - file_format: "plaintext"
94 - max_size: 10000
95 - sync_on_enter: true # Enable to share the history between multiple sessions, else you have to close the session to persist history to file
96 - }
97 - menus: [
98 - # Configuration for default nushell menus
99 - # Note the lack of source parameter
100 - {
101 - name: completion_menu
102 - only_buffer_difference: false
103 - marker: "| "
104 - type: {
105 - layout: columnar
106 - columns: 4
107 - # col_width: 20 # Optional value. If missing all the screen width is used to calculate column width
108 - col_padding: 2
109 - }
110 - style: {
111 - text: green
112 - selected_text: green_reverse
113 - description_text: yellow
114 - }
115 - }
116 - {
117 - name: history_menu
118 - only_buffer_difference: true
119 - marker: "? "
120 - type: {
121 - layout: list
122 - page_size: 10
123 - }
124 - style: {
125 - text: green
126 - selected_text: green_reverse
127 - description_text: yellow
128 - }
129 - }
130 - {
131 - name: help_menu
132 - only_buffer_difference: true
133 - marker: "? "
134 - type: {
135 - layout: description
136 - columns: 4
137 - col_width: 20 # Optional value. If missing all the screen width is used to calculate column width
138 - col_padding: 2
139 - selection_rows: 4
140 - description_rows: 10
141 - }
142 - style: {
143 - text: green
144 - selected_text: green_reverse
145 - description_text: yellow
146 - }
147 - }
148 - # Example of extra menus created using a nushell source
149 - # Use the source field to create a list of records that populates
150 - # the menu
151 - {
152 - name: commands_menu
153 - only_buffer_difference: false
154 - marker: "# "
155 - type: {
156 - layout: columnar
157 - columns: 4
158 - col_width: 20
159 - col_padding: 2
160 - }
161 - style: {
162 - text: green
163 - selected_text: green_reverse
164 - description_text: yellow
165 - }
166 - source: { |buffer, position|
167 - $nu.scope.commands
168 - | where command =~ $buffer
169 - | each { |it| {value: $it.command description: $it.usage} }
170 - }
171 - }
172 - {
173 - name: vars_menu
174 - only_buffer_difference: true
175 - marker: "# "
176 - type: {
177 - layout: list
178 - page_size: 10
179 - }
180 - style: {
181 - text: green
182 - selected_text: green_reverse
183 - description_text: yellow
184 - }
185 - source: { |buffer, position|
186 - $nu.scope.vars
187 - | where name =~ $buffer
188 - | sort-by name
189 - | each { |it| {value: $it.name description: $it.type} }
190 - }
191 - }
192 - {
193 - name: commands_with_description
194 - only_buffer_difference: true
195 - marker: "# "
196 - type: {
197 - layout: description
198 - columns: 4
199 - col_width: 20
200 - col_padding: 2
201 - selection_rows: 4
202 - description_rows: 10
203 - }
204 - style: {
205 - text: green
206 - selected_text: green_reverse
207 - description_text: yellow
208 - }
209 - source: { |buffer, position|
210 - $nu.scope.commands
211 - | where command =~ $buffer
212 - | each { |it| {value: $it.command description: $it.usage} }
213 - }
214 - }
215 - ]
216 - keybindings: [
217 - {
218 - name: completion_menu
219 - modifier: none
220 - keycode: tab
221 - mode: emacs # Options: emacs vi_normal vi_insert
222 - event: {
223 - until: [
224 - { send: menu name: completion_menu }
225 - { send: menunext }
226 - ]
227 - }
228 - }
229 - {
230 - name: completion_previous
231 - modifier: shift
232 - keycode: backtab
233 - mode: [emacs, vi_normal, vi_insert] # Note: You can add the same keybinding to all modes by using a list
234 - event: { send: menuprevious }
235 - }
236 - {
237 - name: history_menu
238 - modifier: control
239 - keycode: char_x
240 - mode: emacs
241 - event: {
242 - until: [
243 - { send: menu name: history_menu }
244 - { send: menupagenext }
245 - ]
246 - }
247 - }
248 - {
249 - name: history_previous
250 - modifier: control
251 - keycode: char_z
252 - mode: emacs
253 - event: {
254 - until: [
255 - { send: menupageprevious }
256 - { edit: undo }
257 - ]
258 - }
259 - }
260 - # Keybindings used to trigger the user defined menus
261 - {
262 - name: commands_menu
263 - modifier: control
264 - keycode: char_t
265 - mode: [emacs, vi_normal, vi_insert]
266 - event: { send: menu name: commands_menu }
267 - }
268 - {
269 - name: vars_menu
270 - modifier: control
271 - keycode: char_y
272 - mode: [emacs, vi_normal, vi_insert]
273 - event: { send: menu name: vars_menu }
274 - }
275 - {
276 - name: commands_with_description
277 - modifier: control
278 - keycode: char_u
279 - mode: [emacs, vi_normal, vi_insert]
280 - event: { send: menu name: commands_with_description }
281 - } ]
284 -# must be done, after defining config, since zoxide mutates it
285 -use zoxide.nu *
287 -overlay use coreutils.nu

env.nu

Modified
1 1 # GLOBAL VARIABLES
2 -# GLOBAL VARIABLES
4 3 $env.WIN32 = ( $nu.os-info.name =~ "windows" )
5 4 $env.NURC_DIR = ( $nu.config-path | path expand | path dirname )
6 5 $env.DOTFILES = ( $env.NURC_DIR | path join ".." | path expand )
7 6 $env.WORKSPACE = if $env.WIN32 { "W:/" } else { "~/Workspace" | path expand }
8 7 $env.NOTES = if $env.WIN32 { "N:/" } else { "~/Notes" | path expand }
9 9 if ($env | get -i TERM_PROGRAM) == WezTerm {
10 - $env.TERM = "wezterm"
11 - $env.TERMCAP = ~/.terminfo/w/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
15 -$env.LS_COLORS = (try { vivid generate ayu | into string } catch {""})
17 +$env.LS_COLORS = (try { vivid generate alabaster_dark | into string } catch {""})
17 19 # Specifies how environment variables are:
18 20 # - converted from a string to a value on Nushell startup (from_string)
35 37 ($nu.config-path | path dirname | path join 'completions')
38 -alias cb = flatpak run app.getclipboard.Clipboard
40 -$env.CLIPBOARD_EDITOR = nvim
41 -$env.CLIPBOARD_HISTORY = 100000
42 -$env.CLIPBOARD_PERSISTDIR = /home/oli/Clipboard
43 -$env.CLIPBOARD_NOAUDIO = 1
44 -# $env.CLIPBOARD_NOGUI = 1
45 -$env.CLIPBOARD_THEME = light
40 +if $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 ) )

helix/config.toml

Modified
43 43 "file-line-ending",
44 44 "file-type",
46 -right = [
47 - "diagnostics",
48 - "spacer",
49 - "spinner"
46 +right = ["diagnostics", "spacer", "spinner"]
51 47 separator = "·"
52 48 mode.normal = ""
53 49 mode.insert = ""
85 81 enable = true
87 83 [keys.normal]
88 -ret = ["add_newline_below","move_line_down"]
84 +ret = ["add_newline_below", "move_line_down"]
89 85 A-ret = ["add_newline_above", "move_line_up"]
91 87 # move current line up
92 -A-up = ["extend_to_line_bounds", "delete_selection", "move_line_up", "paste_before"]
93 -A-k = ["extend_to_line_bounds", "delete_selection", "move_line_up", "paste_before"]
88 +A-up = [
89 + "extend_to_line_bounds",
90 + "delete_selection",
91 + "move_line_up",
92 + "paste_before",
94 +A-k = [
95 + "extend_to_line_bounds",
96 + "delete_selection",
97 + "move_line_up",
98 + "paste_before",
95 101 # move current line down
96 102 A-down = ["extend_to_line_bounds", "delete_selection", "paste_after"]

lua/bugabinga/plugins/heirline.lua

Added
new file mode 100644
1 +---@diagnostic disable: param-type-mismatch
2 +local icon = require 'std.icon'
3 +local auto = require 'std.auto'
4 +local ignored = require 'std.ignored'
6 +local NEW_FILE = '~untitled~'
8 +return {
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 + },
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',
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,
128 + provider = function ( self )
129 + return self.lfilename
130 + end,
131 + },
133 + provider = function ( self )
134 + return vim.fs.normalize( vim.fn.pathshorten( self.lfilename ) )
135 + end,
136 + },
139 + local file_flags = {
141 + condition = function ()
142 + return vim.bo.modified
143 + end,
144 + provider = string.format( ' %s ', icon.modified ),
145 + hl = 'Comment',
146 + },
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 + },
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
168 + local file_type = {
169 + provider = function ()
170 + return icon.file .. ' ' .. string.upper( vim.bo.filetype )
171 + end,
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,
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,
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,
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,
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,
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,
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', },
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 + },
269 + provider = function ( self )
270 + return self.warnings > 0 and (self.warn_icon .. ' ' .. self.warnings .. ' ')
271 + end,
272 + hl = 'DiagnosticWarn',
273 + },
275 + provider = function ( self )
276 + return self.info > 0 and (self.info_icon .. ' ' .. self.info .. ' ')
277 + end,
278 + hl = 'DiagnosticInfo',
279 + },
281 + provider = function ( self )
282 + return self.hints > 0 and (self.hint_icon .. ' ' .. self.hints)
283 + end,
284 + hl = 'DiagnosticHint',
285 + },
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,
325 + provider = function ( self )
326 + return icon.subversion .. ' ' .. icon.branch .. ' ' .. self.relative_url
327 + end,
328 + },
332 + local git = {
333 + condition = conditions.is_git_repo,
335 + init = function ( self )
336 + self.status_dict = vim.b.gitsigns_status_dict
337 + end,
340 + provider = function ( self )
341 + return icon.git .. ' ' .. icon.branch .. ' ' .. self.status_dict.head .. ' '
342 + end,
343 + },
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 + },
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 + },
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 + },
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,
376 + provider = function ( self )
377 + return self.icon .. self.cwd
378 + end,
379 + },
381 + provider = function ( self )
382 + local cwd = vim.fn.pathshorten( self.cwd )
383 + return self.icon .. cwd
384 + end,
385 + },
387 + provider = '',
388 + },
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',
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',
411 + local togglers = {
412 + provider = function ()
413 + local togglers = require 'bugabinga.options.togglers'
414 + return tostring( togglers )
415 + end,
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 + },
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 + },
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,
460 + local special_statusline = {
461 + condition = function ()
462 + return conditions.buffer_matches {
463 + buftype = ignored.buftypes,
464 + filetype = ignored.filetypes,
466 + end,
468 + file_type,
469 + space,
470 + help_file_name,
471 + align,
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,
487 + local inactive_statusline = {
488 + condition = conditions.is_not_active,
489 + file_type,
490 + space,
491 + file_name,
492 + align,
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,
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,
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,
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,
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,
559 + local tabline_file_flags = {
561 + condition = function ( self ) return vim.api.nvim_get_option_value( 'modified', { buf = self.bufnr, } ) end,
562 + provider = icon.modified .. ' ',
563 + },
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',
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,
617 + local tabline_buffer_block = utils.surround(
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, }
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', }
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,
651 + local tab_pages = {
652 + { provider = '%=', },
653 + utils.make_tablist( tabpage ),
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(
671 + buftype = ignored.buftypes,
672 + filetype = ignored.filetypes,
673 + },
674 + args.buf )
675 + end,
676 + },
678 + end,
679 + },

neovim/.editorconfig

Modified
17 17 max_line_length = 120
19 19 # 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'
21 21 end_of_line = lf
23 23 # none/ comma / semicolon / only_kv_colon
24 24 table_separator_style = comma
26 26 #optional keep/never/always/smart
27 -trailing_table_separator = keep
27 +trailing_table_separator = always
29 29 # keep/remove/remove_table_only/remove_string_only
30 30 call_arg_parentheses = remove
105 105 # [line space]
107 107 # The following configuration supports four expressions
108 -# keep
109 -# fixed(n)
108 +# keep
109 +# fixed(n)
110 110 # min(n)
111 111 # max(n)
112 112 # for eg. min(2)

neovim/README.md

Modified
39 39 # 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?
41 46 * pandoc with lua filters for diagrams for generating documents and previewing --> https://github.com/tex/vimpreviewpandoc
42 47 * use gen.ai to generate docs
43 48 * learn marks and refactor mark.lua
44 49 * use ltex-ls for markdown, code comments and commit messages
50 +* create a floating window that shows plugins, that have commands, as reminder
45 51 * setup DAP
46 52 * add nu-check to nvim-lint
47 53 * 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.lua

Modified
1 1 if vim.g.colors_name == nil then
2 2 -- Get the current hour
3 - local current_hour = tonumber( os.date '%H' )
3 + local current_hour = tonumber( os.date '%H' )
5 5 -- Set the background based on the time of day
6 6 if current_hour >= 9 and current_hour < 17 then
10 10 -- print"setting background to dark"
11 11 vim.opt.background = 'dark'
13 +else
14 + -- Reset all highlights if another colorscheme was previously set
15 + vim.cmd [[ highlight clear ]]
15 18 vim.g.colors_name = 'nugu'
18 21 package.loaded['bugabinga.nugu'] = nil
19 22 package.loaded['bugabinga.nugu.palette'] = nil
21 -local lush = require 'lush'
22 -local nugu = require 'bugabinga.nugu'
23 -lush( nugu )
24 +require 'bugabinga.nugu' ()

neovim/ftplugin/lua.lua

Modified
1 1 -- Options to add `gf` functionality inside `.lua` files.
2 2 vim.opt_local.include = [[\v<((do|load)file|require)[^''"]*[''"]\zs[^''"]+]]
3 3 vim.opt_local.includeexpr = "substitute(v:fname,'\\.','/','g')"
4 -for _, path in pairs(vim.api.nvim_list_runtime_paths()) do
5 - vim.opt_local.path:append(path .. '/lua')
4 +for _, path in pairs( vim.api.nvim_list_runtime_paths() ) do
5 + vim.opt_local.path:append( path .. '/lua' )
6 6 end
7 7 vim.opt_local.suffixesadd:prepend '.lua'

neovim/init.lua

Modified
9 9 -- ▀ ▀
11 11 -- setup debug mode
12 --- local debug = require 'std.debug'
13 --- debug.toggle()
12 +-- require 'std.debug'.toggle()
14 +vim.cmd.colorscheme 'nugu'
15 16 local ok, loaded
37 38 -- setup lsp clients
38 39 ok, loaded = pcall( require, 'bugabinga.lsp' )
39 40 if not ok then vim.print( 'error while loading lsp', loaded ) end

neovim/lazy-lock.json

Modified
2 2 "Comment.nvim": { "branch": "master", "commit": "0236521ea582747b58869cb72f70ccfa967d2e89" },
3 - "LuaSnip": { "branch": "master", "commit": "8ae1dedd988eb56441b7858bd1e8554dfadaa46d" },
4 3 "actions-preview.nvim": { "branch": "master", "commit": "5072b1b1065a6b22bdd46b5c21780a91d6a08071" },
5 4 "better-escape.nvim": { "branch": "master", "commit": "7e86edafb8c7e73699e0320f225464a298b96d12" },
6 - "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
7 - "cmp-emoji": { "branch": "main", "commit": "0acd702358230abeb6576769f7116e766bca28a0" },
8 - "cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" },
9 - "cmp-nvim-lsp-document-symbol": { "branch": "main", "commit": "f0f53f704c08ea501f9d222b23491b0d354644b0" },
10 - "cmp-nvim-lsp-signature-help": { "branch": "main", "commit": "3d8912ebeb56e5ae08ef0906e3a54de1c66b92f1" },
11 - "cmp-omni": { "branch": "main", "commit": "4ef610bbd85a5ee4e97e09450c0daecbdc60de86" },
12 - "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
13 - "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" },
5 + "colorizer.nvim": { "branch": "master", "commit": "107719885290366c893e1c1c58b7474cbeabfef6" },
14 6 "diffview.nvim": { "branch": "main", "commit": "3dc498c9777fe79156f3d32dddd483b8b3dbd95f" },
15 7 "dressing.nvim": { "branch": "master", "commit": "18e5beb3845f085b6a33c24112b37988f3f93c06" },
8 + "fidget.nvim": { "branch": "main", "commit": "4e854f3299e21d1c18279add340428a97520fc44" },
16 9 "flash.nvim": { "branch": "main", "commit": "48817af25f51c0590653bbc290866e4890fe1cbe" },
17 - "friendly-snippets": { "branch": "main", "commit": "dcd4a586439a1c81357d5b9d26319ae218cc9479" },
18 10 "gen.nvim": { "branch": "main", "commit": "2cb643b1a827bcdfc665a37d5f8174249d2d5bf5" },
19 11 "gitsigns.nvim": { "branch": "main", "commit": "078041e9d060a386b0c9d3a8c7a7b019a35d3fb0" },
20 12 "glow.nvim": { "branch": "main", "commit": "238070a686c1da3bccccf1079700eb4b5e19aea4" },
21 13 "heirline.nvim": { "branch": "master", "commit": "03cff30d7e7d3ba6fdc00925f015822f79cef908" },
22 14 "hlargs.nvim": { "branch": "main", "commit": "0f2dbf02ff948e8fc8ebe07b215f3174a12bbe3c" },
15 + "hyper.nvim": { "branch": "main", "commit": "b84fb39e703b1dd487d20c4faf028ee51374c88b" },
23 16 "indent-blankline.nvim": { "branch": "master", "commit": "3d08501caef2329aba5121b753e903904088f7e6" },
24 17 "lazy.nvim": { "branch": "main", "commit": "83493db50a434a4c5c648faf41e2ead80f96e478" },
25 - "lspkind.nvim": { "branch": "master", "commit": "1735dd5a5054c1fb7feaf8e8658dbab925f4f0cf" },
26 - "lush.nvim": { "branch": "main", "commit": "bc12f010b34cfeefac35720656eb777753b165d9" },
27 18 "mason-tool-installer.nvim": { "branch": "main", "commit": "1212fb6082b7177dde17ea65e429e027835aeb40" },
28 19 "mason.nvim": { "branch": "main", "commit": "3b5068f0fc565f337d67a2d315d935f574848ee7" },
29 20 "mini.align": { "branch": "main", "commit": "f845218c5fea89e49074e48270dc5e1b9511a0f9" },
30 21 "mini.bracketed": { "branch": "main", "commit": "65c7dfb51e832de9e279e5d5b0741e7af6755ab5" },
31 - "mini.colors": { "branch": "main", "commit": "f64963332f7fcb45c8dfcc243f682a9a0fb9935d" },
32 22 "mini.starter": { "branch": "main", "commit": "ce222a5b6de50a9963c1eb62aa16ec6d5efca7ee" },
33 23 "mkdir.nvim": { "branch": "main", "commit": "c55d1dee4f099528a1853b28bb28caa802eba217" },
34 24 "neodev.nvim": { "branch": "main", "commit": "84e0290f5600e8b89c0dfcafc864f45496a53400" },
36 26 "nrpattern.nvim": { "branch": "master", "commit": "f862ce687761078ef3155688151c55f69d28453e" },
37 27 "nui.nvim": { "branch": "main", "commit": "cbd2668414331c10039278f558630ed19b93e69b" },
38 28 "nvim-autopairs": { "branch": "master", "commit": "797260ff31e8bdd9db0f0c352659a35aba335b0b" },
39 - "nvim-cmp": { "branch": "main", "commit": "04e0ca376d6abdbfc8b52180f8ea236cbfddf782" },
40 - "nvim-colorizer.lua": { "branch": "master", "commit": "85855b38011114929f4058efc97af1059ab3e41d" },
41 29 "nvim-genghis": { "branch": "main", "commit": "8613fc1b43db6cc761733b3630eabff9e86296f7" },
42 30 "nvim-gomove": { "branch": "main", "commit": "2b44ae7ac0804f4e3959228122f7c85bef1964e3" },
43 31 "nvim-jdtls": { "branch": "master", "commit": "a4746791876166dc146eae573a1b49d24a6652e7" },
44 32 "nvim-lastplace": { "branch": "main", "commit": "0bb6103c506315044872e0f84b1f736c4172bb20" },
33 + "nvim-lsp-file-operations": { "branch": "master", "commit": "223aca86b737dc66e9c51ebcda8788a8d9cc6cf2" },
34 + "nvim-navbuddy": { "branch": "master", "commit": "f137a3466a6cd1965cdcc5398daff54e66eebbe5" },
35 + "nvim-navic": { "branch": "master", "commit": "8649f694d3e76ee10c19255dece6411c29206a54" },
45 36 "nvim-neoclip.lua": { "branch": "main", "commit": "798cd0592a81c185465db3a091a0ff8a21af60fd" },
46 37 "nvim-spectre": { "branch": "master", "commit": "e7db8ebca7fd0a604027ebf85acee52f6642c91c" },
47 38 "nvim-surround": { "branch": "main", "commit": "84a26afce16cffa7e3322cfa80a42cddf60616eb" },
61 52 "speedtyper.nvim": { "branch": "main", "commit": "2d158eed4c753995b0501a3a7a72464fbb213e3d" },
62 53 "ssr.nvim": { "branch": "main", "commit": "bb323ba621ac647b4ac5638b47666e3ef3c279e1" },
63 54 "substitute.nvim": { "branch": "main", "commit": "17ffaeb5a1dc2dbef39cf0865d8a4b6000836714" },
64 - "symbols-outline.nvim": { "branch": "master", "commit": "564ee65dfc9024bdde73a6621820866987cbb256" },
65 55 "telescope-symbols.nvim": { "branch": "master", "commit": "a6d0127a53d39b9fc2af75bd169d288166118aec" },
66 56 "telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" },
67 57 "telescope-zoxide": { "branch": "main", "commit": "68966349aa1b8e9ade403e18479ecf79447389a7" },
68 - "telescope.nvim": { "branch": "0.1.x", "commit": "6312868392331c9c0f22725041f1ec2bef57c751" },
58 + "telescope.nvim": { "branch": "master", "commit": "6312868392331c9c0f22725041f1ec2bef57c751" },
69 59 "todo-comments.nvim": { "branch": "main", "commit": "833d8dd8b07eeda37a09e99460f72a02616935cb" },
70 60 "toggleterm.nvim": { "branch": "main", "commit": "193786e0371e3286d3bc9aa0079da1cd41beaa62" },
71 61 "tree-sitter-nu": { "branch": "main", "commit": "c5b7816043992b1cdc1462a889bc74dc08576fa6" },

neovim/lua/bugabinga/diagnostic.lua

Modified
70 70 sign { name = 'DiagnosticSignHint', text = diagnostic_icons.hint }
71 71 sign { name = 'DiagnosticSignInfo', text = diagnostic_icons.info }
73 +-- TODO: move to togglers
73 74 map.normal {
74 75 description = 'Toggle diagnostics',
75 76 category = 'diagnostic',

neovim/lua/bugabinga/health.lua

Modified
6 6 local _ = {}
8 -local function program_installed(name_of_executable)
9 - return (vim.fn.executable(name_of_executable) ~= 0)
8 +local function program_installed( name_of_executable )
9 + return (vim.fn.executable( name_of_executable ) ~= 0)
12 -local function check_program(name, name_of_executable)
12 +local function check_program( name, name_of_executable )
13 13 local display_name = name and (name .. '(' .. name_of_executable .. ')') or name_of_executable
14 - vim.health.start(display_name .. ' report')
15 - if program_installed(name_of_executable) then
16 - vim.health.ok(display_name .. ' found on system')
14 + vim.health.start( display_name .. ' report' )
15 + if program_installed( name_of_executable ) then
16 + vim.health.ok( display_name .. ' found on system' )
17 17 else
18 - vim.health.error(display_name .. ' is not installed on the system')
18 + vim.health.error( display_name .. ' is not installed on the system' )
22 22 local programs_to_check = {}
24 -_.add_dependency = function(program)
25 - vim.validate{
26 - program = { program, 'table' },
27 - name_of_executable = { program.name_of_executable, 'string' },
24 +_.add_dependency = function ( program )
25 + vim.validate {
26 + program = { program, 'table', },
27 + name_of_executable = { program.name_of_executable, 'string', },
30 - programs_to_check[program.name_of_executable] = program
30 + programs_to_check[program.name_of_executable] = program
32 - -- returns itself so that multiple programs can be chain-added
33 - return _.add_dependency
32 + -- returns itself so that multiple programs can be chain-added
33 + return _.add_dependency
36 -_.check = function()
37 - vim.iter(programs_to_check)
38 - :each(function(_, program)
39 - check_program(program.name, program.name_of_executable)
40 - end)
36 +_.check = function ()
37 + vim.iter( programs_to_check )
38 + :each( function ( _, program )
39 + check_program( program.name, program.name_of_executable )
40 + end )
43 43 return _

neovim/lua/bugabinga/lazy.lua

Modified
1 -local win32 = vim.loop.os_uname().sysname:match'Win'
1 +local win32 = vim.loop.os_uname().sysname:match 'Win'
2 2 local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim'
3 -if not vim.loop.fs_stat(lazypath) then
3 +if not vim.loop.fs_stat( lazypath ) then
4 4 vim.fn.system {
5 5 'git',
6 6 'clone',
10 10 lazypath,
13 -vim.opt.rtp:prepend(lazypath)
13 +vim.opt.rtp:prepend( lazypath )
15 15 -- prevents lazy from setting up its highlights.
16 16 -- those will be setup manually later.
17 -require('lazy.view.colors').did_setup = true
17 +require 'lazy.view.colors'.did_setup = true
19 19 local lazy = require 'lazy'
20 -local icon = require'std.icon'
20 +local icon = require 'std.icon'
22 -lazy.setup('bugabinga.plugins', {
22 +lazy.setup( 'bugabinga.plugins', {
23 23 defaults = {
24 24 lazy = true,
25 25 -- version = '*',
27 27 install = {
28 28 missing = true,
29 - colorscheme = { 'nugu', 'quiet' },
29 + colorscheme = { 'nugu_fresh', 'quiet', },
31 31 checker = {
32 32 enabled = not win32,
33 33 notify = false,
35 35 ui = {
36 - size = { width = 0.69 , heigth = 0.69 },
36 + size = { width = 0.69, heigth = 0.69, },
37 37 border = vim.g.border_style,
38 38 icons = {
39 39 lazy = icon.lazy,
44 44 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', {
47 47 cwd = plugin.dir,
48 - })
48 + } )
50 - ["<localleader>t"] = function(plugin)
51 - require("lazy.util").float_term(nil, {
50 + ['<localleader>t'] = function ( plugin )
51 + require 'lazy.util'.float_term( nil, {
52 52 cwd = plugin.dir,
53 - })
53 + } )
56 - change_detection = { notify = false },
56 + change_detection = { notify = false, },
57 57 performance = {
58 58 rtp = {
59 59 disabled_plugins = {
84 84 dev = {
85 85 fallback = true,
86 - patterns = { 'bugabinga' },
87 - path = win32 and 'W:/' or '~/Workspace'
86 + patterns = { 'bugabinga', },
87 + path = win32 and 'W:/' or '~/Workspace',
89 -})
89 +} )
91 91 local map = require 'std.map'
93 93 local 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, },
106 106 local base_key = '<leader>z'
108 -lazy_cmds:each(function(cmd)
108 +lazy_cmds:each( function ( cmd )
109 109 map.normal {
110 110 name = cmd[1] .. ' plugins',
111 111 category = 'plugins',
112 112 keys = base_key .. cmd[2],
113 113 command = cmd[3],
115 -end)
115 +end )

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

Deleted
deleted file mode 100644
1 -local project = require'std.project'
3 -return {
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/asm.lua

Modified
1 -local project = require'std.project'
1 +local project = require 'std.project'
3 3 return {
4 4 name = 'asm-lsp',
5 5 command = 'asm-lsp',
6 - filetypes = { 'asm', 'vmasm' },
6 + filetypes = { 'asm', 'vmasm', },
7 7 root_dir = project.find_vcs_project_root,
8 8 single_file_support = true,
9 9 workspaces = false,

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

Modified
1 -local project = require'std.project'
1 +local project = require 'std.project'
3 3 return {
4 - name = 'bash-lsp',
5 - command = { 'bash-language-server', 'start' } ,
6 - filetypes = { 'sh' },
4 + name = 'bash-lsp',
5 + command = { 'bash-language-server', 'start', },
6 + filetypes = { 'sh', },
7 7 root_dir = project.find_vcs_project_root,
8 8 single_file_support = true,
9 9 workspaces = false,
10 10 settings = {
11 - bashIde = {
12 - -- Glob pattern for finding and parsing shell script files in the workspace.
13 - -- Used by the background analysis features across files.
11 + bashIde = {
12 + -- Glob pattern for finding and parsing shell script files in the workspace.
13 + -- Used by the background analysis features across files.
15 - -- Prevent recursive scanning which will cause issues when opening a file
16 - -- directly in the home directory (e.g. ~/foo.sh).
17 - --
18 - -- Default upstream pattern is "**/*@(.sh|.inc|.bash|.command)".
19 - globPattern = vim.env.GLOB_PATTERN or '*@(.sh|.inc|.bash|.command)',
20 - },
15 + -- Prevent recursive scanning which will cause issues when opening a file
16 + -- directly in the home directory (e.g. ~/foo.sh).
17 + --
18 + -- Default upstream pattern is "**/*@(.sh|.inc|.bash|.command)".
19 + globPattern = vim.env.GLOB_PATTERN or '*@(.sh|.inc|.bash|.command)',
21 + },

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

Modified
1 -local project = require'std.project'
1 +local project = require 'std.project'
3 3 return {
4 - name = 'clangd',
4 + name = 'clangd',
5 5 command = 'clangd',
6 6 filetypes = 'c',
7 7 root_dir = project.find_vcs_project_root,
13 13 editsNearCursor = true,
16 - offsetEncoding = { 'utf-8', 'utf-16' },
16 + offsetEncoding = { 'utf-8', 'utf-16', },

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

Modified
1 -local project = require'std.project'
1 +local project = require 'std.project'
3 3 return {
4 4 name = 'dot-lsp',
5 - command = { 'dot-language-server', '--stdio'},
5 + command = { 'dot-language-server', '--stdio', },
6 6 filetypes = 'dot',
7 7 root_dir = project.find_vcs_project_root,
8 8 single_file_support = true,

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

Modified
1 1 return {
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
1 1 local table = require 'std.table'
2 2 local project = require 'std.project'
3 3 local auto = require 'std.auto'
4 -local map = require'std.map'
4 +local map = require 'std.map'
6 6 local create_shared_config_path = function ( base_path, syntax_server )
7 7 local os_config
54 54 local create_jdtls_command = function ( syntax_server )
55 55 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()
57 57 local shared_config_path = create_shared_config_path( jdtls_package_path, syntax_server )
58 58 local launcher_jar = find_launcher_jar( jdtls_package_path )
59 59 local data_dir = create_data_dir()
94 94 local jdk17 = {
95 95 name = 'JavaSE-17',
97 - local jdk19 = {
98 - name = 'JavaSE-19',
99 - }
100 97 local jdk21 = {
101 98 name = 'JavaSE-21',
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'
109 105 elseif host == 'NB-00718' then
110 106 jdk11.path = 'C:/Users/okr/scoop/apps/openjdk11'
111 107 jdk17.path = 'C:/Users/okr/scoop/apps/openjdk17'
112 - jdk19.path = 'C:/Users/okr/scoop/apps/openjdk19'
113 108 jdk21.path = 'C:/Users/okr/scoop/apps/openjdk21'
115 110 vim.notify 'missing jdk paths in java settings for lsp'
118 - return { jdk11, jdk17, jdk19, jdk21 }
113 + return { jdk11, jdk17, jdk21 }
121 116 local java_settings = {
221 216 description = 'Extract Variable',
222 217 category = 'jdlts',
223 218 keys = '<leader>ljv',
224 - command = function() jdtls.extract_variable(true) end,
219 + command = function () jdtls.extract_variable( true ) end,
227 222 map.visual {
228 223 description = 'Extract Constant',
229 224 category = 'jdlts',
230 225 keys = '<leader>ljc',
231 - command = function() jdtls.extract_constant(true) end,
226 + command = function () jdtls.extract_constant( true ) end,
234 229 map.visual {
235 230 description = 'Extract Method',
236 231 category = 'jdlts',
237 232 keys = '<leader>ljm',
238 - command = function() jdtls.extract_method(true) end,
233 + command = function () jdtls.extract_method( true ) end,
241 236 auto 'refresh_codelens' {

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

Modified
4 4 local project = require 'std.project'
6 6 return {
7 7 name = 'LuaLS',
8 8 filetypes = 'lua',
9 9 command = 'lua-language-server',
10 - root_dir = project.find_lua_project_root ,
10 + root_dir = project.find_lua_project_root,
11 11 single_file_support = true,
12 12 workspaces = true,
13 + before_init = require 'neodev.lsp'.before_init,
13 14 settings = {
14 15 Lua = {
15 - addonManager = { enable = false },
16 - completion = { callSnippet = 'Both', postfix = '.' },
17 - diagnostics = { globals = { 'vim' }, workspaceRate = 50 },
18 - hint = { enable = true, setType = true },
19 - telemetry = { enable = false },
20 - window = { progressBar = false, statusBar = false },
21 - workspace = { checkThirdParty = false, }
16 + addonManager = { enable = false, },
17 + completion = { callSnippet = 'Disable', postfix = '.', },
18 + diagnostics = { globals = { 'vim', }, workspaceRate = 50, },
19 + hint = { enable = true, setType = true, },
20 + telemetry = { enable = false, },
21 + window = { progressBar = true, statusBar = true, },
22 + workspace = { checkThirdParty = false, },
24 - before_init = require 'neodev.lsp'.before_init,

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

Modified
1 -local project = require'std.project'
1 +local project = require 'std.project'
3 3 return {
4 4 name = 'marksman',
5 - command = { 'marksman', 'server' },
5 + command = { 'marksman', 'server', },
6 6 filetypes = 'markdown',
7 - root_dir = function(path)
7 + root_dir = function ( path )
8 8 local markers = {
9 - { name = '.marksman.toml', weight = 10 }
9 + { name = '.marksman.toml', weight = 10, },
11 - return project.find_project_root(path, markers)
11 + return project.find_project_root( path, markers )
12 12 end,
13 13 single_file_support = true,
14 14 workspaces = false,

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

Added
new file mode 100644
1 +local project = require 'std.project'
3 +return {
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,

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

Modified
1 -local project = require'std.project'
1 +local project = require 'std.project'
3 -local function is_library(path)
4 - local cargo_home = os.getenv 'CARGO_HOME' or vim.fs.joinpath(vim.env.HOME, '.cargo')
5 - local registry = vim.fs.joinpath(cargo_home, 'registry', 'src')
3 +--TODO: can this be used as general template for all kinds of lsp commands?
4 +local function reload_workspace( bufnr )
5 + local clients = vim.lsp.get_active_clients { name = 'rust_analyzer', bufnr = bufnr, }
6 + for _, client in ipairs( clients ) do
7 + vim.notify 'Reloading Cargo Workspace'
8 + client.request( 'rust-analyzer/reloadWorkspace', nil, function ( err )
9 + if err then
10 + error( tostring( err ) )
11 + end
12 + vim.notify 'Cargo workspace reloaded'
13 + end, 0 )
14 + end
15 +end
7 - local rustup_home = os.getenv 'RUSTUP_HOME' or vim.fs.joinpath(vim.env.HOME, '.rustup')
8 - for _, item in ipairs { toolchains, registry } do
9 - if path:sub(1, #item) == item then
10 - local clients = vim.lsp.get_active_clients { name = 'rust_analyzer' }
17 +local is_descendant = function ( root, path )
18 + if not path then return false end
20 + for directory in vim.fs.parents( path ) do
21 + if vim.fs.normalize( root ) == vim.fs.normalize( directory ) then return true end
22 + end
24 + return false
25 +end
27 +local function is_library( fname )
28 + local user_home = vim.fs.normalize( vim.env.HOME )
29 + local cargo_home = os.getenv 'CARGO_HOME' or vim.fs.joinpath( user_home, '.cargo' )
30 + local registry = vim.fs.joinpath( cargo_home, 'registry', 'src' )
31 + local git_registry = vim.fs.joinpath( cargo_home, 'git', 'checkouts' )
33 + local rustup_home = os.getenv 'RUSTUP_HOME' or vim.fs.joinpath( user_home, '.rustup' )
34 + local toolchains = vim.fs.joinpath( rustup_home, 'toolchains' )
36 + for _, item in ipairs { toolchains, registry, git_registry, } do
37 + if is_descendant( item, fname ) then
38 + local clients = vim.lsp.get_active_clients { name = 'rust_analyzer', }
11 39 return #clients > 0 and clients[#clients].config.root_dir or nil
17 45 return {
18 - name = 'rust-analyzer',
46 + name = 'rust-analyzer',
19 47 command = 'rust-analyzer',
20 48 filetypes = 'rust',
21 - root_dir = function(path)
22 - local library_root = is_library(path)
49 + root_dir = function ( path )
50 + local library_root = is_library( path )
23 51 if library_root then return library_root end
24 - return project.find_rust_project_root(path)
52 + return project.find_rust_project_root( path )
25 53 end,
26 54 capabilities = {
27 55 experimental = {
28 56 serverStatusNotification = true,
59 + commands = {
60 + CargoReload = {
61 + function ()
62 + reload_workspace( 0 )
63 + end,
64 + description = 'Reload current cargo workspace',
65 + },
66 + },

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

Modified
1 -local project = require'std.project'
1 +local project = require 'std.project'
3 3 return {
4 4 name = 'taplo',
5 - command = { 'taplo', 'lsp', 'stdio' },
5 + command = { 'taplo', 'lsp', 'stdio', },
6 6 root_dir = project.find_vcs_project_root,
7 7 filetypes = 'toml',
8 8 single_file_support = true,

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

Modified
1 -local project = require'std.project'
1 +local project = require 'std.project'
3 3 return {
4 4 name = 'vim-lsp',
5 - command = { 'vim-language-server', '--stdio' },
5 + command = { 'vim-language-server', '--stdio', },
6 6 filetypes = 'vim',
7 7 root_dir = project.find_vcs_project_root,
8 8 single_file_support = true,
9 9 init_options = {
10 - isNeovim = true,
11 - iskeyword = '@,48-57,_,192-255,-#',
12 - vimruntime = '',
13 - runtimepath = '',
14 - diagnostic = { enable = true },
15 - indexes = {
16 - runtimepath = true,
17 - gap = 100,
18 - count = 3,
19 - projectRootPatterns = { 'runtime', 'nvim', '.git', 'autoload', 'plugin' },
20 - },
21 - suggest = { fromVimruntime = true, fromRuntimepath = true },
10 + isNeovim = true,
11 + iskeyword = '@,48-57,_,192-255,-#',
12 + vimruntime = '',
13 + runtimepath = '',
14 + diagnostic = { enable = true, },
15 + indexes = {
16 + runtimepath = true,
17 + gap = 100,
18 + count = 3,
19 + projectRootPatterns = { 'runtime', 'nvim', '.git', 'autoload', 'plugin', },
21 + suggest = { fromVimruntime = true, fromRuntimepath = true, },
22 + },

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

Modified
1 -local project = require'std.project'
1 +local project = require 'std.project'
3 3 return {
4 4 name = 'lemminx',
5 5 command = 'lemminx',
6 - filetypes = { 'xml', 'xsd', 'xsl', 'xslt', 'svg' },
6 + filetypes = { 'xml', 'xsd', 'xsl', 'xslt', 'svg', },
7 7 root_dir = project.find_vcs_project_root,
8 8 single_file_support = true,

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

Modified
1 -local project = require'std.project'
1 +local project = require 'std.project'
3 3 return {
4 4 name = 'zls',
5 - command = 'zls',
5 + command = 'zls',
6 6 filetypes = { 'zig', 'zir' },
7 7 root_dir = project.find_zig_project_root,
8 8 single_file_support = true,

neovim/lua/bugabinga/lsp/init.lua

Modified
38 38 local expand_command = function ( command )
39 - vim.validate { command = { command, { 'string', 'table' } } }
41 - debug.print( 'expanding command', command )
39 + vim.validate { command = { command, { 'string', 'table', }, }, }
43 41 if type( command ) == 'table' then
44 42 command[1] = expand_path( command[1] )
51 49 local lsp_start = function ( file_type_event )
50 + debug.print 'trying to start lsp'
52 51 local match = file_type_event.match
54 - 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
53 + debug.print( 'filetypes to ignore', ignored.filetypes, 'current filetype', match )
54 + if vim.iter( ignored.filetypes ):find( match ) then return end
58 56 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
57 + local buftype = vim.api.nvim_get_option_value( 'buftype', { buf = bufnr, } )
58 + debug.print( 'buftypes to ignore', ignored.buftypes, 'current buftype', buftype )
59 + if vim.iter( ignored.buftypes ):find( buftype ) then return end
62 61 local buffer_path = vim.api.nvim_buf_get_name( bufnr )
66 65 local potential_client_configs = vim.iter( lsp_client_configs )
67 66 :map( function ( config )
68 67 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 },
68 + ['config'] = { config, 'table', },
69 + ['config.name'] = { config.name, 'string', },
70 + ['config.filetypes'] = { config.filetypes, { 'string', 'table', }, },
71 + ['config.command'] = { config.command, { 'string', 'table', }, },
72 + ['config.environment'] = { config.environment, 'table', true, },
73 + ['config.root_dir'] = { config.root_dir, 'function', 'string', },
74 + ['config.single_file_support'] = { config.single_file_support, 'boolean', true, },
75 + ['config.settings'] = { config.settings, 'table', true, },
76 + ['config.workspaces'] = { config.workspaces, 'boolean', true, },
77 + ['config.before_init'] = { config.before_init, 'function', true, },
78 + ['config.init_options'] = { config.init_options, 'table', true, },
79 + ['config.capabilities'] = { config.capabilities, 'table', true, },
80 + ['config.custom_start'] = { config.custom_start, 'function', true, },
83 82 -- normalize scalar values to its vector alternative for easier processing later on
84 83 -- this mutates the lsp client configs! careful!
85 - config.command = type( config.command ) == 'string' and { expand_command( config.command ) } or
84 + config.command = type( config.command ) == 'string' and { expand_command( config.command ), } or
86 85 expand_command( config.command )
87 86 config.environment = config.environment or {}
88 - config.filetypes = type( config.filetypes ) == 'string' and { config.filetypes } or config.filetypes
87 + config.filetypes = type( config.filetypes ) == 'string' and { config.filetypes, } or config.filetypes
89 88 config.single_file_support = config.single_file_support == nil and false or config.single_file_support
90 89 config.workspaces = config.workspaces == nil and false or config.workspaces
91 90 config.capabilities = config.capabilities or {}
99 98 :totable()
101 100 debug.print( 'POTENTIAL CLIENTS',
102 - vim.iter( potential_client_configs ):map( function ( config ) return { name = config.name, command = config.command } end )
103 - :totable() )
101 + vim.iter( potential_client_configs ):map( function ( config )
102 + return {
103 + name = config.name,
104 + command =
105 + config.command,
107 + end )
108 + :totable() )
105 110 if table.is_empty( potential_client_configs ) then
106 111 debug.print( 'found no lsp client for', buffer_path )
115 120 for _, config in ipairs( potential_client_configs ) do
116 121 local root_dir = type( config.root_dir ) == 'string' and config.root_dir or config.root_dir( buffer_path )
117 122 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 )
123 + capabilities = table.extend( 'force', capabilities, config.capabilities )
122 125 debug.print( 'starting command:', config.command )
126 129 cmd_cwd = root_dir,
127 130 -- cmd_env = config.environment,
128 131 detached = false, -- do i want this?
132 + root_dir = root_dir,
129 133 -- workspace_folders = { config.root_dir(buffer_path) }, -- TODO: i think workspaces can only ever be declared per project. i cannot think of a generic way to calculate those, like with root_dir. maybe a toml/ini file in root_dir sets these?
130 134 capabilities = capabilities,
131 135 -- handlers = vim.lsp.handlers,
138 142 on_error = function ( code, ... ) vim.print( 'LSP ERROR', code, ... ) end,
139 143 before_init = config.before_init,
140 144 -- on_init = nil, -- should i send workspace/didChangeConfiguration here?
141 - on_exit = function ( code, signal, client_id ) vim.print( 'LSP CLIENT EXIT', code, signal, client_id ) end,
142 - on_attach = function ( client, bufnr ) debug.print( 'LSP CLIENT ATTACH', client, bufnr ) end,
143 - trace = 'off',
144 - flags = { allow_incremental_sync = true, debounce_text_changes = 250, exit_timeout = 200 },
145 - root_dir = root_dir,
145 + on_exit = function ( code, signal, client_id ) debug.print( 'LSP CLIENT EXIT', code, signal, client_id ) end,
146 + on_attach = function ( client, attach_bufnr ) debug.print( 'LSP CLIENT ATTACH', client, attach_bufnr ) end,
147 + trace = debug.get() and 'on' or 'off',
148 + flags = { allow_incremental_sync = true, debounce_text_changes = 250, exit_timeout = 200, },
148 151 local lsp_starter = config.custom_start or vim.lsp.start
184 - debug.print( 'ATTACHING LSP CLIENT', client_id )
187 + debug.print( 'ATTACHING LSP CLIENT', config.name )
219 222 vim.bo[bufnr].omnifunc = 'v:lua.vim.lsp.omnifunc'
225 + if client.server_capabilities.documentSymbolProvider then
226 + local navic_ok, navic = pcall( require, 'nvim-navic' )
227 + if navic_ok then
228 + navic.attach( client, bufnr )
229 + else
230 + vim.notify 'nvim-navic not found. could not attach to lsp client.'
231 + end
232 + local navbuddy_ok, navbuddy = pcall( require, 'nvim-navbuddy' )
233 + if navbuddy_ok then
234 + navbuddy.attach( client, bufnr )
235 + else
236 + vim.notify 'nvim-navbuddy not found. could not attach to lsp client.'
237 + end
238 + end
222 240 if client.server_capabilities.documentHighlightProvider then
223 241 -- the timer has application lifetime. no need to close
224 242 local delay = 300
236 254 description = 'Remove highlight from symbol under cursor on move',
237 - events = { 'CursorMoved', 'InsertEnter' },
255 + events = { 'CursorMoved', 'InsertEnter', },
238 256 buffer = bufnr,
239 257 command = debounced_clear,
240 - }
258 + },
257 275 description = 'Show hover documentation above cursor.',
258 276 category = 'lsp',
259 277 buffer = bufnr,
260 - keys = { 'K', '<leader>lk' },
278 + keys = { 'K', '<leader>lk', },
261 279 command = vim.lsp.buf.hover,
321 339 description = 'Rename symbol under cursor.',
322 340 category = 'lsp',
323 341 buffer = bufnr,
324 - keys = { '<f2>', '<leader>ln' },
342 + keys = { '<f2>', '<leader>ln', },
325 343 command = vim.lsp.buf.rename,
373 391 description = 'Semantic Tokens from the LSP',
374 392 events = 'LspTokenUpdate',
375 393 command = token_update,
376 - }
394 + },
379 397 local lsp_info = function ( command )
380 - local all_or_current = command.args and command.args == 'all' and {} or { bufnr = 0 }
398 + local all_or_current = command.args and command.args == 'all' and {} or { bufnr = 0, }
381 399 local active_clients = vim.lsp.get_clients( all_or_current )
383 401 local infos = vim.iter( active_clients )
408 426 local lsp_info_extended = function ( command )
409 - local all_or_current = command.args and command.args == 'all' and {} or { bufnr = 0 }
427 + local all_or_current = command.args and command.args == 'all' and {} or { bufnr = 0, }
410 428 local active_clients = vim.lsp.get_clients( all_or_current )
411 429 ui.show_tree( active_clients )
414 432 user_command( 'LspInfo', lsp_info, {
415 433 nargs = '?',
416 - complete = function () return { 'all' } end,
434 + complete = function () return { 'all', } end,
417 435 desc = 'Shows basic information about running LSP clients.',
420 438 user_command( 'LspInfoExtended', lsp_info_extended, {
421 439 nargs = '?',
422 - complete = function () return { 'all' } end,
440 + complete = function () return { 'all', } end,
423 441 desc = 'Shows detailed information about running LSP clients.',
426 ---TODO: lsp restart, lsp exit
444 +-- TODO: lsp restart, lsp exit
446 +-- TODO: move to std.icons.lua
447 +local completion_icons = {
448 + Class = ' ',
449 + Color = ' ',
450 + Constant = ' ',
451 + Constructor = ' ',
452 + Enum = ' ',
453 + EnumMember = ' ',
454 + Field = '󰄶 ',
455 + File = ' ',
456 + Folder = ' ',
457 + Function = ' ',
458 + Interface = '󰜰',
459 + Keyword = '󰌆 ',
460 + Method = 'ƒ ',
461 + Module = '󰏗 ',
462 + Property = ' ',
463 + Snippet = '󰘍 ',
464 + Struct = ' ',
465 + Text = ' ',
466 + Unit = ' ',
467 + Value = '󰎠 ',
468 + Variable = ' ',
471 +local completion_kinds = vim.lsp.protocol.CompletionItemKind
472 +for i, kind in ipairs( completion_kinds ) do
473 + completion_kinds[i] = completion_icons[kind] or kind
474 +end
428 476 return setmetatable( _, {} )

neovim/lua/bugabinga/lsp/lightbulb.lua

Modified
3 3 --VSCode-like lightbulb.
4 4 --Implementation inspired from https://github.com/nvimdev/lspsaga.nvim/blob/c9b17bc7dc694bdbeb3788a583518073a30a6de2/lua/lspsaga/codeaction/lightbulb.lua
6 6 local lb_name = 'mariasolos/lightbulb'
7 7 local lb_namespace = vim.api.nvim_create_namespace( lb_name )
8 -local lb_icon = require 'std.icon'.hint
8 +local lb_icon = require 'std.icon'.hint
9 9 local lb_group = vim.api.nvim_create_augroup( lb_name, { clear = true } )
10 10 local code_action_method = vim.lsp.protocol.Methods.textDocument_codeAction
11 11 local timer = vim.uv.new_timer()

neovim/lua/bugabinga/nugu/init.lua

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

neovim/lua/bugabinga/nugu/palette.lua

Modified
1 -local choose = function ( variants )
2 - if vim.opt.background:get() == 'dark' then
3 - return variants.dark
4 - else
5 - return variants.light
6 - end
1 +local choose = function ( variants )
2 + ---@diagnostic disable-next-line: undefined-field
3 + if vim.opt.background:get() == 'dark' then
4 + return variants.dark
5 + else
6 + return variants.light
7 + end
9 10 return {
10 - debug = choose { light = '#3dd45d', dark = '#3dd45d' },
11 - error = choose { light = '#740523', dark = '#f27a9a' },
12 - info = choose { light = '#4187a7', dark = '#e7f0f3' },
13 - warning = choose { light = '#a7802d', dark = '#f1e8d6' },
11 + debug = choose { light = '#3dd45d', dark = '#3dd45d', },
12 + error = choose { light = '#740523', dark = '#f27a9a', },
13 + info = choose { light = '#4187a7', dark = '#e7f0f3', },
14 + warning = choose { light = '#a7802d', dark = '#f1e8d6', },
15 - content_normal = choose { light = '#494949', dark = '#cfcfcf' },
16 - content_backdrop = choose { light = '#e3e3e3', dark = '#131313' },
17 - content_accent = choose { light = '#800080', dark = '#800080' },
18 - content_minor = choose { light = '#878787', dark = '#727272' },
19 - content_focus = choose { light = '#646464', dark = '#a5bdb6' },
20 - content_unfocus = choose { light = '#c9c9c9', dark = '#3f4543' },
21 - content_important_global = choose { light = '#48256e', dark = '#8e58cc' },
22 - content_important_local = choose { light = '#643398', dark = '#7a3bc3' },
16 + content_normal = choose { light = '#494949', dark = '#cfcfcf', },
17 + content_backdrop = choose { light = '#e3e3e3', dark = '#131313', },
18 + content_accent = choose { light = '#800080', dark = '#800080', },
19 + content_minor = choose { light = '#878787', dark = '#727272', },
20 + content_focus = choose { light = '#646464', dark = '#a5bdb6', },
21 + content_unfocus = choose { light = '#c9c9c9', dark = '#3f4543', },
22 + content_important_global = choose { light = '#48256e', dark = '#8e58cc', },
23 + content_important_local = choose { light = '#643398', dark = '#7a3bc3', },
24 - ui_normal = choose { light = '#929292', dark = '#e2e2e2' },
25 - ui_backdrop = choose { light = '#f9f9f9', dark = '#000000' },
26 - ui_accent = choose { light = '#d43dd4', dark = '#7a067a' },
27 - ui_minor = choose { light = '#d0d0d0', dark = '#424242' },
28 - ui_focus = choose { light = '#646464', dark = '#788984' },
29 - ui_unfocus = choose { light = '#c9c9c9', dark = '#121212' },
30 - ui_important_global = choose { light = '#9170b5', dark = '#5f368d' },
31 - ui_important_local = choose { light = '#ae95c8', dark = '#4c2b72' },
25 + ui_normal = choose { light = '#929292', dark = '#e2e2e2', },
26 + ui_backdrop = choose { light = '#f9f9f9', dark = '#000000', },
27 + ui_accent = choose { light = '#d43dd4', dark = '#7a067a', },
28 + ui_minor = choose { light = '#d0d0d0', dark = '#424242', },
29 + ui_focus = choose { light = '#646464', dark = '#788984', },
30 + ui_unfocus = choose { light = '#c9c9c9', dark = '#121212', },
31 + ui_important_global = choose { light = '#9170b5', dark = '#5f368d', },
32 + ui_important_local = choose { light = '#ae95c8', dark = '#4c2b72', },

neovim/lua/bugabinga/nugu/preview.lua

Added
new file mode 100644
1 +-- TODO: create preview function, that highlights the current buffer with highlights of the global namespace, if group
2 +-- name matches somewhere in the buffer
3 +-- TODO: create user command for preview
4 +local render = function () end
5 +local setup = function () end
7 +return {
8 + setup = setup,
9 + render = render,

neovim/lua/bugabinga/options/behaviour.lua

Modified
1 +local debug = require 'std.debug'
1 2 local auto = require 'std.auto'
3 4 -- How many milliseconds must pass before neovim decides I was "idle"
6 7 vim.opt.timeoutlen = 250
8 9 -- wrap line movements, when start/end is reached
9 -vim.opt.whichwrap:append'<'
10 -vim.opt.whichwrap:append'>'
11 -vim.opt.whichwrap:append'['
12 -vim.opt.whichwrap:append']'
13 -vim.opt.whichwrap:append'h'
14 -vim.opt.whichwrap:append'l'
10 +vim.opt.whichwrap:append '<'
11 +vim.opt.whichwrap:append '>'
12 +vim.opt.whichwrap:append '['
13 +vim.opt.whichwrap:append ']'
14 +vim.opt.whichwrap:append 'h'
15 +vim.opt.whichwrap:append 'l'
16 17 -- Tabs and Spaces, i like 'em 2 spaces wide
17 18 -- only insert spaces for tabs if language configuration explicitly declares so
27 28 vim.opt.wrap = false
29 30 -- do not keep distance to borders while scrolling
30 -vim.opt.scrolloff = 999
31 -vim.opt.sidescrolloff = 999
31 +vim.opt.scrolloff = 0
32 +vim.opt.sidescrolloff = 0
33 34 -- try to guess indentation based on context
34 35 vim.opt.smartindent = true
99 100 if table.contains( ignored.filetypes, filetype ) then return end
100 101 local buftype = vim.api.nvim_buf_get_option( buffer, 'buftype' )
101 102 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() )
104 105 if root and cwd ~= root then
105 106 vim.uv.chdir( root )
106 107 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 ) )

neovim/lua/bugabinga/options/keymaps.lua

Modified
6 6 keys = '<space>',
7 7 command = '<nop>',
10 9 vim.g.mapleader = ' '
11 10 vim.g.maplocalleader = ' '
13 --- disable default ENTER binding
14 -map {
15 - keys = '<enter>',
16 - command = '<nop>',
19 12 -- insert newline under or above in normal mode
20 13 map.normal {
21 14 description = 'Insert newline under cursor',
22 15 category = 'editing',
23 - keys = '<C-enter>',
16 + keys = '<leader>o',
24 17 command = function ()
25 18 local current_buffer = 0
26 19 local current_line = vim.api.nvim_win_get_cursor( current_buffer )[1]
33 26 map.normal {
34 27 description = 'Insert newline above cursor',
35 28 category = 'editing',
36 - keys = '<C-S-enter>',
29 + keys = '<leader>O',
37 30 command = function ()
38 31 local current_buffer = 0
39 32 local current_line = vim.api.nvim_win_get_cursor( current_buffer )[1] - 1
40 33 local strict_indexing = false
41 34 local newline = { '' }
42 36 vim.api.nvim_buf_set_lines( current_buffer, current_line, current_line, strict_indexing, newline )
101 95 command = function () return vim.fn.pumvisible() == 1 and '<C-n>' or '<tab>' end,
98 +--TODO make global
99 +local win32 = vim.loop.os_uname().sysname:match 'Win'
100 +local wsl2 = vim.loop.os_uname().release:match 'WSL2'
104 102 local function open_link_under_cursor()
105 103 ---@diagnostic disable-next-line: missing-parameter
106 104 local file_under_cursor = vim.fn.expand '<cfile>'
109 107 if file_under_cursor and file_under_cursor:match '%a+://.+' then
110 108 vim.system(
111 109 ---@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 },
113 112 { text = true },
114 113 function ( completed )
115 114 if completed.code == 0 then
116 - vim.notify( 'Openend ' .. file_under_cursor )
115 + vim.schedule( function () vim.notify( 'Opened ' .. file_under_cursor ) end )
118 117 error( 'Failed to open ' .. file_under_cursor .. ' because: ' .. completed.stderr )
121 + else
122 + vim.notify 'Found no url under cursor !'
190 191 vim.lsp.buf.format { async = false }
192 193 -- TODO: run makeprg
193 - vim.cmd [[silent make]]
194 + -- vim.cmd [[silent make]]
195 196 -- save
196 197 vim.cmd [[wa]]

neovim/lua/bugabinga/options/togglers.lua

Modified
51 51 table.insert( togglers, make_toggler( display_name, options ) )
54 -add_toggler( icon.spelling, { make_option 'spell' } )
55 -add_toggler( icon.linenumber, { make_option 'number', make_option 'relativenumber' } )
56 -add_toggler( icon.linehighlight, { make_option 'cursorline' } )
57 -add_toggler( icon.virtual, { make_option ('virtualedit', 'all') } )
54 +add_toggler( icon.spelling, { make_option 'spell', } )
55 +add_toggler( icon.linenumber, { make_option 'number', make_option 'relativenumber', } )
56 +add_toggler( icon.linehighlight, { make_option 'cursorline', } )
57 +add_toggler( icon.virtual, { make_option( 'virtualedit', 'all' ), } )
59 59 local tostring = function ( self )
60 60 return vim.iter( self )

neovim/lua/bugabinga/options/ui.lua

Modified
96 96 vim.opt.shortmess:append 'c'
97 97 -- hide vim intro screen
98 98 vim.opt.shortmess:append 'I'
99 +-- truncate messages at end
100 +vim.opt.shortmess:append 't'
100 102 -- show cmd window to prevent jitter ui
101 103 vim.opt.cmdheight = 1

neovim/lua/bugabinga/plugins/auto-dark-mode.lua

Modified
6 6 -- interval of 0 freezes neovim on quit
7 7 -- update_interval = 0,
8 8 update_interval = 5000,
9 - set_dark_mode=function()
9 + set_dark_mode = function ()
10 10 vim.opt.background = 'dark'
11 11 end,
12 - set_light_mode=function()
12 + set_light_mode = function ()
13 13 vim.opt.background = 'light'
14 14 end,

neovim/lua/bugabinga/plugins/autopairs.lua

Modified
3 3 local ignored = require 'std.ignored'
5 5 return {
6 6 'windwp/nvim-autopairs',
7 7 event = 'InsertEnter',
8 - dependencies = {
9 - 'hrsh7th/nvim-cmp'
8 + opts = {
9 + disable_filetype = ignored.filetypes,
11 - config = function ()
12 - local autopairs = require 'nvim-autopairs'
13 - autopairs.setup {
14 - disable_filetype = ignored.filetypes,
15 - }
16 - local cmp_autopairs = require 'nvim-autopairs.completion.cmp'
17 - local cmp = require 'cmp'
18 - cmp.event:on(
19 - 'confirm_done',
20 - cmp_autopairs.on_confirm_done()
21 - )
22 - end

neovim/lua/bugabinga/plugins/better-escape.lua

Modified
1 1 return {
2 - "max397574/better-escape.nvim",
3 - event = "InsertEnter",
4 - opts = {},
2 + 'max397574/better-escape.nvim',
3 + event = 'InsertEnter',
4 + opts = {},

neovim/lua/bugabinga/plugins/cmp.lua

Deleted
deleted file mode 100644
1 ----@diagnostic disable: missing-fields
3 -return {
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,

neovim/lua/bugabinga/plugins/colorizer.lua

Modified
1 1 return {
3 - 'NvChad/nvim-colorizer.lua',
4 - event = { 'BufReadPost', 'BufNew' },
3 + 'JosefLitos/colorizer.nvim',
4 + event = { 'BufReadPost', 'BufNew', },
5 5 opts = {
6 - filetypes = { '*' },
6 + filetypes = { '*', },
7 7 user_default_options = {
8 - RGB = true, -- #RGB hex codes
9 - RRGGBB = true, -- #RRGGBB hex codes
10 - names = false, -- "Name" codes like Blue or blue
11 - RRGGBBAA = true, -- #RRGGBBAA hex codes
12 - AARRGGBB = true, -- 0xAARRGGBB hex codes
13 - rgb_fn = true, -- CSS rgb() and rgba() functions
14 - hsl_fn = true, -- CSS hsl() and hsla() functions
15 - css = false, -- Enable all CSS features: rgb_fn, hsl_fn, names, RGB, RRGGBB
16 - css_fn = false, -- Enable all CSS *functions*: rgb_fn, hsl_fn
8 + RGB = true, -- #RGB hex codes
9 + RRGGBB = true, -- #RRGGBB hex codes
10 + RRGGBBAA = true, -- #RRGGBBAA hex codes
11 + AARRGGBB = true, -- 0xAARRGGBB hex codes
12 + rgb_fn = true, -- CSS rgb() and rgba() functions
13 + hsl_fn = true, -- CSS hsl() and hsla() functions
14 + css = false, -- Enable all CSS features: rgb_fn, hsl_fn, names, RGB, RRGGBB
15 + css_fn = false, -- Enable all CSS *functions*: rgb_fn, hsl_fn
17 16 -- Available modes for `mode`: foreground, background, virtualtext
18 17 mode = 'virtualtext', -- Set the display mode.
19 - -- Available methods are false / true / "normal" / "lsp" / "both"
20 - -- True is same as normal
21 - tailwind = false, -- Enable tailwind colors
18 + names = function () return require 'bugabinga.nugu.palette' end,
22 19 -- parsers can contain values used in |user_default_options|
23 - sass = { enable = false, parsers = { 'css' } }, -- Enable sass colors
20 + sass = { enable = false, parsers = { 'css', }, }, -- Enable sass colors
24 21 virtualtext = '██',
25 22 -- update color values even if buffer is not focused
26 23 -- example use: cmp_menu, cmp_docs

neovim/lua/bugabinga/plugins/colors.lua

Deleted
deleted file mode 100644
1 -return {
2 - 'echasnovski/mini.colors',
3 - opts = {},
4 -}

neovim/lua/bugabinga/plugins/comment.lua

Modified
1 -return {{
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 -}}
1 +return { {
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/devicons.lua

Modified
1 -return {{
2 - 'nvim-tree/nvim-web-devicons',
3 - opts = {
4 - -- instead of creating a highlight for every single icon, use only the
5 - -- DefaultDevIcon highlight for all
6 - color_icons = false,
7 - },
8 -}}
1 +return { {
2 + 'nvim-tree/nvim-web-devicons',
3 + opts = {
4 + -- instead of creating a highlight for every single icon, use only the
5 + -- DefaultDevIcon highlight for all
6 + color_icons = false,
7 + },
8 +}, }

neovim/lua/bugabinga/plugins/dressing.lua

Modified
1 1 return {
2 2 'stevearc/dressing.nvim',
3 - opts = {}
3 + lazy = false,
4 + opts = {},

neovim/lua/bugabinga/plugins/fidget.lua

Added
new file mode 100644
1 +local debug = require 'std.debug'
3 +return {
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 + },

neovim/lua/bugabinga/plugins/flash.lua

Modified
1 1 return {
2 2 'folke/flash.nvim',
3 + tag = 'v1.18.2',
3 4 event = 'VeryLazy',
4 5 opts = {
5 - highlight = { backdrop = false },
6 - modes = { char = { highlight = { backdrop = false, } },
6 + highlight = { backdrop = false, },
7 + modes = { char = { highlight = { backdrop = false, }, },
9 10 keys = {
11 12 '<cr>',
12 - mode = { 'n', 'x', 'o' },
13 + mode = { 'n', 'x', 'o', },
13 14 function () require 'flash'.jump() end,
14 15 desc = 'Flash',
17 18 '<s-cr>',
18 - mode = { 'n', 'o', 'x' },
19 + mode = { 'n', 'o', 'x', },
19 20 function () require 'flash'.treesitter() end,
20 21 desc =
21 - 'Flash Treesitter'
22 + 'Flash Treesitter',

neovim/lua/bugabinga/plugins/genghis.lua

Modified
17 17 dependencies = {
18 18 'stevearc/dressing.nvim',
19 - 'hrsh7th/nvim-cmp',
20 - 'hrsh7th/cmp-omni',
22 20 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 )
32 33 end,

neovim/lua/bugabinga/plugins/gitsigns.lua

Modified
2 2 local map = require 'std.map'
4 4 return {
5 5 'lewis6991/gitsigns.nvim',
6 + tag = 'v0.7',
6 7 event = 'VeryLazy',
7 8 opts = {
8 9 signs = {
9 - add = { text = '│' },
10 - change = { text = '│' },
11 - delete = { text = '_' },
12 - topdelete = { text = '‾' },
13 - changedelete = { text = '~' },
14 - untracked = { text = '┆' },
10 + add = { text = '│', },
11 + change = { text = '│', },
12 + delete = { text = '_', },
13 + topdelete = { text = '‾', },
14 + changedelete = { text = '~', },
15 + untracked = { text = '┆', },
16 17 preview_config = {
17 18 border = vim.g.border_style,
52 53 category = 'git',
53 54 keys = '<leader>hs',
54 55 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,
58 59 map.normal {
68 69 category = 'git',
69 70 keys = '<leader>hr',
70 71 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,
74 75 map.normal {
108 109 category = 'git',
109 110 keys = '<leader>hb',
110 111 buffer = bufnr,
111 - command = function () gitsigns.blame_line { full = true } end,
112 + command = function () gitsigns.blame_line { full = true, } end,
114 115 map.normal {
148 149 category = 'git',
149 150 keys = 'ih',
150 151 buffer = bufnr,
151 - command = ':<C-U>Gitsigns select_hunk<CR>'
152 + command = ':<C-U>Gitsigns select_hunk<CR>',
154 - }
155 + },

neovim/lua/bugabinga/plugins/glow.lua

Modified
1 -local health
1 +require 'bugabinga.health'.add_dependency
2 +{
3 + name = 'Glow',
4 + name_of_executable = 'glow',
5 +}
2 6 return {
3 - "ellisonleao/glow.nvim",
4 - cmd = "Glow",
5 - config = function()
6 - require'bugabinga.health'.add_dependency
7 - {
8 - name = 'Glow',
9 - name_of_executable = 'glow'
10 - }
12 - require'glow'.setup
13 - {
14 - width_ratio = 0.69,
15 - height_ratio = 0.42,
16 - }
17 - end,
7 + 'ellisonleao/glow.nvim',
8 + cmd = 'Glow',
9 + opts = {
10 + width_ratio = 0.69,
11 + height_ratio = 0.42,
12 + },

neovim/lua/bugabinga/plugins/gomove.lua

Modified
4 4 local map = require 'std.map'
6 6 return {
8 8 'booperlv/nvim-gomove',
9 9 keys = {
10 - { '<A-h>', nil, mode = { 'n', 'x' } },
11 - { '<A-j>', nil, mode = { 'n', 'x' } },
12 - { '<A-k>', nil, mode = { 'n', 'x' } },
13 - { '<A-l>', nil, mode = { 'n', 'x' } },
10 + { '<A-h>', nil, mode = { 'n', 'x', }, },
11 + { '<A-j>', nil, mode = { 'n', 'x', }, },
12 + { '<A-k>', nil, mode = { 'n', 'x', }, },
13 + { '<A-l>', nil, mode = { 'n', 'x', }, },
15 - { '<A-H>', nil, mode = { 'n', 'x' } },
16 - { '<A-J>', nil, mode = { 'n', 'x' } },
17 - { '<A-K>', nil, mode = { 'n', 'x' } },
18 - { '<A-L>', nil, mode = { 'n', 'x' } },
15 + { '<A-H>', nil, mode = { 'n', 'x', }, },
16 + { '<A-J>', nil, mode = { 'n', 'x', }, },
17 + { '<A-K>', nil, mode = { 'n', 'x', }, },
18 + { '<A-L>', nil, mode = { 'n', 'x', }, },
20 - config = function()
20 + config = function ()
21 21 local move = require 'gomove'
23 23 move.setup {
31 31 -- default mappings in gomove set no options, but use old keymap api.
32 32 -- recreating old defaults here:
33 - local options = { remap = true }
33 + local options = { remap = true, }
35 35 -- i have tried using the lua functions directly for the commands below.
36 36 -- the behaviour was slightly buggy in respects to block selections though.
42 42 category = 'editing',
43 43 keys = '<A-h>',
44 44 options = options,
45 - command = '<Plug>GoNSMLeft',
45 + command = '<Plug>GoNSMLeft',
47 47 map.normal {
48 48 description = 'Move line down',
49 49 category = 'editing',
50 50 keys = '<A-j>',
51 51 options = options,
52 - command = '<Plug>GoNSMDown',
52 + command = '<Plug>GoNSMDown',
54 54 map.normal {
55 55 description = 'Move line up',
56 56 category = 'editing',
57 57 keys = '<A-k>',
58 58 options = options,
59 - command = '<Plug>GoNSMUp',
59 + command = '<Plug>GoNSMUp',
61 61 map.normal {
62 62 description = 'Move character right',
63 63 category = 'editing',
64 64 keys = '<A-l>',
65 65 options = options,
66 - command = '<Plug>GoNSMRight',
66 + command = '<Plug>GoNSMRight',
69 69 -- VISUAL MOVE
70 70 map.visual {
71 71 description = 'Move block left',
72 72 category = 'editing',
73 - keys = '<A-h>',
73 + keys = '<A-h>',
74 74 options = options,
75 - command = '<Plug>GoVSMLeft',
75 + command = '<Plug>GoVSMLeft',
77 77 map.visual {
78 78 description = 'Move block down',
79 79 category = 'editing',
80 80 keys = '<A-j>',
81 81 options = options,
82 - command = '<Plug>GoVSMDown',
82 + command = '<Plug>GoVSMDown',
84 84 map.visual {
85 85 description = 'Move block up',
86 86 category = 'editing',
87 87 keys = '<A-k>',
88 88 options = options,
89 - command = '<Plug>GoVSMUp',
89 + command = '<Plug>GoVSMUp',
91 91 map.visual {
92 92 description = 'Move block right',
93 93 category = 'editing',
94 94 keys = '<A-l>',
95 95 options = options,
96 - command = '<Plug>GoVSMRight',
96 + command = '<Plug>GoVSMRight',
99 99 -- NORMAL DUPLICATE
102 102 category = 'editing',
103 103 keys = '<A-H>',
104 104 options = options,
105 - command = '<Plug>GoNSDLeft',
105 + command = '<Plug>GoNSDLeft',
107 107 map.normal {
108 108 description = 'Duplicate line down',
109 109 category = 'editing',
110 110 keys = '<A-J>',
111 111 options = options,
112 - command = '<Plug>GoNSDDown',
112 + command = '<Plug>GoNSDDown',
114 114 map.normal {
115 115 description = 'Duplicate line up',
116 116 category = 'editing',
117 117 keys = '<A-K>',
118 118 options = options,
119 - command = '<Plug>GoNSDUp',
119 + command = '<Plug>GoNSDUp',
121 121 map.normal {
122 122 description = 'Duplicate character right',
123 123 category = 'editing',
124 124 keys = '<A-L>',
125 125 options = options,
126 - command = '<Plug>GoNSDRight',
126 + command = '<Plug>GoNSDRight',
129 129 -- VISUAL DUPLICATE
132 132 category = 'editing',
133 133 keys = '<A-H>',
134 134 options = options,
135 - command = '<Plug>GoVSDLeft',
135 + command = '<Plug>GoVSDLeft',
137 137 map.visual {
138 138 description = 'Duplicate block down',
139 139 category = 'editing',
140 140 keys = '<A-J>',
141 141 options = options,
142 - command = '<Plug>GoVSDDown',
142 + command = '<Plug>GoVSDDown',
144 144 map.visual {
145 145 description = 'Duplicate block up',
146 146 category = 'editing',
147 147 keys = '<A-K>',
148 148 options = options,
149 - command = '<Plug>GoVSDUp',
149 + command = '<Plug>GoVSDUp',
151 151 map.visual {
152 152 description = 'Duplicate block right',
153 153 category = 'editing',
154 154 keys = '<A-L>',
155 155 options = options,
156 - command = '<Plug>GoVSDRight',
156 + command = '<Plug>GoVSDRight',

neovim/lua/bugabinga/plugins/heirline.lua

Modified
3 3 ---@diagnostic disable: param-type-mismatch
4 4 local icon = require 'std.icon'
5 5 local auto = require 'std.auto'
6 6 local ignored = require 'std.ignored'
8 -local NEW_FILE = '~new~'
8 +local NEW_FILE = '~untitled~'
10 10 return {
12 12 'rebelot/heirline.nvim',
13 + tag = 'v1.0.3',
13 14 event = 'BufEnter',
14 15 dependencies = {
15 16 'nvim-tree/nvim-web-devicons',
16 17 'lewis6991/gitsigns.nvim',
18 + 'SmiteshP/nvim-navic',
18 20 config = function ()
19 21 local heirline = require 'heirline'
27 29 command = function () utils.on_colorscheme( nugu ) end,
30 - local vi_mode = {
32 + local vi_mode = {
31 33 init = function ( self )
32 34 self.mode = vim.fn.mode( 1 ) -- :h mode()
83 85 r = 'ui_important_global',
84 86 ['!'] = 'ui_important_global',
85 87 t = 'ui_important_global',
86 - }
88 + },
89 91 provider = function ( self )
94 96 hl = function ( self )
95 97 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, }
99 101 update = {
106 - local file_icon = {
108 + local file_icon = {
107 109 init = function ( self )
108 110 local filename = self.filename
109 111 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, } )
112 114 provider = function ( self )
113 115 return self.icon and (self.icon .. ' ')
115 117 hl = 'DefaultIcon',
118 - local file_name = {
120 + local file_name = {
119 121 init = function ( self )
120 122 self.lfilename = vim.fs.normalize( vim.fn.fnamemodify( self.filename, ':.' ) )
121 123 if self.lfilename == '' then self.lfilename = NEW_FILE end
138 - local file_flags = {
140 + local file_flags = {
140 142 condition = function ()
141 143 return vim.bo.modified
155 - local file_name_block = {
157 + local file_name_block = {
156 158 init = function ( self )
157 159 self.filename = vim.fs.normalize( vim.api.nvim_buf_get_name( 0 ) )
160 162 file_icon,
161 - { provider = ' ' },
163 + { provider = ' ', },
162 164 file_name,
163 165 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
167 - local file_type = {
169 + local file_type = {
168 170 provider = function ()
169 171 return icon.file .. ' ' .. string.upper( vim.bo.filetype )
173 - local file_encoding = {
175 + local file_encoding = {
174 176 provider = function ()
175 177 local enc = (vim.bo.fenc ~= '' and vim.bo.fenc) or vim.o.enc -- :h 'enc'
176 178 return enc ~= 'utf-8' and enc:upper()
180 - local file_format = {
182 + local file_format = {
181 183 static = {
182 184 dos = icon.newline .. icon.carriage_return,
183 185 unix = icon.newline,
186 188 provider = function ( self )
187 189 local fileformat = vim.bo.fileformat
188 190 return self[fileformat]
189 - end
191 + end,
192 - local file_size = {
194 + local file_size = {
193 195 provider = function ()
194 196 -- stackoverflow, compute human readable file size
195 197 -- 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', }
197 199 local fsize = vim.fn.getfsize( vim.api.nvim_buf_get_name( 0 ) )
198 200 fsize = (fsize < 0 and 0) or fsize
199 201 if fsize < 1024 then
207 - local file_last_modified = {
209 + local file_last_modified = {
208 210 provider = function ()
209 211 local ftime = vim.fn.getftime( vim.api.nvim_buf_get_name( 0 ) )
210 212 if ftime > 0 then
217 - local lsp_active = {
219 + local lsp_active = {
218 220 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', },
221 225 provider = function ()
222 226 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
224 228 table.insert( names, client.name )
226 230 return icon.lsp .. ' ' .. table.concat( names, ' ' )
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 = {
287 + provider = d.icon,
288 + hl = self.type_hl[d.type],
289 + },
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 + },
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',
328 + local diagnostic_enabled = {
231 329 init = function ( self )
232 330 self.icon = vim.diagnostic.is_disabled() and icon.toggle_off or icon.toggle_on
239 - local diagnostic = {
337 + local diagnostic = {
240 338 condition = conditions.has_diagnostics,
242 340 static = {
249 347 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, } )
256 - update = { 'DiagnosticChanged', 'BufEnter' },
354 + update = { 'DiagnosticChanged', 'BufEnter', 'BufLeave', },
259 357 provider = function ( self )
285 - local is_svn_repo = function ()
383 + local is_svn_repo = function ()
286 384 local svn_dir = vim.fs.find( '.svn', {
287 385 upward = true,
288 386 stop = vim.uv.os_homedir(),
293 391 return not vim.tbl_isempty( svn_dir )
296 - local svn_get_relative_url = function ()
394 + local svn_get_relative_url = function ()
297 395 -- FIXME: replace with vim.system
298 396 local job = require 'plenary.job'
299 - local relative_url = { '[ERR]' }
397 + local relative_url = { '[ERR]', }
301 399 job:new {
302 400 command = 'svn',
303 - args = { 'info', '--show-item', 'relative-url', '--no-newline' },
401 + args = { 'info', '--show-item', 'relative-url', '--no-newline', },
304 402 on_exit = function ( current_job, exit_code )
305 403 if exit_code == 0 then relative_url = current_job:result() end
309 407 return relative_url[1]
312 - local svn = {
410 + local svn = {
313 411 condition = is_svn_repo,
315 413 update = 'BufEnter',
329 - local git = {
427 + local git = {
330 428 condition = conditions.is_git_repo,
332 430 init = function ( self )
364 - local work_dir = {
462 + local work_dir = {
365 463 init = function ( self )
366 464 self.icon = (vim.fn.haslocaldir( 0 ) == 1 and icon['local'] or '') .. ' ' .. icon.global .. ' '
367 465 self.cwd = vim.fs.normalize( vim.uv.cwd() ):gsub( vim.fs.normalize( vim.uv.os_homedir() ), '~' )
384 482 provider = '',
385 - }
483 + },
388 - local help_file_name = {
486 + local help_file_name = {
389 487 condition = function ()
390 488 return vim.bo.filetype == 'help'
396 494 hl = 'Question',
399 - local terminal_name = {
497 + local terminal_name = {
400 498 provider = function ()
401 499 local name, _ = vim.api.nvim_buf_get_name( 0 ):gsub( '.*:', '' )
402 500 local basename = vim.fs.basename( name )
405 503 hl = 'Bold',
408 - local togglers = {
506 + local togglers = {
409 507 provider = function ()
410 508 local togglers = require 'bugabinga.options.togglers'
411 509 return tostring( togglers )
415 - local macro_recording = {
513 + local macro_recording = {
416 514 condition = function ()
417 515 return vim.fn.reg_recording() ~= '' and vim.o.cmdheight == 0
419 517 provider = icon.macro .. ' ',
420 518 hl = 'PreProc',
421 - utils.surround( { '░▒▓ ', ' ▓▒░' }, nil, {
519 + utils.surround( { '░▒▓ ', ' ▓▒░', }, nil, {
422 520 provider = function ()
423 521 return vim.fn.reg_recording()
427 525 update = {
428 526 'RecordingEnter',
429 527 'RecordingLeave',
430 - }
528 + },
433 - local lazy = {
531 + local lazy = {
434 532 condition = function ()
435 533 local ok, lazy_status = pcall( require, 'lazy.status' )
436 534 return ok and lazy_status.has_updates()
438 - update = { 'User', pattern = 'LazyUpdate' },
536 + update = { 'User', pattern = 'LazyUpdate', },
439 537 provider = function () return ' ' .. icon.lazy .. ' ' .. require 'lazy.status'.updates() .. ' ' end,
440 538 on_click = {
441 539 callback = function () require 'lazy'.update() end,
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,
457 - local special_statusline = {
554 + local special_statusline = {
458 555 condition = function ()
459 556 return conditions.buffer_matches {
460 557 buftype = ignored.buftypes,
465 562 file_type,
466 563 space,
467 564 help_file_name,
468 - align
565 + align,
471 - local terminal_statusline = {
568 + local terminal_statusline = {
473 570 condition = function ()
474 - return conditions.buffer_matches { buftype = { 'terminal' } }
571 + return conditions.buffer_matches { buftype = { 'terminal', }, }
477 - { condition = conditions.is_active, vi_mode, space },
574 + { condition = conditions.is_active, vi_mode, space, },
478 575 file_type,
479 576 space,
480 577 terminal_name,
481 578 align,
484 - local inactive_statusline = {
581 + local inactive_statusline = {
485 582 condition = conditions.is_not_active,
486 583 file_type,
487 584 space,
489 586 align,
492 - local statuslines = {
589 + local statuslines = {
493 590 hl = function ()
494 591 if conditions.is_active() then
495 592 return 'StatusLine'
506 603 default_statusline,
509 - local winbars = {
606 + local winbars = {
510 607 hl = function ()
511 608 if conditions.is_active() then
512 609 return 'Winbar'
521 618 condition = function ()
522 - return conditions.buffer_matches { buftype = { 'terminal' } }
619 + return conditions.buffer_matches { buftype = { 'terminal', }, }
525 622 file_type,
527 624 terminal_name,
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 = {
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,
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',
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 = {
636 737 provider = function ( self )
637 738 return '%' .. self.tabnr .. 'T ' .. self.tabpage .. ' %T'
639 740 hl = function ( self )
640 - if not self.is_active then
641 - return 'TabLine'
642 - else
741 + if self.is_active then
643 742 return 'TabLineSel'
743 + else
744 + return 'TabLine'
648 - local tab_pages = {
649 - { provider = '%=' },
749 + local tab_pages = {
750 + { provider = '%=', },
650 751 utils.make_tablist( tabpage ),
653 - local tabline = { buffer_line, tab_pages }
754 + -- local tabline = { buffer_line, tab_pages, }
655 756 -- local statuscolumn = {}
657 758 heirline.setup {
658 759 statusline = statuslines,
659 760 winbar = winbars,
660 - tabline = tabline,
761 + tabline = tab_pages,
762 + -- tabline = tabline,
661 763 -- statuscolumn = statuscolumn,
663 765 opts = {

neovim/lua/bugabinga/plugins/hlargs.lua

Modified
1 1 return {
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
1 +return {
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
1 -local icon = require'std.icon'
1 +local icon = require 'std.icon'
3 3 return {
4 4 'lukas-reineke/indent-blankline.nvim',
5 + tag = 'v3.5.3',
5 6 main = 'ibl',
6 - event = { 'BufReadPost', 'BufNew' },
7 + event = { 'BufReadPost', 'BufNew', },
7 8 config = function ()
8 9 local ibl = require 'ibl'

neovim/lua/bugabinga/plugins/lush.lua

Deleted
deleted file mode 100644
1 -return {
2 - {
3 - 'rktjmp/lush.nvim',
4 - branch = 'main',
5 - lazy = false,
6 - priority = 1000,
7 - config = function ()
8 - vim.cmd.colorscheme 'nugu'
9 - end,
10 - },
11 -}

neovim/lua/bugabinga/plugins/mason.lua

Modified
1 1 return {
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', },
4 5 opts = {
5 6 ui = {
6 7 border = vim.g.border_style,
7 8 width = 0.69,
8 9 height = 0.69,
9 - }
10 + },
11 12 dependencies = {
13 14 'WhoIsSethDaniel/mason-tool-installer.nvim',
14 15 lazy = false,
15 - cmd = { "MasonToolsInstall", "MasonToolsInstallSync", "MasonToolsUpdate", "MasonToolsUpdateSync", "MasonToolsClean" },
16 + cmd = { 'MasonToolsInstall', 'MasonToolsInstallSync', 'MasonToolsUpdate', 'MasonToolsUpdateSync', 'MasonToolsClean', },
16 17 opts = {
17 18 ensure_installed = {
18 19 'lua-language-server',
25 26 'lemminx',
26 27 'marksman',
28 - }
29 - }
30 - }
29 + },
30 + },
31 + },

neovim/lua/bugabinga/plugins/navic.lua

Added
new file mode 100644
1 +return {
2 + 'SmiteshP/nvim-navic',
3 + opts = {
5 + }
6 +}

neovim/lua/bugabinga/plugins/neodev.lua

Modified
1 1 return {
2 - 'folke/neodev.nvim',
3 - opts = {
2 + 'folke/neodev.nvim',
3 + opts = {
4 4 lspconfig = false,
5 + override = function ( root_dir, library )
6 + if root_dir:find( '/etc/nixos', 1, true ) == 1 then
7 + library.enabled = true
8 + library.plugins = true
9 + end
10 + end,

neovim/lua/bugabinga/plugins/neogen.lua

Modified
1 -local map = require'std.map'
1 +local map = require 'std.map'
3 3 return {
4 - 'danymat/neogen',
5 - keys = {'<leader>gd'},
6 - dependencies = {'nvim-treesitter/nvim-treesitter'},
7 - config = function()
8 - local neogen = require'neogen'
4 + 'danymat/neogen',
5 + keys = { '<leader>gd', },
6 + dependencies = { 'nvim-treesitter/nvim-treesitter', },
7 + config = function ()
8 + local neogen = require 'neogen'
10 - neogen.setup { }
10 + neogen.setup {}
12 - map.normal {
13 - description = 'Generate doc comment for outer element',
14 - category = 'editing',
15 - keys = '<leader>gd',
16 - command = neogen.generate,
17 - }
18 -
19 - map.normal {
20 - name = 'Generate Doc Comment for Function',
21 - category = "editing",
22 - keys = '<leader>gd' .. 'f',
23 - command = function() neogen.generate { type = 'func' } end,
24 - }
12 + map.normal {
13 + description = 'Generate doc comment for outer element',
14 + category = 'editing',
15 + keys = '<leader>gd',
16 + command = neogen.generate,
17 + }
26 - map.normal {
27 - description = 'Generate Doc Comment for File',
28 - category = "editing",
29 - keys = '<leader>gd' .. 'F',
30 - command = function() neogen.generate { type = 'file' } end,
31 - }
19 + map.normal {
20 + name = 'Generate Doc Comment for Function',
21 + category = 'editing',
22 + keys = '<leader>gd' .. 'f',
23 + command = function () neogen.generate { type = 'func', } end,
24 + }
33 - map.normal {
34 - description = 'Generate Doc Comment for Class',
35 - category = "editing",
36 - keys = '<leader>gd' .. 'c',
37 - command = function() neogen.generate { type = 'class' } end,
38 - }
26 + map.normal {
27 + description = 'Generate Doc Comment for File',
28 + category = 'editing',
29 + keys = '<leader>gd' .. 'F',
30 + command = function () neogen.generate { type = 'file', } end,
31 + }
40 - end,
33 + map.normal {
34 + description = 'Generate Doc Comment for Class',
35 + category = 'editing',
36 + keys = '<leader>gd' .. 'c',
37 + command = function () neogen.generate { type = 'class', } end,
38 + }
39 + end,

neovim/lua/bugabinga/plugins/nrpattern.lua

Modified
1 -return {{
2 - 'zegervdv/nrpattern.nvim',
3 - keys = { '<C-a>', '<C-x>' },
4 - config = function()
5 - local nrpattern = require'nrpattern'
6 - -- this plugin overrides all its settiungs if empty map is given
7 - nrpattern.setup()
8 - end,
9 -}}
1 +return { {
2 + 'zegervdv/nrpattern.nvim',
3 + keys = { '<C-a>', '<C-x>', },
4 + config = function ()
5 + local nrpattern = require 'nrpattern'
6 + -- this plugin overrides all its settiungs if empty map is given
7 + nrpattern.setup()
8 + end,
9 +}, }

neovim/lua/bugabinga/plugins/persistence.lua

Modified
1 -local map = require'std.map'
1 +local map = require 'std.map'
3 3 return {
4 4 '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 )
11 12 map.normal {
12 13 description = 'Restore session for current directory',
13 14 category = 'history',
14 15 keys = '<F4>',
15 - command = function() persistence.load() end,
16 + command = function () persistence.load() end,
18 19 map.normal {
19 20 description = 'Restore last session',
20 21 category = 'history',
21 22 keys = '<F4><F4>',
22 - command = function() persistence.load{last= true} end,
23 + command = function () persistence.load { last = true, } end,
25 25 end,

neovim/lua/bugabinga/plugins/specs.lua

Modified
1 -local map = require'std.map'
2 -local ignored = require'std.ignored'
1 +local map = require 'std.map'
2 +local ignored = require 'std.ignored'
4 -return {{
5 - 'edluffy/specs.nvim',
6 - keys = { '<leader><leader>', '<leader><leader><leader>' },
7 - config = function()
8 - local specs = require'specs'
4 +return { {
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 {
34 34 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 }
39 39 end,
41 - end,
42 -}}
41 + end,
42 +} }

neovim/lua/bugabinga/plugins/starter.lua

Modified
52 52 pattern = 'LazyVimStarted',
53 53 once = true,
54 54 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
57 59 end ),

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

Modified
1 1 return {
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 + },

neovim/lua/bugabinga/plugins/telescope.lua

Modified
5 5 require 'bugabinga.health'.add_dependency
7 7 name = 'ripgrep',
8 - name_of_executable = 'rg'
8 + name_of_executable = 'rg',
11 11 name = 'find-fd',
12 - name_of_executable = 'fd'
12 + name_of_executable = 'fd',
15 15 return {
16 16 'nvim-telescope/telescope.nvim',
17 - branch = '0.1.x',
17 + tag = '0.1.6',
18 18 cmd = 'Telescope',
19 19 event = 'VeryLazy',
20 20 dependencies = {
30 30 local actions = require 'telescope.actions'
31 31 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, }, }
37 37 telescope.setup {
38 38 defaults = {
39 - path_display = { 'truncate' },
39 + path_display = { 'truncate', },
40 40 sorting_strategy = 'ascending',
41 41 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, },
44 44 width = 0.69,
45 45 height = 0.42,
46 46 preview_cutoff = 124,
69 69 ['<c-p>'] = actions.move_selection_previous,
70 70 ['<c-s>'] = actions.file_split,
72 - n = { q = actions.close },
72 + n = { q = actions.close, },
75 75 pickers = {
83 83 buffers = cursor,
85 85 extensions = {
86 - ['ui-select'] = { cursor },
87 - zoxide = { prompt_title = 'Navigate deez nuts!' },
86 + ['ui-select'] = { cursor, },
87 + zoxide = { prompt_title = 'Navigate deez nuts!', },

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

Modified
1 1 return {
2 2 'folke/todo-comments.nvim',
3 - dependencies = { 'nvim-lua/plenary.nvim' },
3 + tag = 'v1.1.0',
4 + dependencies = { 'nvim-lua/plenary.nvim', },
4 5 event = 'BufReadPost',
5 6 opts = {},

neovim/lua/bugabinga/plugins/toggleterm.lua

Modified
9 9 name_of_executable = 'mdcat',
12 - name_of_executable = 'dot'
12 + name_of_executable = 'dot',
15 15 return {
16 16 'akinsho/toggleterm.nvim',
17 + tag = 'v2.10.0',
17 18 keys = {
18 19 '<F7>',
19 20 '<F8>',
48 49 toggleterm.setup( opts )
50 51 local set_terminal_keymaps = function ()
51 - local local_to_buffer = { buffer = 0 }
52 + local local_to_buffer = { buffer = 0, }
52 53 map.terminal {
53 54 description = 'Quit insert mode',
54 55 category = 'terminal',
69 70 description = 'Open vertical Terminal',
70 71 category = 'terminal',
71 72 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>',
75 76 map.normal {
76 77 description = 'Open horizontal Terminal',
77 78 category = 'terminal',
78 79 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>',
82 83 local Terminal = require 'toggleterm.terminal'.Terminal
99 100 command = toggle_gitui,
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
2 2 local map = require 'std.map'
4 4 return {
5 5 'nvim-tree/nvim-tree.lua',
6 + version = 'v1.0',
7 + lazy = false,
6 8 cmd = 'NvimTreeOpen',
7 9 keys = '<leader>e',
10 + dependencies = {
11 + 'nvim-tree/nvim-web-devicons',
12 + 'antosha417/nvim-lsp-file-operations',
13 + },
8 14 init = function ()
9 15 -- disable netrw at the very start of your init.lua
10 16 vim.g.loaded_netrw = 1
25 31 dotfiles = false,
34 + require 'lsp-file-operations'.setup()
29 36 map.normal {
30 37 description = 'Toggle Tree File Explorer',

neovim/lua/bugabinga/plugins/treesitter.lua

Modified
3 3 local map = require 'std.map'
5 5 require 'bugabinga.health'.add_dependency
7 7 name = 'CMake',
8 - name_of_executable = 'cmake'
9 -}
11 - name_of_executable = 'make'
14 - name_of_executable = 'zig'
17 - name = 'TreeSitter CLI',
18 - name_of_executable = 'tree-sitter'
21 - name_of_executable = 'tar'
8 + name_of_executable = 'cmake',
10 + {
11 + name_of_executable = 'make',
12 + }
13 + {
14 + name_of_executable = 'zig',
15 + }
16 + {
17 + name = 'TreeSitter CLI',
18 + name_of_executable = 'tree-sitter',
19 + }
20 + {
21 + name_of_executable = 'tar',
22 + }
24 24 return {
25 25 'nvim-treesitter/nvim-treesitter',
26 - branch = 'master',
27 - event = { 'BufReadPre', 'BufNewFile' },
26 + tag = 'v0.9.2',
27 + -- branch = 'master',
28 + event = { 'BufReadPre', 'BufNewFile', },
28 29 build = function ()
29 - require 'nvim-treesitter.install'.update { with_sync = true }
30 + require 'nvim-treesitter.install'.update { with_sync = true, }
31 32 dependencies = {
32 33 'windwp/nvim-ts-autotag',
38 39 local parsers = require 'nvim-treesitter.parsers'
40 41 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', }
43 44 ---@diagnostic disable-next-line: missing-fields
44 45 configs.setup {
70 71 'zig',
73 - ignore_install = { 'oil' },
74 + ignore_install = { 'oil', },
75 76 auto_install = true,
77 - autotag = { enable = true },
78 + autotag = { enable = true, },
79 80 highlight = {
80 81 enable = true,
101 - indent = { enable = true },
102 + indent = { enable = true, },
103 104 playground = {
104 105 enable = true,
124 125 enable = true,
125 126 lookahead = true,
126 127 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', },
136 137 -- l overwrites builtin. i have no good idea for better binding. use ia instead.
137 138 -- ['la'] = { query = '@assignment.lhs', desc = 'left hand side of assignment'},
138 139 -- ['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', },
149 150 -- 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', },
157 158 selection_modes = {
158 159 ['@parameter.outer'] = 'v',
166 167 swap = {
167 168 enable = true,
168 169 swap_next = {
169 - ['<leader>spn'] = { query = '@parameter.inner', desc = 'Swap parameter with next' },
170 + ['<leader>spn'] = { query = '@parameter.inner', desc = 'Swap parameter with next', },
171 172 swap_previous = {
172 - ['<leader>spp'] = { query = '@parameter.inner', desc = 'Swap parameter with previous' },
173 + ['<leader>spp'] = { query = '@parameter.inner', desc = 'Swap parameter with previous', },
178 179 border = vim.g.border_style,
179 180 floating_preview_opts = {},
180 181 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.', },
187 188 enable = true,
188 189 set_jumps = true,
189 190 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', },
196 197 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 + },
204 - }
205 + },
207 208 ---@diagnostic disable-next-line: inject-field
208 209 parsers.get_parser_configs().just = {
209 210 install_info = {
210 211 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', },
212 213 branch = 'main',
214 - maintainers = { '@IndianBoy42' },
215 + maintainers = { '@IndianBoy42', },

neovim/lua/bugabinga/plugins/treesj.lua

Modified
1 -local map = require'std.map'
1 +local map = require 'std.map'
3 3 return {
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,
14 - map.normal {
15 - description = 'Toggle Tree Join/Split',
16 - category = 'editing',
17 - keys = '<C-j>',
18 - command = treesj.toggle,
19 - }
20 - end,
21 -}

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

Modified
3 3 local ignored = require 'std.ignored'
5 5 return {
7 7 'lukas-reineke/virt-column.nvim',
8 - event = { 'BufReadPost', 'BufNew' },
8 + tag = 'v2.0.2',
9 + event = { 'BufReadPost', 'BufNew', },
9 10 opts = {
10 11 -- FIXME: I have visual redrawing bugs right now.
11 12 enabled = false,
12 - char = { '░', '▒', '▓' },
13 + char = { '░', '▒', '▓', },
13 14 exclude = {
14 15 filetypes = ignored.filetypes,
15 16 buftypes = ignored.buftypes,
16 - }
17 + },

neovim/lua/bugabinga/plugins/whichkey.lua

Modified
3 3 local ignored = require 'std.ignored'
4 4 local icon = require 'std.icon'
6 6 return {
7 7 'folke/which-key.nvim',
8 + tag = 'v1.6.0',
8 9 event = 'VeryLazy',
9 10 init = function ()
10 11 vim.o.timeout = true
24 25 border = vim.g.border_style,
25 26 winblend = vim.o.winblend,
27 - layout = { align = 'center' },
28 + layout = { align = 'center', },
28 29 disable = {
29 30 buftypes = ignored.buftypes,
30 - }
31 + },
32 33 config = function ( _, opts )
33 34 local wk = require 'which-key'
39 40 -- use category as prefix?
40 41 wk.register {
41 42 ['<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', },
46 47 s = {
47 48 name = 'swap',
48 49 _ = 'which_key_ignore',
50 - p = { name = 'parameter', _ = 'which_key_ignore' },
51 + p = { name = 'parameter', _ = 'which_key_ignore', },
53 54 t = {
54 55 name = 'toggle',
55 56 _ = 'which_key_ignore',
57 - o = { name = 'options', _ = 'which_key_ignore' },
58 - }
58 + o = { name = 'options', _ = 'which_key_ignore', },
59 + },
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 + },
64 - end
65 + end,

neovim/lua/bugabinga/ui.lua

Modified
1 -local display = require 'std.display'
3 1 local NuiPopup = require 'nui.popup'
4 2 local NuiText = require 'nui.text'
5 3 local NuiLine = require 'nui.line'
30 28 show_tree = function ( tree )
31 29 local popup = get_nui_popup()
32 30 local bufnr = popup.bufnr
33 - local text, _ = display( tree )
31 + local text = vim.inspect( tree )
35 33 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
37 36 local nui_line = NuiLine()
38 37 nui_line:append( NuiText( line, 'NormalFloat' ) )
39 - nui_line:render( bufnr, -1, line_number )
39 + nui_line:render( bufnr, namespace, line_number )
40 40 line_number = line_number + 1

neovim/lua/std/debug.lua

Modified
6 6 return vim.g.bugabinga_debug_mode
9 -local function print_debug( ... )
9 +local function print_debug( message, ... )
10 10 if is_debug_mode() then
11 - vim.print( ... )
11 + -- TODO: pipe messages into custom debug buffer and file
12 + vim.print( message, ... )
15 16 local function toggle_debug_mode()
16 17 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() ) )
20 -vim.api.nvim_create_user_command( 'Debug', toggle_debug_mode ,{})
21 +vim.api.nvim_create_user_command( 'Debug', toggle_debug_mode, {} )
22 23 return {
23 24 print = print_debug,

neovim/lua/std/display.lua

Deleted
deleted file mode 100644
1 -local icon = require'std.icon'
2 -local table = require'std.table'
4 -local function display(value)
5 - if value == nil then
6 - return 'nil', 'Special'
7 - end
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
42 -end
44 -return display

neovim/lua/std/icon.lua

Modified
6 6 arrow_right = '',
7 7 branch = '',
8 8 carriage_return = '␍',
9 - checkbox_mark = '',
9 + checkbox_mark = '',
10 10 checkbox_unmark = '',
11 11 command = '󰘳',
12 - close = '',
12 + close = '',
13 13 block = '█',
14 14 data = '',
15 15 diagnostic = '⊙',
26 26 global = '󱥔',
27 27 group = '',
28 28 hash = '',
29 - hint = '󰊪',
29 + hint = '',
30 30 info = '󰩖',
31 31 insert = '',
32 32 lazy = '󰄻',
41 41 normal = 'Ν',
42 42 pending = '',
43 43 precedes = '❮',
44 - quot_left = '󰝗',
45 - quot_right = '󰉾',
44 + quot_left = '"',
45 + quot_right = '"',
46 46 replace = '',
47 47 select = '󰒉',
48 48 space = '·',

neovim/lua/std/ignored.lua

Modified
21 21 local buftypes = {
22 - '',
23 22 'acwrite',
24 23 'help',
25 24 'neotree',

neovim/lua/std/map.lua

Modified
32 32 local bind = function ( self, map )
33 33 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', }, },
39 39 local keys = map.keys
50 50 desc = map.description,
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
55 55 if type( keys ) == 'table' then
56 56 for _, key in ipairs( keys ) do
57 - vim.keymap.set( self.mode, key, command, options )
57 + vim.keymap.set( self.modes, key, command, options )
59 59 else
60 - vim.keymap.set( self.mode, keys, command, options )
60 + vim.keymap.set( self.modes, keys, command, options )
63 - self.mode = {}
63 + self.modes = {}
65 65 return function ()
66 - local delete_options = options.buffer and { buffer = options.buffer } or {}
66 + local delete_options = options.buffer and { buffer = options.buffer, } or {}
67 67 if type( keys ) == 'table' then
68 68 for _, key in ipairs( keys ) do
69 - vim.keymap.del( self.mode, key, delete_options )
69 + vim.keymap.del( self.modes, key, delete_options )
71 71 else
72 - vim.keymap.del( self.mode, keys, delete_options )
72 + vim.keymap.del( self.modes, keys, delete_options )
77 77 local add_mode = function ( self, key )
78 78 local new_mode = available_modes[key]
79 79 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 )
83 83 return self
86 86 --- @overload fun(map:table): function
87 87 local map = setmetatable(
89 - mode = {},
89 + modes = {},
92 92 __index = add_mode,

neovim/lua/std/project.lua

Modified
9 9 local cache = {}
10 10 local hasher = vim.fn.sha256
11 11 local 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 )
21 14 local create_hash = function ( path, markers )
22 15 local path_hash = hasher( path )
39 32 --- number of max loop iterations when searching for markers
40 33 local MAX_TRAVERSAL_COUNT = 100
35 +--- the weight of a project marker, when the likelyhood is low
36 +local MAYBE = 1
37 +--- the weight of a project marker, when the likelyhood is high
38 +local LIKELY = 2
39 +--- the weight of a project marker, when the likelyhood is 100%
40 +local DEFINITLY = 3
42 42 --- Determines the path to a root directory, starting from the given path.
43 43 -- Markers have a name and weight.
44 44 -- Each name is checked for existence in all directories up to the root.
56 56 -- local project = require'std.project'
57 57 -- local current_buffer = vim.api.nvim_buf_get_name(0)
58 58 -- 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 },
63 63 -- local root = project.find_root(current_buffer, markers, vim.uv.os_homedir())
64 64 -- print(root) -- /home/user/workspace/some_project
71 71 ---@return string? # Directory, that contains the `markers` and lies on the path from `path` to `stop`.
72 72 local function find_root( path, markers, stop )
73 73 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, },
79 79 path = path or dirname( vim.api.nvim_buf_get_name( 0 ) )
88 88 local cache_hit = cache_get( path, markers )
89 89 if cache_hit then
90 - -- vim.print("CACHE HIT", cache_hit)
90 + debug.print( 'CACHE HIT', cache_hit )
91 91 return cache_hit
135 135 local project_root = nil
136 136 local max_likelyhood = 0
137 137 -- 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.
139 139 -- because if there are markers further away from the buffer than other markers,
140 140 -- then it is most likely a nested project structure (multi-module).
141 141 -- in those cases we are looking for the root project folder, instead the nearest
142 142 -- child project root folder.
143 143 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
145 145 if likelihood > max_likelyhood then
146 146 max_likelyhood = likelihood
147 147 project_root = score.path
162 162 local function find_project_root( path, markers )
163 163 -- define some language-independent markers
164 164 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, },
182 183 markers = markers or {}
190 191 local function find_java_project_root( path )
191 192 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, },
207 208 return find_root( path, java_markers )
210 211 local 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, },
222 223 local find_lua_project_root = function ( path )
226 227 local 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, },
233 234 local find_zig_project_root = function ( path )
237 238 local find_rust_project_root = function ( path )
238 239 local markers = {
239 - { name = 'Cargo.toml', weight = 3 },
240 + { name = 'Cargo.toml', weight = DEFINITLY, },
241 242 local cargo_crate_dir = find_root( path, markers )
242 243 if cargo_crate_dir == nil then return nil end
251 252 vim.fs.joinpath( cargo_crate_dir, 'Cargo.toml' ),
254 - local result = vim.system( cmd, { text = true } ):wait()
255 + local result = vim.system( cmd, { text = true, } ):wait()
255 256 local cargo_workspace_root
257 258 if result.code == 0 then
279 280 return rooter and rooter( path ) or fallback_rooter( path )
283 +--- @return table parsed configuration as could be found in the `.project_model` file in the root directory. Empty otherwise.
284 +local parse_project_configuration = function ()
285 +end
282 287 return {
283 288 find_root = find_root,
284 289 find_root_by_filetype = find_root_by_filetype,

neovim/lua/std/table/deep_concat.lua

Deleted
deleted file mode 100644
1 -return function( some_table, options)
2 - options = options or {}
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)
68 -end

neovim/lua/std/table/init.lua

Modified
1 1 --- Facade over various table functions in lua, neovim and some of my own.
2 2 return {
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,
9 8 count = vim.tbl_count,
10 9 deep_extend = vim.tbl_deep_extend,
11 10 extend = vim.tbl_extend,

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

Added
new file mode 100644
1 +return {
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 + },

neovim/spell/nerd.utf-8.add

Modified
19 19 insoft
20 20 KKG5
21 21 KKG6
22 +lspconfig
23 +neoconf
24 +lsp
25 +autopairs
26 +cterm/!

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

Modified

Previous version contains binary or non-UTF-8 data.

Current version contains binary or non-UTF-8 data.

nushell/env.nu

Modified
6 6 $env.WORKSPACE = if $env.WIN32 { "W:/" } else { "~/Workspace" | path expand }
7 7 $env.NOTES = if $env.WIN32 { "N:/" } else { "~/Notes" | path expand }
9 +if not (which nvim | is-empty) {
10 + $env.EDITOR = 'nvim'
11 + $env.GIT_EDITOR = 'nvim'
14 +if not (which neovide | is-empty) {
15 + $env.VISUAL = 'neovide'
9 18 if ($env | get -i TERM_PROGRAM) == WezTerm {
10 19 $env.TERM = "wezterm"
11 20 if not $env.WIN32 {

nushell/modules/aliases.nu

Modified
2 2 # Semantic aliases
3 3 export alias show = bat
4 4 export def list [] { ls --all --long --du --mime-type | where type == dir | append (ls --all --long --du --mime-type | where type != dir) }
5 5 export alias web = firefox
6 -export alias edit = nvim
6 +export alias code = nvim
7 +export alias edit = nvim --clean
7 8 # TODO ewrite bak command
8 9 export alias backup = bak

tools/cargo-tools.nu

Modified
6 6 # is not installed yet
7 7 let cargo_crates = [
8 8 [ name bin features];
9 - [ "wiki-tui" "wiki-tui" [] ]
10 9 [ "sccache" "sccache" [] ]
11 10 [ "inferno" "inferno-flamegraph" [] ]
12 11 [ "nu" "nu" [ "--features" "extra" ] ]
22 21 [ "cargo-cache" "cargo-cache" [] ]
23 22 [ "hexyl" "hexyl" [] ]
24 23 [ "hyperfine" "hyperfine" [] ]
25 - [ "so" "so" (so-features) ]
26 24 [ "tealdeer" "tldr" [] ]
27 25 [ "tokei" "tokei" [] ]
28 26 [ "bat" "bat" [] ]
38 36 [ "lychee" "lychee" [] ]
39 37 [ "viu" "viu" [] ]
40 38 [ "vivid" "vivid" [] ]
41 - [ "licensor" "licensor" [] ]
42 - [ "gib" "gib" [] ]
43 39 [ "silicon" "silicon" [] ]
44 40 [ "bottom" "btm" [] ]
45 41 # [ "sic" "sic" [] ] some issue with ssl on win32?
50 46 [ "stylua" "stylua" [ "--features" "lua52" ] ]
51 47 [ "taplo-cli" "taplo" [] ]
52 48 [ "lms" "lms" [] ]
53 - [ "coreutils" "coreutils" (coreutils-features) ]
56 -def coreutils-features [] {
57 - if $nu.os-info.family == 'windows' {
58 - [ "--features" "windows" ]
59 - } else {
60 - [ "--features" "unix" ]
61 - }
62 -}
64 -def so-features [] {
65 - if $nu.os-info.family == 'windows' {
66 - [ "--no-default-features" "--features" "windows" ]
67 - } else {
68 - []
69 - }
70 -}
72 51 # install all my favorite crate, only if they are not already in PATH.
73 52 def main [] {
53 + # FIXME: nushell in NixOS cannot detect hostname?
54 + if (sys).host.name == "NixOS" {
55 + #if (sys).host.name == "x230" {
56 + if (which akku | is-empty) {
57 + echo $'cargo install akku'
58 + cargo install --git https://github.com/bugabinga/akku
59 + } else {
60 + echo $"akku already installed"
61 + }
62 + }
74 63 $cargo_crates | each { | crate |
75 64 if ( which $crate.bin | is-empty ) {
76 65 echo $'cargo install ($crate.name) ($crate.features)'

topgrade/topgrade.windows.toml

Modified
1 -[misc]
2 -# Disable specific steps - same options as the command line flag
3 -disable = ["system"]
5 -assume_yes = true
7 -# Run specific steps - same options as the command line flag
8 -#only = ["system", "emacs"]
10 -# Do not ask to retry failed steps (default: false)
11 -no_retry = true
13 -# Do not set the terminal title
14 -set_title = true
16 -# Display the time in step titles
17 -display_time = true
19 -# Cleanup temporary or old files
20 -cleanup = true
22 -[composer]
23 -self_update = true
25 -[git]
26 -# Additional git repositories to pull
27 -repos = ["W:/*/"]
29 -max_concurrency = 12
31 -pull_predefined = false
33 -# Arguments to pass Git when pulling Repositories
34 -# arguments = "--ff --rebase"
36 -[windows]
37 -enable_winget = true
39 -# Commands to run before anything
40 -[pre_commands]
41 -"01 - Scoop Export" = "scoop export --config > 'X:/scoop_installed_apps.json' *> $null"
43 -[commands]
44 -"00 - Register Nu Plugins" = "nu -c 'register ~\\scoop\\apps\\nu\\current\\nu_plugin_gstat.exe'"
45 -"10 - Refresh dotfiles" = "java W:/dotfiles/bootstripper.java W:/dotfiles"
46 -"20 - Install Cargo Tools" = "nu --env-config ~/AppData/Roaming/nushell/env.nu W:/dotfiles/tools/cargo-tools.nu"
47 -"30 - Advantage-PM Client" = "nu X:/update_apm_client.nu"
48 -"31 - MeMate" = "nu X:/update_memate.nu"
49 -"40 - TLDR" = "tldr --update"
1 +[misc]
2 +# Disable specific steps - same options as the command line flag
3 +disable = ["system"]
5 +assume_yes = true
7 +# Run specific steps - same options as the command line flag
8 +#only = ["system", "emacs"]
10 +# Do not ask to retry failed steps (default: false)
11 +no_retry = true
13 +# Do not set the terminal title
14 +set_title = true
16 +# Display the time in step titles
17 +display_time = true
19 +# Cleanup temporary or old files
20 +cleanup = true
22 +[composer]
23 +self_update = true
25 +[git]
26 +# Additional git repositories to pull
27 +repos = ["W:/*/"]
29 +max_concurrency = 12
31 +pull_predefined = false
33 +# Arguments to pass Git when pulling Repositories
34 +# arguments = "--ff --rebase"
36 +[windows]
37 +enable_winget = true
39 +# Commands to run before anything
40 +[pre_commands]
41 +"01 - Scoop Export" = "scoop export --config > 'X:/scoop_installed_apps.json' *> $null"
43 +[commands]
44 +"00 - Register Nu Plugins" = "nu -c 'register ~\\scoop\\apps\\nu\\current\\nu_plugin_gstat.exe'"
45 +"10 - Refresh dotfiles" = "java W:/dotfiles/bootstripper.java W:/dotfiles"
46 +"20 - Install Cargo Tools" = "nu --env-config ~/AppData/Roaming/nushell/env.nu W:/dotfiles/tools/cargo-tools.nu"
47 +"30 - Advantage-PM Client" = "nu X:/update_apm_client.nu"
48 +"31 - MeMate" = "nu X:/update_memate.nu"
49 +"40 - TLDR" = "tldr --update"