repositories / dotfiles

dotfiles

bugabingas dorkfiles

owned by bugabinga

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

4fad50925d5625376bf18361a4df229927a0ed0a

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

unsigned

Browse filesCompare with HEAD

Changed files (70)

+2079 / −1208 text lines · all files grouped into 32 bars

Diff layout

EJ-PC-00363.symlinks

Modified

+10 / −1 text lines

1616stackoverflow/so
1717~/AppData/Roaming/Sam Tay/so
19subversion/config
19subversion/config.win32
2020~/AppData/Roaming/Subversion/config
22subversion/diff.bat
23~/AppData/Roaming/Subversion/diff.bat
25subversion/diff3.bat
26~/AppData/Roaming/Subversion/diff3.bat
28subversion/merge.bat
29~/AppData/Roaming/Subversion/merge.bat
2231cargo/config.toml
2332~/scoop/persist/rustup/.cargo/config.toml

PC-00625.symlinks

Modified

+0 / −9 text lines

1919subversion/config.win32
2020~/AppData/Roaming/Subversion/config
22subversion/diff
23~/AppData/Roaming/Subversion/diff
25subversion/diff3
26~/AppData/Roaming/Subversion/diff3
28subversion/merge
29~/AppData/Roaming/Subversion/merge
3122subversion/diff.bat
3223~/AppData/Roaming/Subversion/diff.bat

config.nu

Added
new file mode 100644

+287 / −0 text lines

1# Nushell Config File
2use table.nu *
3use os.nu *
4use prompt.nu *
5use aliases.nu *
6use todo.nu
7use openssl.nu *
8use pacnew.nu
9use syncthing.nu
11# for more information on themes see
12# https://github.com/nushell/nushell/blob/main/docs/How_To_Coloring_and_Theming.md
13let 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
62}
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: {
81
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 } ]
282}
284# must be done, after defining config, since zoxide mutates it
285use zoxide.nu *
287overlay use coreutils.nu

env.nu

Added
new file mode 100644

+45 / −0 text lines

1# GLOBAL VARIABLES
2# GLOBAL VARIABLES
3
4$env.WIN32 = ( $nu.os-info.name =~ "windows" )
5$env.NURC_DIR = ( $nu.config-path | path expand | path dirname )
6$env.DOTFILES = ( $env.NURC_DIR | path join ".." | path expand )
7$env.WORKSPACE = if $env.WIN32 { "W:/" } else { "~/Workspace" | path expand }
8$env.NOTES = if $env.WIN32 { "N:/" } else { "~/Notes" | path expand }
9if ($env | get -i TERM_PROGRAM) == WezTerm {
10 $env.TERM = "wezterm"
11 $env.TERMCAP = ~/.terminfo/w/wezterm
12}
14# theme for ls and other programs, that use LS_COLORS
15$env.LS_COLORS = (try { vivid generate ayu | into string } catch {""})
17# Specifies how environment variables are:
18# - converted from a string to a value on Nushell startup (from_string)
19# - converted from a value back to a string when running external commands (to_string)
20# Note: The conversions happen *after* config.nu is loaded
21$env.ENV_CONVERSIONS = {
22 "PATH": {
23 from_string: { |s| $s | split row (char esep) }
24 to_string: { |v| $v | str join (char esep) }
25 }
26 "Path": {
27 from_string: { |s| $s | split row (char esep) }
28 to_string: { |v| $v | str join (char esep) }
29 }
30}
32# Directories to search for scripts when calling source or use
33$env.NU_LIB_DIRS = [
34 ($nu.config-path | path dirname | path join 'modules'),
35 ($nu.config-path | path dirname | path join 'completions')
36]
38alias 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

neovim/.gitignore

Added
new file mode 100644

+2 / −0 text lines

1repro.lua
2.repro

neovim/.luarc.jsonc

Modified

+15 / −15 text lines

11{
2 "$schema": "https://raw.githubusercontent.com/sumneko/vscode-lua/master/setting/schema.json",
3 "runtime": {
4 "version": "LuaJIT"
5 },
6 "diagnostics": {
7 "globals": {
8 "vim"
2 "$schema": "https://raw.githubusercontent.com/sumneko/vscode-lua/master/setting/schema.json",
3 "diagnostics": {
4 "globals": [
5 "vim"
6 ],
7 "neededFileStatus": {
8 "codestyle-check": "Any"
99 }
1010 },
11 "workspace": {
12 "checkThirdParty": false,
13 },
14 "runtime": {
15 "version": "LuaJIT",
16 "pathStrict": true,
17 "special": {
18 "want": "require",
11 "workspace": {
12 "checkThirdParty": false
13 },
14 "runtime": {
15 "version": "LuaJIT",
16 "pathStrict": true,
17 "special": {
18 "want": "require"
1919 }
2020 }

neovim/README.md

Modified

+35 / −12 text lines

1# Yet another neovim configuration
1# bugabinga neovim config
3because life is just too long...
3neovim configuration is scripting.
4scripting with lua + neovim api is programming.
5```lua
6local why_does_my_heart = "feel so bad"
7-- why does my soul...
8```
6## project structure
10<table>yoyo</table>
8init.lua
9: main entry point
10\
11lua/std
12: standard lib. can only depend on itself and neovim apis.
13\
14lua/bugabinga
15: config modules. in aggregation, defines all of the config. can depend on itself, std and plugins.
16\
17lua/bugabinga/plugins
18: third party plugins and their config glue integrating it into the config.
19\
20colors/nugu
21: color theme
22\
23ftplugin
24: file type specific config
12```xml
13<div> some value </div>
14```
26----------
16## it must be a sicknses
28# todo
18_why_ do I do *this* to ~myself~ ...?
30* pandoc with lua filters for diagrams for generating documents and previewing --> https://github.com/tex/vimpreviewpandoc
31* think about mini.colors
32* setup spell checking for code (english + german)
33* use gen.ai to generate docs
34* learn marks and refac mark.lua
35* use ltex-ls for markdown, code comments and commit messages
36* setup DAP
37* add nu-check to nvim-lint
38* autocomplete in cmdline does not work no more
39* make telescope highlights more like NormalFloat
40* create facade over vim.api.nvim_create_user_command
41* fix autocomplete in cmdline

neovim/init.lua

Modified

+9 / −13 text lines

88-- ▀▀▀ █ █ ██ █
99-- ▀ ▀
1010-- set general neovim editor settings
11require'bugabinga.options'
11require 'bugabinga.options'
1212-- install plugin manager and declare plugins to use
13require'bugabinga.lazy'
13require 'bugabinga.lazy'
1414-- configures the vim diagnostic subsystem
15require'bugabinga.diagnostic'
16require'bugabinga.trim'
17require'bugabinga.mark'
18require'bugabinga.lsp'
20-- TODO:
21-- [ ] highlight return keyword
22-- [ ] use ltex-ls for markdown, code comments and commit messages
23-- [ ] DAP
24-- [ ] add nu-check to nvim-lint
25-- [ ] replace hydra with normal mapping + whcihkey
15require 'bugabinga.diagnostic'
16-- Defines `TrimTrailingWhitespace` command
17require 'bugabinga.trim'
18-- visualize marks in signcolumn
19require 'bugabinga.mark'
20-- setup lsp clients
21require 'bugabinga.lsp'

neovim/justfile

Modified

+4 / −0 text lines

44default:
55 @just --list
7# Reproduce some neovim issue
8repro:
9 nvim -u repro.lua
711# update nvim plugins
812update:
913 nvim --headless "+Lazy! sync" +qa

neovim/lazy-lock.json

Modified

+35 / −28 text lines

11{
2 "Comment.nvim": { "branch": "master", "commit": "e51f2b142d88bb666dcaa77d93a07f4b419aca70" },
2 "Comment.nvim": { "branch": "master", "commit": "0236521ea582747b58869cb72f70ccfa967d2e89" },
33 "LuaSnip": { "branch": "master", "commit": "0b4950a237ce441a6a3a947d501622453f6860ea" },
44 "better-escape.nvim": { "branch": "master", "commit": "7031dc734add47bb71c010e0551829fa5799375f" },
55 "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
6 "cmp-cmdline": { "branch": "main", "commit": "8ee981b4a91f536f52add291594e89fb6645e451" },
6 "cmp-emoji": { "branch": "main", "commit": "19075c36d5820253d32e2478b6aaf3734aeaafa0" },
77 "cmp-nvim-lsp": { "branch": "main", "commit": "44b16d11215dce86f253ce0c30949813c0a90765" },
8 "cmp-omni": { "branch": "main", "commit": "4ef610bbd85a5ee4e97e09450c0daecbdc60de86" },
8 "cmp-nvim-lsp-document-symbol": { "branch": "main", "commit": "f0f53f704c08ea501f9d222b23491b0d354644b0" },
9 "cmp-nvim-lsp-signature-help": { "branch": "main", "commit": "3d8912ebeb56e5ae08ef0906e3a54de1c66b92f1" },
910 "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
10 "cmp_luasnip": { "branch": "master", "commit": "18095520391186d634a0045dacaa346291096566" },
11 "diffview.nvim": { "branch": "main", "commit": "a111d19ccceac6530448d329c63f998f77b5626e" },
12 "dressing.nvim": { "branch": "master", "commit": "59fe7ef1aeeed499b983614fcfff89206bf0d5ce" },
13 "flash.nvim": { "branch": "main", "commit": "e5a7bd96d0bb7e0806bfc18adea5ab148165bd62" },
14 "friendly-snippets": { "branch": "main", "commit": "ebf6d6e83494cdd88a54a429340256f4dbb6a052" },
15 "gitsigns.nvim": { "branch": "main", "commit": "bb808fc7376ed7bac0fbe8f47b83d4bf01738167" },
16 "glow.nvim": { "branch": "main", "commit": "cf2177a514859fa3c55837b46de91d93b24cf488" },
11 "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" },
12 "diffview.nvim": { "branch": "main", "commit": "d38c1b5266850f77f75e006bcc26213684e1e141" },
13 "dressing.nvim": { "branch": "master", "commit": "1f2d1206a03bd3add8aedf6251e4534611de577f" },
14 "flash.nvim": { "branch": "main", "commit": "48817af25f51c0590653bbc290866e4890fe1cbe" },
15 "friendly-snippets": { "branch": "main", "commit": "43727c2ff84240e55d4069ec3e6158d74cb534b6" },
16 "gen.nvim": { "branch": "main", "commit": "de6952db44082b8931a237d6af7fa729a06f6b25" },
17 "gitsigns.nvim": { "branch": "main", "commit": "5a9a6ac29a7805c4783cda21b80a1e361964b3f2" },
18 "glow.nvim": { "branch": "main", "commit": "5b38fb7b6e806cac62707a4aba8c10c5f14d5bb5" },
1719 "heirline.nvim": { "branch": "master", "commit": "7f1e805dfc001d5dbb7d894105063f463f6c7dcc" },
1820 "hlargs.nvim": { "branch": "main", "commit": "6218a401824c5733ac50b264991b62d064e85ab2" },
1921 "hydra.nvim": { "branch": "master", "commit": "3ced42c0b6a6c85583ff0f221635a7f4c1ab0dd0" },
2224 "lazy.nvim": { "branch": "main", "commit": "7ca3bdb566c3ba4492f2d22b37c2c9e26f09470f" },
2325 "lspkind.nvim": { "branch": "master", "commit": "57610d5ab560c073c465d6faf0c19f200cb67e6e" },
2426 "lush.nvim": { "branch": "main", "commit": "966aad1accd47fa11fbe2539234f81f678fef2de" },
25 "mason.nvim": { "branch": "main", "commit": "d66c60e17dd6fd8165194b1d14d21f7eb2c1697a" },
26 "multicursors.nvim": { "branch": "main", "commit": "b7a837496da6f5b39b610a7cbd6c3f7d05526d6e" },
27 "neodev.nvim": { "branch": "main", "commit": "da1562e1e3df0e994ddc52cb4ba22376a5d7f2fc" },
28 "neogen": { "branch": "main", "commit": "cb1f384df804c1bf729332c4f728253fe17962d4" },
29 "noice.nvim": { "branch": "main", "commit": "396f9146529130904e07c45e90ecdbfa607534f3" },
27 "mason.nvim": { "branch": "main", "commit": "cd7835b15f5a4204fc37e0aa739347472121a54c" },
28 "mini.align": { "branch": "main", "commit": "e3a0c114d3fea0479f8e8ee3e273c7ca4ba6ea8d" },
29 "mini.bracketed": { "branch": "main", "commit": "d99f8f6c93e2a4cff1ebc27072d74ba400c8d241" },
30 "mini.colors": { "branch": "main", "commit": "a84b460fd5012a6af878d6beb96e912181f25c30" },
31 "mini.starter": { "branch": "main", "commit": "c74bdde61385360b02ca9fd7731ebce8903d78d7" },
32 "mkdir.nvim": { "branch": "main", "commit": "c55d1dee4f099528a1853b28bb28caa802eba217" },
33 "neodev.nvim": { "branch": "main", "commit": "d617d9eb27e73e701e446874c6ea2cb528719260" },
34 "neogen": { "branch": "main", "commit": "70127baaff25611deaf1a29d801fc054ad9d2dc1" },
35 "noice.nvim": { "branch": "main", "commit": "50fc77bcd75cf32374521fb227e9f41f3fe1521a" },
3036 "nrpattern.nvim": { "branch": "master", "commit": "f862ce687761078ef3155688151c55f69d28453e" },
31 "nui.nvim": { "branch": "main", "commit": "9e3916e784660f55f47daa6f26053ad044db5d6a" },
32 "nvim-autopairs": { "branch": "master", "commit": "de4f7138a68d5d5063170f2182fd27faf06b0b54" },
33 "nvim-cmp": { "branch": "main", "commit": "983453e32cb35533a119725883c04436d16c0120" },
37 "nui.nvim": { "branch": "main", "commit": "c0c8e347ceac53030f5c1ece1c5a5b6a17a25b32" },
38 "nvim-autopairs": { "branch": "master", "commit": "0f04d78619cce9a5af4f355968040f7d675854a1" },
39 "nvim-cmp": { "branch": "main", "commit": "51260c02a8ffded8e16162dcf41a23ec90cfba62" },
3440 "nvim-colorizer.lua": { "branch": "master", "commit": "dde3084106a70b9a79d48f426f6d6fec6fd203f7" },
35 "nvim-genghis": { "branch": "main", "commit": "b15d7d0c37f7739a5723f20dfae9e501b9952b08" },
41 "nvim-genghis": { "branch": "main", "commit": "ba59d6fd8440c9b8928acd22b845d18fe9a8b848" },
3642 "nvim-gomove": { "branch": "main", "commit": "2b44ae7ac0804f4e3959228122f7c85bef1964e3" },
3743 "nvim-jdtls": { "branch": "master", "commit": "a5c6f38f8151d7b4f5b32c005a95022fa66f4c9d" },
3844 "nvim-lastplace": { "branch": "main", "commit": "0bb6103c506315044872e0f84b1f736c4172bb20" },
4450 "nvim-treesitter-endwise": { "branch": "master", "commit": "4c344ffc8d54d7e1ba2cefaaa2c10ea93aa1cc2d" },
4551 "nvim-treesitter-textobjects": { "branch": "master", "commit": "bd103502252027434ec42f628d2dbf54821d4ce6" },
4652 "nvim-ts-autotag": { "branch": "main", "commit": "6be1192965df35f94b8ea6d323354f7dc7a557e4" },
47 "nvim-ts-context-commentstring": { "branch": "main", "commit": "95e9ba9de4289d221666b66fd930d157c7ca08c6" },
48 "nvim-web-devicons": { "branch": "master", "commit": "45d0237c427baba8cd05e0ab26d30e2ee58c2c82" },
49 "oil.nvim": { "branch": "master", "commit": "fdb50dc5c57524c4b0b05b593abff4d4f7a099f6" },
50 "persistence.nvim": { "branch": "main", "commit": "adcf6913693a0434665d162ee45a186230496f8a" },
53 "nvim-ts-context-commentstring": { "branch": "main", "commit": "92e688f013c69f90c9bbd596019ec10235bc51de" },
54 "nvim-web-devicons": { "branch": "master", "commit": "5de460ca7595806044eced31e3c36c159a493857" },
55 "oil.nvim": { "branch": "stevearc-trash", "commit": "9487fdfeb5b50ebcd46e644fbdc9d15ac9b9f55d" },
56 "persistence.nvim": { "branch": "main", "commit": "ad538bfd5336f1335cdb6fd4e0b0eebfa6e12f32" },
5157 "playground": { "branch": "master", "commit": "ba48c6a62a280eefb7c85725b0915e021a1a0749" },
52 "plenary.nvim": { "branch": "master", "commit": "253d34830709d690f013daf2853a9d21ad7accab" },
53 "schemastore.nvim": { "branch": "main", "commit": "ce624332e6ba5a9a0c8f311a114ac179c5e72f62" },
58 "plenary.nvim": { "branch": "master", "commit": "50012918b2fc8357b87cff2a7f7f0446e47da174" },
59 "schemastore.nvim": { "branch": "main", "commit": "e0884542c973b92a193274eaebedd8d2ae05ceb5" },
5460 "specs.nvim": { "branch": "main", "commit": "2743e412bbe21c9d73954c403d01e8de7377890d" },
55 "substitute.nvim": { "branch": "main", "commit": "42d09f1e6324d98aa2e5b765b64528e0aefe72b0" },
61 "substitute.nvim": { "branch": "main", "commit": "cf35db50188f3d7de624ae391c9bb9f2e9de5610" },
62 "symbols-outline.nvim": { "branch": "master", "commit": "512791925d57a61c545bc303356e8a8f7869763c" },
5663 "telescope-symbols.nvim": { "branch": "master", "commit": "f2060117d965df4a626f068a4ebbd8ee051aa076" },
57 "telescope-ui-select.nvim": { "branch": "master", "commit": "62ea5e58c7bbe191297b983a9e7e89420f581369" },
64 "telescope-ui-select.nvim": { "branch": "master", "commit": "b0015e6e4b46a64192c64b68dec9a9ac5a4e5690" },
5865 "telescope-zoxide": { "branch": "main", "commit": "68966349aa1b8e9ade403e18479ecf79447389a7" },
5966 "telescope.nvim": { "branch": "0.1.x", "commit": "54930e1abfc94409e1bb9266e752ef8379008592" },
6067 "todo-comments.nvim": { "branch": "main", "commit": "8febc60a76feefd8203077ef78b6a262ea1a41f9" },
6471 "virt-column.nvim": { "branch": "master", "commit": "5fc72873dc3175eddbdbbedea8071919c99ad755" },
6572 "which-key.nvim": { "branch": "main", "commit": "bf09a25bdc9a83bcc69d2cf078e680368676513b" },
6673 "zen-mode.nvim": { "branch": "main", "commit": "6e6c963d70a8e47854fa656987666bfb863f9c4e" }
67}No final newline
74}

neovim/lua/bugabinga/diagnostic.lua

Modified

+10 / −26 text lines

1local want = require 'std.want'
21local map = require 'std.map'
32local auto = require 'std.auto'
43local icon = require 'std.icon'
7473map.normal {
7574 description = 'Toggle diagnostics',
7675 category = 'diagnostic',
77 keys = '<F6><F6>',
76 keys = '<leader>td',
7877 command = function ()
7978 if diagnostic.is_disabled( 0 ) then
8079 diagnostic.enable( 0 )
9695local show_diagnostics_in_buffer = function ()
97 want { 'telescope.builtin', 'telescope.themes' } (
98 function ( builtin, themes )
99 builtin.diagnostics( themes.get_dropdown { bufnr = 0, layout_config = { width = 0.69 } } )
100 end )
96 local builtin = require 'telescope.builtin'
97 local themes = require 'telescope.themes'
98 builtin.diagnostics( themes.get_dropdown { bufnr = 0, layout_config = { width = 0.69 } } )
10199end
103101map.normal {
110108local show_diagnostics_in_workspace = function ()
111 want { 'telescope.builtin', 'telescope.themes' } (
112 function ( builtin, themes )
113 builtin.diagnostics( themes.get_dropdown { layout_config = { width = 0.69 } } )
114 end )
109 local builtin = require 'telescope.builtin'
110 local themes = require 'telescope.themes'
111 builtin.diagnostics( themes.get_dropdown { layout_config = { width = 0.69 } } )
115112end
117114map.normal {
118115 description = 'Show all diagnostics in workspace',
119116 category = 'diagnostic',
120 keys = '<leader><F6>',
117 keys = '<F6><F6>',
121118 command = show_diagnostics_in_workspace,
124map.normal {
125 description = 'Go to previous diagnostic',
126 category = 'diagnostic',
127 keys = '<C-.>',
128 command = diagnostic.goto_prev,
129}
131map.normal {
132 description = 'Go to next diagnostic',
133 category = 'diagnostic',
134 keys = '<C-,>',
135 command = diagnostic.goto_next,
136}
138121-- a little debug helper to show all kinds of diagnostics
140123local dia = function ( severity, line )
160143 dia( vim.diagnostic.severity.HINT, 4 )
161144end
163vim.g.send_dia = send_diaNo final newline
146vim.g.send_dia = send_dia

neovim/lua/bugabinga/lazy.lua

Modified

+30 / −19 text lines

2222lazy.setup('bugabinga.plugins', {
2323 defaults = {
2424 lazy = true,
25 version = '*',
25 -- version = '*',
2626 },
2727 install = {
2828 missing = false,
4141 ft = icon.file,
4242 },
4343 },
44 custom_keys = false,
44 custom_keys = {
45 ["<localleader>l"] = function(plugin)
46 require("lazy.util").float_term("gitui", {
47 cwd = plugin.dir,
48 })
49 end,
50 ["<localleader>t"] = function(plugin)
51 require("lazy.util").float_term(nil, {
52 cwd = plugin.dir,
53 })
54 end,
55 },
4556 change_detection = { notify = false },
4657 performance = {
4758 rtp = {
8091local map = require 'std.map'
8293local lazy_cmds = vim.iter {
83 { 'Show', '' , lazy.show } ,
84 { 'Install', 'i', lazy.install },
85 { 'Update', 'u', lazy.update },
86 { 'Sync', 's', lazy.sync },
87 { 'Clean', 'x', lazy.clean },
88 { 'Check', 'c', lazy.check },
89 { 'Log', 'l', lazy.log },
90 { 'Restore', 'r', lazy.restore },
91 { 'Profile', 'p', lazy.profile },
92 { '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 },
95106local base_key = '<leader>z'
97108lazy_cmds:each(function(cmd)
98 map.normal {
99 name = cmd[1] .. ' plugins via Lazy.nvim',
100 category = 'plugins',
101 keys = base_key .. cmd[2],
102 command = cmd[3],
103 }
104end)No final newline
109 map.normal {
110 name = cmd[1] .. ' plugins',
111 category = 'plugins',
112 keys = base_key .. cmd[2],
113 command = cmd[3],
114 }
115end)

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

Modified

+186 / −43 text lines

11local table = require 'std.table'
22local project = require 'std.project'
3local auto = require 'std.auto'
4local map = require'std.map'
4local create_shared_config_path = function(base_path, syntax_server)
6local create_shared_config_path = function ( base_path, syntax_server )
57 local os_config
6 if vim.fn.has('linux') == 1 then
7 os_config = syntax_server and 'config_linux' or 'config_ss_linux'
8 elseif vim.fn.has('mac') == 1 then
9 os_config = syntax_server and 'config_mac' or 'config_ss_mac'
8 if vim.fn.has 'linux' == 1 then
9 os_config = syntax_server and 'config_ss_linux' or 'config_linux'
10 elseif vim.fn.has 'mac' == 1 then
11 os_config = syntax_server and 'config_ss_mac' or 'config_mac'
1012 else
11 os_config = syntax_server and 'config_win' or 'config_ss_win'
13 os_config = syntax_server and 'config_ss_win' or 'config_win'
1214 end
13 return vim.fs.joinpath(base_path, os_config)
15 return vim.fs.joinpath( base_path, os_config )
1416end
16local find_launcher_jar = function(base_path)
17 local plugins_dir = vim.fs.joinpath(base_path, 'plugins')
18 local launchers = vim.fn.globpath(plugins_dir, 'org.eclipse.equinox.launcher_*.jar', false, true)
18local find_launcher_jar = function ( base_path )
19 local plugins_dir = vim.fs.joinpath( base_path, 'plugins' )
20 local launchers = vim.fn.globpath( plugins_dir, 'org.eclipse.equinox.launcher_*.jar', false, true )
20 if table.is_empty(launchers) then
21 vim.error('Could not find jdtls launcher jar in ' .. plugins_dir)
22 if table.is_empty( launchers ) then
23 error( 'Could not find jdtls launcher jar in ' .. plugins_dir )
2224 end
2426 -- vim.print('found launcher jars', launchers)
2527 return launchers[1]
2628end
28local create_data_dir = function()
30local create_data_dir = function ()
2931 local cwd = vim.uv.cwd() or ''
30 local data_name = vim.fn.sha256(cwd)
32 local data_name = vim.fn.sha256( cwd )
3133 local cache = vim.fn.stdpath 'cache'
32 cache = type(cache) == 'table' and cache[1] or cache
34 cache = type( cache ) == 'table' and cache[1] or cache
34 return vim.fs.joinpath(cache, 'jdtls_data', data_name)
36 return vim.fs.joinpath( cache, 'jdtls_data', data_name )
3537end
37local create_jdtls_command = function(syntax_server)
38 local mason_packages_base_path = require 'mason-core.package':get_install_path()
39 local jdtls_package_path = vim.fs.joinpath(mason_packages_base_path, 'jdtls')
40 local shared_config_path = create_shared_config_path(jdtls_package_path, syntax_server)
41 local launcher_jar = find_launcher_jar(jdtls_package_path)
39local function get_bundles()
40 local mason_registry = require 'mason-registry'
41 local java_debug = mason_registry.get_package 'java-debug-adapter'
42 local java_test = mason_registry.get_package 'java-test'
43 local java_debug_path = java_debug:get_install_path()
44 local java_test_path = java_test:get_install_path()
45 local bundles = {}
46 --FIXME: refactor this!
47 vim.list_extend( bundles,
48 vim.split(
49 vim.fn.glob( java_debug_path .. '/extension/server/com.microsoft.java.debug.plugin-*.jar' ), '\n' ) )
50 vim.list_extend( bundles, vim.split( vim.fn.glob( java_test_path .. '/extension/server/*.jar' ), '\n' ) )
51 return bundles
52end
54local create_jdtls_command = function ( syntax_server )
55 local mason_registry = require 'mason-registry'
56 local jdtls_package_path = mason_registry.get_package('jdtls'):get_install_path()
57 local shared_config_path = create_shared_config_path( jdtls_package_path, syntax_server )
58 local launcher_jar = find_launcher_jar( jdtls_package_path )
4259 local data_dir = create_data_dir()
44 local ss_option = syntax_server and '-Dsyntaxserver=true' or ''
61 local ss_option = syntax_server and '-Dsyntaxserver=true' or nil
46 return {
63 local command = {
4764 'java',
4865 '-Declipse.application=org.eclipse.jdt.ls.core.id1',
4966 '-Dosgi.bundles.defaultStartLevel=4',
5067 '-Declipse.product=org.eclipse.jdt.ls.core.product',
5168 '-Dlog.protocol=true',
5269 '-Dlog.level=ALL',
53 "-Dosgi.checkConfiguration=true",
54 "-Dosgi.sharedConfiguration.area=" .. shared_config_path,
55 "-Dosgi.sharedConfiguration.area.readOnly=true",
56 "-Dosgi.configuration.cascaded=true",
57 ss_option,
70 '-Dosgi.checkConfiguration=true',
71 '-Dosgi.sharedConfiguration.area=' .. shared_config_path,
72 '-Dosgi.sharedConfiguration.area.readOnly=true',
73 '-Dosgi.configuration.cascaded=true',
5874 '--add-modules=ALL-SYSTEM',
5975 '--add-opens', 'java.base/java.util=ALL-UNNAMED',
6076 '--add-opens', 'java.base/java.lang=ALL-UNNAMED',
6177 '-jar', launcher_jar,
6278 '-data', data_dir,
6379 }
81 if ss_option then
82 -- insert option after 'java'
83 table.insert( command, 2, ss_option )
84 end
86 return command
6487end
66local find_jdks = function()
89local find_jdks = function ()
6790 local host = vim.uv.os_gethostname()
6891 local jdk11 = {
69 name = "JavaSE-11",
92 name = 'JavaSE-11',
7093 }
7194 local jdk17 = {
72 name = "JavaSE-17",
95 name = 'JavaSE-17',
7396 }
7497 local jdk19 = {
75 name = "JavaSE-19",
98 name = 'JavaSE-19',
99 }
100 local jdk21 = {
101 name = 'JavaSE-21',
76102 }
77103 local jdk21 = {
78104 name = "JavaSE-21",
79105 }
81107 if host == 'pop-os' then
82 jdk11.path = '/usr/lib/jvm/openjdk-11'
83 jdk17.path = '/usr/lib/jvm/openjdk-17'
84 jdk19.path = '/usr/lib/jvm/openjdk-19'
85 jdk21.path = '~/.jdks/openjdk-21'
86elseif host == 'PC-00625' then
108 jdk11.path = '/usr/lib/jvm/java-11-openjdk-amd64'
109 jdk17.path = '/usr/lib/jvm/java-17-openjdk-amd64'
110 jdk19.path = '/usr/lib/jvm/java-19-openjdk-amd64'
111 jdk21.path = '/home/oli/.jdks/openjdk-21'
112 elseif host == 'PC-00625' then
87113 jdk11.path = '~/scoop/apps/openjdk11/current'
88114 jdk17.path = '~/scoop/apps/openjdk17/current'
89115 jdk19.path = '~/scoop/apps/openjdk19/current'
98124local java_settings = {
99125 signatureHelp = { enabled = true },
100126 sources = {
127 autobuild = { enabeld = true },
128 signatureHelp = { enabled = true },
129 saveActions = { origanizeImports = true },
101130 organizeImports = {
102131 starThreshold = 9999,
103132 staticStarThreshold = 9999,
104133 },
134 codeGeneration = {
135 toString = {
136 template = '${object.className}{${member.name()}=${member.value()}, ${otherMembers}}',
137 },
138 hashCodeEquals = { useJava7Objects = true },
139 useBlocks = true,
140 },
141 eclipse = { downloadSources = true },
142 },
143 configuration = {
144 updateBuildConfiguration = 'interactive',
145 runtimes = find_jdks(),
146 },
147 maven = { downloadSources = true },
148 implementationsCodeLens = { enabled = true },
149 referencesCodeLens = { enabled = true },
150 references = { includeDecompiledSources = true },
151 inlayHints = { parameterNames = { enabled = 'all' } },
152 format = {
153 enabled = true,
154 -- TODO: set these here with my preferred settings
155 -- set these on a project level -> read intellij /eclipse settings?
156 -- settings = {
157 -- url = 'TODO',
158 -- profile = 'TODO',
159 -- },
105160 },
106 configuration = { runtimes = find_jdks(), },
109local jdtls_lsp_start = function(config, opts)
163local jdtls_lsp_start = function ( config, opts )
110164 -- vim.print('jdtls lsp start', config, opts)
111 require 'jdtls'.start_or_attach(config, opts)
165 require 'jdtls'.start_or_attach( config, opts )
166end
168local get_extended_capabilites = function ()
169 local ext = require 'jdtls'.extendedClientCapabilities
170 ext.resolveAdditionalTextEditsSupport = true
171 return ext
172end
174local on_attach = function ()
175 local jdtls = require 'jdtls'
176 vim.lsp.codelens.refresh()
177 jdtls.setup_dap { hotcodereplace = 'auto' }
178 require 'jdtls.dap'.setup_dap_main_class_configs()
179 require 'jdtls.setup'.add_commands()
181 map.normal {
182 description = 'Organize Imports',
183 category = 'jdlts',
184 keys = '<leader>ljo',
185 command = jdtls.organize_imports,
186 }
188 map.normal {
189 description = 'Extract Variable',
190 category = 'jdlts',
191 keys = '<leader>ljv',
192 command = jdtls.extract_variable,
193 }
195 map.normal {
196 description = 'Extract Constant',
197 category = 'jdlts',
198 keys = '<leader>ljc',
199 command = jdtls.extract_constant,
200 }
202 map.normal {
203 description = 'Test Nearest Method',
204 category = 'jdlts',
205 keys = '<leader>ljt',
206 command = jdtls.test_nearest_method,
207 }
209 map.normal {
210 description = 'Test Class',
211 category = 'jdlts',
212 keys = '<leader>ljT',
213 command = jdtls.test_class,
214 }
216 map.normal {
217 description = 'Update Config',
218 category = 'jdlts',
219 keys = '<leader>lju',
220 command = '<cmd>JdtUpdateConfig<cr>',
221 }
223 map.visual {
224 description = 'Extract Variable',
225 category = 'jdlts',
226 keys = '<leader>ljv',
227 command = function() jdtls.extract_variable(true) end,
228 }
230 map.visual {
231 description = 'Extract Constant',
232 category = 'jdlts',
233 keys = '<leader>ljc',
234 command = function() jdtls.extract_constant(true) end,
235 }
237 map.visual {
238 description = 'Extract Method',
239 category = 'jdlts',
240 keys = '<leader>ljm',
241 command = function() jdtls.extract_method(true) end,
242 }
244 auto 'refresh_codelens' {
245 events = 'BufWritePost',
246 description = 'Refreshes LSP CodeLens after java file is written.',
247 pattern = '*.java',
248 command = function () pcall( vim.lsp.codelens.refresh ) end,
249 }
112250end
114252return {
115 name = 'jdtls',
253 name = 'jdtls',
116254 custom_start = jdtls_lsp_start,
117255 filetypes = 'java',
118 command = create_jdtls_command(true),
256 command = create_jdtls_command( false ),
119257 root_dir = project.find_java_project_root,
120258 single_file_support = true,
121 workspaces = false,
259 workspaces = true,
122260 settings = { java = java_settings },
261 on_attach = on_attach,
262 init_options = {
263 bundles = get_bundles(),
264 extendedClientCapabilities = get_extended_capabilites(),
265 }

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

Modified

+5 / −5 text lines

1local project = require'std.project'
1local project = require 'std.project'
33return {
44 name = 'jsonls',
1212 },
1313 settings = {
1414 json = {
15 schemas = require'schemastore'.json.schemas{
15 schemas = require 'schemastore'.json.schemas {
1616 extra = {
1717 description = 'Settings for lua-language-server',
18 name = "LuaLS Settings",
19 url = "https://raw.githubusercontent.com/LuaLS/vscode-lua/master/setting/schema.json",
20 fileMatch = { ".luarc.json", ".luarc.jsonc" },
18 name = 'LuaLS Settings',
19 url = 'https://raw.githubusercontent.com/LuaLS/vscode-lua/master/setting/schema.json',
20 fileMatch = { '.luarc.json', '.luarc.jsonc' },
2121 }
2222 },
2323 validate = { enable = true },

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

Modified

+1 / −3 text lines

44 name = 'LuaLS',
55 filetypes = 'lua',
66 command = 'lua-language-server',
7 root_dir = function ( path )
8 return project.find_lua_nvim_project_root( path ) or project.find_lua_project_root( path )
9 end,
7 root_dir = project.find_lua_project_root ,
108 single_file_support = true,
119 workspaces = true,
1210 settings = {

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

Modified

+2 / −2 text lines

11local project = require'std.project'
33local function is_library(path)
4 local cargo_home = os.getenv 'CARGO_HOME' or util.path.join(vim.env.HOME, '.cargo')
4 local cargo_home = os.getenv 'CARGO_HOME' or vim.fs.joinpath(vim.env.HOME, '.cargo')
55 local registry = vim.fs.joinpath(cargo_home, 'registry', 'src')
7 local rustup_home = os.getenv 'RUSTUP_HOME' or util.path.join(vim.env.HOME, '.rustup')
7 local rustup_home = os.getenv 'RUSTUP_HOME' or vim.fs.joinpath(vim.env.HOME, '.rustup')
88 for _, item in ipairs { toolchains, registry } do
99 if path:sub(1, #item) == item then
1010 local clients = vim.lsp.get_active_clients { name = 'rust_analyzer' }

neovim/lua/bugabinga/lsp/init.lua

Modified

+82 / −53 text lines

33local defer = require 'std.defer'
44local map = require 'std.map'
55local auto = require 'std.auto'
6local want = require 'std.want'
76local ui = require 'bugabinga.ui'
87local table = require 'std.table'
98local ignored = require 'std.ignored'
4948end
5150local lsp_start = function ( file_type_event )
52 -- vim.print("LSP START", file_type_event)
5451 local match = file_type_event.match
5653 local matches_to_ignore = ignored.filetypes
5855 if vim.iter( matches_to_ignore ):find( match ) then return end
6057 local bufnr = file_type_event.buf
58 local buftype = vim.api.nvim_get_option_value( 'buftype', { buf = bufnr } )
59 if buftype ~= '' then return end
6161 local buffer_path = vim.api.nvim_buf_get_name( bufnr )
63 -- vim.print( "SEARCHING LSP CLIENT FOR:", match, buffer_path)
63 vim.notify( string.format( 'searching lsp client for: match: %s, buffer: %s, path: %s', match, bufnr, buffer_path ) )
6565 local potential_client_configs = vim.iter( lsp_client_configs )
6666 :map( function ( config )
104104 return
105105 end
107 -- TODO: LspStart
108 -- TODO: LspStop
109 -- TODO: stop lsp on vim idle/ficus lost?
110 -- FIXME: lsp detach errors
107112 for _, config in ipairs( potential_client_configs ) do
108113 local root_dir = type( config.root_dir ) == 'string' and config.root_dir or config.root_dir( buffer_path )
109114 local capabilities = vim.lsp.protocol.make_client_capabilities()
110 local cmp_capabilities = want 'cmp_nvim_lsp' ( function ( cmp )
111 return cmp.default_capabilities()
112 end, {} )
115 local cmp_capabilities = require 'cmp_nvim_lsp'.default_capabilities()
113116 capabilities = table.extend( 'force', capabilities, cmp_capabilities, config.capabilities )
114117 -- vim.print( 'lsp capabilities', capabilities, config.capabilities, cmp_capabilities )
119 -- vim.print('starting command:', config.command)
116121 local start_config = {
117122 cmd = config.command,
118123 cmd_cwd = root_dir,
130135 on_error = function ( code, ... ) vim.print( 'LSP ERROR', code, ... ) end,
131136 before_init = config.before_init,
132137 -- on_init = nil, -- should i send workspace/didChangeConfiguration here?
133 -- on_exit = function(code, signal, client_id) vim.print("LSP CLIENT EXIT", code, signal, client_id) end,
138 on_exit = function ( code, signal, client_id ) vim.print( 'LSP CLIENT EXIT', code, signal, client_id ) end,
134139 -- on_attach = function(client, bufnr) vim.print("LSP CLIENT ATTACH", client.data.client_id, bufnr) end,
135140 trace = 'off',
136141 flags = { allow_incremental_sync = true, debounce_text_changes = 250, exit_timeout = 200 },
145150 bufnr = bufnr,
146151 -- TODO: reuse if workspaces
147152 -- local supported = vim.tbl_get(client, 'server_capabilities', 'workspace', 'workspaceFolders', 'supported')
148 -- reuse_client = function ( existing_client, new_config )
149 -- --TODO lsps with single file or worksopaces support do not need smame root dir. instead add_workspace_folder
150 -- local same_name_and_root = existing_client.name == new_config.name and
151 -- existing_client.workspace_folders[1] == new_config.root_dir;
152 -- -- vim.print( 'resuing lsp client?', same_name_and_root )
153 -- return same_name_and_root;
154 -- end,
153 reuse_client = function ( existing_client, new_config )
154 -- vim.print(
155 -- 'lsp resuse client',
156 -- existing_client.name,
157 -- existing_client.workspace_folders,
158 -- new_config.name,
159 -- new_config.root_dir
160 -- )
162 --TODO lsps with single file or worksopaces support do not need smame root dir. instead add_workspace_folder
163 local same_name = existing_client.name == new_config.name
165 local new_root_raw = new_config.root_dir or nil
166 local existing_root_raw = existing_client.workspace_folders and #existing_client.workspace_folders >= 1 and
167 existing_client.workspace_folders[1].name or nil
169 if not (new_root_raw and existing_root_raw) then return false end
171 local new_root = vim.fs.normalize( new_root_raw )
172 local existing_root = vim.fs.normalize( existing_root_raw )
173 local same_root = new_root == existing_root
175 local reuse = same_name and same_root
176 -- vim.print( 'reusing lsp client?', reuse )
177 return reuse
178 end,
155179 } )
157181 -- vim.print("ATTACHING LSP CLIENT", client_id)
163187local old_tagfunc
165189local keybinds = {}
166local add = function ( keybind )
167 table.insert( keybinds, keybind )
190local add = function ( client_id, keybind )
191 if not table.contains( keybinds, client_id ) then
192 keybinds[client_id] = {}
193 end
194 table.insert( keybinds[client_id], keybind )
168195end
170197local lsp_attach = function ( args )
211238 }
212239 end
214 -- if client.server_capabilities.inlayHintProvider then
215 -- TODO: how to prevent the UI from jittering
216 -- vim.lsp.inlay_hint( bufnr, true )
217 -- end
241 if client.server_capabilities.inlayHintProvider then
242 add( map.normal {
243 description = 'Toggle inlay hints',
244 category = 'lsp',
245 buffer = bufnr,
246 keys = '<leader>ti',
247 command = function ()
248 vim.lsp.inlay_hint( bufnr, nil )
249 end,
250 } )
251 end
219 add(map.normal {
220 description = 'Format current buffer',
221 category = 'lsp',
222 buffer = bufnr,
223 keys = '<c-s>',
224 --TODO: save actions
225 command = vim.lsp.buf.format,
226 })
228 add(map.normal {
253 add( map.normal {
229254 description = 'Show hover documentation above cursor.',
230255 category = 'lsp',
231256 buffer = bufnr,
232257 keys = { 'K', '<leader>lk' },
233258 command = vim.lsp.buf.hover,
234 })
259 } )
236 add(map.normal {
261 add( map.normal {
237262 description = 'Show signature help under cursor.',
238263 category = 'lsp',
239264 buffer = bufnr,
240265 keys = '<leader>ls',
241266 command = vim.lsp.buf.signature_help,
242 })
267 } )
244 add(map.normal {
269 add( map.normal {
245270 description = 'Show available code actions on current line.',
246271 category = 'lsp',
247272 buffer = bufnr,
248273 keys = '<leader>la',
249274 command = vim.lsp.buf.code_action,
250 })
275 } )
252 add(map.normal {
277 add( map.normal {
253278 description = 'Goto to definition of symbol under cursor.',
254279 category = 'lsp',
255280 buffer = bufnr,
256281 keys = '<leader>ld',
257282 command = vim.lsp.buf.definition,
258 })
283 } )
260 add(map.normal {
285 add( map.normal {
261286 description = 'Show implementations of symbol under cursor.',
262287 category = 'lsp',
263288 buffer = bufnr,
264289 keys = '<leader>li',
265290 command = vim.lsp.buf.implementation,
266 })
291 } )
268 add(map.normal {
293 add( map.normal {
269294 description = 'Show incoming calls of symbol under cursor.',
270295 category = 'lsp',
271296 buffer = bufnr,
272297 keys = '<leader>lci',
273298 command = vim.lsp.buf.incoming_calls,
274 })
299 } )
276 add(map.normal {
301 add( map.normal {
277302 description = 'Show outgoing calls of symbol under cursor.',
278303 category = 'lsp',
279304 buffer = bufnr,
280305 keys = '<leader>lco',
281306 command = vim.lsp.buf.outgoing_calls,
282 })
307 } )
284 add(map.normal {
309 add( map.normal {
285310 description = 'Show references of symbol under cursor.',
286311 category = 'lsp',
287312 buffer = bufnr,
288313 keys = '<leader>lr',
289314 command = vim.lsp.buf.references,
290 })
315 } )
292 add(map.normal {
317 add( map.normal {
293318 description = 'Rename symbol under cursor.',
294319 category = 'lsp',
295320 buffer = bufnr,
296321 keys = { '<f2>', '<leader>ln' },
297322 command = vim.lsp.buf.rename,
298 })
323 } )
299324end
301326local lsp_detach = function ( args )
302327 -- vim.print("DETACH LSP", ...)
304329 local bufnr = args.buf
305 local client = vim.lsp.get_client_by_id( args.data.client_id )
330 local client_id = args.data.client_id
331 local client = vim.lsp.get_client_by_id( client_id )
306332 if not client then return end
308334 if client.server_capabilities.definitionProvider then
317343 vim.bo[bufnr].omnifunc = old_omnifunc
318344 end
320 for _, keybind_delete in ipairs(keybinds) do
321 keybind_delete()
346 if table.contains( keybinds, client_id ) then
347 for _, keybind_delete in ipairs( keybinds[client_id] ) do
348 keybind_delete()
349 end
322350 end
324351end
326353auto 'lsp' {
349376local lsp_info = function ( command )
350377 local all_or_current = command.args and command.args == 'all' and {} or { bufnr = 0 }
351 local active_clients = vim.lsp.get_active_clients( all_or_current )
378 local active_clients = vim.lsp.get_clients( all_or_current )
353380 local infos = vim.iter( active_clients )
354381 :map( function ( client )
393420 desc = 'Shows detailed information about running LSP clients.',
394421} )
423--TODO: lsp restart, lsp exit
396425return setmetatable( _, {} )

neovim/lua/bugabinga/mark.lua

Modified

+4 / −4 text lines

8080---@param bufnr integer
8181local function set_keymaps( bufnr )
82 vim.api.nvim_buf_set_keymap( bufnr, 'n', '<leader>m', '', {
82 vim.api.nvim_buf_set_keymap( bufnr, 'n', '<leader>ma', '', {
8383 desc = 'Add mark',
8484 callback = function ()
8585 local ok, mark = pcall( function ()
9696 end,
9797 } )
99 vim.api.nvim_buf_set_keymap( bufnr, 'n', '<leader>dm', '', {
99 vim.api.nvim_buf_set_keymap( bufnr, 'n', '<leader>md', '', {
100100 desc = 'Delete mark',
101101 callback = function ()
102102 local ok, mark = pcall( function ()
112112 end,
113113 } )
115 vim.api.nvim_buf_set_keymap( bufnr, 'n', '<leader>dM', '', {
115 vim.api.nvim_buf_set_keymap( bufnr, 'n', '<leader>mD', '', {
116116 desc = 'Delete all buffer marks',
117117 callback = function ()
118 -- NOTE: This will delete the builtin marks too, but I'll restore
118 -- This will delete the builtin marks too, but I'll restore
119119 -- them on cursor move so whatever.
120120 marks[bufnr] = {}
121121 vim.fn.sign_unplace( sign_group_name, { buffer = bufnr } )

neovim/lua/bugabinga/nugu/init.lua

Modified

+171 / −149 text lines

33local lush = require 'lush'
44local hsl = lush.hsluv
6vim.g.terminal_color_0 = palette.ui_backdrop -- black
7vim.g.terminal_color_1 = palette.content_accent -- maroon
8vim.g.terminal_color_2 = palette.info -- green
9vim.g.terminal_color_3 = palette.ui_focus -- olive
10vim.g.terminal_color_4 = palette.content_important_local -- navy
11vim.g.terminal_color_5 = palette.content_important_global -- purple
12vim.g.terminal_color_6 = palette.ui_focus -- teal
13vim.g.terminal_color_7 = palette.content_normal -- silver
15vim.g.terminal_color_8 = palette.ui_minor -- grey
16vim.g.terminal_color_9 = palette.error -- red
17vim.g.terminal_color_10 = palette.info -- lime
18vim.g.terminal_color_11 = palette.content_focus -- yellow
19vim.g.terminal_color_12 = palette.ui_important_local -- blue
20vim.g.terminal_color_13 = palette.ui_accent -- fuchsia
21vim.g.terminal_color_14 = palette.ui_important_global -- aqua
22vim.g.terminal_color_15 = palette.ui_normal -- white
624local flux = function ( color, number )
725 if vim.opt.background:get() == 'dark' then
826 return color.li( -number )
2139local content_accent = hsl( palette.content_accent )
2240local content_minor = hsl( palette.content_minor )
2341local content_focus = hsl( palette.content_focus )
24local content_unfocus = hsl( palette.content_unfocus )
42local content_unfocus = flux( hsl( palette.content_unfocus ), 33 ) -- FIXME: this change needs to go into nugu
2543local content_important_global = hsl( palette.content_important_global )
2644local content_important_local = hsl( palette.content_important_local )
3755local nugu = lush( function ( injects )
3856 local sym = injects.sym
3957 return {
40 Debug { fg = debug.readable(), bg = debug, gui = 'bold' }, -- debugging statements
58 Debug { fg = debug.readable(), bg = debug, gui = 'bold' },
4260 Normal { fg = content_normal, bg = content_backdrop },
4361 NotifyBackground { bg = ui_backdrop },
44 Comment { fg = content_important_global, gui = 'bold italic' },
45 LineNr { fg = ui_minor, bg = ui_backdrop },
62 Comment { fg = content_important_global },
63 LineNr { fg = ui_minor, bg = content_backdrop },
4664 CursorLineNr { fg = ui_focus, bg = ui_backdrop },
47 Search { fg = content_important_global.readable(), bg = content_important_global },
48 IncSearch { fg = content_important_local.readable(), bg = content_important_local },
49 NormalFloat { fg = ui_normal, bg = ui_backdrop }, -- Normal text in floating windows.
50 FloatBorder { fg = ui_accent, bg = NormalFloat.bg },
51 ColorColumn { fg = ui_important_global, bg = content_backdrop }, -- used for the columns set with 'colorcolumn'
52 Conceal { fg = content_normal, bg = ui_unfocus, gui = 'italic' }, -- placeholder characters substituted for concealed text (see 'conceallevel')
53 Cursor { bg = ui_accent }, -- character under the cursor
54 lCursor { bg = ui_accent }, -- the character under the cursor when |language-mapping| is used (see 'guicursor')
55 CursorIM { bg = ui_accent }, -- like Cursor, but used when in IME mode |CursorIM|
56 Directory { fg = Normal.fg }, -- directory names (and other special names in listings)
57 DiffAdd { fg = content_focus }, -- diff mode: Added line |diff.txt|
58 DiffDelete { fg = content_focus, gui = 'strikethrough' }, -- diff mode: Deleted line |diff.txt|
59 DiffChange { fg = content_important_global }, -- diff mode: Changed line |diff.txt|
60 DiffText { fg = content_important_local.readable(), bg = content_important_local }, -- diff mode: Changed text within a changed line |diff.txt|
61 EndOfBuffer { Normal }, -- filler lines (~) after the end of the buffer. By default, this is highlighted like |hl-NonText|.
62 TermCursor { lCursor }, -- cursor in a focused terminal
63 TermCursorNC { Cursor }, -- cursor in an unfocused terminal
64 ErrorMsg { fg = error.readable(), bg = error }, -- error messages on the command line
65 VertSplit { fg = ui_important_global, bg = content_backdrop }, -- the column separating vertically split windows
66 Folded { Conceal }, -- line used for closed folds
67 FoldColumn { Conceal }, -- 'foldcolumn'
68 SignColumn { bg = ui_backdrop }, -- column where |signs| are displayed
69 ModeMsg { gui = 'bold' }, -- 'showmode' message (e.g., "-- INSERT -- ")
70 MsgArea { Normal }, -- Area for messages and cmdline
71 MsgSeparator { fg = ui_accent }, -- Separator for scrolled messages, `msgsep` flag of 'display'
72 MoreMsg { Normal }, -- |more-prompt|
73 NonText { fg = ui_unfocus }, -- '@' at the end of the window, characters from 'showbreak' and other characters that do not really exist in the text (e.g., ">" displayed when a double-wide character doesn't fit at the end of the line). See also |hl-EndOfBuffer|.
74 NormalNC {}, -- normal text in non-current windows
75 Pmenu { NormalFloat }, -- Popup menu: normal item.
76 PmenuSel { fg = ui_focus, sp = ui_focus.readable(), bg = ui_unfocus, gui = 'underline' }, -- Popup menu: selected item.
77 PmenuSbar { bg = ui_unfocus }, -- Popup menu: scrollbar.
78 PmenuThumb { bg = ui_minor }, -- Popup menu: Thumb of the scrollbar.
79 Question { fg = ui_important_global, gui = 'bold' }, -- |hit-enter| prompt and yes/no questions
80 QuickFixLine { PmenuSel }, -- Current |quickfix| item in the quickfix window. Combined with |hl-CursorLine| when the cursor is there.
81 SpecialKey { fg = error, bg = content_unfocus, gui = 'bold' }, -- Unprintable characters: text displayed differently from what it really is. But not 'listchars' whitespace. |hl-Whitespace|
82 SpellBad { fg = error, gui = 'undercurl' }, -- Word that is not recognized by the spellchecker. |spell| Combined with the highlighting used otherwise.
83 SpellCap { SpellBad }, -- Word that should start with a capital. |spell| Combined with the highlighting used otherwise.
84 SpellLocal { SpellBad }, -- Word that is recognized by the spellchecker as one that is used in another region. |spell| Combined with the highlighting used otherwise.
85 SpellRare { SpellBad }, -- Word that is recognized by the spellchecker as one that is hardly ever used. |spell| Combined with the highlighting used otherwise.
86 StatusLine { fg = ui_normal, bg = ui_backdrop }, -- status line of current window
87 StatusLineNC { fg = ui_normal, bg = ui_unfocus }, -- status lines of not-current windows Note: if this is equal to "StatusLine" Vim will use "^^^" in the status line of the current window.
88 Winbar { StatusLine },
89 WinbarNC { StatusLineNC },
90 IndentBlanklineContextChar { fg = content_accent, gui = 'nocombine' },
91 IndentBlanklineContextStart { sp = IndentBlanklineContextChar.fg, gui = 'underline' },
92 Title { fg = content_important_global, sp = content_important_global, gui = 'bold underline' }, -- titles for output from ":set all", ":autocmd" etc.
93 TabLine { StatusLine }, -- tab pages line, not active tab page label
94 TabLineFill { bg = TabLine.bg }, -- tab pages line, where there are no labels
95 TabLineSel { fg = ui_accent.readable(), bg = ui_accent, gui = 'underline bold' }, -- tab pages line, active tab page label
96 Visual { fg = content_focus.readable(), bg = content_focus }, -- Visual mode selection
97 VisualNOS { fg = Visual.fg, bg = flux( Visual.bg, -42 ) }, -- Visual mode selection when vim is "Not Owning the Selection".
98 WarningMsg { fg = warning, gui = 'bold' }, -- warning messages
99 WhiteSpace { fg = ui_unfocus }, -- "nbsp", "space", "tab" and "trail" in 'listchars'
100 WildMenu { fg = ui_accent, gui = 'bold' }, -- current match in 'wildmenu' completion
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 = ui_accent, bg = Normal.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 },
102118 String { fg = content_important_local, gui = 'italic' },
103 Constant { String }, -- (preferred) any constant
104 Character { String }, -- a character constant: 'c', '\n'
105 Number { String }, -- a number constant: 234, 0xff
106 Boolean { String }, -- a boolean constant: TRUE, false
107 Float { String }, -- a floating point constant: 2.3e10
119 Constant { String },
120 Character { String },
121 Number { String },
122 Boolean { String },
123 Float { String },
109 Identifier { Normal }, -- (preferred) any variable name
125 Identifier { Normal },
110126 MutableVariable { Debug },
111 Function { Normal }, -- function name (also: methods for classes)
127 Function { Normal },
113 Statement { fg = content_minor }, -- (preferred) any statement
114 Conditional { Statement }, -- if, then, else, endif, switch, etc.
115 Repeat { Statement }, -- for, do, while, etc.
116 Label { Statement }, -- case, default, etc.
117 Operator { Statement }, -- "sizeof", "+", "*", etc.
118 Keyword { Statement }, -- any other keyword
119 Exception { Statement }, -- try, catch, throw
129 Statement { fg = content_minor },
130 Conditional { Statement },
131 Repeat { Statement },
132 Label { Statement },
133 Operator { Statement },
134 Keyword { Statement },
135 Exception { Statement },
121 PreProc { fg = content_important_global, bg = content_unfocus, gui = 'bold' }, -- (preferred) generic Preprocessor
122 Include { PreProc }, -- preprocessor #include
123 Define { PreProc }, -- preprocessor #define
124 Macro { PreProc }, -- same as Define
125 PreCondit { PreProc }, -- preprocessor #if, #else, #endif, etc.
137 PreProc { fg = content_important_global, bg = content_unfocus, gui = 'bold' },
138 Include { PreProc },
139 Define { PreProc },
140 Macro { PreProc },
141 PreCondit { PreProc },
127 Type { Statement }, -- (preferred) int, long, char, etc.
128 StorageClass { Statement }, -- static, register, volatile, etc.
129 Structure { Statement }, -- struct, union, enum, etc.
130 Typedef { Statement }, -- A typedef
143 Type { Statement },
144 StorageClass { Statement },
145 Structure { Statement },
146 Typedef { Statement },
132 Special { fg = content_normal, gui = 'italic bold' }, -- (preferred) any special symbol
133 SpecialChar { Special }, -- special character in a constant
134 Tag { Special }, -- you can use CTRL-] on this
135 Delimiter { fg = content_minor }, -- character that needs attention
136 SpecialComment { Special }, -- special things inside a comment
148 Special { fg = content_normal, gui = 'italic bold' },
149 SpecialChar { Special },
150 Tag { Special },
151 Delimiter { fg = content_minor },
152 SpecialComment { Special },
138 Underlined { sp = content_normal, gui = 'underline' }, -- (preferred) text that stands out, HTML links
154 Underlined { sp = content_normal, gui = 'underline' },
139155 Bold { gui = 'bold' },
140156 Italic { gui = 'italic' },
142 -- ("Ignore", below, may be invisible...)
143 Ignore { fg = Normal.bg, bg = Normal.bg }, -- (preferred) left blank, hidden |hl-Ignore|
145 Error { fg = error }, -- (preferred) any erroneous construct
158 Ignore { fg = Normal.bg, bg = Normal.bg },
160 Error { fg = error },
147161 Todo { fg = content_important_global, sp = content_important_global, gui = 'bold underdouble' },
148162 DiagnosticUnnecessary { fg = ui_focus },
149163 DiagnosticDeprecated { fg = ui_important_global, sp = ui_important_global, gui = 'strikethrough' },
170184 DiagnosticSignHint { DiagnosticHint },
171185 DiagnosticSignOk { DiagnosticOk },
173 LspReferenceText { fg = content_focus, bg = content_unfocus },
187 LspReferenceText { sp = content_unfocus, gui = 'underline' },
174188 LspReferenceRead { LspReferenceText },
175189 LspReferenceWrite { LspReferenceText },
176 LspInlayHint { fg = content_minor, bg = ui_unfocus },
178 -- hlargs.nvim
179 Hlargs { fg = ui_important_local },
190 LspInlayHint { fg = content_minor, bg = Normal.bg },
181192 -- Tree-Sitter syntax groups.
182193 --
228239 sym '@label' { Label },
229240 sym '@operator' { Operator },
230241 sym '@keyword' { Keyword },
242 sym '@keyword.return' { fg = Keyword.fg, bg = Keyword.bg, gui = 'underline bold' },
231243 sym '@exception' { Exception },
232244 sym '@variable' { Identifier },
233245 sym '@type' { Type },
255267 sym '@lsp.type.macro' { sym '@macro' },
256268 sym '@lsp.type.decorator' { sym '@function' },
258 -- lazy.nvim
259270 LazyButton { NormalFloat, sp = NormalFloat.fg, gui = 'bold' },
260271 LazyButtonActive { fg = ui_important_local.readable(), sp = NormalFloat.fg, bg = ui_important_local, gui = LazyButton
261272 .gui },
274285 LazyProgressDone { fg = Search.bg, bg = Cursor.bg, gui = 'bold' },
275286 LazyProgressTodo { fg = LazyProgressDone.bg, bg = LazyProgressDone.fg, gui = LazyProgressDone.gui },
276287 LazyProp { LazyComment },
277 LazyReasonCmd { N.fgormalFloat },
278 LazyReasonEvent { N.fgormalFloat },
279 LazyReasonFt { N.fgormalFloat },
280 LazyReasonImport { N.fgormalFloat },
281 LazyReasonKeys { N.fgormalFloat },
282 LazyReasonPlugin { N.fgormalFloat },
283 LazyReasonRuntime { N.fgormalFloat },
284 LazyReasonSource { N.fgormalFloat },
285 LazyReasonStart { N.fgormalFloat },
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 },
286297 LazySpecial { fg = ColorColumn.fg },
287298 LazyTaskError { ErrorMsg },
288299 LazyTaskOutput { Debug },
289300 LazyUrl { sp = NormalFloat.fg, gui = 'italic underline' },
290301 LazyValue { gui = 'italic' },
292 -- Noice
293 NoiceCmdline { fg = ui_focus, bg = ui_backdrop },
294 NoiceCmdlineIcon { fg = ui_accent, bg = NoiceCmdline.bg, gui = 'bold' },
303 NoiceCmdline { NormalFloat },
304 NoiceCmdlineIcon { fg = ui_accent },
295305 NoiceCmdlineIconCalculator { NoiceCmdlineIcon },
296 NoiceCmdlineIconCmdline { fg = ui_accent, bg = NoiceCmdlineIcon.bg, gui = NoiceCmdlineIcon.gui },
306 NoiceCmdlineIconCmdline { NoiceCmdlineIcon },
297307 NoiceCmdlineIconFilter { NoiceCmdlineIcon },
298308 NoiceCmdlineIconHelp { NoiceCmdlineIcon },
299309 NoiceCmdlineIconIncRename { NoiceCmdlineIcon },
339349 NoiceCompletionItemWord { NoiceCompletionItemKindDefault },
341351 NoiceConfirm { NormalFloat },
342 NoiceConfirmBorder { fg = ui_accent, bg = NormalFloat.bg },
352 NoiceConfirmBorder { FloatBorder },
343353 NoiceFormatConfirm { LazyButton },
344354 NoiceFormatConfirmDefault { LazyButtonActive },
346 NoiceCursor { Cursor },
356 -- NoiceCursor { Cursor },
348358 NoiceFormatDate { NonText },
349359 NoiceFormatEvent { NonText },
365375 NoiceMini { DiagnosticInfo },
367377 NoicePopup { NormalFloat },
368 NoicePopupBorder { fg = ui_accent, bg = NormalFloat.bg },
378 NoicePopupBorder { FloatBorder },
370380 NoicePopupmenu { Pmenu },
371 NoicePopupmenuBorder { fg = ui_accent, bg = NormalFloat.bg },
381 NoicePopupmenuBorder { FloatBorder },
372382 NoicePopupmenuMatch { Bold },
373383 NoicePopupmenuSelected { PmenuSel },
375385 NoiceScrollbar { PmenuSbar },
376386 NoiceScrollbarThumb { PmenuThumb },
378 NoiceSplit { NormalFloat },
379 NoiceSplitBorder { NoiceConfirmBorder, bg = NormalFloat.bg },
380 NoiceVirtualText { fg = ui_important_local, bg = ui_backdrop, gui = 'bold' },
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 },
382 -- Notify
383 NotifyERRORBorder { DiagnosticError, bg = NormalFloat.bg },
384 NotifyWARNBorder { DiagnosticWarn, bg = NormalFloat.bg },
385 NotifyINFOBorder { DiagnosticInfo, bg = NormalFloat.bg },
386 NotifyDEBUGBorder { fg = Debug.bg, bg = NormalFloat.bg },
387 NotifyTRACEBorder { DiagnosticHint, bg = NormalFloat.bg },
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 },
389 NotifyERRORIcon { NotifyERRORBorder },
390 NotifyWARNIcon { NotifyWARNBorder },
391 NotifyINFOIcon { NotifyINFOBorder },
392 NotifyDEBUGIcon { NotifyDEBUGBorder },
393 NotifyTRACEIcon { NotifyTRACEBorder },
395 NotifyERRORTitle { NotifyERRORBorder },
396 NotifyWARNTitle { NotifyWARNBorder },
397 NotifyINFOTitle { NotifyINFOBorder },
398 NotifyDEBUGTitle { NotifyDEBUGBorder },
399 NotifyTRACETitle { NotifyTRACEBorder },
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 },
401409 NotifyERRORBody { NormalFloat },
402410 NotifyWARNBody { NormalFloat },
407415 TelescopeSelectionCaret { PmenuSel },
408416 TelescopeSelection { PmenuSel },
409 TelescopeMultiSelection { fg = PmenuSel.fg, bg = ui_important_local },
417 TelescopeMultiSelection { fg = ui_important_local.readable(), bg = ui_important_local },
411419 FlashBackdrop {},
412 FlashMatch { bg = content_unfocus },
413 FlashCurrent { fg = content_accent, bg = content_unfocus },
414 FlashLabel { fg = Search.bg, bg = Search.fg },
420 FlashMatch { fg = Search.bg },
421 FlashCurrent { fg = IncSearch.bg },
422 FlashLabel { Search },
416 GitSignsAdd { fg = DiffAdd.fg, bg = ui_backdrop },
417 GitSignsChange { fg = DiffChange.fg, bg = ui_backdrop },
418 GitSignsDelete { fg = DiffDelete.fg, bg = ui_backdrop },
424 GitSignsAdd { fg = DiffAdd.fg, bg = LineNr.bg },
425 GitSignsChange { fg = DiffChange.fg, bg = LineNr.bg },
426 GitSignsDelete { fg = DiffDelete.fg, bg = LineNr.bg },
420428 GitSignsChangedelete { GitSignsChange },
421429 GitSignsTopdelete { GitSignsDelete },
438446 GitSignsDeletePreview { GitSignsDelete },
440448 GitSignsCurrentLineBlame { Debug },
442449 GitSignsAddInline { GitSignsAdd },
443450 GitSignsDeleteInline { GitSignsDelete },
444451 GitSignsChangeInline { GitSignsChange },
451458 GitSignsDeleteVirtLnInLine { DiffText },
452459 GitSignsVirtLnum { fg = LineNr.fg },
454 WhichKey { fg = ui_important_global }, -- the key
455 WhichKeyGroup { fg = ui_important_local }, -- a group
456 WhichKeySeparator { fg = ui_minor }, -- the separator between the key and its label
457 WhichKeyDesc { fg = ui_normal }, -- the label of the key
458 WhichKeyFloat { NormalFloat }, -- Normal in the popup window
459 WhichKeyBorder { FloatBorder }, -- Normal in the popup window
460 WhichKeyValue { Comment }, -- used by plugins that provide values
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.
461483 }
462484end )

neovim/lua/bugabinga/options/autocommands.lua

Deleted
deleted file mode 100644

+0 / −19 text lines

1local auto = require 'std.auto'
2
3auto 'highlight_yanked_text' {
4 description = 'briefly highlight yanked text',
5 events = 'TextYankPost',
6 pattern = '*',
7 command = function()
8 vim.highlight.on_yank { timeout = 500 }
9 end,
10}
12auto 'disable_colorcolumn_in_special_buffers' {
13 description = 'Hide colorcolumn in buffers, that do not show source code.',
14 events = { 'FileType' },
15 pattern = 'lazy,noice,Trouble,qf,help,toggleterm',
16 command = function()
17 vim.opt_local.colorcolumn = {}
18 end,
19}

neovim/lua/bugabinga/options/behaviour.lua

Modified

+38 / −4 text lines

1local auto = require 'std.auto'
2
13-- How many milliseconds must pass before neovim decides I was "idle"
24vim.opt.updatetime = 50
35-- How long to wait between key sequences in order to chain them. e.g. <LEADER>b
2224-- insert whitespace type based on whitespace on previous line
2325vim.opt.smarttab = true
25-- keep distance to borders while scrolling
27vim.opt.wrap = false
29-- do not keep distance to borders while scrolling
2630vim.opt.scrolloff = 0
2731vim.opt.sidescrolloff = 0
5054vim.opt.shellquote = ''
5155vim.opt.shellxquote = ''
53require'bugabinga.health'.add_dependency
57require 'bugabinga.health'.add_dependency
55 name = 'Nushell',
56 name_of_executable = 'nu'
59 name = 'Nushell',
60 name_of_executable = 'nu'
5963-- highlight all search matches
7276vim.opt.grepprg = 'rg --hidden --vimgrep --no-heading --smart-case --'
7377vim.opt.grepformat = '%f:%l:%c:%m'
79require 'bugabinga.health'.add_dependency
80{
81 name = 'Ripgrep',
82 name_of_executable = 'rg'
83}
7585-- ask me to force failed commands
7686vim.opt.confirm = true
88auto 'load_project_if_available' {
89 description = 'Loads the project root dir as cwd, if it can be determined from a file path.',
90 events = { 'FileType' },
91 pattern = '*',
92 command = function ( event )
93 local project = require 'std.project'
94 local ignored = require 'std.ignored'
95 local table = require 'std.table'
96 local buffer = event.buf
97 local file = event.file
98 local filetype = vim.api.nvim_buf_get_option( buffer, 'filetype' )
99 if table.contains( ignored.filetypes, filetype ) then return end
100 local buftype = vim.api.nvim_buf_get_option( buffer, 'buftype' )
101 if table.contains( ignored.buftypes, buftype ) then return end
102 local root = project.find_root_by_filetype( file, filetype )
103 local cwd = vim.uv.cwd()
104 if root and cwd ~= root then
105 vim.uv.chdir( root )
106 vim.notify( 'Changed root directory to ' .. root )
107 -- vim.print( buffer, file, vim.inspect( filetype ), vim.inspect( buftype ) )
108 end
109 end,
110}

neovim/lua/bugabinga/options/init.lua

Modified

+0 / −1 text lines

44require 'bugabinga.options.ui'
55require 'bugabinga.options.file'
66require 'bugabinga.options.keymaps'
7require 'bugabinga.options.autocommands'
98-- disable some runtime providers that i will not use.
109-- keeps checkhealth clean

neovim/lua/bugabinga/options/keymaps.lua

Modified

+132 / −108 text lines

11local map = require 'std.map'
2local want = require 'std.want'
2local togglers = require 'bugabinga.options.togglers'
44-- set <SPACE> as leader key
55map {
6 keys = '<space>',
7 command = '<nop>',
6 keys = '<space>',
7 command = '<nop>',
88}
1010vim.g.mapleader = ' '
1313-- disable default ENTER binding
1414map {
15 keys = '<enter>',
16 command = '<nop>',
15 keys = '<enter>',
16 command = '<nop>',
1919-- insert newline under or above in normal mode
2020map.normal {
21 description = 'Insert newline under cursor',
22 category = 'editing',
23 keys = '<C-enter>',
24 command = function()
25 local current_buffer = 0
26 local current_line = vim.api.nvim_win_get_cursor(current_buffer)[1]
27 local strict_indexing = false
28 local newline = { '' }
29 vim.api.nvim_buf_set_lines(current_buffer, current_line, current_line, strict_indexing, newline)
30 end,
21 description = 'Insert newline under cursor',
22 category = 'editing',
23 keys = '<C-enter>',
24 command = function ()
25 local current_buffer = 0
26 local current_line = vim.api.nvim_win_get_cursor( current_buffer )[1]
27 local strict_indexing = false
28 local newline = { '' }
29 vim.api.nvim_buf_set_lines( current_buffer, current_line, current_line, strict_indexing, newline )
30 end,
3333map.normal {
34 description = 'Insert newline above cursor',
35 category = 'editing',
36 keys = '<C-S-enter>',
37 command = function()
38 local current_buffer = 0
39 local current_line = vim.api.nvim_win_get_cursor(current_buffer)[1] - 1
40 local strict_indexing = false
41 local newline = { '' }
42 vim.api.nvim_buf_set_lines(current_buffer, current_line, current_line, strict_indexing, newline)
43 end,
34 description = 'Insert newline above cursor',
35 category = 'editing',
36 keys = '<C-S-enter>',
37 command = function ()
38 local current_buffer = 0
39 local current_line = vim.api.nvim_win_get_cursor( current_buffer )[1] - 1
40 local strict_indexing = false
41 local newline = { '' }
42 vim.api.nvim_buf_set_lines( current_buffer, current_line, current_line, strict_indexing, newline )
43 end,
4646-- disable command history keymap, because i fatfinger it too often
4747map {
48 keys = 'q:',
49 command = '<nop>',
48 keys = 'q:',
49 command = '<nop>',
5252map {
53 keys = 'Q:',
54 command = '<nop>',
53 keys = 'Q:',
54 command = '<nop>',
5757map {
58 keys = 'q/',
59 command = '<nop>',
58 keys = 'q/',
59 command = '<nop>',
6262map {
63 keys = 'Q',
64 command = '<nop>',
63 keys = 'Q',
64 command = '<nop>',
6767-- disable them evil arrows
6868map {
69 keys = '<up>',
70 command = '<nop>',
69 keys = '<up>',
70 command = '<nop>',
7373map {
74 keys = '<down>',
75 command = '<nop>',
74 keys = '<down>',
75 command = '<nop>',
7878map {
79 keys = '<left>',
80 command = '<nop>',
79 keys = '<left>',
80 command = '<nop>',
8383map {
84 keys = '<right>',
85 command = '<nop>',
84 keys = '<right>',
85 command = '<nop>',
8888-- system clipboard copy and paste
8989map.normal.visual {
90 description = 'yank into system clipboard',
91 category = 'editing',
92 keys = '<leader>y',
93 command = '"+y',
94}
96map.normal.visual {
97 description = 'yank line into system clipboard',
98 category = 'editing',
99 keys = '<leader>yy',
100 command = '"+Y',
101}
103map.normal.visual {
104 description = 'paste before from system clipboard',
105 category = 'editing',
106 keys = '<leader>p',
107 command = '"+p',
108}
110map.normal.visual {
111 description = 'paste after from system clipboard',
112 category = 'editing',
113 keys = '<leader>P',
114 command = '"+P',
90 description = 'system clipboard motion',
91 category = 'editing',
92 keys = '<c-v>',
93 command = '"+',
11796map.insert {
118 description = 'Cycle through autocomplete popup',
119 category = 'editing',
120 keys = '<tab>',
121 options = { expr = true },
122 command = function() return vim.fn.pumvisible() == 1 and '<C-n>' or '<tab>' end,
97 description = 'Cycle through autocomplete popup',
98 category = 'editing',
99 keys = '<tab>',
100 options = { expr = true },
101 command = function () return vim.fn.pumvisible() == 1 and '<C-n>' or '<tab>' end,
125104local host = vim.uv.os_gethostname()
126105local browser = host == 'PC-00625' and 'chrome' or 'firefox'
127106local function open_link_under_cursor()
128 ---@diagnostic disable-next-line: missing-parameter
129 local file_under_cursor = vim.fn.expand '<cfile>'
130 --check that it vaguely resembles an URI
131 if file_under_cursor and file_under_cursor:match '%a+://.+' then
132 local Job = require 'plenary.job'
133 local job = Job:new {
134 command = browser,
135 args = { file_under_cursor },
136 on_exit = function()
137 vim.notify('Openend ' .. file_under_cursor)
138 end,
139 }
140 job:start()
141 end
107 ---@diagnostic disable-next-line: missing-parameter
108 local file_under_cursor = vim.fn.expand '<cfile>'
109 --check that it vaguely resembles an URI
110 ---@diagnostic disable-next-line: param-type-mismatch
111 if file_under_cursor and file_under_cursor:match '%a+://.+' then
112 vim.system(
113 ---@diagnostic disable-next-line: assign-type-mismatch
114 { 'firefox', file_under_cursor },
115 { text = true },
116 function ( completed )
117 if completed.code == 0 then
118 vim.notify( 'Openend ' .. file_under_cursor )
119 else
120 error( 'Failed to open ' .. file_under_cursor .. ' because: ' .. completed.stderr )
121 end
122 end
123 )
124 end
142125end
144127map.normal {
145 description = 'Open web link under cursor in browser',
146 category = 'navigation',
147 keys = 'gx',
148 command = open_link_under_cursor,
128 description = 'Open web link under cursor in browser',
129 category = 'navigation',
130 keys = 'gx',
131 command = open_link_under_cursor,
151134map.normal {
152 description = 'Dismiss current search highlight',
153 category = 'search',
154 keys = '<esc><esc>',
155 command = function() vim.cmd [[ nohlsearch ]] end,
135 description = 'Grep search for word under cursor',
136 category = 'search',
137 keys = 'gw',
138 command = '<cmd>grep <cword> . <cr>',
158141map.normal {
159 description = 'Toggle dark/light theme variant',
160 category = 'ui',
161 keys = '<leader>tt',
162 command = function()
163 if vim.opt.background:get() == 'dark' then
164 vim.opt.background = 'light'
165 else
166 vim.opt.background = 'dark'
167 end
168 vim.notify('Toggled background to ' .. vim.opt.background:get() .. '.')
169 end,
142 description = 'Dismiss current search highlight',
143 category = 'search',
144 keys = '<esc><esc>',
145 command = function () vim.cmd [[ nohlsearch ]] end,
146}
148map.normal {
149 description = 'Toggle dark/light theme variant',
150 category = 'ui',
151 keys = '<leader>tt',
152 command = function ()
153 if vim.opt.background:get() == 'dark' then
154 vim.opt.background = 'light'
155 else
156 vim.opt.background = 'dark'
157 end
158 vim.notify( 'Toggled background to ' .. vim.opt.background:get() .. '.' )
159 end,
172162map.insert {
173 description = 'Exit normal mode',
174 category = 'vim',
175 keys = 'jj',
176 command = '<C-c>',
163 description = 'Exit normal mode',
164 category = 'vim',
165 keys = 'jj',
166 command = '<C-c>',
179169map.normal {
189179 keys = 'U',
190180 command = vim.cmd.redo,
183map.normal {
184 description = 'Run save actions',
185 category = 'edit',
186 keys = '<c-s>',
187 command = function ()
188 -- trim
189 vim.cmd 'TrimTrailingWhitespace'
191 -- format
192 vim.lsp.buf.format { async = false }
194 -- TODO: run makeprg
195 vim.cmd [[silent make]]
197 -- save
198 vim.cmd [[wa]]
200 -- workaround for neovim bug:https://github.com/neovim/neovim/issues/25370
201 vim.api.nvim_feedkeys( 'zz', 'n', true )
202 end,
203}
205for _, toggler in ipairs( togglers ) do
206 local option_name = toggler.options[1].name
207 local first_char = string.sub( option_name, 1, 1 )
209 map.normal {
210 description = 'Toggle ' .. option_name .. ' option',
211 category = 'options',
212 keys = '<leader>to' .. first_char,
213 command = function () toggler:toggle() end,
214 }
215end

neovim/lua/bugabinga/options/togglers.lua

Modified

+50 / −50 text lines

1local icon = require'std.icon'
1local icon = require 'std.icon'
3local _ = {}
3local togglers = {}
55local toggle_on_icon = icon.toggle_on
66local toggle_off_icon = icon.toggle_off
8local get_option = function ( name ) return vim.api.nvim_get_option_value( name, {} ) end
9local set_option = function ( name, value ) vim.api.nvim_set_option_value( name, value, {} ) end
9local get_option = function(name) return vim.api.nvim_get_option_value(name, {}) end
10local set_option = function(name, value) vim.api.nvim_set_option_value(name, value, {}) end
12local toggle = function(self)
13 vim.iter(self.options)
14 :each(function(option)
15 local current_value = get_option(option.name)
16 if current_value == option.default then
17 set_option(option.name, option.alternative)
18 vim.notify( self.display_name .. ' ' .. toggle_on_icon )
19 else
20 set_option(option.name, option.default)
21 vim.notify( self.display_name .. ' ' .. toggle_off_icon )
22 end
23 end)
11local toggle = function ( self )
12 vim.iter( self.options )
13 :each( function ( option )
14 local current_value = get_option( option.name )
15 if current_value == option.default then
16 set_option( option.name, option.alternative )
17 vim.notify( self.display_name .. ' ' .. toggle_on_icon )
18 else
19 set_option( option.name, option.default )
20 vim.notify( self.display_name .. ' ' .. toggle_off_icon )
21 end
22 end )
2423end
26local toggler_tostring = function(self)
27 local all_default = vim.iter(self.options)
28 :all(function(option) return get_option(option.name) == option.default end)
29 return self.display_name .. ' ' .. ( all_default and toggle_off_icon or toggle_on_icon )
25local toggler_tostring = function ( self )
26 local all_default = vim.iter( self.options )
27 :all( function ( option ) return get_option( option.name ) == option.default end )
28 return self.display_name .. ' ' .. (all_default and toggle_off_icon or toggle_on_icon)
3029end
32local make_toggler = function( display_name, options)
33 return {
34 display_name = display_name,
35 options = options,
36 toggle = toggle,
37 tostring = toggler_tostring,
38 }
31local make_toggler = function ( display_name, options )
32 return {
33 display_name = display_name,
34 options = options,
35 toggle = toggle,
36 tostring = toggler_tostring,
37 }
3938end
41local make_option = function (name, alternative)
42 local option_value = get_option(name)
43 alternative = alternative or not option_value
44 return {
45 name = name,
46 default = option_value,
47 alternative = alternative,
48 }
40local make_option = function ( name, alternative )
41 local option_value = get_option( name )
42 alternative = alternative or not option_value
43 return {
44 name = name,
45 default = option_value,
46 alternative = alternative,
47 }
4948end
51local add_toggler = function( display_name, togglers )
52 table.insert(_, make_toggler(display_name, togglers ))
50local add_toggler = function ( display_name, options )
51 table.insert( togglers, make_toggler( display_name, options ) )
5352end
55add_toggler(icon.spelling, { make_option'spell' } )
56add_toggler(icon.linenumber, { make_option'number', make_option'relativenumber'})
57add_toggler(icon.linehighlight, { make_option'cursorline'} )
54add_toggler( icon.spelling, { make_option 'spell' } )
55add_toggler( icon.linenumber, { make_option 'number', make_option 'relativenumber' } )
56add_toggler( icon.linehighlight, { make_option 'cursorline' } )
57add_toggler( icon.virtual, { make_option ('virtualedit', 'all') } )
59local tostring = function(self)
60 return vim.iter(self)
61 :map(toggler_tostring)
62 :fold('', function(buffer, text)
63 return buffer .. (buffer == '' and '' or ' ' ) .. text
64 end)
59local tostring = function ( self )
60 return vim.iter( self )
61 :map( toggler_tostring )
62 :fold( '', function ( buffer, text )
63 return buffer .. (buffer == '' and '' or ' ') .. text
64 end )
6565end
67return setmetatable(_,{
68 __tostring = tostring,
69})
67return setmetatable( togglers, {
68 __tostring = tostring,
69} )

neovim/lua/bugabinga/options/ui.lua

Modified

+73 / −14 text lines

1local icon = require'std.icon'
1local icon = require 'std.icon'
2local auto = require 'std.auto'
3local ignored = require 'std.ignored'
4
5auto 'highlight_yanked_text' {
6 description = 'briefly highlight yanked text',
7 events = 'TextYankPost',
8 pattern = '*',
9 command = function () vim.highlight.on_yank() end,
10}
12auto 'disable_columns_in_special_buffers' {
13 description = 'Hide columns in buffers, that do not show source code.',
14 events = { 'FileType' },
15 pattern = ignored.filetypes,
16 command = function ()
17 vim.opt_local.colorcolumn = {}
18 vim.opt_local.signcolumn = 'no'
19 vim.opt_local.foldcolumn = '0'
20 vim.opt_local.number = false
21 end,
22}
24-- TODO: this should probably live in nugu?
26-- local hl_to_mode = {
27-- n = { bg = 'black' },
28-- i = { bg = 'blue' },
29-- v = { bg = 'green' },
30-- }
31--
32-- auto 'change_cursor_highlight_based_on_mode' {
33-- description = 'Changes the highlight of the cursor based on the current mode.',
34-- events = 'ModeChanged',
35-- command = function ()
36-- local current_mode = vim.fn.mode()
37-- local hl = hl_to_mode[current_mode]
38-- vim.notify( 'changing Cursor highlight for mode ' .. current_mode .. ' to ' .. vim.inspect( hl ) )
39-- if hl then
40-- vim.api.nvim_set_hl( 0, 'Cursor', hl )
41-- end
42-- end,
43-- }
345-- show trailing whitespace
446vim.opt.list = true
3173-- hide weird symbol at end of buffer
3274vim.opt.fillchars = {
3375 eob = ' ',
34 fold = ' ',
76 lastline = ' ',
3577 diff = '╱',
78 wbr = ' ',
80 horiz = '─',
81 horizup = '┴',
82 horizdown = '┬',
83 vert = '│',
84 vertleft = '┤',
85 vertright = '├',
86 verthoriz = '┼',
3889-- better have no syntax highlighting than regex based, treesitter will take over later
4192-- hide output of insert completion popup in status
4293vim.opt.shortmess:append 'c'
94-- hide vim intro screen
95vim.opt.shortmess:append 'I'
4497-- show cmd window to prevent jitter ui
4598vim.opt.cmdheight = 1
60113vim.opt.pumheight = 10
62115-- transparent popups and floating windows
63vim.opt.pumblend = 8
116vim.opt.pumblend = 0
64117vim.opt.winblend = 0
66119vim.g.border_style = 'shadow'
69122vim.opt.showmode = false
71124-- always show tabs, to avoid jitter ui
72vim.opt.showtabline = 1
125vim.opt.showtabline = 2
74127-- Use true colors
75128vim.opt.termguicolors = true
76129vim.opt.lazyredraw = false
131-- scroll by screen lines if buffer is wrapped
132vim.opt.smoothscroll = true
78134-- cursor
79135vim.opt.guicursor = 'n-v-c-sm:block-Cursor,i-ci-ve:ver25-blinkon250,r-cr:hor20,o:hor50'
81137-- font
82vim.opt.guifont = 'BlexMono_Nerd_Font:h14:#e-subpixelantialias:#h-none'
138vim.opt.guifont = 'BlexMono_Nerd_Font:h13:#e-subpixelantialias:#h-full'
139-- NOTE: neovide font config is not as powerful as wezterm right now
140-- characters for box drawing do not seem to line up. try different font for now?
141vim.opt.linespace = -3
84143-- neovide only options
85144if vim.g.neovide then
86 vim.g.neovide_floating_blur_amount_x = 8.0
87 vim.g.neovide_floating_blur_amount_y = 4.0
88 vim.g.neovide_scroll_animation_length = 0.42
145 -- vim.g.neovide_floating_blur_amount_x = 12.0
146 -- vim.g.neovide_floating_blur_amount_y = 12.0
147 -- vim.g.neovide_scroll_animation_length = 0.69
89148 -- vim.g.neovide_fullscreen = true
90149 vim.g.neovide_remember_window_size = true
91150 vim.g.neovide_profiler = false
92 vim.g.neovide_cursor_animation_length = 0.11
93 vim.g.neovide_cursor_trail_length = 1.69
94 vim.g.neovide_cursor_vfx_mode = 'pixiedust'
95 vim.g.neovide_cursor_unfocused_outline_width = 0.125
151 -- vim.g.neovide_cursor_animation_length = 0.42
152 -- vim.g.neovide_cursor_trail_length = 0.42
153 vim.g.neovide_cursor_vfx_mode = 'railgun'
154 -- vim.g.neovide_cursor_unfocused_outline_width = 0.125
96155 vim.g.neovide_cursor_antialiasing = true
97156 vim.g.neovide_padding_top = 0
98157 vim.g.neovide_padding_bottom = 0
99 vim.g.neovide_padding_right = 1
100 vim.g.neovide_padding_left = 1
158 vim.g.neovide_padding_right = 0
159 vim.g.neovide_padding_left = 0
101160 vim.g.neovide_hide_mouse_when_typing = true
102161 vim.g.neovide_theme = 'auto'
103162 vim.g.neovide_refresh_rate = vim.uv.os_gethostname() == 'pop-os' and 144 or 60

neovim/lua/bugabinga/plugins/align.lua

Added
new file mode 100644

+8 / −0 text lines

1return {
2 'echasnovski/mini.align',
3 lazy = false,
4 config = function ()
5 local align = require 'mini.align'
6 align.setup()
7 end,
8}

neovim/lua/bugabinga/plugins/autopairs.lua

Modified

+16 / −4 text lines

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

neovim/lua/bugabinga/plugins/bracketed.lua

Added
new file mode 100644

+5 / −0 text lines

1return {
2 'echasnovski/mini.bracketed',
3 lazy = false,
4 opts = {},
5}

neovim/lua/bugabinga/plugins/cmp.lua

Modified

+41 / −30 text lines

66 dependencies = {
77 'hrsh7th/cmp-buffer',
88 'hrsh7th/cmp-nvim-lsp',
9 'hrsh7th/cmp-cmdline',
109 'hrsh7th/cmp-path',
10 'hrsh7th/cmp-nvim-lsp-document-symbol',
11 'hrsh7th/cmp-nvim-lsp-signature-help',
12 'hrsh7th/cmp-emoji',
1113 { 'L3MON4D3/LuaSnip', version = '2.*', build = 'make install_jsregexp' },
1214 'saadparwaiz1/cmp_luasnip',
1315 'rafamadriz/friendly-snippets',
2123 require 'luasnip.loaders.from_vscode'.lazy_load()
2325 cmp.setup {
26 performance = {
27 debounce = 150,
28 throttle = 300,
29 fetching_timeout = 400,
30 },
2431 completion = {
2532 autocomplete = false,
2633 completeopt = 'menu,menuone,preview,noselect',
2734 },
35 window = {
36 completion = cmp.config.window.bordered(),
37 documentation = cmp.config.window.bordered(),
38 },
2839 formatting = {
2940 format = lspkind.cmp_format {
3041 mode = 'symbol',
3243 ellipsis_char = '…',
3344 },
3445 },
46 -- experimental = { ghost_text = true, },
47 preselect = cmp.PreselectMode.None,
3548 snippet = { expand = function ( args ) luasnip.lsp_expand( args.body ) end },
3649 mapping = {
3750 ['<c-p>'] = cmp.mapping.select_prev_item(),
3851 ['<c-n>'] = cmp.mapping.select_next_item(),
3952 ['<c-k>'] = cmp.mapping.select_prev_item(),
4053 ['<c-j>'] = cmp.mapping.select_next_item(),
41 ['<s-tab>'] = cmp.mapping.select_prev_item(),
42 ['<tab>'] = cmp.mapping.select_next_item(),
54 ['<tab>'] = cmp.mapping( function ( fallback )
55 if cmp.visible() then
56 cmp.select_next_item()
57 elseif luasnip.expand_or_locally_jumpable() then
58 luasnip.expand_or_jump()
59 else
60 fallback()
61 end
62 end, { 'i', 's' } ),
63 ['<s-tab>'] = cmp.mapping( function ( fallback )
64 if cmp.visible() then
65 cmp.select_prev_item()
66 elseif luasnip.locally_jumpable( -1 ) then
67 luasnip.jump( -1 )
68 else
69 fallback()
70 end
71 end, { 'i', 's' } ),
4372 ['<c-b>'] = cmp.mapping.scroll_docs( -2 ),
4473 ['<c-f>'] = cmp.mapping.scroll_docs( 2 ),
4574 ['<c-u>'] = cmp.mapping.scroll_docs( -4 ),
4675 ['<c-d>'] = cmp.mapping.scroll_docs( 4 ),
4776 ['<c-space>'] = cmp.mapping.complete {},
4877 ['<esc>'] = cmp.mapping.abort(),
49 ['<cr>'] = cmp.mapping.confirm { select = false }
78 ['<cr>'] = cmp.mapping.confirm {
79 behaviour = cmp.ConfirmBehavior.Replace,
80 select = true,
81 }
5082 },
5183 sources = cmp.config.sources {
52 { name = 'luasnip' },
84 { name = 'nvim_lsp_signature_help' },
5385 { name = 'nvim_lsp' },
54 { name = 'buffer' },
86 { name = 'nvim_lsp_document_symbol' },
87 { name = 'luasnip' },
5588 { name = 'path' },
89 { name = 'emoji' },
90 { name = 'buffer', keyword_length = 3 },
5691 }
5792 }
65100 { name = 'path' },
66101 }
67102 } )
69 cmp.setup.cmdline( '/', {
70 mapping = cmp.mapping.preset.cmdline(),
71 sources = {
72 { name = 'buffer' }
73 }
74 } )
76 cmp.setup.cmdline( '?', {
77 mapping = cmp.mapping.preset.cmdline(),
78 sources = {
79 { name = 'buffer' }
80 }
81 } )
83 cmp.setup.cmdline( ':', {
84 mapping = cmp.mapping.preset.cmdline(),
85 sources = cmp.config.sources {
86 { name = 'path' }
87 },
88 {
89 { name = 'cmdline' }
90 }
91 } )
92103 end,

neovim/lua/bugabinga/plugins/colors.lua

Added
new file mode 100644

+5 / −0 text lines

1return {
2 'echasnovski/mini.colors',
3 lazy = false,
4 opts = {},
5}

neovim/lua/bugabinga/plugins/gen.lua

Added
new file mode 100644

+8 / −0 text lines

1return {
2 'David-Kunz/gen.nvim',
3 cmd = 'Gen',
4 config = function ()
5 local gen = require 'gen'
6 gen.model = 'kathy'
7 end
8}

neovim/lua/bugabinga/plugins/genghis.lua

Modified

+4 / −74 text lines

11return {
2 {
3 'chrisgrieser/nvim-genghis',
4 dependencies = {
5 'stevearc/dressing.nvim',
6 'hrsh7th/nvim-cmp',
7 'hrsh7th/cmp-omni',
8 'anuvyklack/hydra.nvim',
9 },
10 keys = { '<leader>g' },
11 cmd = {
12 'New',
13 'Duplicate',
14 'NewFromSelection',
15 'Rename',
16 'Move',
17 'Trash',
18 'CopyFilename',
19 'CopyFilepath',
20 'Chmodx',
21 },
22 config = function ()
23 local genghis = require 'genghis'
24 local cmp = require 'cmp'
25 local hydra = require 'hydra'
27 cmp.setup.filetype( 'DressingInput', {
28 sources = cmp.config.sources { { name = 'omni' } },
29 } )
31 local hint = [[
32^ Ghenigs
33^
34_yp_ copy filepath
35_yn_ copy filename
36_cx_ set executable permission
37_rf_ rename file
38_mf_ move and rename file
39_nf_ create new file
40_df_ duplicate file
41_tf_ trash file
42_ms_ move selection to new file
43^
44_<esc>_ quit
45]]
47 hydra {
48 name = 'Genghis',
49 hint = hint,
50 config = {
51 color = 'teal',
52 invoke_on_body = true,
53 buffer = true,
54 hint = {
55 type = 'window',
56 border = vim.g.border_style,
57 position = 'middle',
58 }
59 },
60 mode = { 'n', 'x' },
61 body = '<leader>g',
62 heads = {
63 { 'yp', genghis.copyFilepath, },
64 { 'yn', genghis.copyFilename, },
65 { 'cx', genghis.chmodx, },
66 { 'rf', genghis.renameFile, },
67 { 'mf', genghis.moveAndRenameFile, },
68 { 'nf', genghis.createNewFile, },
69 { 'df', genghis.duplicateFile, },
70 { 'tf', genghis.trashFile, },
71 { 'ms', genghis.moveSelectionToNewFile },
72 { '<esc>', nil },
73 },
74 }
75 end,
2 'chrisgrieser/nvim-genghis',
3 lazy = false,
4 dependencies = {
5 'stevearc/dressing.nvim',
766 },
777}

neovim/lua/bugabinga/plugins/gitsigns.lua

Modified

+153 / −4 text lines

1local map = require 'std.map'
2
13return {
2 'lewis6991/gitsigns.nvim',
3 -- branch='main',
4 event = 'VeryLazy',
5 opts = {},
4 'lewis6991/gitsigns.nvim',
5 event = 'VeryLazy',
6 opts = {
7 signs = {
8 add = { text = '│' },
9 change = { text = '│' },
10 delete = { text = '_' },
11 topdelete = { text = '‾' },
12 changedelete = { text = '~' },
13 untracked = { text = '┆' },
14 },
15 preview_config = {
16 border = vim.g.border_style,
17 },
18 current_line_blame = true,
19 current_line_blame_opts = {
20 ignore_whitespace = true,
21 },
22 current_line_blame_formatter = '<author>(<author_time:%d.%m.%Y>): <summary>',
23 on_attach = function ( bufnr )
24 local gitsigns = require 'gitsigns'
26 map.normal {
27 description = 'Goto next hunk',
28 category = 'git',
29 keys = ']h',
30 buffer = bufnr,
31 command = gitsigns.next_hunk,
32 }
34 map.normal {
35 description = 'Goto previous hunk',
36 category = 'git',
37 keys = '[h',
38 buffer = bufnr,
39 command = gitsigns.prev_hunk,
40 }
42 map.normal {
43 description = 'Stage hunk',
44 category = 'git',
45 keys = '<leader>hs',
46 buffer = bufnr,
47 command = gitsigns.stage_hunk,
48 }
50 map.visual_select {
51 description = 'Stage hunk',
52 category = 'git',
53 keys = '<leader>hs',
54 buffer = bufnr,
55 command = function () gitsigns.stage_hunk { vim.fn.line '.', vim.fn.line 'v' } end,
56 }
58 map.normal {
59 description = 'Reset hunk',
60 category = 'git',
61 keys = '<leader>hr',
62 buffer = bufnr,
63 command = gitsigns.reset_hunk,
64 }
66 map.visual_select {
67 description = 'Reset hunk',
68 category = 'git',
69 keys = '<leader>hr',
70 buffer = bufnr,
71 command = function () gitsigns.reset_hunk { vim.fn.line '.', vim.fn.line 'v' } end,
72 }
74 map.normal {
75 description = 'Undo stage hunk',
76 category = 'git',
77 keys = '<leader>hu',
78 buffer = bufnr,
79 command = gitsigns.undo_stage_hunk,
80 }
82 map.normal {
83 description = 'Stage buffer',
84 category = 'git',
85 keys = '<leader>hS',
86 buffer = bufnr,
87 command = gitsigns.stage_buffer,
88 }
90 map.normal {
91 description = 'Reset buffer',
92 category = 'git',
93 keys = '<leader>hR',
94 buffer = bufnr,
95 command = gitsigns.reset_buffer,
96 }
98 map.normal {
99 description = 'Preview hunk',
100 category = 'git',
101 keys = '<leader>hp',
102 buffer = bufnr,
103 command = gitsigns.preview_hunk,
104 }
106 map.normal {
107 description = 'Blame line',
108 category = 'git',
109 keys = '<leader>hb',
110 buffer = bufnr,
111 command = function () gitsigns.blame_line { full = true } end,
112 }
114 map.normal {
115 description = 'Diff this',
116 category = 'git',
117 keys = '<leader>hd',
118 buffer = bufnr,
119 command = gitsigns.diffthis,
120 }
122 map.normal {
123 description = 'Diff this ~',
124 category = 'git',
125 keys = '<leader>hD',
126 buffer = bufnr,
127 command = function () gitsigns.diffthis '~' end,
128 }
130 map.normal {
131 description = 'Toggle current line blame',
132 category = 'git',
133 keys = '<leader>tb',
134 buffer = bufnr,
135 command = gitsigns.toggle_current_line_blame,
136 }
138 map.normal {
139 description = 'Toggle deleted',
140 category = 'git',
141 keys = '<leader>td',
142 buffer = bufnr,
143 command = gitsigns.toggle_deleted,
144 }
146 map.operator_pending.visual {
147 description = 'select hunk',
148 category = 'git',
149 keys = 'ih',
150 buffer = bufnr,
151 command = ':<C-U>Gitsigns select_hunk<CR>'
152 }
153 end,
154 }

neovim/lua/bugabinga/plugins/inc-rename.lua

Deleted
deleted file mode 100644

+0 / −13 text lines

1return {
2 'smjonas/inc-rename.nvim',
3 cmd = 'IncRename',
4 keys = { {
5 '<F2>',
6 function()
7 return ':IncRename ' .. vim.fn.expand('<cword>')
8 end,
9 desc = 'lsp: Rename symbol under cursor with live preview',
10 expr = true,
11 } },
12 opts = {},
13}

neovim/lua/bugabinga/plugins/indent_blankline.lua

Modified

+16 / −12 text lines

1return {
2 "lukas-reineke/indent-blankline.nvim" ,
3 event = { 'BufReadPost', 'BufNew' },
4 config = function()
5 local indent_blankline = require'indent_blankline'
1local icon = require'std.icon'
7 indent_blankline.setup {
8 space_char_blankline = " ",
9 show_current_context = true,
10 show_current_context_start = true,
11 show_trailing_blankline_indent = false,
12 }
13 end,
3return {
4 'lukas-reineke/indent-blankline.nvim',
5 main = 'ibl',
6 event = { 'BufReadPost', 'BufNew' },
7 config = function ()
8 local ibl = require 'ibl'
9
10 ibl.setup {
11 debounce = 250,
12 indent = {
13 char = icon.vertical_bar,
14 tab_char = icon.vertical_bar,
15 },
16 }
17 end,

neovim/lua/bugabinga/plugins/lush.lua

Modified

+3 / −3 text lines

44 branch = 'main',
55 lazy = false,
66 priority = 1000,
7 config = function()
8 vim.cmd.colorscheme 'nugu'
9 end,
7 config = function ()
8 vim.cmd.colorscheme 'nugu'
9 end,
1010 },

neovim/lua/bugabinga/plugins/mason.lua

Modified

+1 / −1 text lines

11return {
22 "williamboman/mason.nvim",
33 -- needs to be loaded early, so that LSP can find programs in PATH
4 lazy = false,
4 -- lazy = false,
55 cmd = { 'Mason', 'MasonUpdate', 'MasonInstall', 'MasonUninstall', 'MasonUninstallAll', 'MasonLog' },
66 opts = {
77 ui = {

neovim/lua/bugabinga/plugins/mkdir.lua

Added
new file mode 100644

+4 / −0 text lines

1return {
2 'jghauser/mkdir.nvim',
3 lazy = false,
4}

neovim/lua/bugabinga/plugins/multicursors.lua

Deleted
deleted file mode 100644

+0 / −27 text lines

1return {
2 'smoka7/multicursors.nvim',
3 event = 'VeryLazy',
4 dependencies = {
5 'nvim-treesitter/nvim-treesitter',
6 'anuvyklack/hydra.nvim',
7 },
8 opts = {
9 hint_config = {
10 border = vim.g.border_style,
11 },
12 generate_hints = {
13 normal = true,
14 insert = false,
15 extend = false,
16 }
17 },
18 cmd = { 'MCstart', 'MCvisual', 'MCclear', 'MCpattern', 'MCvisualPattern', 'MCunderCursor' },
19 keys = {
20 {
21 mode = { 'v', 'n' },
22 '<c-n>',
23 '<cmd>MCstart<cr>',
24 desc = 'Create a selection for selected text or word under the cursor',
25 },
26 },
27}

neovim/lua/bugabinga/plugins/neoclip.lua

Modified

+22 / −22 text lines

1local map = require'std.map'
1local map = require 'std.map'
33return {
4 'AckslD/nvim-neoclip.lua',
5 event = 'TextYankPost',
6 keys = {'y', '<C-v><C-v>' },
7 dependencies = {
8 'nvim-telescope/telescope.nvim',
9 },
10 config = function()
11 local neoclip = require'neoclip'
12 local telescope = require'telescope'
13 local themes = require 'telescope.themes'
14 local cursor = themes.get_cursor { layout_config = { preview_width = 0.42, width = 0.69 } }
4 'AckslD/nvim-neoclip.lua',
5 event = 'TextYankPost',
6 keys = { 'y', '<C-v><C-v>' },
7 dependencies = {
8 'nvim-telescope/telescope.nvim',
9 },
10 config = function ()
11 local neoclip = require 'neoclip'
12 local telescope = require 'telescope'
13 local themes = require 'telescope.themes'
14 local cursor = themes.get_cursor { layout_config = { preview_width = 0.69, width = 0.42 } }
16 neoclip.setup{}
17 telescope.load_extension'neoclip'
16 neoclip.setup {}
17 telescope.load_extension 'neoclip'
19 map.normal {
20 description = 'Open clipboard history...',
21 category = 'history',
22 keys = '<C-v><C-v>',
23 command = function() telescope.extensions.neoclip.default(cursor) end,
24 }
19 map.normal {
20 description = 'Open clipboard history...',
21 category = 'history',
22 keys = '<C-v><C-v>',
23 command = function () telescope.extensions.neoclip.default( cursor ) end,
24 }
25 end,
26}
26 end,
27}No final newline

neovim/lua/bugabinga/plugins/noice.lua

Modified

+22 / −35 text lines

1010 },
1111 opts = {
1212 cmdline = {
13 view = 'cmdline', -- cmdline on bottom
13 view = 'cmdline', -- cmdline on cursor
1414 },
1515 lsp = {
16 signature = {
17 auto_open = { trigger = false },
18 },
1619 -- override markdown rendering so that **cmp** and other plugins use **Treesitter**
1720 override = {
1821 ['vim.lsp.util.convert_input_to_markdown_lines'] = true,
2124 },
2225 },
2326 presets = {
24 inc_rename = true, -- enables an input dialog for inc-rename.nvim
25 long_message_to_split = true,
27 inc_rename = true, -- enables an input dialog for inc-rename.nvim
28 long_message_to_split = true, -- long messages will be sent to a split
2629 },
2730 views = {
2831 vsplit = {
3841 border = { style = vim.g.border_style },
3942 position = { row = -2, col = 2 },
4043 },
41 -- does not seem to play well with other popups?
44 -- does not seem to play well with other popups? -- treesitter in particular
4245 cmdline = {
4346 relative = 'cursor',
44 position = { row = 0, col = 0 },
45 size = { min_width = 42, width = 'auto', height = 'auto' },
46 border = { style = vim.g.border_style, padding = { 1, 2 } },
47 position = { row = 0, col = -2 }, -- -2 makes the cursor stay in the same place
48 size = { width = 'auto', height = 'auto' },
49 border = { style = vim.g.border_style },
4750 },
4851 cmdline_popupmenu = {
4952 relative = 'cursor',
50 position = { row = 2, col = 0 },
51 size = { min_width = 42, width = 'auto', height = 'auto' },
52 border = { style = vim.g.border_style},
53 win_options = { winhighlight = { FloatBorder = 'NoiceCmdlinePopupBorder' } },
53 position = { row = 1, col = 0 },
54 size = { width = 'auto', height = 'auto' },
55 border = { style = vim.g.border_style },
56 win_options = { winhighlight = { Normal = 'NormalFloat', FloatBorder = 'FloatBorder' } },
5457 },
5558 },
5659 routes = {
57 {
58 filter = { event = 'msg_show', kind = '', find = 'written', },
59 opts = { skip = true },
60 },
61 {
62 filter = { event = 'msg_show', kind = 'quickfix' },
63 opts = { skip = true },
64 },
65 {
66 filter = { event = 'msg_show', find = 'E42' },
67 opts = { skip = true },
68 },
69 {
70 filter = { event = 'msg_show', kind = '', find = '^".*" %[.*%]', },
71 opts = { skip = true },
72 },
73 {
74 filter = { event = 'notify', min_height = 15 },
75 view = 'split',
76 },
7760 {
7861 filter = { cmdline = '^:%s*!' },
79 --TODO: pipe external commands to terminal?
80 --terminal view does not exist, right?
8162 view = 'vsplit'
8263 },
8364 {
84 filter = { cmdline = true, min_height = 2 },
85 view = 'cmdline_output',
65 filter = { event = 'msg_show', kind = 'echomsg' },
66 view = 'mini'
67 },
68 {
69 filter = { event = 'msg_show', kind = '', find = 'written' },
70 view = 'mini'
8671 },
8772 {
8873 filter = { any = { { cmdline = '^:%s*lua%s+' }, { cmdline = '^:%s*lua%s*=%s*' }, { cmdline = '^:%s*=%s*' }, } },
10590 description = 'Redirect Cmdline',
10691 category = 'ui',
10792 keys = '<S-cr>',
93 ---@diagnostic disable-next-line: param-type-mismatch
10894 command = function () noice.redirect( vim.fn.getcmdline() ) end,
10995 }
153139 return opts
154140 end
142 ---@diagnostic disable-next-line: missing-fields
156143 notify.setup {
157144 stages = { shadow_fade, unpack( fade, 2 ) },
158145 render = 'compact',

neovim/lua/bugabinga/plugins/nrpattern.lua

Modified

+1 / −1 text lines

33 keys = { '<C-a>', '<C-x>' },
44 config = function()
55 local nrpattern = require'nrpattern'
6 -- NOTE: this plugin overrides all its settiungs if empty map is given
6 -- this plugin overrides all its settiungs if empty map is given
77 nrpattern.setup()
88 end,
99}}

neovim/lua/bugabinga/plugins/nui.lua

Added
new file mode 100644

+3 / −0 text lines

1return {
2 'MunifTanjim/nui.nvim',
3}

neovim/lua/bugabinga/plugins/nvim-jdtls.lua

Modified

+0 / −1 text lines

11return {
22 'bugabinga/nvim-jdtls',
3 ft = { 'java' },
43}

neovim/lua/bugabinga/plugins/oil.lua

Modified

+42 / −41 text lines

1local map = require'std.map'
1local map = require 'std.map'
33return {
4 'stevearc/oil.nvim',
5 lazy = false,
6 -- event = 'VeryLazy',
7 dependencies = { "nvim-tree/nvim-web-devicons" },
8 config = function()
9 local oil = require'oil'
10 oil.setup{
11 skip_confirm_for_simple_edits = true,
12 -- delete_to_trash = true,
13 -- trash_command = 'rm', --nu command
4 'stevearc/oil.nvim',
5 branch = 'stevearc-trash',
6 keys = '-',
7 cmd = { 'Oil' },
8 dependencies = { 'nvim-tree/nvim-web-devicons' },
9 config = function ()
10 local oil = require 'oil'
11 oil.setup {
12 skip_confirm_for_simple_edits = true,
13 delete_to_trash = true,
14 -- trash_command = 'rm --trash', --nu command
15 colums = {
16 "icon",
17 "permissions",
18 "size",
19 "mtime",
20 },
21 keymaps = {
22 ["q"] = "actions.close",
23 ["<esc>"] = "actions.close",
24 ["<C-/>"] = "actions.show_help",
25 ["<C-_>"] = "actions.show_help",
26 ["<C-?>"] = "actions.show_help",
27 ["<C-v>"] = "actions.select_vsplit",
28 ["<C-x>"] = "actions.select_split",
29 ["<C-h>"] = "actions.toggle_hidden",
30 },
31 float = {
32 border = vim.g.border_style,
33 padding = 2,
34 -- win_options = { winblend = vim.o.winblend },
35 },
36 }
16 colums = {
17 'icon',
18 'permissions',
19 'size',
20 'mtime',
21 },
22 keymaps = {
23 ['q'] = 'actions.close',
24 ['<esc>'] = 'actions.close',
25 ['<C-/>'] = 'actions.show_help',
26 ['<C-v>'] = 'actions.select_vsplit',
27 ['<C-s>'] = 'actions.select_split',
28 ['<C-h>'] = 'actions.toggle_hidden',
29 },
30 float = {
31 max_width = 69,
32 min_width = 42,
33 border = vim.g.border_style,
34 padding = 2,
35 win_options = { winblend = vim.o.winblend },
36 },
37 }
38 map.normal {
39 description = 'Open parent directory in buffer.',
40 category = 'files',
41 keys = '-',
42 -- command = oil.open,
43 command = oil.open_float,
44 }
45 end,
39 map.normal {
40 description = 'Open parent directory in buffer.',
41 category = 'files',
42 keys = '-',
43 -- command = oil.open,
44 command = oil.open_float,
45 }
46 end,

neovim/lua/bugabinga/plugins/persistence.lua

Modified

+2 / −2 text lines

33return {
44 'folke/persistence.nvim',
5 lazy = false,
5 event = "BufReadPre",
66 opts = { },
77 config = function(_, opts)
88 local persistence = require'persistence'
2323 }
2525 end,
26}No final newline
26}

neovim/lua/bugabinga/plugins/starter.lua

Added
new file mode 100644

+85 / −0 text lines

1local auto = require 'std.auto'
2local icon = require 'std.icon'
3
4return {
5 'echasnovski/mini.starter',
6 lazy = false,
7 config = function ()
8 local starter = require 'mini.starter'
9 local is_home = vim.uv.cwd() == vim.uv.os_homedir()
11 local custom_actions = {
12 { name = 'Find files', action = 'Telescope find_files', section = 'Builtin actions' },
13 { name = 'Oil', action = 'Oil', section = 'Builtin actions' },
14 }
16 local sessions = function ( limit )
17 limit = limit or 8
18 local persistence = require 'persistence'
19 local persistence_config = require 'persistence.config'
20 local sessions = persistence.list()
21 table.sort( sessions, function ( a, b )
22 return vim.loop.fs_stat( a ).mtime.sec > vim.loop.fs_stat( b ).mtime.sec
23 end )
24 return vim.iter( sessions )
25 :slice( 1, limit )
26 :map( function ( session_path )
27 -- session files encode their cwd as an escaped path in their file name
28 -- t = tail of name
29 -- r = remove extension
30 -- gs = replace all % with /
31 -- ~ = relative to home
32 local name = vim.fn.fnamemodify( session_path, ':t:r:gs_%_/_:~' )
33 local session_restore = 'silent! source ' .. vim.fn.fnameescape( session_path )
34 local action = function ()
35 vim.cmd( session_restore )
36 vim.notify( 'Restored session: ' .. name )
37 end
38 local section = 'Sessions'
40 return { name = name, action = action, section = section }
41 end )
42 :totable()
43 end
45 starter.setup {
46 footer = (function ()
47 local startuptime
49 auto 'display_startup_time' {
50 description = 'Display startup time on starter screen',
51 events = 'User',
52 pattern = 'LazyVimStarted',
53 once = true,
54 command = vim.schedule_wrap( function ()
55 startuptime = require 'lazy'.stats().startuptime
56 starter.refresh()
57 end ),
58 }
60 return function ()
61 return icon.start .. ' ' .. (startuptime or ' ') .. 'ms'
62 end
63 end)(),
64 header = [[
65███ ▄ ▄▀ ██ ███ ▄█ ▄ ▄▀ ██
66█ █ █ ▄▀ █ █ █ █ ██ █ ▄▀ █ █
67█ ▀ ▄ █ █ █ ▀▄ █▄▄█ █ ▀ ▄ ██ ██ █ █ ▀▄ █▄▄█
68█ ▄▀ █ █ █ █ █ █ █ ▄▀ ▐█ █ █ █ █ █ █ █
69███ █▄ ▄█ ███ █ ███ ▐ █ █ █ ███ █
70 ▀▀▀ █ █ ██ █
71 ▀ ▀]],
72 items = {
73 starter.sections.builtin_actions(),
74 custom_actions,
75 sessions,
76 starter.sections.recent_files( is_home and 24 or 8, not is_home, is_home ),
77 },
78 content_hooks = {
79 starter.gen_hook.adding_bullet(),
80 starter.gen_hook.aligning( 'center', 'center' ),
81 starter.gen_hook.indexing( 'all', { 'Recent files', 'Recent files (current directory)', 'Builtin actions' } ),
82 },
83 }
84 end,
85}

neovim/lua/bugabinga/plugins/surround.lua

Modified

+5 / −7 text lines

11return {
22 {
33 'kylechui/nvim-surround',
4 keys = { '<C-g>s', '<C-g>S', 'ms', 'mss', 'mS', 'mSS', 'S', 'gS', 'md', 'mr', 'mR'},
4 lazy = false,
55 opts = {
66 keymaps = {
7 insert = '<C-g>s',
8 insert_line = '<C-g>S',
97 normal = 'ms',
108 normal_cur = 'mss',
119 normal_line = 'mS',
1210 normal_cur_line = 'mSS',
13 visual = 'S',
14 visual_line = 'gS',
11 visual = 'ms',
12 visual_line = 'mS',
1513 delete = 'md',
16 change = 'mr',
17 change_line = 'mR',
14 change = 'mc',
15 change_line = 'mC',
1816 },
1917 },
2018 dependencies = {

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

Added
new file mode 100644

+5 / −0 text lines

1return {
2 'simrat39/symbols-outline.nvim',
3 cmd = 'SymbolsOutline',
4 opts = {},
5}

neovim/lua/bugabinga/plugins/telescope.lua

Modified

+48 / −38 text lines

55 name = 'ripgrep',
66 name_of_executable = 'rg'
77}
8 {
9 name = 'find-fd',
10 name_of_executable = 'fd'
11 }
8 {
9 name = 'find-fd',
10 name_of_executable = 'fd'
11 }
1313return {
1414 'nvim-telescope/telescope.nvim',
2222 'nvim-telescope/telescope-ui-select.nvim',
2323 'jvgrootveld/telescope-zoxide',
2424 },
25 config = function()
25 config = function ()
2626 local telescope = require 'telescope'
2727 local builtin = require 'telescope.builtin'
2828 local actions = require 'telescope.actions'
4343 preview_cutoff = 124,
4444 },
4545 file_ignore_patterns = {
46 ".git/",
47 ".cache",
48 "%.o",
49 "%.a",
50 "%.out",
51 "%.class",
52 "%.pdf",
53 "%.mkv",
54 "%.mp4",
55 "%.zip",
46 '.git/',
47 '.cache',
48 '%.o',
49 '%.a',
50 '%.out',
51 '%.class',
52 '%.pdf',
53 '%.mkv',
54 '%.mp4',
55 '%.zip',
5656 },
5757 mappings = {
5858 i = {
59 ['<C-j>'] = actions.cycle_history_next,
60 ['<C-k>'] = actions.cycle_history_prev,
61 ['<C-n>'] = actions.move_selection_next,
62 ['<C-p>'] = actions.move_selection_previous,
63 ['<C-s>'] = actions.file_split,
59 ['<c-j>'] = actions.cycle_history_next,
60 ['<c-k>'] = actions.cycle_history_prev,
61 ['<c-n>'] = actions.move_selection_next,
62 ['<c-p>'] = actions.move_selection_previous,
63 ['<c-s>'] = actions.file_split,
6464 },
6565 n = { q = actions.close },
6666 },
6767 },
6868 extensions = {
69 find_files = {
70 ivy
71 },
6972 ['ui-select'] = { cursor },
7073 zoxide = {
7174 ivy,
8891 description = 'Search help files',
8992 category = 'help',
9093 keys = '<F1>',
91 command = function() builtin.help_tags(dropdown) end,
94 command = function () builtin.help_tags( dropdown ) end,
95 }
97 map.normal {
98 description = 'Open last search...',
99 category = 'plugins',
100 keys = '<c-p>',
101 command = function () builtin.resume() end,
92102 }
94104 map.normal {
95105 description = 'Open search for commands...',
96106 category = 'plugins',
97 keys = '<C-p>',
98 command = function() builtin.commands() end,
107 keys = '<c-p><c-m>',
108 command = function () builtin.commands() end,
99109 }
101111 map.normal {
102112 description = 'Open search for all files...',
103113 category = 'search',
104 keys = '<C-p><C-p>',
105 command = function() builtin.find_files(ivy) end,
114 keys = '<c-p><c-p>',
115 command = function () builtin.find_files( ivy ) end,
106116 }
108118 map.normal {
109119 description = 'Open search for all recent files...',
110120 category = 'search',
111 keys = '<C-p><C-o>',
112 command = function() builtin.oldfiles(ivy) end,
121 keys = '<c-p><c-o>',
122 command = function () builtin.oldfiles( ivy ) end,
113123 }
115125 map.normal {
116126 description = 'Open search for keymaps...',
117127 category = 'search',
118 keys = '<C-p><C-k>',
119 command = function() builtin.keymaps(dropdown) end,
128 keys = '<c-p><c-k>',
129 command = function () builtin.keymaps( dropdown ) end,
120130 }
122132 map.normal {
123133 description = 'Open search for symbols...',
124134 category = 'search',
125 keys = '<C-p><C-s>',
126 command = function() builtin.symbols(cursor) end,
135 keys = '<c-p><c-s>',
136 command = function () builtin.symbols( cursor ) end,
127137 }
129139 map.normal {
130140 description = 'Open search for all file contents...',
131141 category = 'search',
132 keys = '<C-p><C-g>',
133 command = function() builtin.live_grep(ivy) end,
142 keys = '<c-p><c-g>',
143 command = function () builtin.live_grep( ivy ) end,
134144 }
136146 map.normal {
137147 description = 'Open search for current buffer content...',
138148 category = 'search',
139 keys = '<C-p><C-b>',
140 command = function() builtin.current_buffer_fuzzy_find(ivy) end,
149 keys = '<c-p><c-b>',
150 command = function () builtin.current_buffer_fuzzy_find( ivy ) end,
141151 }
143153 map.normal {
144154 description = 'Open search for buffers...',
145155 category = 'search',
146 keys = '<C-e>',
147 command = function() builtin.buffers(cursor) end,
156 keys = '<c-e>',
157 command = function () builtin.buffers( cursor ) end,
148158 }
149159 end,
150}No final newline
160}

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

Modified

+1 / −0 text lines

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

neovim/lua/bugabinga/plugins/toggleterm.lua

Modified

+3 / −40 text lines

9090 direction = 'tab',
9191 }
93 _G.Gitui = function () gitui:toggle() end
93 local toggle_gitui = function () gitui:toggle() end
9595 map.normal.terminal.insert {
9696 description = 'Toggle gitui terminal in tab',
9797 category = 'terminal',
9898 keys = '<F10>',
99 command = Gitui,
99 command = toggle_gitui,
100100 }
102 vim.cmd [[ command! Gitui lua Gitui() ]]
104 --[ MDCAT ]
106 local mdcat = Terminal:new {
107 hidden = true,
108 direction = 'vertical',
109 cmd = '',
110 }
112 _G.Mdcat = function ()
113 local window = vim.api.nvim_get_current_win()
114 local current_file = vim.api.nvim_buf_get_name( 0 )
115 mdcat.cmd = 'watch ' .. current_file .. ' { clear; mdcat ' .. current_file .. ' }'
116 mdcat:toggle()
117 vim.api.nvim_set_current_win( window )
118 end
120 vim.cmd [[ command! Mdcat lua Mdcat() ]]
122 -- [ GRAPHVIZ ]
124 local graphviz = Terminal:new {
125 hidden = true,
126 direction = 'vertical',
127 cmd = '',
128 }
130 _G.Graphviz = function ()
131 local window = vim.api.nvim_get_current_win()
132 local current_file = vim.api.nvim_buf_get_name( 0 )
133 graphviz.cmd = 'watch ' ..
134 current_file .. ' { clear; dot -O -Tpng ' .. current_file .. ' ; viu --blocks ' .. current_file .. '.png }'
135 graphviz:toggle()
136 vim.api.nvim_set_current_win( window )
137 end
139 vim.cmd [[ command! Graphviz lua Graphviz() ]]
102 vim.api.nvim_create_user_command( 'Gitui', toggle_gitui, { desc = 'Toggle Gitui' } )
140103 end

neovim/lua/bugabinga/plugins/treesitter.lua

Modified

+40 / −52 text lines

2525return {
2626 'nvim-treesitter/nvim-treesitter',
2727 branch = 'master',
28 event = 'BufRead',
29 cmd = {
30 'TSBufDisable',
31 'TSBufEnable',
32 'TSBufToggle',
33 'TSDisable',
34 'TSEnable',
35 'TSToggle',
36 'TSInstall',
37 'TSInstallInfo',
38 'TSInstallSync',
39 'TSModuleInfo',
40 'TSUninstall',
41 'TSUpdate',
42 'TSUpdateSync',
43 'TSPlaygroundToggle',
44 'TSHighlightCapturesUnderCursor',
45 'TSNodeUnderCursor',
46 },
28 event = { 'BufReadPre', 'BufNewFile'},
4729 build = function ()
4830 require 'nvim-treesitter.install'.update { with_sync = true }
4931 end,
123105 'bash',
124106 'c',
125107 -- https://github.com/nvim-treesitter/nvim-treesitter/issues/5389
126 -- 'comment',
108 'comment',
127109 'diff',
128110 'dot',
129111 'git_config',
176158 keymaps = {
177159 init_selection = '<up>',
178160 node_incremental = '<right>',
179 node_decremental = '<left>',
180 scope_incremental = false,
161 node_decremental = '<down>',
162 scope_incremental = '<up>',
181163 },
182164 },
207189 enable = true,
208190 lookahead = true,
209191 keymaps = {
210 ['af'] = { query = '@function.outer', desc = 'Select outer function' },
211 ['if'] = { query = '@function.inner', desc = 'Select inner function' },
192 ['af'] = { query = '@call.outer', desc = 'outer function call' },
193 ['if'] = { query = '@call.inner', desc = 'inner function call' },
213 ['ac'] = { query = '@class.outer', desc = 'Select outer class' },
214 ['ic'] = { query = '@class.inner', desc = 'Select inner class' },
195 ['am'] = { query = '@function.outer', desc = 'outer function definition' },
196 ['im'] = { query = '@function.inner', desc = 'inner function definition' },
216 ['at'] = { query = '@comment.outer', desc = 'Select outer comment' },
198 ['aa'] = { query = '@assignment.outer', desc = 'outer assignment' },
199 ['ia'] = { query = '@assignment.inner', desc = 'inner assignment' },
218 ['as'] = { query = '@scope', query_group = 'locals', desc = 'Select language scope' },
201 -- l overwrites builtin. i have no good idea for better binding. use ia instead.
202 -- ['la'] = { query = '@assignment.lhs', desc = 'left hand side of assignment'},
203 -- ['ra'] = { query = '@assignment.rhs', desc = 'right hand side of assignment'},
205 ['ac'] = { query = '@class.outer', desc = 'outer class' },
206 ['ic'] = { query = '@class.inner' , desc = 'inner class' },
208 ['ao'] = { query = '@conditional.outer', desc = 'outer conditional' },
209 ['io'] = { query = '@conditional.inner' , desc = 'inner conditional' },
211 ['al'] = { query = '@loop.outer', desc = 'outer loop' },
212 ['il'] = { query = '@loop.inner' , desc = 'inner loop' },
214 -- this overwrites the built-in 'paragraph' object
215 ['ap'] = { query = '@parameter.outer', desc = 'outer parameter' },
216 ['ip'] = { query = '@parameter.inner' , desc = 'inner parameter' },
218 ['at'] = { query = '@comment.outer' , desc = 'outer comment' },
220 ['as'] = { query = '@scope', query_group = 'locals', desc = 'language scope' },
219221 },
220222 selection_modes = {
221223 ['@parameter.outer'] = 'v',
229231 swap = {
230232 enable = true,
231233 swap_next = {
232 ['<leader>sn'] = { query = '@parameter.inner', desc = 'Swap parameter with next' },
234 ['<leader>spn'] = { query = '@parameter.inner' , desc = 'Swap parameter with next' },
233235 },
234236 swap_previous = {
235 ['<leader>sp'] = { query = '@parameter.inner', desc = 'Swap parameter with previous' },
237 ['<leader>spp'] = { query = '@parameter.inner' , desc = 'Swap parameter with previous' },
236238 },
237239 },
250252 enable = true,
251253 set_jumps = true,
252254 goto_next = {
253 [']f'] = { query = '@function.outer', desc = 'Goto next funtion' },
255 [']f'] = { query = '@call.outer' , desc = 'Goto next function call' },
256 [']m'] = { query = '@fucntion.outer' , desc = 'Goto next function definition' },
254257 [']c'] = { query = '@class.outer', desc = 'Goto next class' },
258 [']o'] = { query = '@conditional.outer' , desc = 'Goto next conditional' },
259 [']p'] = { query = '@parameter.outer' , desc = 'Goto next parameter' },
255260 [']s'] = { query = '@scope', query_group = 'locals', desc = 'Goto next scope' },
256 [']i'] = { query = '@conditional.outer', desc = 'Goto next conditional' },
257 [']a'] = { query = '@parameter.outer', desc = 'Goto next parameter' },
258261 },
259262 goto_previous = {
260 ['[f'] = { query = '@function.outer', desc = 'Goto previous function' },
263 ['[f'] = { query = '@call.outer' , desc = 'Goto previous function call' },
264 ['[m'] = { query = '@function.outer' , desc = 'Goto previous function definition' },
261265 ['[c'] = { query = '@class.outer', desc = 'goto previous class' },
266 ['[o'] = { query = '@conditional.outer' , desc = 'Goto previous conditional' },
267 ['[p'] = { query = '@parameter.outer' , desc = 'Goto previous parameter' },
262268 ['[s'] = { query = '@scope', query_group = 'locals', desc = 'Goto previous scope' },
263 ['[i'] = { query = '@conditional.outer', desc = 'Goto previous conditional' },
264 ['[a'] = { query = '@parameter.outer', desc = 'Goto previous parameter' },
265269 }
266270 },
267271 }
268272 }
270 local ts_repeat_move = require 'nvim-treesitter.textobjects.repeatable_move'
272 map.normal.visual.operator_pending {
273 description = 'This repeats the last query with always previous direction and to the start of the range.',
274 keys = '<PageUp>',
275 category = 'textobjects',
276 command = function () ts_repeat_move.repeat_last_move { forward = false } end
277 }
279 map.normal.visual.operator_pending {
280 description = 'This repeats the last query with always next direction and to the end of the range.',
281 keys = '<PageDown>',
282 category = 'textobjects',
283 command = function () ts_repeat_move.repeat_last_move { forward = true } end
284 }
286274 ---@diagnostic disable-next-line: inject-field
287275 parsers.get_parser_configs().just = {
288276 install_info = {

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

Modified

+9 / −1 text lines

1local ignored = require 'std.ignored'
2
13return {
24 {
35 'lukas-reineke/virt-column.nvim',
46 event = { 'BufReadPost', 'BufNew' },
57 opts = {
6 char = '│',
8 -- FIXME: I have visual redrawing bugs right now.
9 enabled = false,
10 char = { '░', '▒', '▓' },
11 exclude = {
12 filetypes = ignored.filetypes,
13 buftypes = ignored.buftypes,
14 }
715 },
816 },
917}

neovim/lua/bugabinga/plugins/whichkey.lua

Modified

+44 / −7 text lines

11local ignored = require 'std.ignored'
2local icon = require 'std.icon'
3--TODO: add which-key highlights in nugu
44return {
55 'folke/which-key.nvim',
66 event = 'VeryLazy',
77 init = function ()
88 vim.o.timeout = true
9 vim.o.timeoutlen = 300
9 vim.o.timeoutlen = 250
1010 end,
1111 opts = {
12 operators = {
13 -- TODO: make surround bind more logical and add here
14 ms = 'Surround',
12 key_labels = {
13 ['<space>'] = icon.space_key,
14 ['<cr>'] = icon.return_key,
15 ['<tab>'] = icon.tab_key,
16 ['<esc>'] = icon.esc_key,
17 ['<bs>'] = icon.backspace_key,
18 ['<leader>'] = icon.leader_key,
1519 },
1620 icons = {
17 group = ' '
21 group = icon.group,
1822 },
1923 window = {
2024 border = vim.g.border_style,
2125 winblend = vim.o.winblend,
2226 },
27 layout = { align = 'center' },
2328 disable = {
2429 buftypes = ignored.buftypes,
2530 }
26 }
31 },
32 config = function ( _, opts )
33 local wk = require 'which-key'
34 wk.setup( opts )
36 -- TODO: how can my own map api be used to generate the following wk prefixes?
37 -- map should not depend on wk.
38 -- can map cache mappings to read here?
39 -- use category as prefix?
40 wk.register {
41 ['<leader>'] = {
42 m = { name = 'mark', _ = 'which_key_ignore' },
43 h = { name = 'hunk', _ = 'which_key_ignore' },
44 l = { name = 'lsp', _ = 'which_key_ignore' },
45 s = {
46 name = 'swap',
47 _ = 'which_key_ignore',
48 {
49 p = { name = 'parameter', _ = 'which_key_ignore' },
50 },
51 },
52 t = {
53 name = 'toggle',
54 _ = 'which_key_ignore',
55 {
56 o = { name = 'options', _ = 'which_key_ignore' },
57 }
58 },
59 z = { name = 'lazy', _ = 'which_key_ignore' },
60 [' '] = { name = 'fun', _ = 'which_key_ignore' },
61 }
62 }
63 end

neovim/lua/bugabinga/ui.lua

Modified

+42 / −50 text lines

1local want = require'std.want'
2local display = require'std.display'
1local display = require 'std.display'
4return want{
5 'nui.popup',
6 'nui.text',
7 'nui.line',
8}(
9 function(
10 NuiPopup,
11 NuiText,
12 NuiLine
13 )
14 local get_nui_popup = function()
15 local popup = NuiPopup{
16 relative = 'editor',
17 focusable = true,
18 position= '50%',
19 enter = true,
20 size = {
21 width = '69%',
22 height = '42%',
23 },
24 border = {
25 style = vim.g.border_style,
26 },
27 buf_options = {
28 modifiable = true,
29 readonly = false,
30 }
31 }
32 popup:map("n", "q", function() popup:unmount() end, { noremap = true })
33 return popup
3local NuiPopup = require 'nui.popup'
4local NuiText = require 'nui.text'
5local NuiLine = require 'nui.line'
6
7local get_nui_popup = function ()
8 local popup = NuiPopup {
9 relative = 'editor',
10 focusable = true,
11 position = '50%',
12 enter = true,
13 size = {
14 width = '69%',
15 height = '42%',
16 },
17 border = {
18 style = vim.g.border_style,
19 },
20 buf_options = {
21 modifiable = true,
22 readonly = false,
23 }
24 }
25 popup:map( 'n', 'q', function () popup:unmount() end, { noremap = true } )
26 return popup
27end
29return {
30 show_tree = function ( tree )
31 local popup = get_nui_popup()
32 local bufnr = popup.bufnr
33 local text, _ = display( tree )
35 local line_number = 1
36 for line in text:gmatch '[^\r\n]+' do
37 local nui_line = NuiLine()
38 nui_line:append( NuiText( line, 'NormalFloat' ) )
39 nui_line:render( bufnr, -1, line_number )
40 line_number = line_number + 1
3441 end
36 return {
37 show_tree = function(tree)
38 local popup = get_nui_popup()
39 local bufnr = popup.bufnr
40 local text, _ = display(tree)
42 local line_number = 1
43 for line in text:gmatch('[^\r\n]+') do
44 local nui_line = NuiLine()
45 nui_line:append(NuiText(line, 'NormalFloat'))
46 nui_line:render(bufnr, -1, line_number)
47 line_number = line_number + 1
48 end
50 popup:mount()
51 end,
52 }
53 end)
43 popup:mount()
44 end,
45}

neovim/lua/std/auto.lua

Modified

+2 / −0 text lines

1-- TODO: metatable for api like map.modes
12-- Wrapper over `vim.api.nvim_create_autocmd` for automatic grouping and idempotency.
23return function(group_name)
34 local group = vim.api.nvim_create_augroup(group_name, { clear = true })
2021 group = group,
2122 buffer = autocommand.buffer,
2223 pattern = autocommand.pattern,
24 once = autocommand.once,
2325 command = command,
2426 callback = callback,
2527 })

neovim/lua/std/icon.lua

Modified

+69 / −54 text lines

11return {
2 error = '󰇷',
3 warn = '󰱯',
4 info = '󰩖',
5 hint = '󰊪',
6 quot_left = '󰝗',
7 quot_right = '󰉾',
8 hash = '',
9 checkbox_mark = '',
10 checkbox_unmark = '',
11 user = ' ',
12 data = '',
13 thread = '󱇫',
14 ['function'] = '󰡱',
15 ['table'] = '',
16 toggle_on = '',
17 toggle_off = '',
18 diagnostic = '⊙',
19 spelling = '󰓆',
20 linenumber = '󰉻',
21 linehighlight = '󰘤',
22 modified = '',
23 lock = '',
24 file = '',
25 newline = '␤',
2 ['function'] = '󰡱',
3 ['local'] = '󱥕',
4 ['table'] = '',
5 arrow_left = '',
6 arrow_right = '',
7 branch = '',
268 carriage_return = '␍',
27 lsp = '',
28 subversion = '󰳗',
29 vim = '',
30 branch = '',
31 git = '',
32 diff_add = '',
33 diff_remove = '',
34 diff_change = '',
35 folder = '',
36 terminal = '',
37 macro = '',
38 lazy = '󰄻',
39 global = '󱥔',
40 ['local'] = '󱥕',
41 space = '⋅',
42 eol = '↴',
43 tab = '󰌒',
44 trail = '•',
45 extends = '❯',
46 precedes = '❮',
47 nbsp = '␣',
48 normal = 'Ν',
49 visual = '󰒉',
50 insert = '',
51 select = '󰒉',
52 replace = '',
53 command = '󰘳',
54 pending = '',
55 exclaim = '',
9 checkbox_mark = '',
10 checkbox_unmark = '',
11 command = '󰘳',
12 close = '',
13 block = '█',
14 data = '',
15 diagnostic = '⊙',
16 diff_add = '',
17 diff_change = '',
18 diff_remove = '',
19 eol = '↴',
20 error = '󰇷',
21 exclaim = '',
22 extends = '❯',
23 file = '',
24 folder = '',
25 git = '',
26 global = '󱥔',
27 group = '',
28 hash = '',
29 hint = '󰊪',
30 info = '󰩖',
31 insert = '',
32 lazy = '󰄻',
33 linehighlight = '󰘤',
34 linenumber = '󰉻',
35 lock = '',
36 lsp = '',
37 macro = '',
38 modified = '',
39 nbsp = '␣',
40 newline = '␤',
41 normal = 'Ν',
42 pending = '',
43 precedes = '❮',
44 quot_left = '󰝗',
45 quot_right = '󰉾',
46 replace = '',
47 select = '󰒉',
48 space = '⋅',
49 spelling = '󰓆',
50 subversion = '󰳗',
51 tab = '󰌒',
52 terminal = '',
53 thread = '󱇫',
54 toggle_off = '',
55 toggle_on = '',
56 trail = '•',
57 user = ' ',
58 vertical_bar = '│',
59 vim = '',
60 virtual = '󰢔',
61 visual = '󰒉',
62 warn = '󰱯',
63 space_key = '󱁐',
64 return_key = '',
65 tab_key = '',
66 esc_key = '󱊷',
67 backspace_key = '',
68 leader_key = '󱁐',
69 start = '',
70 slant_left = '▟',
71 slant_right = '▙',

neovim/lua/std/ignored.lua

Modified

+17 / −14 text lines

11local filetypes = {
2 'gitcommit',
3 'gitrebase',
4 'svn',
5 'hgcommit',
6 'help',
7 'noice',
8 'notify',
2 'Outline',
93 'TelescopePrompt',
104 'TelescopeResults',
11 'toggleterm',
5 'WhichKey',
6 'flash_prompt',
7 '^git.*',
8 'help',
129 'lazy',
10 'noice',
11 'notify',
1312 'oil',
1413 'spectre_panel',
15 'WhichKey',
14 'starter',
15 'svn',
16 'toggleterm',
17 'Trouble',
1820local buftypes = {
19 'noice',
20 'neotree',
21 'quickfix',
22 'help',
23 'nofile',
2421 'acwrite',
22 'help',
23 'neotree',
24 'nofile',
25 'noice',
26 'prompt',
27 'quickfix',
2730local as_kv = function(list)

neovim/lua/std/map.lua

Modified

+4 / −1 text lines

8383 return self
8484end
86return setmetatable(
86--- @overload fun(map:table): function
87local map = setmetatable(
8788 {
8889 mode = {},
8990 },
9192 __index = add_mode,
9293 __call = bind,
9394 } )
96return map

neovim/lua/std/project.lua

Modified

+64 / −53 text lines

1local ignored = require 'std.ignored'
21local table = require 'std.table'
32local join = table.join
43local dirname = vim.fs.dirname
98local cache = {}
109local hasher = vim.fn.sha256
11local markers_to_string = function(markers)
12 return table.deep_concat(markers, {
10local markers_to_string = function ( markers )
11 return table.deep_concat( markers, {
1312 prefix = '',
1413 suffix = '',
1514 row_delimiter = '',
1615 key_value_delimiter = '',
1716 fill = '',
1817 newline = '',
19 })
18 } )
2019end
21local create_hash = function(path, markers)
22 local path_hash = hasher(path)
23 local markers_hash = hasher(markers_to_string(markers))
20local create_hash = function ( path, markers )
21 local path_hash = hasher( path )
22 local markers_hash = hasher( markers_to_string( markers ) )
2423 local hash = path_hash .. '|' .. markers_hash
2524 return hash
2625end
27local cache_get = function(path, markers)
28 local hash = create_hash(path, markers)
26local cache_get = function ( path, markers )
27 local hash = create_hash( path, markers )
2928 local hit = cache[hash]
3029 return hit
3130end
32local cache_set = function(project_root, path, markers)
33 local hash = create_hash(path, markers)
31local cache_set = function ( project_root, path, markers )
32 local hash = create_hash( path, markers )
3433 cache[hash] = project_root
3534end
36local expand = function ( path ) return vim.fn.fnamemodify( path, ':p' ) end
3738--- number of max loop iterations when searching for markers
3839local MAX_TRAVERSAL_COUNT = 100
6768---@param stop string? The last directory on the path to root, when to stop searching. if `nil`, the users home
6869---directory is used.
6970---@return string? # Directory, that contains the `markers` and lies on the path from `path` to `stop`.
70local function find_root(path, markers, stop)
71local function find_root( path, markers, stop )
7172 validate {
7273 path = { path, 'string', true },
7374 markers = { markers, 'table' },
7475 stop = { stop, 'string', true },
7576 }
77 path = path or dirname(vim.api.nvim_buf_get_name(0))
78 path = normalize(path)
78 path = path or dirname( vim.api.nvim_buf_get_name( 0 ) )
79 path = dirname( normalize( expand( path ) ) )
7980 stop = stop or vim.uv.os_homedir()
80 stop = normalize(stop)
81 stop = normalize( stop )
82 if not exists(stop) then error(('the stop directory %s does not exist!'):format(stop)) end
83 if not exists( stop ) then error( ('the stop directory %s does not exist!'):format( stop ) ) end
84 local cache_hit = cache_get(path, markers)
85 if #path == 0 then return nil end
87 local cache_hit = cache_get( path, markers )
8588 if cache_hit then
8689 -- vim.print("CACHE HIT", cache_hit)
8790 return cache_hit
99102 local current_path = path
100103 while current_path ~= stop do
101104 if loop_count > MAX_TRAVERSAL_COUNT then
102 vim.notify(('searching for markers reached the max traversal count for path %s !'):format(path))
105 vim.notify( ('searching for markers reached the max traversal count for path %s !'):format( path ) )
103106 break
104107 end
110113 markers = {},
111114 }
113 for _, marker in ipairs(markers) do
116 for _, marker in ipairs( markers ) do
114117 local marker_path = current_path .. '/' .. marker.name
115 if exists(marker_path) then
118 if exists( marker_path ) then
116119 score.marker_count = score.marker_count + marker.weight
117 table.insert(score.markers, marker_path)
120 table.insert( score.markers, marker_path )
118121 end
119122 end
121124 if score.marker_count > 0 then
122 table.insert(directory_scores, score)
125 table.insert( directory_scores, score )
123126 end
125 current_path = dirname(current_path)
128 current_path = dirname( current_path )
127130 current_distance_to_buffer = current_distance_to_buffer + 1
128131 loop_count = loop_count + 1
136139 -- then it is most likely a nested project structure (multi-module).
137140 -- in those cases we are looking for the root project folder, instead the nearest
138141 -- child project root folder.
139 for _, score in ipairs(directory_scores) do
140 local likelihood = score.marker_count + 1/score.distance_to_buffer_file
142 for _, score in ipairs( directory_scores ) do
143 local likelihood = score.marker_count + 1 / score.distance_to_buffer_file
141144 if likelihood > max_likelyhood then
142145 max_likelyhood = likelihood
143146 project_root = score.path
144147 end
145148 end
146149 if project_root then
147 cache_set(project_root, path, markers)
150 cache_set( project_root, path, markers )
148151 end
149152 return project_root
150153end
155158---
156159---@return string? # The project root of the current buffer, or `nil`, if none could be determined.
157160---
158local function find_project_root(path, markers)
161local function find_project_root( path, markers )
159162 -- define some language-independent markers
160163 local default_markers = {
161164 { name = '.git', weight = 1 },
175178 { name = 'flake.nix', weight = 1 },
176179 }
178 return find_root(path, join(default_markers, markers))
181 markers = markers or {}
182 return find_root( path, join( default_markers, markers ) )
179183end
181local function find_vcs_project_root(path)
182 return find_project_root(path, {})
185local function find_vcs_project_root( path )
186 return find_project_root( path, {} )
183187end
185local function find_java_project_root(path)
189local function find_java_project_root( path )
186190 local java_markers = {
187191 { name = '.idea', weight = 2 },
188192 { name = '.classpath', weight = 2 },
199203 { name = 'gradlew', weight = 3 },
200204 { name = 'gradlew.bat', weight = 3 },
201205 }
202 return find_root(path, java_markers)
206 return find_root( path, java_markers )
203207end
205-- TODO: how to get a marker for luarocks stuff?
206209local lua_markers = {
207210 { name = '.luarc.json', weight = 1 },
208211 { name = '.luarc.jsonc', weight = 1 },
211214 { name = 'stylua.toml', weight = 1 },
212215 { name = 'selene.toml', weight = 1 },
213216 { name = 'selene.yml', weight = 1 },
217 { name = 'neovim.yml', weight = 1 },
218 { name = 'lua', weight = 1 },
216local nvim_lua_markers = {
217 { name = 'neovim.yml', weight = 1 },
218 { name = 'lua', weight = 1 },
219}
221local find_lua_project_root = function(path)
222 return find_root(path, lua_markers)
223end
225local find_lua_nvim_project_root = function(path)
226 return find_root(path, nvim_lua_markers)
221local find_lua_project_root = function ( path )
222 return find_root( path, lua_markers )
227223end
229225local zig_markers = {
233229 { name = 'zig-out', weight = 1 },
236local find_zig_project_root = function(path)
237 return find_root(path, zig_markers)
232local find_zig_project_root = function ( path )
233 return find_root( path, zig_markers )
238234end
240local find_rust_project_root = function(path)
236local find_rust_project_root = function ( path )
241237 local markers = {
242238 { name = 'Cargo.toml', weight = 3 },
243239 }
244 local cargo_crate_dir = find_root(path, markers)
240 local cargo_crate_dir = find_root( path, markers )
245241 if cargo_crate_dir == nil then return nil end
247243 local cmd = {
251247 '--format-version',
252248 '1',
253249 '--manifest-path',
254 vim.fs.joinpath(cargo_crate_dir, 'Cargo.toml'),
250 vim.fs.joinpath( cargo_crate_dir, 'Cargo.toml' ),
255251 }
257 local result = vim.system(cmd, { text = true }):wait()
253 local result = vim.system( cmd, { text = true } ):wait()
258254 local cargo_workspace_root
260256 if result.code == 0 then
261 local json = vim.json.decode(result.stdout)
257 local json = vim.json.decode( result.stdout )
262258 if json['workspace_root'] then
263 cargo_workspace_root = vim.fs.normalize(json['workspace_root'])
259 cargo_workspace_root = vim.fs.normalize( json['workspace_root'] )
264260 end
265261 end
267263 return cargo_workspace_root or cargo_crate_dir
268264end
266local fallback_rooter = function ( path )
267 return find_vcs_project_root( path ) or find_project_root( path )
268end
269local rooters = {
270 java = find_java_project_root,
271 lua = find_lua_project_root,
272 rust = find_rust_project_root,
273 zig = find_zig_project_root,
274}
276local find_root_by_filetype = function ( path, filetype )
277 local rooter = rooters[filetype]
278 return rooter and rooter( path ) or fallback_rooter( path )
279end
270281return {
271282 find_root = find_root,
283 find_root_by_filetype = find_root_by_filetype,
272284 find_project_root = find_project_root,
273285 find_vcs_project_root = find_vcs_project_root,
274286 find_java_project_root = find_java_project_root,
275287 find_lua_project_root = find_lua_project_root,
276 find_lua_nvim_project_root = find_lua_nvim_project_root,
277288 find_zig_project_root = find_zig_project_root,
278289 find_rust_project_root = find_rust_project_root,

neovim/lua/std/want.lua

Deleted
deleted file mode 100644

+0 / −29 text lines

1--- attempts to import modules with the given names.
2---@param module_names string|table name or list of names, or a function that returns those
3---@return function function that takes a function that takes in the modules listed by `module_names`
4return function ( module_names )
5 return function ( block, error_handler )
6 local loaded_modules = {}
7 local failed_modules = {}
8 if type( module_names ) == 'string' then
9 module_names = { module_names }
10 end
11 for _, name in pairs( module_names ) do
12 local status_ok, module = pcall( require, name )
13 if status_ok then
14 table.insert( loaded_modules, module )
15 else
16 table.insert( failed_modules, module )
17 end
18 end
19 if #failed_modules > 0 then
20 return error_handler and type( error_handler ) == 'function' and error_handler( unpack( failed_modules ) ) or
21 error_handler
22 else
23 for _, module in pairs( failed_modules ) do
24 vim.notify( 'A wanted module failed to load: ' .. module, 'error' )
25 end
26 end
27 return block and block( unpack( loaded_modules ) )
28 end
29end

neovim/popo.xml

Deleted
deleted file mode 100644

No text changes.

nushell/config.nu

Modified

+0 / −3 text lines

7474 rm: {
7575 always_trash: true
7676 }
77 cd: {
78 abbreviations: true
79 }
8077 color_config: $default_theme
8178 use_grid_icons: true
8279 footer_mode: "auto" # always, never, number_of_rows, auto

nushell/env.nu

Modified

+5 / −2 text lines

77$env.WORKSPACE = if $env.WIN32 { "W:/" } else { "~/Workspace" | path expand }
88$env.NOTES = if $env.WIN32 { "N:/" } else { "~/Notes" | path expand }
10$env.TERM = if ($env | get -i TERM_PROGRAM) == WezTerm { "wezterm" } else { "xterm-256color" }
10if ($env | get -i TERM_PROGRAM) == WezTerm {
11 $env.TERM = "wezterm"
12 $env.TERMCAP = ~./termcap/w/wezterm
13}
1215# theme for ls and other programs, that use LS_COLORS
13$env.LS_COLORS = (try { vivid generate ayu | into string } catch {""})
16$env.LS_COLORS = (try { vivid generate alabaster_dark | into string } catch {""})
1518# Specifies how environment variables are:
1619# - converted from a string to a value on Nushell startup (from_string)

nushell/modules/aliases.nu

Modified

+9 / −1 text lines

22export alias show = bat
33export def list [] { ls --all --long --du --mime-type | where type == dir | append (ls --all --long --du --mime-type | where type != dir) }
44export alias web = firefox
5export alias edit = hx
5export alias edit = nvim
66# TODO ewrite bak command
77export alias backup = bak
2929export alias nf = open-editor-with-file-search
31def fuzzy-kill [ query:string ] {
32 let pid = (^ps -ef | sed 1d | fzf -m --query $query | awk '{print $2}')
33 if not ($pid | is-empty) {
34 kill ($pid | into int )
35 }
36}
37export alias fkill = fuzzy-kill
3139# TODO: HOST SPECIFIC ALIASES
3240# I do not see a way right now the have different aliases per host with nu.

nushell/modules/starship.nu

Added
new file mode 100644

+39 / −0 text lines

1# this file is both a valid
2# - overlay which can be loaded with `overlay use starship.nu`
3# - module which can be used with `use starship.nu`
4# - script which can be used with `source starship.nu`
5export-env { load-env {
6 STARSHIP_SHELL: "nu"
7 STARSHIP_SESSION_KEY: (random chars -l 16)
8 PROMPT_MULTILINE_INDICATOR: (
9 ^/home/oli/.cargo/bin/starship prompt --continuation
10 )
12 # Does not play well with default character module.
13 # TODO: Also Use starship vi mode indicators?
14 PROMPT_INDICATOR: ""
16 PROMPT_COMMAND: {||
17 # jobs are not supported
18 (
19 ^/home/oli/.cargo/bin/starship prompt
20 --cmd-duration $env.CMD_DURATION_MS
21 $"--status=($env.LAST_EXIT_CODE)"
22 --terminal-width (term size).columns
23 )
24 }
26 config: ($env.config? | default {} | merge {
27 render_right_prompt_on_last_line: true
28 })
30 PROMPT_COMMAND_RIGHT: {||
31 (
32 ^/home/oli/.cargo/bin/starship prompt
33 --right
34 --cmd-duration $env.CMD_DURATION_MS
35 $"--status=($env.LAST_EXIT_CODE)"
36 --terminal-width (term size).columns
37 )
38 }
39}}

subversion/config

Modified

+4 / −5 text lines

4747### This will override the environment variables that Subversion
4848### examines by default to find this information ($EDITOR,
4949### et al).
50editor-cmd = hx
50editor-cmd = nvim
5151### Set diff-cmd to the absolute path of your 'diff' program.
5252### This will override the compile-time default, which is to use
5353### Subversion's internal diff implementation.
54# TODO windows versions as bat files
55diff-cmd = /home/oli/.subversion/diff.bat
54diff-cmd = /home/oli/.subversion/diff
5655### Diff-extensions are arguments passed to an external diff
5756### program or to Subversion's internal diff implementation.
5857### Set diff-extensions to override the default arguments ('-u').
6059### Set diff3-cmd to the absolute path of your 'diff3' program.
6160### This will override the compile-time default, which is to use
6261### Subversion's internal diff3 implementation.
63# diff3-cmd = /home/oli/.subversion/diff3.bat
62diff3-cmd = /home/oli/.subversion/diff3
6463### Set diff3-has-program-arg to 'yes' if your 'diff3' program
6564### accepts the '--diff-program' option.
6665# diff3-has-program-arg = no
6766### Set merge-tool-cmd to the command used to invoke your external
6867### merging tool of choice. Subversion will pass 5 arguments to
6968### the specified command: base theirs mine merged wcfile
70merge-tool-cmd = /home/oli/.subversion/merge.bat
69merge-tool-cmd = /home/oli/.subversion/merge
7271### Section for configuring tunnel agents.
7372[tunnels]

subversion/config.win32

Modified

+1 / −2 text lines

4747### This will override the environment variables that Subversion
4848### examines by default to find this information ($EDITOR,
4949### et al).
50editor-cmd = hx
50editor-cmd = nvim
5151### Set diff-cmd to the absolute path of your 'diff' program.
5252### This will override the compile-time default, which is to use
5353### Subversion's internal diff implementation.
54# TODO windows versions as bat files
5554diff-cmd = C:/Users/okr/AppData/Roaming/Subversion/diff.bat
5655### Diff-extensions are arguments passed to an external diff
5756### program or to Subversion's internal diff implementation.

wezterm/wezterm.lua

Modified

+1 / −1 text lines

5757 default_prog = { 'nu' },
5858 default_cursor_style = 'SteadyBlock',
5959 cursor_blink_rate = 0,
60 cursor_thickness = '1cell',
60 -- cursor_thickness = '1cell',
6161 window_decorations = window_decorations,
6262 enable_tab_bar = true,
6363 -- if this is hidden, we cannot see the right status area