repositories / dotfiles

dotfiles

bugabingas dorkfiles

owned by bugabinga

neovim: remove cmp

0bff741c56b57367557fe14296aacc83135e591a

Oliver Jan Krylow <oliver@bugabinga.net> ·

unsigned

Browse filesCompare with HEAD

Changed files (30)

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

Diff layout

neovim/README.md

Modified

+6 / −3 text lines

3939# todo
41* kill custom lsp stuff in favor of lspconfig and try neoconf + nvim-java
42* does status bar fail to display if lsp fails to load?
4143* pandoc with lua filters for diagrams for generating documents and previewing --> https://github.com/tex/vimpreviewpandoc
4244* use gen.ai to generate docs
4345* learn marks and refactor mark.lua
4446* use ltex-ls for markdown, code comments and commit messages
47* create a floating window that shows plugins, that have commands, as reminder
4548* setup DAP
4649* add nu-check to nvim-lint
4750* create facade over vim.api.nvim_create_user_command
48* create skelleton-plugin for default file content based on file type
49* add support for Java mutliline string in autopairs
50* nvim spell for camelcase words
51* create skeleton-plugin for default file content based on file type
52* add support for Java multi line string in autopairs
53* nvim spell for camel case words

neovim/init.lua

Modified

+1 / −3 text lines

99-- ▀ ▀
1111-- setup debug mode
12-- local debug = require 'std.debug'
13-- debug.toggle()
12-- require 'std.debug'.toggle()
1514local ok, loaded
3736-- setup lsp clients
3837ok, loaded = pcall( require, 'bugabinga.lsp' )
3938if not ok then vim.print( 'error while loading lsp', loaded ) end

neovim/lazy-lock.json

Modified

+17 / −27 text lines

11{
22 "Comment.nvim": { "branch": "master", "commit": "0236521ea582747b58869cb72f70ccfa967d2e89" },
3 "LuaSnip": { "branch": "master", "commit": "8ae1dedd988eb56441b7858bd1e8554dfadaa46d" },
43 "actions-preview.nvim": { "branch": "master", "commit": "5c240e6356156b72cfbf7c05feefadae61d7a06f" },
4 "auto-dark-mode.nvim": { "branch": "master", "commit": "e328dc463d238cb7d690fb4daf068eba732a5a14" },
55 "better-escape.nvim": { "branch": "master", "commit": "7e86edafb8c7e73699e0320f225464a298b96d12" },
6 "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
7 "cmp-emoji": { "branch": "main", "commit": "19075c36d5820253d32e2478b6aaf3734aeaafa0" },
8 "cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" },
9 "cmp-nvim-lsp-document-symbol": { "branch": "main", "commit": "f0f53f704c08ea501f9d222b23491b0d354644b0" },
10 "cmp-nvim-lsp-signature-help": { "branch": "main", "commit": "3d8912ebeb56e5ae08ef0906e3a54de1c66b92f1" },
11 "cmp-omni": { "branch": "main", "commit": "4ef610bbd85a5ee4e97e09450c0daecbdc60de86" },
12 "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
13 "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" },
146 "diffview.nvim": { "branch": "main", "commit": "3dc498c9777fe79156f3d32dddd483b8b3dbd95f" },
157 "dressing.nvim": { "branch": "master", "commit": "6f212262061a2120e42da0d1e87326e8a41c0478" },
168 "flash.nvim": { "branch": "main", "commit": "48817af25f51c0590653bbc290866e4890fe1cbe" },
17 "friendly-snippets": { "branch": "main", "commit": "dcd4a586439a1c81357d5b9d26319ae218cc9479" },
18 "gen.nvim": { "branch": "main", "commit": "a6cc144ccd885a6ba104e8285a37e6ab627eda78" },
9 "gen.nvim": { "branch": "main", "commit": "85a739cea06148a56d52f26b01d63de6671ce4ce" },
1910 "gitsigns.nvim": { "branch": "main", "commit": "2c2463dbd82eddd7dbab881c3a62cfbfbe3c67ae" },
2011 "glow.nvim": { "branch": "main", "commit": "238070a686c1da3bccccf1079700eb4b5e19aea4" },
2112 "heirline.nvim": { "branch": "master", "commit": "03cff30d7e7d3ba6fdc00925f015822f79cef908" },
2213 "hlargs.nvim": { "branch": "main", "commit": "0f2dbf02ff948e8fc8ebe07b215f3174a12bbe3c" },
14 "hyper.nvim": { "branch": "main", "commit": "b84fb39e703b1dd487d20c4faf028ee51374c88b" },
2315 "indent-blankline.nvim": { "branch": "master", "commit": "821a7acd88587d966f7e464b0b3031dfe7f5680c" },
24 "lazy.nvim": { "branch": "main", "commit": "aedcd79811d491b60d0a6577a9c1701063c2a609" },
25 "lspkind.nvim": { "branch": "master", "commit": "1735dd5a5054c1fb7feaf8e8658dbab925f4f0cf" },
16 "lazy.nvim": { "branch": "main", "commit": "83493db50a434a4c5c648faf41e2ead80f96e478" },
2617 "lush.nvim": { "branch": "main", "commit": "2e8d34e748642621d761a65e3c2a198154b914e8" },
2718 "mason-tool-installer.nvim": { "branch": "main", "commit": "1212fb6082b7177dde17ea65e429e027835aeb40" },
2819 "mason.nvim": { "branch": "main", "commit": "3b5068f0fc565f337d67a2d315d935f574848ee7" },
3122 "mini.colors": { "branch": "main", "commit": "f64963332f7fcb45c8dfcc243f682a9a0fb9935d" },
3223 "mini.starter": { "branch": "main", "commit": "ce222a5b6de50a9963c1eb62aa16ec6d5efca7ee" },
3324 "mkdir.nvim": { "branch": "main", "commit": "c55d1dee4f099528a1853b28bb28caa802eba217" },
34 "neodev.nvim": { "branch": "main", "commit": "3157f2e876fd6223d36cfa76bee4709247d62fa5" },
35 "neogen": { "branch": "main", "commit": "70127baaff25611deaf1a29d801fc054ad9d2dc1" },
25 "neoconf.nvim": { "branch": "main", "commit": "db1d1bd45f4e91da6abc898281711fa47eda0ece" },
26 "neogen": { "branch": "main", "commit": "b95347a588401a755eadd17482edc1662876bd58" },
3627 "nrpattern.nvim": { "branch": "master", "commit": "f862ce687761078ef3155688151c55f69d28453e" },
37 "nui.nvim": { "branch": "main", "commit": "c3c7fd618dcb5a89e443a2e1033e7d11fdb0596b" },
28 "nui.nvim": { "branch": "main", "commit": "756c59f46057cd2d43619cd3a6d4e01b2aa60295" },
3829 "nvim-autopairs": { "branch": "master", "commit": "c6139ca0d5ad7af129ea6c89cb4c56093f2c034a" },
39 "nvim-cmp": { "branch": "main", "commit": "04e0ca376d6abdbfc8b52180f8ea236cbfddf782" },
4030 "nvim-colorizer.lua": { "branch": "master", "commit": "85855b38011114929f4058efc97af1059ab3e41d" },
41 "nvim-genghis": { "branch": "main", "commit": "d04dbfe57b0ae908ba8e397962a1fcef98ca9fd9" },
31 "nvim-genghis": { "branch": "main", "commit": "8613fc1b43db6cc761733b3630eabff9e86296f7" },
4232 "nvim-gomove": { "branch": "main", "commit": "2b44ae7ac0804f4e3959228122f7c85bef1964e3" },
4333 "nvim-jdtls": { "branch": "master", "commit": "a4746791876166dc146eae573a1b49d24a6652e7" },
4434 "nvim-lastplace": { "branch": "main", "commit": "0bb6103c506315044872e0f84b1f736c4172bb20" },
4535 "nvim-neoclip.lua": { "branch": "main", "commit": "798cd0592a81c185465db3a091a0ff8a21af60fd" },
4636 "nvim-spectre": { "branch": "master", "commit": "e7db8ebca7fd0a604027ebf85acee52f6642c91c" },
47 "nvim-surround": { "branch": "main", "commit": "8f2af76134f37058dc4c27a24bc5f86c9cae76dc" },
48 "nvim-tree.lua": { "branch": "master", "commit": "d52fdeb0a300ac42b9cfa65ae0600a299f8e8677" },
49 "nvim-treesitter": { "branch": "master", "commit": "db12bd416e2764420047e4a5d6b96fe44e4377d5" },
50 "nvim-treesitter-textobjects": { "branch": "master", "commit": "7f00d94543f1fd37cab2afa2e9a6cd54e1c6b9ef" },
37 "nvim-surround": { "branch": "main", "commit": "84a26afce16cffa7e3322cfa80a42cddf60616eb" },
38 "nvim-tree.lua": { "branch": "master", "commit": "efafd73efa9bc8c26282aed563ba0f01c7465b06" },
39 "nvim-treesitter": { "branch": "master", "commit": "9775d5d7c724f81acdd441e7e9edefc4514e990b" },
40 "nvim-treesitter-textobjects": { "branch": "master", "commit": "b7a0bfa3e93697ca5b61b15df633404bf8f45883" },
5141 "nvim-ts-autotag": { "branch": "main", "commit": "531f48334c422222aebc888fd36e7d109cb354cd" },
5242 "nvim-ts-context-commentstring": { "branch": "main", "commit": "7ab799a9792f7cf3883cf28c6a00ad431f3d382a" },
53 "nvim-web-devicons": { "branch": "master", "commit": "0bb67ef952ea3eb7b1bac9c011281471d99a27bc" },
43 "nvim-web-devicons": { "branch": "master", "commit": "4adea17610d140a99c313e3f79a9dc01825d59ae" },
5444 "nvim-window": { "branch": "main", "commit": "e7f5d60eeec8ff37af7be4c9a99f65edf67fc574" },
55 "oil.nvim": { "branch": "master", "commit": "132b4ea0740c417b9d717411cab4cf187e1fd095" },
45 "oil.nvim": { "branch": "master", "commit": "18dfd2458dc741fea683357a17aaa95870b25a3c" },
5646 "persistence.nvim": { "branch": "main", "commit": "4982499c1636eac254b72923ab826ee7827b3084" },
5747 "playground": { "branch": "master", "commit": "ba48c6a62a280eefb7c85725b0915e021a1a0749" },
58 "plenary.nvim": { "branch": "master", "commit": "4f71c0c4a196ceb656c824a70792f3df3ce6bb6d" },
59 "schemastore.nvim": { "branch": "main", "commit": "a93078f016d3216f4ab4e4c65306b65212314d8d" },
60 "specs.nvim": { "branch": "main", "commit": "2743e412bbe21c9d73954c403d01e8de7377890d" },
48 "plenary.nvim": { "branch": "master", "commit": "f7adfc4b3f4f91aab6caebf42b3682945fbc35be" },
49 "schemastore.nvim": { "branch": "main", "commit": "6eb5d8d9ec9f81b75aaa6d15d0f6dc12a066fd3f" },
50 "specs.nvim": { "branch": "main", "commit": "e929006d3f6bb8e43f03e13ac364c67236eb5299" },
6151 "speedtyper.nvim": { "branch": "main", "commit": "2d158eed4c753995b0501a3a7a72464fbb213e3d" },
6252 "ssr.nvim": { "branch": "main", "commit": "bb323ba621ac647b4ac5638b47666e3ef3c279e1" },
6353 "substitute.nvim": { "branch": "main", "commit": "17ffaeb5a1dc2dbef39cf0865d8a4b6000836714" },

neovim/lua/bugabinga/diagnostic.lua

Modified

+1 / −0 text lines

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

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

Deleted
deleted file mode 100644

+0 / −10 text lines

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

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

Modified

+13 / −14 text lines

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

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

Modified

+10 / −15 text lines

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

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

Modified

+2 / −3 text lines

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

neovim/lua/bugabinga/lsp/init.lua

Modified

+45 / −11 text lines

3838local expand_command = function ( command )
3939 vim.validate { command = { command, { 'string', 'table' } } }
41 debug.print( 'expanding command', command )
4341 if type( command ) == 'table' then
4442 command[1] = expand_path( command[1] )
4543 return command
4947end
5149local lsp_start = function ( file_type_event )
50 debug.print 'trying to start lsp'
5251 local match = file_type_event.match
5453 local matches_to_ignore = ignored.filetypes
55 debug.print( 'filetypes to ignore', ignored.filetypes)
56 if vim.iter( ignored.filetypes):find( match ) then return end
54 debug.print( 'filetypes to ignore', ignored.filetypes, 'current filetype', match )
55 if vim.iter( ignored.filetypes ):find( match ) then return end
5857 local bufnr = file_type_event.buf
5958 local buftype = vim.api.nvim_get_option_value( 'buftype', { buf = bufnr } )
60 if vim.iter(ignored.buftypes):find(buftype) then return end
59 debug.print( 'buftypes to ignore', ignored.buftypes, 'current buftype', buftype )
60 if vim.iter( ignored.buftypes ):find( buftype ) then return end
6262 local buffer_path = vim.api.nvim_buf_get_name( bufnr )
9999 :totable()
101101 debug.print( 'POTENTIAL CLIENTS',
102 vim.iter( potential_client_configs ):map( function ( config ) return { name = config.name, command = config.command } end )
103 :totable() )
102 vim.iter( potential_client_configs ):map( function ( config )
103 return {
104 name = config.name,
105 command =
106 config.command
107 }
108 end )
109 :totable() )
105111 if table.is_empty( potential_client_configs ) then
106112 debug.print( 'found no lsp client for', buffer_path )
115121 for _, config in ipairs( potential_client_configs ) do
116122 local root_dir = type( config.root_dir ) == 'string' and config.root_dir or config.root_dir( buffer_path )
117123 local capabilities = vim.lsp.protocol.make_client_capabilities()
118 local cmp_capabilities = require 'cmp_nvim_lsp'.default_capabilities()
119 capabilities = table.extend( 'force', capabilities, cmp_capabilities, config.capabilities )
120 debug.print( 'lsp capabilities', capabilities, config.capabilities, cmp_capabilities )
124 capabilities = table.extend( 'force', capabilities, config.capabilities )
122126 debug.print( 'starting command:', config.command )
423427 desc = 'Shows detailed information about running LSP clients.',
424428} )
426--TODO: lsp restart, lsp exit
430-- TODO: lsp restart, lsp exit
432-- TODO: move to std.icons.lua
433local completion_icons = {
434 Class = ' ',
435 Color = ' ',
436 Constant = ' ',
437 Constructor = ' ',
438 Enum = ' ',
439 EnumMember = ' ',
440 Field = '󰄶 ',
441 File = ' ',
442 Folder = ' ',
443 Function = ' ',
444 Interface = '󰜰',
445 Keyword = '󰌆 ',
446 Method = 'ƒ ',
447 Module = '󰏗 ',
448 Property = ' ',
449 Snippet = '󰘍 ',
450 Struct = ' ',
451 Text = ' ',
452 Unit = ' ',
453 Value = '󰎠 ',
454 Variable = ' ',
455}
457local completion_kinds = vim.lsp.protocol.CompletionItemKind
458for i, kind in ipairs( completion_kinds ) do
459 completion_kinds[i] = completion_icons[kind] or kind
460end
428462return setmetatable( _, {} )

neovim/lua/bugabinga/lsp/lightbulb.lua

Modified

+1 / −1 text lines

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

neovim/lua/bugabinga/options/behaviour.lua

Modified

+12 / −11 text lines

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

neovim/lua/bugabinga/options/keymaps.lua

Modified

+13 / −12 text lines

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

neovim/lua/bugabinga/options/ui.lua

Modified

+2 / −0 text lines

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

neovim/lua/bugabinga/plugins/autopairs.lua

Modified

+2 / −14 text lines

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

neovim/lua/bugabinga/plugins/cmp.lua

Deleted
deleted file mode 100644

+0 / −117 text lines

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

neovim/lua/bugabinga/plugins/dressing.lua

Modified

+2 / −1 text lines

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

neovim/lua/bugabinga/plugins/hyper.lua

Added
new file mode 100644

+8 / −0 text lines

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

neovim/lua/bugabinga/plugins/neodev.lua

Deleted
deleted file mode 100644

+0 / −6 text lines

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

neovim/lua/bugabinga/plugins/specs.lua

Modified

+36 / −35 text lines

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

neovim/lua/bugabinga/plugins/starter.lua

Modified

+4 / −2 text lines

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

neovim/lua/bugabinga/plugins/treesj.lua

Modified

+19 / −17 text lines

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

neovim/lua/bugabinga/ui.lua

Modified

+5 / −5 text lines

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

neovim/lua/std/display.lua

Deleted
deleted file mode 100644

+0 / −44 text lines

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

neovim/lua/std/icon.lua

Modified

+5 / −5 text lines

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

neovim/lua/std/ignored.lua

Modified

+0 / −1 text lines

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

neovim/lua/std/project.lua

Modified

+27 / −9 text lines

99local cache = {}
1010local hasher = vim.fn.sha256
1111local markers_to_string = function ( markers )
12 return table.deep_concat( markers, {
13 prefix = '',
14 suffix = '',
15 row_delimiter = '',
16 key_value_delimiter = '',
17 fill = '',
18 newline = '',
19 } )
12 return vim.inspect( markers )
2013end
2114local create_hash = function ( path, markers )
2215 local path_hash = hasher( path )
8881 local cache_hit = cache_get( path, markers )
8982 if cache_hit then
90 -- vim.print("CACHE HIT", cache_hit)
83 debug.print( 'CACHE HIT', cache_hit )
9184 return cache_hit
9285 end
279272 return rooter and rooter( path ) or fallback_rooter( path )
280273end
275--- @return table parsed configuration as could be found in the `.project` file in the root directory. Empty otherwise.
276local parse_project_configuration = function ()
277end
279local override_neovim_options = function ( options )
280end
282local setup = function ()
283 local local_project_config = parse_project_configuration()
284 if vim.tbl_isempty( local_project_config ) then return end
286 if local_project_config.neovim then
287 override_neovim_options( local_project_config.neovim )
288 end
290 local ok, lazy_core_loader = pcall( require, 'lazy.core.loader' )
291 if not ok then return end
293 local old_config = lazy_core_loader.config
294 lazy_core_loader.config = function ( plugin )
296 end
297end
282299return {
300 setup = setup,
283301 find_root = find_root,
284302 find_root_by_filetype = find_root_by_filetype,
285303 find_project_root = find_project_root,

neovim/lua/std/table/deep_concat.lua

Deleted
deleted file mode 100644

+0 / −68 text lines

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

neovim/lua/std/table/init.lua

Modified

+4 / −5 text lines

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

neovim/spell/nerd.utf-8.add

Modified

+4 / −0 text lines

1919insoft
2020KKG5
2121KKG6
22lspconfig
23neoconf
24lsp
25autopairs

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

Modified

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