repositories / dotfiles

dotfiles

bugabingas dorkfiles

owned by bugabinga

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

3c79b2a5705595aa0aa6901ebb88fd3f1b738c51

Oliver Jan Krylow <oliver@bugabinga.net> ·

unsigned

Browse filesCompare with HEAD

Changed files (30)

+658 / −833 text lines

Diff layout

git/gitconfig

Modified

+1 / −0 text lines

5353[push]
5454 autoSetupRemote = true
55 default = "upstream"
5657[pull]
5758 rebase = false

neovim/.lsp.settings.lua

Modified

+3 / −0 text lines

33 Lua = {
44 diagnostics = { globals = { 'vim', 'prequire', }, },
55 runtime = { version = 'LuaJIT', },
6 workspace = {
7 library = { prequire 'neodev.config'.types(), },
8 },
69 },
710 },
811}

neovim/README.md

Modified

+1 / −1 text lines

5353 In case of markdown and text it seems useful, for code it seems like a
5454 headache...
5555* use ltex-ls for markdown, code comments and commit messages
56* setup DAP
56* flesh out 'const.lua', move to std?
5757* nvim spell for camel case words
5858* add nu-check to nvim-lint
5959* create skeleton-plugin for default file content based on file type

neovim/ftplugin/lua.lua

Modified

+0 / −37 text lines

77vim.opt_local.suffixesadd:prepend '.lua'
88vim.opt_local.conceallevel = 1
99vim.opt_local.concealcursor = 'n'
11local map = require 'std.map'
13map.normal {
14 description = 'Wrap word under cursor with require call',
15 keys = '<leader>rq',
16 category = 'refactor',
17 -- surround word with '
18 -- insert `require`
19 -- move 3 words
20 command = "ebi'<esc>ea'<esc>bbirequire <esc>www",
21 buffer = true,
22 remap = true,
23}
25--TODO: add dbg.print, require, prequire
26prequire 'nvim-surround'.buffer_setup {
27 surrounds = {
28 ['R'] = {
29 add = { "require '", "'", },
30 find = "require%b''",
31 --FIXME: find out how to craft these, those cannot be correct right now
32 delete = "^(require')().-(')()$",
33 change = {
34 target = "^(require')().-('()$",
35 },
36 },
37 ['P'] = {
38 add = { 'vim.print(', ')', },
39 find = 'vim%.print%b()',
40 delete = '^(vim%.print%()().-(%))()$',
41 change = {
42 target = '^(vim%.print%()().-(%))()$',
43 },
44 },
45 },
46}

neovim/init.lua

Modified

+8 / −0 text lines

1111-- setup debug mode
1212-- require 'std.debug'.toggle()
14-- vim.g.did_load_filetypes = 1
1416vim.cmd.colorscheme 'nugu'
1618---create special global, that serves as a more graceful alternative to `require`
5456 vim.print( 'error while loading mark', loaded )
5557end
59-- save and load sessions
60ok, loaded = pcall( require, 'bugabinga.sessions' )
61if not ok then
62 vim.print( 'error while loading sessions', loaded )
63end
5765-- configure builtin terminal
5866ok, loaded = pcall( require, 'bugabinga.terminal' )
5967if not ok then

neovim/lazy-lock.json

Modified

+1 / −8 text lines

2121 "lazy.nvim": { "branch": "main", "commit": "3f13f080434ac942b150679223d54f5ca91e0d52" },
2222 "lspkind.nvim": { "branch": "master", "commit": "1735dd5a5054c1fb7feaf8e8658dbab925f4f0cf" },
2323 "mini.bracketed": { "branch": "main", "commit": "65c7dfb51e832de9e279e5d5b0741e7af6755ab5" },
24 "mini.bufremove": { "branch": "main", "commit": "931a3bb514147d9e812767275c4beba6b779b1d3" },
2425 "mkdir.nvim": { "branch": "main", "commit": "c55d1dee4f099528a1853b28bb28caa802eba217" },
2526 "neodev.nvim": { "branch": "main", "commit": "ce9a2e8eaba5649b553529c5498acb43a6c317cd" },
2627 "neogen": { "branch": "main", "commit": "0daffcec249bf42275e322361fe55b89a05ff278" },
27 "neotest": { "branch": "master", "commit": "5caac5cc235d495a2382bc2980630ef36ac87032" },
28 "neotest-plenary": { "branch": "master", "commit": "dcaf5ed67a9e28a246e9783319e5aa6c9ea1c584" },
2928 "nrpattern.nvim": { "branch": "master", "commit": "f862ce687761078ef3155688151c55f69d28453e" },
3029 "nui.nvim": { "branch": "main", "commit": "cbd2668414331c10039278f558630ed19b93e69b" },
3130 "nvim-autopairs": { "branch": "master", "commit": "4f41e5940bc0443fdbe5f995e2a596847215cd2a" },
3231 "nvim-cmp": { "branch": "main", "commit": "8f3c541407e691af6163e2447f3af1bd6e17f9a3" },
33 "nvim-dap": { "branch": "master", "commit": "6ae8a14828b0f3bff1721a35a1dfd604b6a933bb" },
34 "nvim-dap-ui": { "branch": "master", "commit": "5934302d63d1ede12c0b22b6f23518bb183fc972" },
35 "nvim-dap-virtual-text": { "branch": "master", "commit": "3e8e207513e6ef520894950acd76b79902714103" },
3632 "nvim-genghis": { "branch": "main", "commit": "01eeb090ea4947df6b6b9d8589b324b9f1aaf851" },
3733 "nvim-gomove": { "branch": "main", "commit": "2b44ae7ac0804f4e3959228122f7c85bef1964e3" },
3834 "nvim-lastplace": { "branch": "main", "commit": "0bb6103c506315044872e0f84b1f736c4172bb20" },
4137 "nvim-navbuddy": { "branch": "master", "commit": "f34237e8a41ebc6e2716af2ebf49854d8c5289c8" },
4238 "nvim-navic": { "branch": "master", "commit": "8649f694d3e76ee10c19255dece6411c29206a54" },
4339 "nvim-neoclip.lua": { "branch": "main", "commit": "798cd0592a81c185465db3a091a0ff8a21af60fd" },
44 "nvim-nio": { "branch": "master", "commit": "8765cbc4d0c629c8158a5341e1b4305fd93c3a90" },
4540 "nvim-spectre": { "branch": "master", "commit": "4651801ba37a9407b7257287aec45b6653ffc5e9" },
4641 "nvim-surround": { "branch": "main", "commit": "6d0dc3dbb557bcc6a024969da461df4ba803fc48" },
4742 "nvim-tree.lua": { "branch": "master", "commit": "76db7ed0da3027882dd0a72de18643c2e26956dc" },
5449 "nvim-web-devicons": { "branch": "master", "commit": "794bba734ec95eaff9bb82fbd112473be2087283" },
5550 "nvim-window": { "branch": "main", "commit": "fad0dc96de265b0bdcb21d1071329e5ab1deb4af" },
5651 "oil.nvim": { "branch": "master", "commit": "bcfc0a2e01def5019aa14fac2fc6de20dedb6d3d" },
57 "overseer.nvim": { "branch": "master", "commit": "89942ad366c8a9bb93f82411de17dc7c644b4e3b" },
5852 "pair-ls.nvim": { "branch": "master", "commit": "ccf3280d8cafec48e4947dd827abbc456435dfad" },
5953 "playground": { "branch": "master", "commit": "ba48c6a62a280eefb7c85725b0915e021a1a0749" },
6054 "plenary.nvim": { "branch": "master", "commit": "08e301982b9a057110ede7a735dd1b5285eb341f" },
6155 "qf_helper.nvim": { "branch": "master", "commit": "301cea47118ccfc91a7cc48e316f2abc1ec7c1c6" },
62 "resession.nvim": { "branch": "master", "commit": "dc8825439c619030925543a444c4186a2487c200" },
6356 "schemastore.nvim": { "branch": "main", "commit": "2ef728ff7e790431f1f71052bfd4c5568157e110" },
6457 "specs.nvim": { "branch": "main", "commit": "8a108c8b37dec1b184a1d3d76c6cf867bfbe9636" },
6558 "speedtyper.nvim": { "branch": "main", "commit": "2d158eed4c753995b0501a3a7a72464fbb213e3d" },

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

Modified

+0 / −1 text lines

11return {
22 require 'bugabinga.lsp.clients.java',
33 require 'bugabinga.lsp.clients.lua',
4 require 'bugabinga.lsp.clients.json',
54 require 'bugabinga.lsp.clients.asm',
65 require 'bugabinga.lsp.clients.c',
76 require 'bugabinga.lsp.clients.graphviz',

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

Deleted
deleted file mode 100644

+0 / −26 text lines

1local project = require 'std.project'
2
3return {
4 name = 'jsonls',
5 filetypes = { 'json', 'jsonc' },
6 command = { 'vscode-json-language-server', '--stdio' },
7 root_dir = project.find_vcs_project_root,
8 single_file_support = true,
9 workspaces = false,
10 init_options = {
11 provideFormatter = true,
12 },
13 settings = {
14 json = {
15 schemas = require 'schemastore'.json.schemas {
16 extra = {
17 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' },
21 }
22 },
23 validate = { enable = true },
24 },
25 },
26}

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

Modified

+2 / −2 text lines

1111 settings = {
1212 Lua = {
1313 addonManager = { enable = false, },
14 completion = { callSnippet = 'Replace', },
14 completion = { callSnippet = 'Both', },
1515 hint = { enable = true, setType = true, },
1616 telemetry = { enable = false, },
17 window = { progressBar = true, statusBar = true, },
17 window = { progressBar = false, statusBar = false, },
1818 workspace = { checkThirdParty = false, },
1919 },
2020 },

neovim/lua/bugabinga/nugu/init.lua

Modified

+4 / −3 text lines

122122} )
124124_.Debug { fg = ui_normal, bg = debug, bold = true, }
125126_.Normal { fg = content_normal, bg = content_backdrop, }
126127_.Comment { fg = content_important_global, }
127128_.NotifyBackground { bg = ui_backdrop, }
129130_.CursorLineNr { fg = ui_focus, bg = ui_backdrop, }
130131_.Search { bg = content_unfocus, }
131132_.IncSearch { fg = content_focus, }
132_.CurSearch { fg = content_normal, bg = content_important_global, }
133_.CurSearch { fg = content_important_global, bg = content_unfocus, }
133134_.NormalFloat { fg = ui_normal, bg = ui_backdrop, }
134135_.FloatBorder { fg = _.NormalFloat.bg, bg = _.NormalFloat.bg, }
135136_.ColorColumn { fg = ui_important_global, bg = _.Normal.bg, }
141142_.DiffAdd { fg = content_focus, }
142143_.DiffDelete { fg = content_focus, strikethrough = true, }
143144_.DiffChange { fg = content_important_global, }
144_.DiffText { fg = content_normal, bg = content_important_local, }
145_.DiffText { fg = content_normal, bg = content_unfocus, }
145146_.EndOfBuffer = _.Normal
146147-- _.TermCursor = _.Cursor
147148-- _.TermCursorNC = _.Cursor
472473_.TelescopeSelection = _.PmenuSel
473474_.TelescopeMultiSelection { fg = content_normal, bg = ui_important_local, }
475_.FlashBackdrop {}
476_.FlashBackdrop { fg = ui_normal, bg = ui_backdrop, }
476477_.FlashMatch = _.IncSearch
477478_.FlashCurrent = _.CurSearch
478479_.FlashLabel { fg = ui_accent, bg = ui_backdrop, }

neovim/lua/bugabinga/options/ui.lua

Modified

+7 / −18 text lines

127127vim.opt.guicursor = 'n-v-c-sm:block-Cursor,i-ci-ve:ver25-blinkon250,r-cr:hor20,o:hor50'
129129-- font
130vim.opt.guifont = 'Cousine,Symbols Nerd Font Mono:#e-subpixelantialias:#h-full'
131-- NOTE: neovide font config is not as powerful as wezterm right now
132-- characters for box drawing do not seem to line up. try different font for now?
133vim.opt.linespace = -3
130vim.opt.guifont = 'Cousine,Symbols Nerd Font Mono:h16:#e-subpixelantialias:#h-none'
135132-- neovide only options
136133if vim.g.neovide then
137 -- vim.g.neovide_floating_blur_amount_x = 12.0
138 -- vim.g.neovide_floating_blur_amount_y = 12.0
139 -- vim.g.neovide_scroll_animation_length = 0.69
140 -- vim.g.neovide_fullscreen = true
141 vim.g.neovide_remember_window_size = true
142 vim.g.neovide_profiler = false
143 -- vim.g.neovide_cursor_animation_length = 0.42
144 -- vim.g.neovide_cursor_trail_length = 0.42
145 vim.g.neovide_cursor_vfx_mode = 'railgun'
146 -- vim.g.neovide_cursor_unfocused_outline_width = 0.125
147 vim.g.neovide_cursor_antialiasing = true
134 -- vim.g.neovide_profiler = false
135 -- interpret all touch events as scroll events
136 vim.g.neovide_touch_deadzone = 0.0
137 -- after this timeout, start a visual selection
138 vim.g.neovide_touch_drag_timeout = 0.69
148139 vim.g.neovide_padding_top = 0
140 vim.g.neovide_padding_left = 8
149141 vim.g.neovide_padding_bottom = 0
150142 vim.g.neovide_padding_right = 0
151 vim.g.neovide_padding_left = 0
152143 vim.g.neovide_hide_mouse_when_typing = true
153 vim.g.neovide_theme = 'auto'
154 vim.g.neovide_refresh_rate = vim.uv.os_gethostname() == 'pop-os' and 144 or 60
155144 vim.g.neovide_refresh_rate_idle = 5
156145end

neovim/lua/bugabinga/plugins/bufremove.lua

Added
new file mode 100644

+27 / −0 text lines

1-- FIXME: own this
2return {
3 'echasnovski/mini.bufremove',
4
5 keys = {
6 {
7 '<leader>bd',
8 function ()
9 local bd = require 'mini.bufremove' .delete
10 if vim.bo.modified then
11 local choice = vim.fn.confirm( ('Save changes to %q?'):format( vim.fn.bufname() ), '&Yes\n&No\n&Cancel' )
12 if choice == 1 then -- Yes
13 vim.cmd.write()
14 bd( 0 )
15 elseif choice == 2 then -- No
16 bd( 0, true )
17 end
18 else
19 bd( 0 )
20 end
21 end,
22 desc = 'Delete Buffer',
23 },
24 -- stylua: ignore
25 { '<leader>bD', function () require 'mini.bufremove' .delete( 0, true ) end, desc = 'Delete Buffer (Force)', },
26 },
27}

neovim/lua/bugabinga/plugins/cmp.lua

Modified

+118 / −119 text lines

11local icon = require 'std.icon'
33return {
4 'hrsh7th/nvim-cmp',
5 lazy = false,
6 dependencies = {
7 'hrsh7th/cmp-nvim-lsp',
8 'hrsh7th/cmp-buffer',
9 'hrsh7th/cmp-path',
10 'hrsh7th/cmp-nvim-lua',
11 'saadparwaiz1/cmp_luasnip',
12 'onsails/lspkind.nvim',
13 'L3MON4D3/LuaSnip',
14 },
15 config = function ()
16 local cmp = require 'cmp'
17 local luasnip = require 'luasnip'
18 local MAX_INDEX_FILE_SIZE = 4000
4 'hrsh7th/nvim-cmp',
5 event = 'InsertEnter',
6 dependencies = {
7 'hrsh7th/cmp-nvim-lsp',
8 'hrsh7th/cmp-buffer',
9 'hrsh7th/cmp-path',
10 'hrsh7th/cmp-nvim-lua',
11 'saadparwaiz1/cmp_luasnip',
12 'onsails/lspkind.nvim',
13 'L3MON4D3/LuaSnip',
14 },
15 config = function ()
16 local cmp = require 'cmp'
17 local luasnip = require 'luasnip'
18 local MAX_INDEX_FILE_SIZE = 4000
20 local snippet_next = function ( fallback )
21 if luasnip.expand_or_jumpable() then
22 luasnip.expand_or_jump()
23 elseif cmp.visible() then
24 cmp.select_next_item()
25 else
26 fallback()
27 end
28 end
20 local snippet_next = function ( fallback )
21 if luasnip.expand_or_jumpable() then
22 luasnip.expand_or_jump()
23 elseif cmp.visible() then
24 cmp.select_next_item()
25 else
26 fallback()
27 end
28 end
30 local snippet_prev = function ( fallback )
31 if luasnip.jumpable( -1 ) then
32 luasnip.jump( -1 )
33 elseif cmp.visible() then
34 cmp.select_prev_item()
35 else
36 fallback()
37 end
38 end
30 local snippet_prev = function ( fallback )
31 if luasnip.jumpable( -1 ) then
32 luasnip.jump( -1 )
33 elseif cmp.visible() then
34 cmp.select_prev_item()
35 else
36 fallback()
37 end
38 end
40 local mapping = cmp.mapping.preset.insert {
41 ['<C-d>'] = cmp.mapping.scroll_docs( -4 ),
42 ['<C-f>'] = cmp.mapping.scroll_docs( 4 ),
43 ['<C-e>'] = cmp.mapping.close(),
44 ['<C-y>'] = cmp.mapping.confirm { behavior = cmp.ConfirmBehavior.Replace, select = true, },
45 ['<C-space>'] = cmp.mapping.complete(),
46 ['<Tab>'] = cmp.mapping( snippet_next, { 'i', 's', } ),
47 ['<S-Tab>'] = cmp.mapping( snippet_prev, { 'i', 's', } ),
48 }
40 local mapping = cmp.mapping.preset.insert {
41 ['<C-d>'] = cmp.mapping.scroll_docs( -4 ),
42 ['<C-f>'] = cmp.mapping.scroll_docs( 4 ),
43 ['<C-e>'] = cmp.mapping.close(),
44 ['<C-y>'] = cmp.mapping.confirm { behavior = cmp.ConfirmBehavior.Replace, select = true, },
45 ['<C-space>'] = cmp.mapping.complete(),
46 ['<Tab>'] = cmp.mapping( snippet_next, { 'i', 's', } ),
47 ['<S-Tab>'] = cmp.mapping( snippet_prev, { 'i', 's', } ),
48 }
50 local formatting = {}
51 local ok, lspkind = pcall( require, 'lspkind' )
52 if ok then
53 formatting.format = lspkind.cmp_format {
54 mode = 'symbol',
55 symbol_map = {
56 Copilot = icon.copilot,
57 Class = icon.class,
58 Color = icon.color,
59 Constant = icon.constant,
60 Constructor = icon.constructor,
61 Enum = icon.enum,
62 EnumMember = icon.enum_member,
63 Event = icon.event,
64 Field = icon.field,
65 File = icon.file,
66 Folder = icon.folder,
67 Function = icon['function'],
68 Interface = icon.interface,
69 Keyword = icon.keyword,
70 Method = icon.method,
71 Module = icon.module,
72 Operator = icon.operator,
73 Property = icon.property,
74 Reference = icon.reference,
75 Snippet = icon.snippet,
76 Struct = icon.struct,
77 Text = icon.text,
78 TypeParameter = icon.type_parameter,
79 Unit = icon.unit,
80 Value = icon.value,
81 Variable = icon.variable,
82 },
83 menu = {
84 buffer = '[buf]',
85 nvim_lsp = '[LSP]',
86 nvim_lua = '[nvim]',
87 path = '[path]',
88 luasnip = '[snip]',
89 },
90 }
91 end
50 local formatting = {}
51 local ok, lspkind = pcall( require, 'lspkind' )
52 if ok then
53 formatting.format = lspkind.cmp_format {
54 mode = 'symbol',
55 symbol_map = {
56 Copilot = icon.copilot,
57 Class = icon.class,
58 Color = icon.color,
59 Constant = icon.constant,
60 Constructor = icon.constructor,
61 Enum = icon.enum,
62 EnumMember = icon.enum_member,
63 Event = icon.event,
64 Field = icon.field,
65 File = icon.file,
66 Folder = icon.folder,
67 Function = icon['function'],
68 Interface = icon.interface,
69 Keyword = icon.keyword,
70 Method = icon.method,
71 Module = icon.module,
72 Operator = icon.operator,
73 Property = icon.property,
74 Reference = icon.reference,
75 Snippet = icon.snippet,
76 Struct = icon.struct,
77 Text = icon.text,
78 TypeParameter = icon.type_parameter,
79 Unit = icon.unit,
80 Value = icon.value,
81 Variable = icon.variable,
82 },
83 menu = {
84 buffer = '[buf]',
85 nvim_lsp = '[LSP]',
86 nvim_lua = '[nvim]',
87 path = '[path]',
88 luasnip = '[snip]',
89 },
90 }
91 end
93 local sources = {
94 { name = 'neodev', },
95 { name = 'nvim_lua', },
96 { name = 'nvim_lsp', },
97 { name = 'path', },
98 { name = 'luasnip', },
99 { name = 'neorg', },
100 {
101 name = 'buffer',
102 keyword_length = 4,
103 options = {
104 get_bufnrs = function ()
105 local bufs = {}
106 for _, bufnr in ipairs( vim.api.nvim_list_bufs() ) do
107 -- Don't index giant files
108 if vim.api.nvim_buf_is_loaded( bufnr ) and vim.api.nvim_buf_line_count( bufnr ) < MAX_INDEX_FILE_SIZE then
109 table.insert( bufs, bufnr )
110 end
111 end
112 return bufs
113 end,
114 },
115 },
116 }
93 local sources = {
94 { name = 'neodev', },
95 { name = 'nvim_lua', },
96 { name = 'nvim_lsp', },
97 { name = 'path', },
98 { name = 'luasnip', },
99 {
100 name = 'buffer',
101 keyword_length = 4,
102 options = {
103 get_bufnrs = function ()
104 local bufs = {}
105 for _, bufnr in ipairs( vim.api.nvim_list_bufs() ) do
106 -- Don't index giant files
107 if vim.api.nvim_buf_is_loaded( bufnr ) and vim.api.nvim_buf_line_count( bufnr ) < MAX_INDEX_FILE_SIZE then
108 table.insert( bufs, bufnr )
109 end
110 end
111 return bufs
112 end,
113 },
114 },
115 }
118 cmp.setup {
119 mapping = mapping,
120 formatting = formatting,
121 sources = sources,
117 cmp.setup {
118 mapping = mapping,
119 formatting = formatting,
120 sources = sources,
123 completion = { autocomplete = false, },
124 snippet = {
125 expand = function ( args ) luasnip.lsp_expand( args.body ) end,
126 },
122 completion = { autocomplete = false, },
123 snippet = {
124 expand = function ( args ) luasnip.lsp_expand( args.body ) end,
125 },
128 -- experimental = { native_menu = false, },
129 }
130 end,
127 -- experimental = { native_menu = false, },
128 }
129 end,

neovim/lua/bugabinga/plugins/dap.lua

Deleted
deleted file mode 100644

+0 / −59 text lines

1--FIXME: own this
2return {
3 {
4 'mfussenegger/nvim-dap',
5 dependencies = {
6 'rcarriga/nvim-dap-ui',
7 { 'theHamsta/nvim-dap-virtual-text', config = true, },
8 { 'stevearc/overseer.nvim', },
9 },
10 keys = {
11 { '<leader>dc', "<cmd>lua require'dap'.continue()<CR>", mode = 'n', desc = '[D]ebug [C]ontinue', },
12 { '<leader>dj', "<cmd>lua require'dap'.step_over()<CR>", mode = 'n', desc = '[D]ebug step over', },
13 { '<leader>di', "<cmd>lua require'dap'.step_into()<CR>", mode = 'n', desc = '[D]ebug step [I]nto', },
14 { '<leader>do', "<cmd>lua require'dap'.step_out()<CR>", mode = 'n', desc = '[D]ebug step [O]ut', },
15 { '<leader>dl', "<cmd>lua require'dap'.run_last()<CR>", mode = 'n', desc = '[D]ebug run [L]ast', },
16 { '<leader>dr', "<cmd>lua require'dap'.repl.open()<CR>", mode = 'n', desc = '[D]ebug open [R]epl', },
17 { '<leader>dq', "<cmd>lua require'dap'.terminate()<CR>", mode = 'n', desc = '[D]ebug [Q]uit', },
18 { '<leader>db', "<cmd>lua require'dap'.toggle_breakpoint()<CR>", mode = 'n', desc = '[D]ebug set [B]reakpoint', },
19 {
20 '<leader>dB',
21 function ()
22 vim.ui.input( { prompt = 'Breakpoint condition', }, function ( cond )
23 if cond then
24 require 'dap' .set_breakpoint( cond )
25 end
26 end )
27 end,
28 mode = 'n',
29 desc = '[D]ebug set conditional [B]reakpoint',
30 },
31 },
32 config = function ()
33 -- dap.set_log_level("DEBUG")
34 vim.fn.sign_define( 'DapBreakpoint', { text = '•', texthl = 'DiagnosticError', linehl = '', numhl = '', } )
35 vim.fn.sign_define( 'DapBreakpointCondition', { text = '?', texthl = 'DiagnosticError', linehl = '', numhl = '', } )
36 vim.fn.sign_define( 'DapLogPoint', { text = '⁋', texthl = '', linehl = '', numhl = '', } )
37 vim.fn.sign_define( 'DapStopped', { text = ' ', texthl = 'DiagnosticInfo', linehl = '', numhl = '', } )
38 vim.fn.sign_define( 'DapBreakpointRejected', { text = 'X', texthl = 'DiagnosticError', linehl = '', numhl = '', } )
40 local dapui = require 'dapui'
41 local dap = require 'dap'
42 dapui.setup()
43 dap.listeners.after.event_initialized['dapui_config'] = function ()
44 dapui.open()
45 end
46 dap.listeners.before.event_terminated['dapui_config'] = function ()
47 dapui.close()
48 end
49 dap.listeners.before.event_exited['dapui_config'] = function ()
50 dapui.close()
51 end
52 vim.schedule( function ()
53 require 'dap.ext.vscode' .json_decode = require 'overseer.json' .decode
54 require 'dap.ext.vscode' .load_launchjs( nil, { node = { 'typescript', 'javascript', }, } )
55 require 'overseer' .patch_dap( true )
56 end )
57 end,
58 },
59}

neovim/lua/bugabinga/plugins/flash.lua

Modified

+3 / −4 text lines

1010return {
1111 'folke/flash.nvim',
1212 version = '1.*',
13 event = 'VeryLazy',
13 -- event = 'VeryLazy',
1414 opts = {
15 highlight = { backdrop = false, },
16 modes = { char = { highlight = { backdrop = false, }, },
17 },
15 -- highlight = { backdrop = false, },
16 -- modes = { char = { highlight = { backdrop = false, }, }, },
1817 },

neovim/lua/bugabinga/plugins/genghis.lua

Modified

+73 / −60 text lines

1local const = require 'bugabinga.const'
2if const.win32 then
3 require 'bugabinga.health'.add_dependency {
4 name_of_executable = 'recycle-bin',
5 }
6end
7
18local map = require 'std.map'
310map.normal {
4 keys = '<leader>fn',
5 category = 'files',
6 description = 'Create new file',
7 command = function () require 'genghis'.createNewFile() end,
11 keys = '<leader>fn',
12 category = 'files',
13 description = 'Create new file',
14 command = function () require 'genghis'.createNewFile() end,
815}
1017map.visual {
11 keys = '<leader>fx',
12 category = 'files',
13 description = 'Move selection to new file',
14 command = function () require 'genghis'.moveSelectionToNewFile() end,
18 keys = '<leader>fx',
19 category = 'files',
20 description = 'Move selection to new file',
21 command = function () require 'genghis'.moveSelectionToNewFile() end,
1724map.normal {
18 keys = '<leader>fy',
19 category = 'files',
20 description = 'Yank file name',
21 command = function () require 'genghis'.copyFilename() end,
25 keys = '<leader>fy',
26 category = 'files',
27 description = 'Yank file name',
28 command = function () require 'genghis'.copyFilename() end,
2431map.normal {
25 keys = '<leader>fY',
26 category = 'files',
27 description = 'Yank file path',
28 command = function () require 'genghis'.copyFilepath() end,
32 keys = '<leader>fY',
33 category = 'files',
34 description = 'Yank file path',
35 command = function () require 'genghis'.copyFilepath() end,
3138map.normal {
32 keys = '<leader>fc',
33 category = 'files',
34 description = 'Change file mode/permissions',
35 command = function () require 'genghis'.chmodx() end,
39 keys = '<leader>fc',
40 category = 'files',
41 description = 'Change file mode/permissions',
42 command = function () require 'genghis'.chmodx() end,
3845map.normal {
39 keys = '<leader>fr',
40 category = 'files',
41 description = 'Rename file',
42 command = function () require 'genghis'.renameFile() end,
46 keys = '<leader>fr',
47 category = 'files',
48 description = 'Rename file',
49 command = function () require 'genghis'.renameFile() end,
4552map.normal {
46 keys = '<leader>fm',
47 category = 'files',
48 description = 'Move file',
49 command = function () require 'genghis'.moveAndRenameFile() end,
53 keys = '<leader>fm',
54 category = 'files',
55 description = 'Move file',
56 command = function () require 'genghis'.moveAndRenameFile() end,
5259map.normal {
53 keys = '<leader>fM',
54 category = 'files',
55 description = 'Move file to current working directory',
56 command = function () require 'genghis'.moveToFolderInCwd() end,
60 keys = '<leader>fM',
61 category = 'files',
62 description = 'Move file to current working directory',
63 command = function () require 'genghis'.moveToFolderInCwd() end,
5966map.normal {
60 keys = '<leader>ff',
61 category = 'files',
62 description = 'Duplicate file',
63 command = function () require 'genghis'.duplicateFile() end,
67 keys = '<leader>ff',
68 category = 'files',
69 description = 'Duplicate file',
70 command = function () require 'genghis'.duplicateFile() end,
6673map.normal {
67 keys = '<leader>fd',
68 category = 'files',
69 description = 'Move file to system trash',
70 command = function () require 'genghis'.trashFile() end,
74 keys = '<leader>fd',
75 category = 'files',
76 description = 'Move file to system trash',
77 command = function ()
78 local opts = const.win32 and {
79 trashCmd = 'recycle-bin',
80 } or {}
82 require 'genghis'.trashFile( opts )
83 end,
7386return {
74 'chrisgrieser/nvim-genghis',
75 cmd = {
76 'New',
77 'NewFromSelection',
78 'Duplicate',
79 'Rename',
80 'Move',
81 'MoveToFolderInCwd',
82 'Trash',
83 'CopyFilename',
84 'CopyFilepath',
85 'CopyFilepathWithTilde',
86 'CopyRelativePath',
87 'CopyDirectoryPath',
88 'CopyRelativeDirectoryPath',
89 'Chmodx',
90 },
91 dependencies = {
92 'stevearc/dressing.nvim',
93 },
87 'chrisgrieser/nvim-genghis',
88 cmd = {
89 'New',
90 'NewFromSelection',
91 'Duplicate',
92 'Rename',
93 'Move',
94 'MoveToFolderInCwd',
95 'Trash', -- this one does not work on windows, because we cannot configure the trashCmd...
96 'CopyFilename',
97 'CopyFilepath',
98 'CopyFilepathWithTilde',
99 'CopyRelativePath',
100 'CopyDirectoryPath',
101 'CopyRelativeDirectoryPath',
102 'Chmodx',
103 },
104 dependencies = {
105 'stevearc/dressing.nvim',
106 },

neovim/lua/bugabinga/plugins/luasnip.lua

Modified

+2 / −0 text lines

11--FIXME: own this
22return {
33 'L3MON4D3/LuaSnip',
4 version = 'v2.*',
5 build = false,
46 dependencies = {
57 'stevearc/vim-vscode-snippets',
68 },

neovim/lua/bugabinga/plugins/neodev.lua

Modified

+4 / −0 text lines

55 -- If you disable this, then you have to set {before_init=require("neodev.lsp").before_init}
66 -- in your lsp start options
77 lspconfig = false,
8 setup_jsonls = false,
9 -- override = function ( root_dir, library )
10 -- vim.print( root_dir, library )
11 -- end,
812 },
913}

neovim/lua/bugabinga/plugins/sessions.lua

Deleted
deleted file mode 100644

+0 / −98 text lines

1local map = require 'std.map'
2local auto = require 'std.auto'
3
4local LAST_SESSION = 'last'
5
6auto 'automatic_session_management' {
7 {
8 events = 'VimEnter',
9 description = 'Load automatically saved session for the CWD',
10 command = function ()
11 -- Only load the session if nvim was started with no args
12 if vim.fn.argc( -1 ) == 0 then
13 -- Save these to a different directory, so our manual sessions don't get polluted
14 prequire 'resession'.load( vim.fn.getcwd(), { dir = 'autosession', silence_errors = true, } )
15 end
16 end,
17 },
18 {
19 events = 'VimLeavePre',
20 description = 'Automatically save sessions for the CWD (tab)',
21 command = function () prequire 'resession'.save_tab( vim.fn.getcwd(), { dir = 'autosession', notify = false, } ) end,
22 },
23 {
24 events = 'VimLeavePre',
25 description = 'Automatically save last session (all tabs)',
26 command = function () prequire 'resession'.save( LAST_SESSION ) end,
27 },
28}
30map.normal {
31 description = 'Restore last session',
32 category = 'history',
33 keys = '<leader>sl',
34 command = function () prequire 'resession'.load( LAST_SESSION ) end,
35}
37map.normal {
38 description = 'Restore a session',
39 category = 'history',
40 keys = '<leader>sL',
41 command = function () prequire 'resession'.load() end,
42}
44map.normal {
45 description = 'Delete session',
46 category = 'history',
47 keys = '<leader>sd',
48 command = function () prequire 'resession'.delete() end,
49}
51map.normal {
52 description = 'Save session (tab)',
53 category = 'history',
54 keys = '<leader>ss',
55 command = function () prequire 'resession'.save_tab() end,
56}
58map.normal {
59 description = 'Save session (all tabs)',
60 category = 'history',
61 keys = '<leader>sS',
62 command = function () prequire 'resession'.save() end,
63}
65return {
66 'stevearc/resession.nvim',
67 version = '1.*',
68 event = 'VeryLazy',
69 opts = {
70 autosave = { enable = true, },
71 -- Save and restore these options
72 options = {
73 'binary',
74 'bufhidden',
75 'buflisted',
76 'cmdheight',
77 'diff',
78 'filetype',
79 'modifiable',
80 'previewwindow',
81 'readonly',
82 'scrollbind',
83 'winfixheight',
84 'winfixwidth',
85 'cursorline',
86 'virtualedit',
87 'number',
88 'spell',
89 },
90 -- only save buffers that are associated with the cwd of the current tab
91 tab_buf_filter = function ( tabpage, bufnr )
92 local dir = vim.fn.getcwd( -1, vim.api.nvim_tabpage_get_number( tabpage ) )
93 -- ensure dir has trailing /
94 dir = dir:sub( -1 ) ~= '/' and dir .. '/' or dir
95 return vim.startswith( vim.api.nvim_buf_get_name( bufnr ), dir )
96 end,
97 },
98}

neovim/lua/bugabinga/plugins/surround.lua

Modified

+61 / −20 text lines

11return {
2 'kylechui/nvim-surround',
3 event = 'VeryLazy',
4 opts = {
5 keymaps = {
6 insert = '<C-g>ms',
7 insert_line = '<C-g>mS',
8 normal = 'ms',
9 normal_cur = 'mss',
10 normal_line = 'mS',
11 normal_cur_line = 'mSS',
12 visual = 'ms',
13 visual_line = 'mS',
14 delete = 'md',
15 change = 'mc',
16 change_line = 'mC',
17 },
18 },
19 dependencies = {
20 'nvim-treesitter/nvim-treesitter',
21 },
2 'kylechui/nvim-surround',
3 keys = {
4 '<C-g>ms',
5 '<C-g>mS',
6
7 'ms',
8 'mss',
9 'mS',
10 'mSS',
12 'ms',
13 'mS',
15 'md',
17 'mr',
18 'mR',
19 },
20 opts = {
21 -- setting key maps for this plugin is pretty intricate.
22 -- normally I would set them myself, but in this case not...
23 keymaps = {
24 insert = '<C-g>ms',
25 insert_line = '<C-g>mS',
27 normal = 'ms',
28 normal_cur = 'mss',
29 normal_line = 'mS',
30 normal_cur_line = 'mSS',
32 visual = 'ms',
33 visual_line = 'mS',
35 delete = 'md',
37 change = 'mr',
38 change_line = 'mR',
39 },
40 surrounds = {
41 ['R'] = {
42 add = { "require '", "'", },
43 find = "require%b''",
44 --FIXME: find out how to craft these, those cannot be correct right now
45 delete = "^(require')().-(')()$",
46 change = {
47 target = "^(require')().-('()$",
48 },
49 },
50 ['P'] = {
51 add = { 'vim.print(', ')', },
52 find = 'vim%.print%b()',
53 delete = '^(vim%.print%()().-(%))()$',
54 change = {
55 target = '^(vim%.print%()().-(%))()$',
56 },
57 },
58 },
59 },
60 dependencies = {
61 'nvim-treesitter/nvim-treesitter',
62 },

neovim/lua/bugabinga/plugins/telescope.lua

Modified

+0 / −1 text lines

9191 'nvim-telescope/telescope.nvim',
9292 version = '0.*',
9393 cmd = 'Telescope',
94 event = 'VeryLazy',
9594 dependencies = {
9695 {
9796 'nvim-telescope/telescope-fzf-native.nvim',

neovim/lua/bugabinga/plugins/tests.lua

Deleted
deleted file mode 100644

+0 / −137 text lines

1local debug = require 'std.dbg'
2local icon = require 'std.icon'
3local map = require 'std.map'
4
5map.normal {
6 description = 'Run all tests',
7 category = 'test',
8 keys = '<leader>7n',
9 command = function () prequire 'neotest'.run.run {} end,
10}
12map.normal {
13 description = 'Run all tests',
14 category = 'test',
15 keys = '<leader>7n',
16 command = function () prequire 'neotest'.run.run {} end,
17}
19map.normal {
20 description = 'Run tests for current file',
21 category = 'test',
22 keys = '<leader>7t',
23 command = function () prequire 'neotest'.run.run { vim.api.nvim_buf_get_name( 0 ), } end,
24}
26map.normal {
27 description = 'Run all test suites',
28 category = 'test',
29 keys = '<leader>7a',
30 command = function ()
31 for _, adapter_id in ipairs( require 'neotest'.run.adapters() ) do
32 prequire 'neotest'.run.run { suite = true, adapter = adapter_id, }
33 end
34 end,
35}
37map.normal {
38 description = 'Run last test',
39 category = 'test',
40 keys = '<leader>7l',
41 command = function () prequire 'neotest'.run.run_last() end,
42}
44map.normal {
45 description = 'Run all tests in debugger',
46 category = 'test',
47 keys = '<leader>7d',
48 command = function () prequire 'neotest'.run.run { strategy = 'dap', } end,
49}
51map.normal {
52 description = 'Show test summary',
53 category = 'test',
54 keys = '<leader>7p',
55 command = function () prequire 'neotest'.summary.toggle() end,
56}
58map.normal {
59 description = 'Show test output',
60 category = 'test',
61 keys = '<leader>7o',
62 command = function () prequire 'neotest'.output.open { short = true, } end,
63}
65-- Investigate:
66-- * Does neotest have ability to throttle groups of individual test runs?
67-- * Tangential, but also check out https://github.com/andythigpen/nvim-coverage
68return {
69 'nvim-neotest/neotest',
70 dependencies = {
71 'nvim-lua/plenary.nvim',
72 'nvim-neotest/neotest-plenary',
73 'nvim-neotest/nvim-nio',
74 'stevearc/overseer.nvim',
75 },
77 config = function ()
78 local neotest = require 'neotest'
79 if debug.get() then
80 require 'neotest.logging':set_level 'trace'
81 end
82 neotest.setup {
83 adapters = {
84 require 'neotest-plenary',
85 },
86 discovery = {
87 enabled = false,
88 },
89 consumers = {
90 overseer = prequire 'neotest.consumers.overseer',
91 },
92 summary = {
93 mappings = {
94 attach = 'a',
95 expand = 'l',
96 expand_all = 'L',
97 jumpto = 'gf',
98 output = 'o',
99 run = '<C-r>',
100 short = 'p',
101 stop = 'u',
102 },
103 },
104 icons = {
105 passed = icon.passed,
106 running = icon.running,
107 failed = icon.failed,
108 unknown = icon.unknown,
109 running_animated = vim.tbl_map(
110 function ( s ) return s .. ' ' end,
111 {
112 icon.progress_0,
113 icon.progress_1,
114 icon.progress_2,
115 icon.progress_3,
116 icon.progress_4,
117 icon.progress_5,
118 icon.progress_6,
119 icon.progress_7,
120 icon.progress_8,
121 icon.progress_9,
122 }
123 ),
124 },
125 diagnostic = {
126 enabled = true,
127 },
128 output = {
129 enabled = true,
130 open_on_run = false,
131 },
132 status = {
133 enabled = true,
134 },
135 }
136 end,
137}

neovim/lua/bugabinga/plugins/text-case.lua

Modified

+2 / −5 text lines

1-- FIXME: own this
12return {
23 'johmsalas/text-case.nvim',
34 dependencies = { 'nvim-telescope/telescope.nvim', },
78 end,
89 keys = {
910 'ga', -- Default invocation prefix
10 { 'gA', '<cmd>TextCaseOpenTelescope<CR>', mode = { 'n', 'x', }, desc = 'Telescope', },
11 { 'gA', '<cmd>TextCaseOpenTelescope<CR>', mode = { 'n', 'x', }, desc = 'Change text case', },
1112 },
1213 cmd = {
1314 'TextCaseOpenTelescope',
1516 'TextCaseOpenTelescopeLSPChange',
1617 'TextCaseStartReplacingCommand',
1718 },
18 -- If you want to use the interactive feature of the `Subs` command right away, text-case.nvim
19 -- has to be loaded on startup. Otherwise, the interactive feature of the `Subs` will only be
20 -- available after the first executing of it or after a keymap of text-case.nvim has been used.
21 lazy = false,

neovim/lua/bugabinga/plugins/treesitter.lua

Modified

+209 / −198 text lines

11require 'bugabinga.health'.add_dependency
22{ name = 'CMake', name_of_executable = 'cmake', }
3 { name_of_executable = 'make', }
4 { name_of_executable = 'zig', }
5 { name = 'TreeSitter CLI', name_of_executable = 'tree-sitter', }
6 { name_of_executable = 'tar', }
3 { name_of_executable = 'make', }
4 { name_of_executable = 'zig', }
5 { name = 'TreeSitter CLI', name_of_executable = 'tree-sitter', }
6 { name_of_executable = 'tar', }
7
8local events = { 'VeryLazy', }
9table.insert( events, vim.g.FILE_LOADED_EVENTS )
811return {
9 'nvim-treesitter/nvim-treesitter',
10 -- version = '0.9.*',
11 branch = 'master',
12 -- restoring session throws errors, if this is lazy
13 lazy = false,
14 build = function ()
15 require 'nvim-treesitter.install'.update { with_sync = false, }
16 end,
17 dependencies = {
18 'nvim-treesitter/playground',
19 'nvim-treesitter/nvim-treesitter-textobjects',
20 'windwp/nvim-ts-autotag',
21 'RRethy/nvim-treesitter-endwise',
22 'nvim-treesitter/nvim-treesitter-context',
23 'nushell/tree-sitter-nu',
24 },
25 config = function ()
26 local install = require 'nvim-treesitter.install'
27 local configs = require 'nvim-treesitter.configs'
12 'nvim-treesitter/nvim-treesitter',
13 -- version = '0.9.*',
14 branch = 'master',
15 event = events,
16 init = function ( plugin )
17 -- PERF: add nvim-treesitter queries to the rtp and it's custom query predicates early
18 -- This is needed because a bunch of plugins no longer `require("nvim-treesitter")`, which
19 -- no longer trigger the **nvim-treesitter** module to be loaded in time.
20 -- Luckily, the only things that those plugins need are the custom queries, which we make available
21 -- during startup.
22 require 'lazy.core.loader'.add_to_rtp( plugin )
23 require 'nvim-treesitter.query_predicates'
24 end,
25 build = function ()
26 require 'nvim-treesitter.install'.update { with_sync = false, }
27 end,
28 dependencies = {
29 'nvim-treesitter/playground',
30 'nvim-treesitter/nvim-treesitter-textobjects',
31 'windwp/nvim-ts-autotag',
32 'RRethy/nvim-treesitter-endwise',
33 'nvim-treesitter/nvim-treesitter-context',
34 'nushell/tree-sitter-nu',
35 },
36 config = function ()
37 local install = require 'nvim-treesitter.install'
38 local configs = require 'nvim-treesitter.configs'
29 install.prefer_git = false
30 install.compilers = { 'clang', 'zig', 'gcc', 'cl', 'cc', vim.fn.getenv 'CC', }
40 install.prefer_git = false
41 install.compilers = { 'zig', 'clang', 'gcc', 'cl', 'cc', vim.fn.getenv 'CC', }
33 local should_disable = function ( _, bufnr )
34 local max_filesize = 5 * 1024 * 1024 --MiB
35 local ok, stats = pcall( vim.loop.fs_stat, vim.api.nvim_buf_get_name( bufnr or 0 ) )
36 if ok and stats and stats.size > max_filesize then
37 return true
38 end
39 return false
40 end
44 local should_disable = function ( _, bufnr )
45 local max_filesize = 5 * 1024 * 1024 --MiB
46 local ok, stats = pcall( vim.loop.fs_stat, vim.api.nvim_buf_get_name( bufnr or 0 ) )
47 if ok and stats and stats.size > max_filesize then
48 return true
49 end
50 return false
51 end
42 ---@diagnostic disable-next-line: missing-fields
43 configs.setup {
44 sync_install = false,
45 ensure_installed = {
46 'bash',
47 'c',
48 'comment',
49 'diff',
50 'dot',
51 'dtd',
52 'git_config',
53 'gitattributes',
54 'gitcommit',
55 'gitignore',
56 'ini',
57 'java',
58 'just',
59 'jsonc',
60 'lua',
61 'luap',
62 'luadoc',
63 'markdown',
64 'markdown_inline',
65 'muttrc',
66 'nasm',
67 'nix',
68 'nu',
69 'passwd',
70 'pem',
71 'properties',
72 'proto',
73 'printf',
74 'query',
75 'regex',
76 'ssh_config',
77 'toml',
78 'udev',
79 'vim',
80 'vimdoc',
81 'xml',
82 'zig',
83 },
53 ---@diagnostic disable-next-line: missing-fields
54 configs.setup {
55 sync_install = false,
56 ensure_installed = {
57 'bash',
58 'c',
59 'comment',
60 'diff',
61 'dot',
62 'dtd',
63 'git_config',
64 'gitattributes',
65 'gitcommit',
66 'gitignore',
67 'ini',
68 'java',
69 'just',
70 'jsonc',
71 'lua',
72 'luap',
73 'luadoc',
74 'markdown',
75 'markdown_inline',
76 'muttrc',
77 'nasm',
78 'nix',
79 'nu',
80 'passwd',
81 'pem',
82 'properties',
83 'proto',
84 'printf',
85 'query',
86 'regex',
87 'ssh_config',
88 'toml',
89 'udev',
90 'vim',
91 'vimdoc',
92 'xml',
93 'zig',
94 },
85 ignore_install = { 'oil', },
96 ignore_install = { 'oil', },
87 auto_install = true,
98 auto_install = true,
89 autotag = { enable = true, disable = should_disable, },
90 endwise = { enable = true, disable = should_disable, },
100 autotag = { enable = true, disable = should_disable, },
101 endwise = { enable = true, disable = should_disable, },
92 highlight = {
93 enable = true,
94 disable = should_disable,
95 additional_vim_regex_highlighting = false,
96 },
103 highlight = {
104 enable = true,
105 disable = should_disable,
106 additional_vim_regex_highlighting = false,
107 },
98 incremental_selection = {
99 enable = true,
100 disable = should_disable,
101 keymaps = {
102 init_selection = '<up>',
103 node_incremental = '<up>',
104 node_decremental = '<down>',
105 scope_incremental = '<right>',
106 },
107 },
109 incremental_selection = {
110 enable = true,
111 disable = should_disable,
112 keymaps = {
113 init_selection = '<up>',
114 node_incremental = '<up>',
115 node_decremental = '<down>',
116 scope_incremental = '<right>',
117 },
118 },
109 indent = { enable = true, },
120 indent = { enable = true, },
111 playground = {
112 enable = true,
113 disable = should_disable,
114 updatetime = 25,
115 persist_queries = false,
116 keybindings = {
117 toggle_query_editor = 'o',
118 toggle_hl_groups = 'i',
119 toggle_injected_languages = 't',
120 toggle_anonymous_nodes = 'a',
121 toggle_language_display = 'I',
122 focus_language = 'f',
123 unfocus_language = 'F',
124 update = 'R',
125 goto_node = '<cr>',
126 show_help = '?',
127 },
128 },
122 playground = {
123 enable = true,
124 disable = should_disable,
125 updatetime = 25,
126 persist_queries = false,
127 keybindings = {
128 toggle_query_editor = 'o',
129 toggle_hl_groups = 'i',
130 toggle_injected_languages = 't',
131 toggle_anonymous_nodes = 'a',
132 toggle_language_display = 'I',
133 focus_language = 'f',
134 unfocus_language = 'F',
135 update = 'R',
136 goto_node = '<cr>',
137 show_help = '?',
138 },
139 },
130 textobjects = {
131 select = {
132 enable = true,
133 disable = should_disable,
134 lookahead = true,
135 keymaps = {
136 ['af'] = { query = '@call.outer', desc = 'outer function call', },
137 ['if'] = { query = '@call.inner', desc = 'inner function call', },
141 textobjects = {
142 select = {
143 enable = true,
144 disable = should_disable,
145 lookahead = true,
146 keymaps = {
147 ['af'] = { query = '@call.outer', desc = 'outer function call', },
148 ['if'] = { query = '@call.inner', desc = 'inner function call', },
139 ['am'] = { query = '@function.outer', desc = 'outer function definition', },
140 ['im'] = { query = '@function.inner', desc = 'inner function definition', },
150 ['am'] = { query = '@function.outer', desc = 'outer function definition', },
151 ['im'] = { query = '@function.inner', desc = 'inner function definition', },
142 ['ac'] = { query = '@class.outer', desc = 'outer class', },
143 ['ic'] = { query = '@class.inner', desc = 'inner class', },
153 ['ac'] = { query = '@class.outer', desc = 'outer class', },
154 ['ic'] = { query = '@class.inner', desc = 'inner class', },
145 ['ai'] = { query = '@conditional.outer', desc = 'outer conditional', },
146 ['ii'] = { query = '@conditional.inner', desc = 'inner conditional', },
156 ['ai'] = { query = '@conditional.outer', desc = 'outer conditional', },
157 ['ii'] = { query = '@conditional.inner', desc = 'inner conditional', },
148 ['al'] = { query = '@loop.outer', desc = 'outer loop', },
149 ['il'] = { query = '@loop.inner', desc = 'inner loop', },
159 ['al'] = { query = '@loop.outer', desc = 'outer loop', },
160 ['il'] = { query = '@loop.inner', desc = 'inner loop', },
151 ['aa'] = { query = '@parameter.outer', desc = 'outer parameter', },
152 ['ia'] = { query = '@parameter.inner', desc = 'inner parameter', },
162 ['aa'] = { query = '@parameter.outer', desc = 'outer parameter', },
163 ['ia'] = { query = '@parameter.inner', desc = 'inner parameter', },
154 ['agc'] = { query = '@comment.outer', desc = 'outer comment', },
155 ['igc'] = { query = '@comment.inner', desc = 'inner comment', },
156 },
157 selection_modes = {
158 ['@parameter.outer'] = 'v',
159 ['@function.outer'] = 'v',
160 ['@class.outer'] = '<c-v>',
161 ['@scope'] = 'V',
162 },
163 include_surroundig_whitespace = true,
164 },
165 ['agc'] = { query = '@comment.outer', desc = 'outer comment', },
166 ['igc'] = { query = '@comment.inner', desc = 'inner comment', },
167 },
168 selection_modes = {
169 ['@parameter.outer'] = 'v',
170 ['@function.outer'] = 'v',
171 ['@class.outer'] = '<c-v>',
172 ['@scope'] = 'V',
173 },
174 include_surroundig_whitespace = true,
175 },
166 swap = {
167 enable = true,
168 disable = should_disable,
169 swap_next = {
170 ['<leader>rwn'] = { query = '@parameter.inner', desc = 'Swap parameter with next', },
171 },
172 swap_previous = {
173 ['<leader>rwp'] = { query = '@parameter.inner', desc = 'Swap parameter with previous', },
174 },
175 },
177 swap = {
178 enable = true,
179 disable = should_disable,
180 swap_next = {
181 ['<leader>rwn'] = { query = '@parameter.inner', desc = 'Swap parameter with next', },
182 },
183 swap_previous = {
184 ['<leader>rwp'] = { query = '@parameter.inner', desc = 'Swap parameter with previous', },
185 },
186 },
177 lsp_interop = {
178 enable = true,
179 disable = should_disable,
180 border = vim.g.border_style,
181 floating_preview_opts = {},
182 peek_definition_code = {
183 ['<leader>lpf'] = { query = '@function.outer', desc = 'Peek definition of outer function.', },
184 ['<leader>lpc'] = { query = '@class.outer', desc = 'Peek definition of outer class.', },
185 },
186 },
188 lsp_interop = {
189 enable = true,
190 disable = should_disable,
191 border = vim.g.border_style,
192 floating_preview_opts = {},
193 peek_definition_code = {
194 ['<leader>lpf'] = { query = '@function.outer', desc = 'Peek definition of outer function.', },
195 ['<leader>lpc'] = { query = '@class.outer', desc = 'Peek definition of outer class.', },
196 },
197 },
188 move = {
189 enable = true,
190 disable = should_disable,
191 set_jumps = true,
192 goto_next = {
193 [']f'] = { query = '@call.outer', desc = 'Goto next function call', },
194 [']m'] = { query = '@fucntion.outer', desc = 'Goto next function definition', },
195 [']c'] = { query = '@class.outer', desc = 'Goto next class', },
196 [']o'] = { query = '@conditional.outer', desc = 'Goto next conditional', },
197 [']p'] = { query = '@parameter.outer', desc = 'Goto next parameter', },
198 },
199 goto_previous = {
200 ['[f'] = { query = '@call.outer', desc = 'Goto previous function call', },
201 ['[m'] = { query = '@function.outer', desc = 'Goto previous function definition', },
202 ['[c'] = { query = '@class.outer', desc = 'goto previous class', },
203 ['[o'] = { query = '@conditional.outer', desc = 'Goto previous conditional', },
204 ['[p'] = { query = '@parameter.outer', desc = 'Goto previous parameter', },
205 },
206 },
207 },
208 }
209 require 'treesitter-context'.setup {
210 enable = true, -- Enable this plugin (Can be enabled/disabled later via commands)
211 max_lines = 0, -- How many lines the window should span. Values <= 0 mean no limit.
212 min_window_height = 0, -- Minimum editor window height to enable context. Values <= 0 mean no limit.
213 line_numbers = true,
214 multiline_threshold = 20, -- Maximum number of lines to show for a single context
215 trim_scope = 'outer', -- Which context lines to discard if `max_lines` is exceeded. Choices: 'inner', 'outer'
216 mode = 'cursor', -- Line used to calculate context. Choices: 'cursor', 'topline'
217 -- Separator between context and content. Should be a single character string, like '-'.
218 -- When separator is set, the context will only show up when there are at least 2 lines above cursorline.
219 separator = nil,
220 zindex = 20, -- The Z-index of the context window
221 on_attach = nil, -- (fun(buf: integer): boolean) return false to disable attaching
222 }
223 end,
199 move = {
200 enable = true,
201 disable = should_disable,
202 set_jumps = true,
203 goto_next = {
204 [']f'] = { query = '@call.outer', desc = 'Goto next function call', },
205 [']m'] = { query = '@fucntion.outer', desc = 'Goto next function definition', },
206 [']c'] = { query = '@class.outer', desc = 'Goto next class', },
207 [']o'] = { query = '@conditional.outer', desc = 'Goto next conditional', },
208 [']p'] = { query = '@parameter.outer', desc = 'Goto next parameter', },
209 },
210 goto_previous = {
211 ['[f'] = { query = '@call.outer', desc = 'Goto previous function call', },
212 ['[m'] = { query = '@function.outer', desc = 'Goto previous function definition', },
213 ['[c'] = { query = '@class.outer', desc = 'goto previous class', },
214 ['[o'] = { query = '@conditional.outer', desc = 'Goto previous conditional', },
215 ['[p'] = { query = '@parameter.outer', desc = 'Goto previous parameter', },
216 },
217 },
218 },
219 }
220 require 'treesitter-context'.setup {
221 enable = true, -- Enable this plugin (Can be enabled/disabled later via commands)
222 max_lines = 0, -- How many lines the window should span. Values <= 0 mean no limit.
223 min_window_height = 0, -- Minimum editor window height to enable context. Values <= 0 mean no limit.
224 line_numbers = true,
225 multiline_threshold = 20, -- Maximum number of lines to show for a single context
226 trim_scope = 'outer', -- Which context lines to discard if `max_lines` is exceeded. Choices: 'inner', 'outer'
227 mode = 'cursor', -- Line used to calculate context. Choices: 'cursor', 'topline'
228 -- Separator between context and content. Should be a single character string, like '-'.
229 -- When separator is set, the context will only show up when there are at least 2 lines above cursorline.
230 separator = nil,
231 zindex = 20, -- The Z-index of the context window
232 on_attach = nil, -- (fun(buf: integer): boolean) return false to disable attaching
233 }
234 end,

neovim/lua/bugabinga/plugins/whichkey.lua

Modified

+1 / −0 text lines

4242 ['<leader>'] = {
4343 ['7'] = { name = 'tests', _ = 'which_key_ignore', },
4444 m = { name = '|m|ark', _ = 'which_key_ignore', },
45 b = { name = '|b|uffer', _ = 'which_key_ignore', },
4546 h = { name = '|h|unk', _ = 'which_key_ignore', },
4647 f = { name = '|f|iles', _ = 'which_key_ignore', },
4748 g = { name = '|g|enerate', _ = 'which_key_ignore', },

neovim/lua/bugabinga/sessions.lua

Added
new file mode 100644

+100 / −0 text lines

1local map = require 'std.map'
2local auto = require 'std.auto'
3
4local sessions = vim.fs.normalize( vim.fn.stdpath 'data' .. '/sessions' )
5
6-- FIXME: this needs to live somewhere in std
7local file_exists = function ( path )
8 local stat = vim.uv.fs_stat( path )
9 ---@diagnostic disable-next-line: undefined-field
10 return stat ~= nil and stat.type ~= nil
11end
13local encode = function ( data )
14 vim.validate { data = { data, 'string', }, }
16 -- replace some chars in base64, that are not allowed in file names.
17 return vim.base64.encode( data ):gsub( '%+', '-' ):gsub( '%/', '.' ):gsub( '%=', '_' )
18end
20local decode = function ( data )
21 vim.validate { data = { data, 'string', }, }
22 return vim.base64.decode( data:gsub( '%-', '+' ):gsub( '%.', '/' ):gsub( '%_', '=' )
23 )
24end
26local to_session_path = function ( path )
27 local encoded = sessions .. '/' .. encode( path )
28 local session_save_path = vim.fs.normalize( encoded )
29 return session_save_path
30end
32local save_session_for_cwd = function ()
33 local cwd = vim.uv.cwd()
34 local session_save_path = to_session_path( cwd )
35 vim.cmd.mksession { session_save_path, bang = true, }
36end
38local load_session = function ( session )
39 local session_path = vim.fs.normalize( sessions .. '/' .. session )
41 if file_exists( session_path ) then
42 vim.cmd.source { session_path, }
43 else
44 vim.notify( 'No session `' .. session .. '` found!' )
45 end
46end
48local load_current_session = function ()
49end
51local load_any_session = function ()
52 local all_sessions = {}
54 for session, type in vim.fs.dir( sessions ) do
55 if type == 'file' then
56 table.insert( all_sessions, session )
57 end
58 end
60 table.sort( all_sessions, function ( a, b )
61 a = vim.fs.normalize( sessions .. '/' .. a )
62 b = vim.fs.normalize( sessions .. '/' .. b )
63 return vim.uv.fs_stat( a ).mtime.sec > vim.uv.fs_stat( b ).mtime.sec
64 end )
66 vim.ui.select(
67 all_sessions,
68 {
69 prompt = 'Select a session to load: ',
70 format_item = function ( encoded_session_path )
71 local session_name = vim.fs.basename( encoded_session_path )
72 session_name = decode( session_name )
73 session_name = vim.fn.fnamemodify( session_name, ':~' )
74 return '󱦰 ' .. session_name
75 end,
76 },
77 function ( session )
78 if session then load_session( session ) end
79 end )
80end
82map.normal {
83 description = 'Load for cwd, if available.',
84 category = 'session',
85 keys = '<F4>',
86 command = load_current_session,
87}
89map.normal {
90 description = 'Load any.',
91 category = 'session',
92 keys = '<F4><F4>',
93 command = load_any_session,
94}
96auto 'save_session_on_exit' {
97 description = 'Save current session for cwd, when leaving vim',
98 events = 'VimLeavePre',
99 command = save_session_for_cwd,
100}

neovim/lua/bugabinga/terminal.lua

Modified

+23 / −3 text lines

44map.normal {
55 description = 'Open terminal in a split',
66 category = 'terminal',
7 keys = '<F7>',
7 keys = '<F12>',
88 command = function ()
99 local cwd = vim.uv.cwd()
1010 ---@diagnostic disable-next-line: undefined-field
1111 local shell = vim.opt.shell:get()
12 local open_term_cmd = string.format( 'split term://%s//%s', cwd, shell )
12 -- paths in term names seem to be relative to home
13 local relative_cwd = vim.fn.fnamemodify( cwd, ':~' )
14 local term_name = string.format( 'term://%s//%s', relative_cwd, shell )
15 local buffers = vim.api.nvim_list_bufs()
16 local existing_term = vim.iter( buffers ):map( function ( buffer_number )
17 return { buffer_number, vim.api.nvim_buf_get_name( buffer_number ), }
18 end ):filter( function ( buffer )
19 return string.find( buffer[2], relative_cwd, 1, true )
20 end ):next()
21 if existing_term then
22 term_name = existing_term[2]
23 end
24 local open_term_cmd = string.format( 'split %s', term_name )
1325 vim.cmd( open_term_cmd )
1426 end,
1729local terminal_settings = function ()
1830 map.terminal {
19 description = 'Quit insert mode via <esc>',
31 description = 'Quit terminal mode via <esc>',
2032 category = 'terminal',
2133 keys = '<esc>',
2234 buffer = true,
2335 command = [[ <C-\><C-n> ]],
2436 }
38 map.normal.terminal {
39 description = 'Close.',
40 category = 'terminal',
41 keys = '<F12>',
42 buffer = true,
43 command = [[<cmd>close<cr>]],
44 }
2646 vim.opt_local.spell = false
2747 vim.cmd.startinsert()
2848end

neovim/lua/std/map.lua

Modified

+4 / −0 text lines

4949 local options = vim.tbl_extend("keep", map.options, {
5050 silent = true,
5151 desc = map.description,
52 buffer = map.buffer,
53 remap = map.remap,
5254 })
5456 if vim.tbl_isempty(self.modes) then
5557 self.modes[1] = available_modes.normal_visual_select_operator_pending
5658 end
60 -- vim.print('vim.keymap', self.modes, keys, command, options)
5862 if type(keys) == "table" then
5963 for _, key in ipairs(keys) do
6064 vim.keymap.set(self.modes, key, command, options)

nushell/env.nu

Modified

+0 / −9 text lines

4646 ($nu.config-path | path dirname | path join 'completions')
49if $env.WIN32 {
50 # TODO: insert scoop cargo path here
51 # $env.CARGO_HOME = ( '~/.cargo' | path expand )
52 $env.Path = ( $env.Path | prepend '' )
53} else {
54 $env.CARGO_HOME = ( '~/.cargo' | path expand )
55 $env.PATH = ( $env.PATH | prepend ( $env.CARGO_HOME | path join 'bin') )
56 $env.PATH = ( $env.PATH | prepend ( '~/.local/bin'| path expand ) )
57}

tools/cargo-tools.nu

Modified

+4 / −24 text lines

55# we also cannot use `cargo install --list` to search for the binary name, in case the crate
66# is not installed yet
77let cargo_crates = [
8 [ name bin features];
9 [ "sccache" "sccache" [] ]
8 [ name bin crago_args];
109 [ "inferno" "inferno-flamegraph" [] ]
1110 [ "nu" "nu" [ "--features" "extra" ] ]
1211 [ "sd" "sd" [] ]
1413 [ "fd-find" "fd" [] ]
1514 [ "choose", "choose", [] ]
1615 [ "ripgrep" "rg" [] ]
17 [ "onefetch" "onefetch" [] ]
1816 [ "eva" "eva" [] ]
1917 [ "mdcat" "mdcat" [] ]
2018 [ "cargo-update" "cargo-install-update" [] ]
2523 [ "tokei" "tokei" [] ]
2624 [ "bat" "bat" [] ]
2725 [ "pastel" "pastel" [] ]
28 [ "diskonaut" "diskonaut" [] ]
29 [ "menyoki" "menyoki" [] ]
3026 [ "zoxide" "zoxide" [] ]
31 [ "difftastic" "difft" []]
32 [ "grex" "grex" [] ]
33 [ "xh" "xh" [] ]
34 [ "comrak" "comrak" [] ]
35 # [ "bandwhich" "bandwhich" [] ] masked until https://github.com/imsnif/bandwhich/issues/233
3627 [ "lychee" "lychee" [] ]
3728 [ "viu" "viu" [] ]
3829 [ "vivid" "vivid" [] ]
39 [ "silicon" "silicon" [] ]
4030 [ "bottom" "btm" [] ]
41 # [ "sic" "sic" [] ] some issue with ssl on win32?
4231 [ "just" "just" [] ]
4332 [ "mdsh" "mdsh" [] ]
4433 [ "git-delta" "delta" [] ]
4635 [ "stylua" "stylua" [ "--features" "lua52" ] ]
4736 [ "taplo-cli" "taplo" [] ]
4837 [ "lms" "lms" [] ]
38 [ "gitu" "gitu" [ "--locked" ] ]
5141# install all my favorite crate, only if they are not already in PATH.
5242def main [] {
53 # FIXME: nushell in NixOS cannot detect hostname?
54 if (sys).host.name == "NixOS" {
55 #if (sys).host.name == "x230" {
56 if (which akku | is-empty) {
57 echo $'cargo install akku'
58 cargo install --git https://github.com/bugabinga/akku
59 } else {
60 echo $"akku already installed"
61 }
62 }
6343 $cargo_crates | each { | crate |
6444 if ( which $crate.bin | is-empty ) {
65 echo $'cargo install ($crate.name) ($crate.features)'
66 cargo install $crate.name ...$crate.features
45 echo $'cargo install ($crate.name) ($crate.crago_args)'
46 cargo install $crate.name ...$crate.crago_args
6747 } else {
6848 echo $"($crate.name) already installed"
6949 }