repositories / dotfiles

dotfiles

bugabingas dorkfiles

owned by bugabinga

neovim: merge rooters for lua and nvim-lua in project.lua

9b9c4ad8d969d7b5510e17b1917b8301cc2d12ca

Oliver Jan Krylow <oliver@bugabinga.net> ·

unsigned

Browse filesCompare with HEAD

Changed files (10)

+47 / −71 text lines

neovim/init.lua

Modified

+3 / −11 text lines

17 17 require 'bugabinga.mark'
18 18 require 'bugabinga.lsp'
20 --- TODO:
21 --- [ ] check out gen.nvim
22 --- [ ] check out mini.*
23 --- colors
24 --- hipatterns
25 --- sessions
26 --- completion
27 --- bufremove
28 --- bracketed
29 --- align
20 + -- TODO:
21 +-- [ ] think about mini.colors
22 +-- [ ] setup spell checking for code (english + german)
30 23 -- [ ] learn marks and refac mark.lua
31 24 -- [ ] use ltex-ls for markdown, code comments and commit messages
32 25 -- [ ] DAP
33 26 -- [ ] add nu-check to nvim-lint
34 --- [ ] replace hydra with normal mapping + whcihkey

neovim/lazy-lock.json

Modified

+9 / −7 text lines

5 5 "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
6 6 "cmp-cmdline": { "branch": "main", "commit": "8ee981b4a91f536f52add291594e89fb6645e451" },
7 7 "cmp-nvim-lsp": { "branch": "main", "commit": "44b16d11215dce86f253ce0c30949813c0a90765" },
8 - "cmp-omni": { "branch": "main", "commit": "4ef610bbd85a5ee4e97e09450c0daecbdc60de86" },
9 8 "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
10 9 "cmp_luasnip": { "branch": "master", "commit": "18095520391186d634a0045dacaa346291096566" },
11 10 "diffview.nvim": { "branch": "main", "commit": "0437ef8bfdd67156d87140d692840a3c2824fa20" },
12 11 "dressing.nvim": { "branch": "master", "commit": "59fe7ef1aeeed499b983614fcfff89206bf0d5ce" },
13 12 "flash.nvim": { "branch": "main", "commit": "f219066f1976c781780e2c317d52d515bc0e588b" },
14 13 "friendly-snippets": { "branch": "main", "commit": "43727c2ff84240e55d4069ec3e6158d74cb534b6" },
15 - "gen.nvim": { "branch": "main", "commit": "fb44b33fd036ecbd2b5c0d9a63921337c9cb8992" },
14 + "gen.nvim": { "branch": "main", "commit": "2c5ac7f14f078027e1a7d872b956bcce35f88813" },
16 15 "gitsigns.nvim": { "branch": "main", "commit": "bb808fc7376ed7bac0fbe8f47b83d4bf01738167" },
17 16 "glow.nvim": { "branch": "main", "commit": "cf2177a514859fa3c55837b46de91d93b24cf488" },
18 17 "heirline.nvim": { "branch": "master", "commit": "7f1e805dfc001d5dbb7d894105063f463f6c7dcc" },
19 18 "hlargs.nvim": { "branch": "main", "commit": "6218a401824c5733ac50b264991b62d064e85ab2" },
20 19 "indent-blankline.nvim": { "branch": "master", "commit": "877c1db2bf957300097dd5348a665666a4d900cb" },
21 - "lazy.nvim": { "branch": "main", "commit": "62745a7320f48a00ac4f7b0591352608cbc6bcea" },
20 + "lazy.nvim": { "branch": "main", "commit": "9102d051a8e27298f4c913e3017ac44f151ae820" },
22 21 "lspkind.nvim": { "branch": "master", "commit": "57610d5ab560c073c465d6faf0c19f200cb67e6e" },
23 22 "lush.nvim": { "branch": "main", "commit": "966aad1accd47fa11fbe2539234f81f678fef2de" },
24 23 "mason.nvim": { "branch": "main", "commit": "d66c60e17dd6fd8165194b1d14d21f7eb2c1697a" },
25 - "mini.nvim": { "branch": "main", "commit": "707dca4f4152c2d9c9b4c5e02635f78dfd33db50" },
24 + "mini.align": { "branch": "main", "commit": "86c8edae77023a7b71d0fa9e2bf78960c1e46fd8" },
25 + "mini.bracketed": { "branch": "main", "commit": "ac93e3d6df596c750200aa8529fd352ec91bbad2" },
26 + "mini.colors": { "branch": "main", "commit": "0dc1b0fddbf9a659fb351ca102551b33bec205ac" },
27 + "mini.starter": { "branch": "main", "commit": "c7e027558477838eac7109d8576ff1f2d9804845" },
26 28 "neodev.nvim": { "branch": "main", "commit": "da1562e1e3df0e994ddc52cb4ba22376a5d7f2fc" },
27 29 "neogen": { "branch": "main", "commit": "cb1f384df804c1bf729332c4f728253fe17962d4" },
28 30 "noice.nvim": { "branch": "main", "commit": "fcd01710ff6918d4d3ef90c8e36f3addacba13bf" },
31 33 "nvim-autopairs": { "branch": "master", "commit": "748e72c05495a3d30e88a6ef04b21697019a9aa9" },
32 34 "nvim-cmp": { "branch": "main", "commit": "983453e32cb35533a119725883c04436d16c0120" },
33 35 "nvim-colorizer.lua": { "branch": "master", "commit": "dde3084106a70b9a79d48f426f6d6fec6fd203f7" },
36 + "nvim-genghis": { "branch": "main", "commit": "68149dd6591632841d6c18ecffbcbb340633fd25" },
34 37 "nvim-gomove": { "branch": "main", "commit": "2b44ae7ac0804f4e3959228122f7c85bef1964e3" },
35 38 "nvim-lastplace": { "branch": "main", "commit": "0bb6103c506315044872e0f84b1f736c4172bb20" },
36 - "nvim-lsp-file-operations": { "branch": "master", "commit": "0ae13ac58136c6175638b6e1ba04cb487dd22272" },
37 39 "nvim-neoclip.lua": { "branch": "main", "commit": "4e406ae0f759262518731538f2585abb9d269bac" },
38 40 "nvim-notify": { "branch": "master", "commit": "ea9c8ce7a37f2238f934e087c255758659948e0f" },
39 41 "nvim-surround": { "branch": "main", "commit": "0d6882635817a2677749a330127d12ac30a4f3c8" },
40 - "nvim-treesitter": { "branch": "master", "commit": "957f3f8c15a88ef0f0c77ecd13edf2e2578f176e" },
42 + "nvim-treesitter": { "branch": "master", "commit": "a102053352bd958d84a3e1be3de0203d2af92984" },
41 43 "nvim-treesitter-textobjects": { "branch": "master", "commit": "76c7a89b41de77a4f83fb77fa072c5ad7605fe3b" },
42 44 "nvim-ts-autotag": { "branch": "main", "commit": "6be1192965df35f94b8ea6d323354f7dc7a557e4" },
43 45 "nvim-ts-context-commentstring": { "branch": "main", "commit": "7241635869b7a8115893ffa67bab3907756caf4f" },
44 - "nvim-web-devicons": { "branch": "master", "commit": "45d0237c427baba8cd05e0ab26d30e2ee58c2c82" },
46 + "nvim-web-devicons": { "branch": "master", "commit": "56b3a6ce6d69329cbf603dd38ac59fb4d7774b01" },
45 47 "oil.nvim": { "branch": "stevearc-trash", "commit": "b62f680059fffcf7ff89fd88126fbca12418df20" },
46 48 "persistence.nvim": { "branch": "main", "commit": "adcf6913693a0434665d162ee45a186230496f8a" },
47 49 "playground": { "branch": "master", "commit": "ba48c6a62a280eefb7c85725b0915e021a1a0749" },

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

Modified

+1 / −3 text lines

5 5 name = 'LuaLS',
6 6 filetypes = 'lua',
7 7 command = 'lua-language-server',
8 - root_dir = function ( path )
9 - return project.find_lua_nvim_project_root( path ) or project.find_lua_project_root( path )
10 - end,
8 + root_dir = project.find_lua_project_root ,
11 9 single_file_support = true,
12 10 workspaces = true,
13 11 settings = {

neovim/lua/bugabinga/plugins/align.lua

Added
new file mode 100644

+8 / −0 text lines

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

neovim/lua/bugabinga/plugins/bracketed.lua

Added
new file mode 100644

+5 / −0 text lines

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

neovim/lua/bugabinga/plugins/colors.lua

Added
new file mode 100644

+5 / −0 text lines

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

neovim/lua/bugabinga/plugins/genghis.lua

Modified

+4 / −32 text lines

1 1 return {
2 - {
3 - -- 'bugabinga/nvim-genghis',
4 - 'chrisgrieser/nvim-genghis',
5 - dependencies = {
6 - 'stevearc/dressing.nvim',
7 - 'hrsh7th/nvim-cmp',
8 - 'hrsh7th/cmp-omni',
9 - {
10 - 'antosha417/nvim-lsp-file-operations',
11 - config = function ()
12 - require 'lsp-file-operations'.setup {
13 - -- used to see debug logs in file `vim.fn.stdpath("cache") .. lsp-file-operations.log`
14 - debug = true,
15 - -- how long to wait (in milliseconds) for file rename information before cancelling
16 - timeout_ms = 1000,
17 - }
18 - end
19 - },
20 - },
21 - cmd = {
22 - 'New',
23 - 'Duplicate',
24 - 'NewFromSelection',
25 - 'Rename',
26 - 'Move',
27 - 'Trash',
28 - 'CopyFilename',
29 - 'CopyFilepath',
30 - 'Chmodx',
31 - },
32 - -- config = function () require 'genghis' end,
33 - config = false,
2 + 'chrisgrieser/nvim-genghis',
3 + lazy = false,
4 + dependencies = {
5 + 'stevearc/dressing.nvim',

neovim/lua/bugabinga/plugins/starter.lua

Modified

+4 / −5 text lines

1 1 return {
2 - 'echasnovski/mini.nvim',
3 - main = 'mini.starter',
2 + 'echasnovski/mini.starter',
4 3 lazy = false,
5 4 config = function ()
6 5 local starter = require 'mini.starter'
23 22 :slice( 1, limit )
24 23 :map( function ( session_path )
25 24 -- session files encode their cwd as an escaped path in their file name
26 - -- t = tail of name
27 - -- r = remove extension
25 + -- t = tail of name
26 + -- r = remove extension
28 27 -- gs = replace all % with /
29 - -- ~ = relative to home
28 + -- ~ = relative to home
30 29 local name = vim.fn.fnamemodify( session_path, ':t:r:gs_%_/_:~' )
31 30 local action = 'silent! source ' .. vim.fn.fnameescape( session_path )
32 31 local section = 'Sessions'

neovim/lua/bugabinga/plugins/surround.lua

Modified

+1 / −1 text lines

1 1 return {
3 3 'kylechui/nvim-surround',
4 - keys = { '<C-g>s', '<C-g>S', 'ms', 'mss', 'mS', 'mSS', 'S', 'gS', 'md', 'mr', 'mR'},
4 + lazy = false,
5 5 opts = {
6 6 keymaps = {
7 7 insert = '<C-g>s',

neovim/lua/std/project.lua

Modified

+7 / −12 text lines

33 33 cache[hash] = project_root
36 +local expand = function ( path ) return vim.fn.fnamemodify( path, ':p' ) end
36 38 --- number of max loop iterations when searching for markers
37 39 local MAX_TRAVERSAL_COUNT = 100
76 78 path = path or dirname( vim.api.nvim_buf_get_name( 0 ) )
77 - path = normalize( path )
79 + path = dirname( normalize( expand( path ) ) )
78 80 stop = stop or vim.uv.os_homedir()
79 81 stop = normalize( stop )
176 178 { name = 'flake.nix', weight = 1 },
181 + markers = markers or {}
179 182 return find_root( path, join( default_markers, markers ) )
212 215 { name = 'stylua.toml', weight = 1 },
213 216 { name = 'selene.toml', weight = 1 },
214 217 { name = 'selene.yml', weight = 1 },
217 -local nvim_lua_markers = {
218 - { name = 'neovim.yml', weight = 1 },
219 - { name = 'lua', weight = 1 },
218 + { name = 'neovim.yml', weight = 1 },
219 + { name = 'lua', weight = 1 },
222 222 local find_lua_project_root = function ( path )
223 223 return find_root( path, lua_markers )
226 -local find_lua_nvim_project_root = function ( path )
227 - return find_root( path, nvim_lua_markers )
228 -end
230 226 local zig_markers = {
231 227 { name = 'build.zig', weight = 3 },
232 228 { name = 'zls.build.json', weight = 3 },
274 270 local rooters = {
275 271 java = find_java_project_root,
276 - lua = function ( path ) return find_lua_nvim_project_root( path ) or find_lua_project_root( path ) end,
272 + lua = find_lua_project_root,
277 273 rust = find_rust_project_root,
278 274 zig = find_zig_project_root,
290 286 find_vcs_project_root = find_vcs_project_root,
291 287 find_java_project_root = find_java_project_root,
292 288 find_lua_project_root = find_lua_project_root,
293 - find_lua_nvim_project_root = find_lua_nvim_project_root,
294 289 find_zig_project_root = find_zig_project_root,
295 290 find_rust_project_root = find_rust_project_root,