dotfiles bugabingas dorkfiles
owned by bugabinga
README Source History Refs Reviews Compare Notes Search Review guide neovim: removed `want` module
cce9046c27852155cd18b0e11900e318604545e0
Oliver Jan Krylow <oliver@bugabinga.net > · 10 Oct 2023
unsigned
Browse files Compare with HEAD
Changed files (22) Diff layout Auto Unified Split
+1 / −0 text lines
18 18 require 'bugabinga.lsp' require 'bugabinga.lsp' neovim/lazy-lock.json Modified +4 / −4 text lines
6 6 "cmp-cmdline" : { "branch" : "main" , "commit" : "8ee981b4a91f536f52add291594e89fb6645e451" }, "cmp-cmdline" : { "branch" : "main" , "commit" : "8ee981b4a91f536f52add291594e89fb6645e451" },7 7 "cmp-nvim-lsp" : { "branch" : "main" , "commit" : "44b16d11215dce86f253ce0c30949813c0a90765" }, "cmp-nvim-lsp" : { "branch" : "main" , "commit" : "44b16d11215dce86f253ce0c30949813c0a90765" },8 8 "cmp-path" : { "branch" : "main" , "commit" : "91ff86cd9c29299a64f968ebb45846c485725f23" }, "cmp-path" : { "branch" : "main" , "commit" : "91ff86cd9c29299a64f968ebb45846c485725f23" },9 - "cmp_luasnip" : { "branch" : "master" , "commit" : "18095520391186d634a0045dacaa346291096566" },9 + "cmp_luasnip" : { "branch" : "master" , "commit" : "05a9ab28b53f71d1aece421ef32fee2cb857a843" },10 10 "diffview.nvim" : { "branch" : "main" , "commit" : "0437ef8bfdd67156d87140d692840a3c2824fa20" }, "diffview.nvim" : { "branch" : "main" , "commit" : "0437ef8bfdd67156d87140d692840a3c2824fa20" },11 11 "dressing.nvim" : { "branch" : "master" , "commit" : "59fe7ef1aeeed499b983614fcfff89206bf0d5ce" }, "dressing.nvim" : { "branch" : "master" , "commit" : "59fe7ef1aeeed499b983614fcfff89206bf0d5ce" },12 12 "flash.nvim" : { "branch" : "main" , "commit" : "f219066f1976c781780e2c317d52d515bc0e588b" }, "flash.nvim" : { "branch" : "main" , "commit" : "f219066f1976c781780e2c317d52d515bc0e588b" },17 17 "heirline.nvim" : { "branch" : "master" , "commit" : "7f1e805dfc001d5dbb7d894105063f463f6c7dcc" }, "heirline.nvim" : { "branch" : "master" , "commit" : "7f1e805dfc001d5dbb7d894105063f463f6c7dcc" },18 18 "hlargs.nvim" : { "branch" : "main" , "commit" : "6218a401824c5733ac50b264991b62d064e85ab2" }, "hlargs.nvim" : { "branch" : "main" , "commit" : "6218a401824c5733ac50b264991b62d064e85ab2" },19 19 "indent-blankline.nvim" : { "branch" : "master" , "commit" : "877c1db2bf957300097dd5348a665666a4d900cb" }, "indent-blankline.nvim" : { "branch" : "master" , "commit" : "877c1db2bf957300097dd5348a665666a4d900cb" },20 - "lazy.nvim" : { "branch" : "main" , "commit" : "9102d051a8e27298f4c913e3017ac44f151ae820" },20 + "lazy.nvim" : { "branch" : "main" , "commit" : "0d9989d46cd2ae624858b94e529ee3e9d07773fd" },21 21 "lspkind.nvim" : { "branch" : "master" , "commit" : "57610d5ab560c073c465d6faf0c19f200cb67e6e" }, "lspkind.nvim" : { "branch" : "master" , "commit" : "57610d5ab560c073c465d6faf0c19f200cb67e6e" },22 22 "lush.nvim" : { "branch" : "main" , "commit" : "966aad1accd47fa11fbe2539234f81f678fef2de" }, "lush.nvim" : { "branch" : "main" , "commit" : "966aad1accd47fa11fbe2539234f81f678fef2de" },23 23 "mason.nvim" : { "branch" : "main" , "commit" : "d66c60e17dd6fd8165194b1d14d21f7eb2c1697a" }, "mason.nvim" : { "branch" : "main" , "commit" : "d66c60e17dd6fd8165194b1d14d21f7eb2c1697a" },39 39 "nvim-neoclip.lua" : { "branch" : "main" , "commit" : "4e406ae0f759262518731538f2585abb9d269bac" }, "nvim-neoclip.lua" : { "branch" : "main" , "commit" : "4e406ae0f759262518731538f2585abb9d269bac" },40 40 "nvim-notify" : { "branch" : "master" , "commit" : "ea9c8ce7a37f2238f934e087c255758659948e0f" }, "nvim-notify" : { "branch" : "master" , "commit" : "ea9c8ce7a37f2238f934e087c255758659948e0f" },41 41 "nvim-surround" : { "branch" : "main" , "commit" : "0d6882635817a2677749a330127d12ac30a4f3c8" }, "nvim-surround" : { "branch" : "main" , "commit" : "0d6882635817a2677749a330127d12ac30a4f3c8" },42 - "nvim-treesitter" : { "branch" : "master" , "commit" : "a102053352bd958d84a3e1be3de0203d2af92984" },42 + "nvim-treesitter" : { "branch" : "master" , "commit" : "1d1c32b64b17b866152f29a3676a719cb6078028" },43 43 "nvim-treesitter-textobjects" : { "branch" : "master" , "commit" : "76c7a89b41de77a4f83fb77fa072c5ad7605fe3b" }, "nvim-treesitter-textobjects" : { "branch" : "master" , "commit" : "76c7a89b41de77a4f83fb77fa072c5ad7605fe3b" },44 44 "nvim-ts-autotag" : { "branch" : "main" , "commit" : "6be1192965df35f94b8ea6d323354f7dc7a557e4" }, "nvim-ts-autotag" : { "branch" : "main" , "commit" : "6be1192965df35f94b8ea6d323354f7dc7a557e4" },45 45 "nvim-ts-context-commentstring" : { "branch" : "main" , "commit" : "7241635869b7a8115893ffa67bab3907756caf4f" }, "nvim-ts-context-commentstring" : { "branch" : "main" , "commit" : "7241635869b7a8115893ffa67bab3907756caf4f" },46 - "nvim-web-devicons" : { "branch" : "master" , "commit" : "56b3a6ce6d69329cbf603dd38ac59fb4d7774b01" },46 + "nvim-web-devicons" : { "branch" : "master" , "commit" : "a1e6268779411048a87f767a27380089362a0ce2" },47 47 "oil.nvim" : { "branch" : "stevearc-trash" , "commit" : "b62f680059fffcf7ff89fd88126fbca12418df20" }, "oil.nvim" : { "branch" : "stevearc-trash" , "commit" : "b62f680059fffcf7ff89fd88126fbca12418df20" },48 48 "persistence.nvim" : { "branch" : "main" , "commit" : "adcf6913693a0434665d162ee45a186230496f8a" }, "persistence.nvim" : { "branch" : "main" , "commit" : "adcf6913693a0434665d162ee45a186230496f8a" },49 49 "playground" : { "branch" : "master" , "commit" : "ba48c6a62a280eefb7c85725b0915e021a1a0749" }, "playground" : { "branch" : "master" , "commit" : "ba48c6a62a280eefb7c85725b0915e021a1a0749" },neovim/lua/bugabinga/diagnostic.lua Modified +8 / −10 text lines
1 - local want = require 'std.want'
2 1 local map = require 'std.map' local map = require 'std.map' 3 2 local auto = require 'std.auto' local auto = require 'std.auto' 4 3 local icon = require 'std.icon' local icon = require 'std.icon' 96 95 local show_diagnostics_in_buffer = function ()local show_diagnostics_in_buffer = function ()97 - want { 'telescope.builtin' , 'telescope.themes' } (98 - function ( builtin, themes )99 - builtin.diagnostics( themes.get_dropdown { bufnr = 0 , layout_config = { width = 0.69 } } )96 + local builtin = require 'telescope.builtin' 97 + local themes = require 'telescope.themes' 98 + builtin.diagnostics( themes.get_dropdown { bufnr = 0 , layout_config = { width = 0.69 } } )103 101 map.normal {map.normal {110 108 local show_diagnostics_in_workspace = function ()local show_diagnostics_in_workspace = function ()111 - want { 'telescope.builtin' , 'telescope.themes' } (112 - function ( builtin, themes )113 - builtin.diagnostics( themes.get_dropdown { layout_config = { width = 0.69 } } )109 + local builtin = require 'telescope.builtin' 110 + local themes = require 'telescope.themes' 111 + builtin.diagnostics( themes.get_dropdown { layout_config = { width = 0.69 } } )117 114 map.normal {map.normal {160 157 dia( vim.diagnostic.severity.HINT, 4 ) dia( vim.diagnostic.severity.HINT, 4 )163 - vim.g.send_dia = send_diaNo final newline 160 + vim.g.send_dia = send_dianeovim/lua/bugabinga/lsp/clients/java.lua Modified +2 / −8 text lines
1 1 local table = require 'std.table' local table = require 'std.table' 2 2 local project = require 'std.project' local project = require 'std.project' 3 - local want = require 'std.want'
4 3 local auto = require 'std.auto' local auto = require 'std.auto' 5 4 local map = require 'std.map' local map = require 'std.map' 55 54 local create_jdtls_command = function ( syntax_server )local create_jdtls_command = function ( syntax_server )56 - local mason_packages_base_path = want 'mason-core.package' (57 - function ( mason ) return mason:get_install_path() end ,58 - function () return '/home/oli/Programs' end 61 - local jdtls_package_path = vim.fs.joinpath( mason_packages_base_path, 'jdtls' )55 + local mason_registry = require 'mason-registry' 56 + local jdtls_package_path = mason_registry.get_package('jdtls' ):get_install_path()62 57 local shared_config_path = create_shared_config_path( jdtls_package_path, syntax_server ) local shared_config_path = create_shared_config_path( jdtls_package_path, syntax_server )63 58 local launcher_jar = find_launcher_jar( jdtls_package_path ) local launcher_jar = find_launcher_jar( jdtls_package_path )64 59 local data_dir = create_data_dir() local data_dir = create_data_dir()168 163 return ext return ext172 166 local on_attach = function ()local on_attach = function ()173 167 local jdtls = require 'jdtls' local jdtls = require 'jdtls' 174 168 vim.lsp.codelens.refresh() vim.lsp.codelens.refresh()neovim/lua/bugabinga/lsp/clients/json.lua Modified +6 / −7 text lines
1 - local project = require 'std.project' 2 - local want = require 'std.want' 1 + local project = require 'std.project' 5 4 name = 'jsonls' , name = 'jsonls' ,14 13 settings = { settings = {16 - schemas = want'schemastore' (function (schemastore) return schemastore.json.schemas {15 + schemas = require 'schemastore' .json.schemas {18 17 description = 'Settings for lua-language-server' , description = 'Settings for lua-language-server' ,19 - name = " LuaLS Settings" ,20 - url = " https://raw.githubusercontent.com/LuaLS/vscode-lua/master/setting/schema.json" ,21 - fileMatch = { " .luarc.json" , " .luarc.jsonc" },18 + name = ' LuaLS Settings' ,19 + url = ' https://raw.githubusercontent.com/LuaLS/vscode-lua/master/setting/schema.json' ,20 + fileMatch = { ' .luarc.json' , ' .luarc.jsonc' },24 23 validate = { enable = true }, validate = { enable = true },neovim/lua/bugabinga/lsp/clients/lua.lua Modified +0 / −1 text lines
1 1 local project = require 'std.project' local project = require 'std.project' 2 - local want = require 'std.want'
5 4 name = 'LuaLS' , name = 'LuaLS' ,neovim/lua/bugabinga/lsp/init.lua Modified +6 / −7 text lines
3 3 local defer = require 'std.defer' local defer = require 'std.defer' 4 4 local map = require 'std.map' local map = require 'std.map' 5 5 local auto = require 'std.auto' local auto = require 'std.auto' 6 - local want = require 'std.want'
7 6 local ui = require 'bugabinga.ui' local ui = require 'bugabinga.ui' 8 7 local table = require 'std.table' local table = require 'std.table' 9 8 local ignored = require 'std.ignored' local ignored = require 'std.ignored' 56 55 if vim.iter( matches_to_ignore ):find( match ) then return end if vim.iter( matches_to_ignore ):find( match ) then return end 58 57 local bufnr = file_type_event.buf local bufnr = file_type_event.buf59 - local buftype = vim.api.nvim_get_option_value('buftype' , { buf = bufnr })58 + local buftype = vim.api.nvim_get_option_value( 'buftype' , { buf = bufnr } )60 59 if buftype ~= '' then return end if buftype ~= '' then return end 62 61 local buffer_path = vim.api.nvim_buf_get_name( bufnr ) local buffer_path = vim.api.nvim_buf_get_name( bufnr )108 107 for _, config in ipairs ( potential_client_configs ) do for _, config in ipairs ( potential_client_configs ) do 109 108 local root_dir = type ( config.root_dir ) == 'string' and config.root_dir or config.root_dir( buffer_path ) local root_dir = type ( config.root_dir ) == 'string' and config.root_dir or config.root_dir( buffer_path )110 109 local capabilities = vim.lsp.protocol.make_client_capabilities() local capabilities = vim.lsp.protocol.make_client_capabilities()111 - local cmp_capabilities = want 'cmp_nvim_lsp' ( function ( cmp ) return cmp.default_capabilities() end , {} )110 + local cmp_capabilities = require 'cmp_nvim_lsp' .default_capabilities()112 111 capabilities = table .extend( 'force' , capabilities, cmp_capabilities, config.capabilities ) capabilities = table .extend( 'force' , capabilities, cmp_capabilities, config.capabilities )161 160 local new_root_raw = new_config.root_dir or nil local new_root_raw = new_config.root_dir or nil 162 161 local existing_root_raw = existing_client.workspace_folders and # existing_client.workspace_folders >= 1 and local existing_root_raw = existing_client.workspace_folders and # existing_client.workspace_folders >= 1 and 163 - existing_client.workspace_folders[1 ].name or nil 162 + existing_client.workspace_folders[1 ].name or nil 165 164 if not (new_root_raw and existing_root_raw) then return false end if not (new_root_raw and existing_root_raw) then return false end 237 236 if client.server_capabilities.inlayHintProvider then if client.server_capabilities.inlayHintProvider then 239 237 add( map.normal { add( map.normal {240 238 description = 'Toggle inlay hints' , description = 'Toggle inlay hints' ,241 239 category = 'lsp' , category = 'lsp' ,242 240 buffer = bufnr, buffer = bufnr,243 241 keys = '<leader>ti' , keys = '<leader>ti' ,244 - command = function ( ) vim.lsp.inlay_hint( bufnr, nil ) end , 242 + command = function ()243 + vim.lsp.inlay_hint( bufnr, nil )250 250 category = 'lsp' , category = 'lsp' ,251 251 buffer = bufnr, buffer = bufnr,252 252 keys = '<c-s>' , keys = '<c-s>' ,254 253 command = vim.lsp.buf.format, command = vim.lsp.buf.format,neovim/lua/bugabinga/mark.lua Modified +1 / −1 text lines
115 115 vim.api.nvim_buf_set_keymap( bufnr, 'n' , '<leader>dM' , '' , { vim.api.nvim_buf_set_keymap( bufnr, 'n' , '<leader>dM' , '' , {116 116 desc = 'Delete all buffer marks' , desc = 'Delete all buffer marks' ,117 117 callback = function () callback = function ()120 120 marks[bufnr] = {} marks[bufnr] = {}121 121 vim.fn.sign_unplace( sign_group_name, { buffer = bufnr } ) vim.fn.sign_unplace( sign_group_name, { buffer = bufnr } )neovim/lua/bugabinga/nugu/init.lua Modified +3 / −4 text lines
188 188 LspReferenceText { sp = content_unfocus, gui = 'underline' }, LspReferenceText { sp = content_unfocus, gui = 'underline' },189 189 LspReferenceRead { LspReferenceText }, LspReferenceRead { LspReferenceText },190 190 LspReferenceWrite { LspReferenceText }, LspReferenceWrite { LspReferenceText },191 - LspInlayHint { fg = ui_minor, bg = ui_unfocus },191 + LspInlayHint { fg = content_minor, bg = content_backdrop },447 447 GitSignsDeletePreview { GitSignsDelete }, GitSignsDeletePreview { GitSignsDelete },449 449 GitSignsCurrentLineBlame { Debug }, GitSignsCurrentLineBlame { Debug },451 450 GitSignsAddInline { GitSignsAdd }, GitSignsAddInline { GitSignsAdd },452 451 GitSignsDeleteInline { GitSignsDelete }, GitSignsDeleteInline { GitSignsDelete },453 452 GitSignsChangeInline { GitSignsChange }, GitSignsChangeInline { GitSignsChange },475 474 Hlargs { fg = ui_important_local }, Hlargs { fg = ui_important_local },477 - MiniStarterCurrent { bg = content_accent }, 476 + MiniStarterCurrent { fg = ui_accent.readable(), bg = ui_accent }, 478 477 MiniStarterFooter { Keyword }, MiniStarterFooter { Keyword }, 479 478 MiniStarterHeader { Comment }, MiniStarterHeader { Comment }, 480 479 MiniStarterInactive { fg = content_unfocus }, MiniStarterInactive { fg = content_unfocus }, 482 481 MiniStarterItemBullet { Whitespace }, MiniStarterItemBullet { Whitespace }, 483 482 MiniStarterItemPrefix { fg = content_focus, gui = '' }, MiniStarterItemPrefix { fg = content_focus, gui = '' }, 484 483 MiniStarterSection { fg = content_important_global, gui = 'underline' }, MiniStarterSection { fg = content_important_global, gui = 'underline' }, 485 - MiniStarterQuery { bg = content_accent }, 484 + MiniStarterQuery { fg = content_accent . readable ( ) , bg = content_accent }, neovim/lua/bugabinga/options/keymaps.lua Modified +126 / −116 text lines
1 1 local map = require 'std.map' local map = require 'std.map' 2 - local want = require 'std.want'
10 9 vim.g.mapleader = ' ' vim.g.mapleader = ' ' 20 19 map.normal {map.normal {21 - description = 'Insert newline under cursor' ,22 - category = 'editing' ,25 - local current_buffer = 0 26 - local current_line = vim.api.nvim_win_get_cursor(current_buffer)[1 ]27 - local strict_indexing = false 28 - local newline = { '' }29 - vim.api.nvim_buf_set_lines(current_buffer, current_line, current_line, strict_indexing, newline)20 + description = 'Insert newline under cursor' ,21 + category = 'editing' ,23 + command = function ()24 + local current_buffer = 0 25 + local current_line = vim.api.nvim_win_get_cursor( current_buffer )[1 ]26 + local strict_indexing = false 27 + local newline = { '' }28 + vim.api.nvim_buf_set_lines( current_buffer, current_line, current_line, strict_indexing, newline )33 32 map.normal {map.normal {34 - description = 'Insert newline above cursor' ,35 - category = 'editing' ,36 - keys = '<C-S-enter>' ,38 - local current_buffer = 0 39 - local current_line = vim.api.nvim_win_get_cursor(current_buffer)[1 ] - 1 40 - local strict_indexing = false 41 - local newline = { '' }42 - vim.api.nvim_buf_set_lines(current_buffer, current_line, current_line, strict_indexing, newline)33 + description = 'Insert newline above cursor' ,34 + category = 'editing' ,35 + keys = '<C-S-enter>' ,36 + command = function ()37 + local current_buffer = 0 38 + local current_line = vim.api.nvim_win_get_cursor( current_buffer )[1 ] - 1 39 + local strict_indexing = false 40 + local newline = { '' }41 + vim.api.nvim_buf_set_lines( current_buffer, current_line, current_line, strict_indexing, newline )89 88 map.normal.visual {map.normal.visual {90 - description = 'yank into system clipboard' ,91 - category = 'editing' ,89 + description = 'yank into system clipboard' ,90 + category = 'editing' ,96 95 map.normal.visual {map.normal.visual {97 - description = 'yank line into system clipboard' ,98 - category = 'editing' ,96 + description = 'yank line into system clipboard' ,97 + category = 'editing' ,103 102 map.normal.visual {map.normal.visual {104 - description = 'paste before from system clipboard' ,105 - category = 'editing' ,103 + description = 'paste before from system clipboard' ,104 + category = 'editing' ,110 109 map.normal.visual {map.normal.visual {111 - description = 'paste after from system clipboard' ,112 - category = 'editing' ,110 + description = 'paste after from system clipboard' ,111 + category = 'editing' ,117 116 map.insert {map.insert {118 - description = 'Cycle through autocomplete popup' ,119 - category = 'editing' ,121 - options = { expr = true },122 - command = function () return vim.fn.pumvisible() == 1 and '<C-n>' or '<tab>' end ,117 + description = 'Cycle through autocomplete popup' ,118 + category = 'editing' ,120 + options = { expr = true },121 + command = function () return vim.fn.pumvisible() == 1 and '<C-n>' or '<tab>' end ,125 124 local function open_link_under_cursor ()local function open_link_under_cursor ()127 - local file_under_cursor = vim.fn.expand '<cfile>' 129 - if file_under_cursor and file_under_cursor:match '%a+://.+' then 130 - local Job = require 'plenary.job' 131 - local job = Job:new {132 - command = 'firefox' ,133 - args = { file_under_cursor },134 - on_exit = function ()135 - vim.schedule(function () vim.notify('Openend ' .. file_under_cursor) end )126 + local file_under_cursor = vim.fn.expand '<cfile>' 129 + if file_under_cursor and file_under_cursor:match '%a+://.+' then 132 + { 'firefox' , file_under_cursor },134 + function ( completed )135 + if completed.code == 0 then 136 + vim.notify( 'Openend ' .. file_under_cursor )138 + error ( 'Failed to open ' .. file_under_cursor .. ' because: ' .. completed.stderr )142 145 map.normal {map.normal {143 - description = 'Open web link under cursor in browser' ,144 - category = 'navigation' ,146 - command = open_link_under_cursor,146 + description = 'Open web link under cursor in browser' ,147 + category = 'navigation' ,149 + command = open_link_under_cursor,149 152 map.normal {map.normal {150 - description = 'Dismiss current search highlight' ,151 - category = 'search' ,152 - keys = '<esc><esc>' ,153 - command = function () vim.cmd [[ nohlsearch ]] end ,153 + description = 'Grep search for word under cursor' ,154 + category = 'search' ,156 + command = '<cmd>grep <cword> . <cr>' ,156 159 map.normal {map.normal {157 - description = 'Toggle dark/light theme variant' ,159 - keys = '<leader>tt' ,160 - command = function ()161 - if vim.opt.background:get() == 'dark' then 162 - vim.opt.background = 'light' 164 - vim.opt.background = 'dark' 166 - vim.notify('Toggled background to ' .. vim.opt.background:get() .. '.' )160 + description = 'Dismiss current search highlight' ,161 + category = 'search' ,162 + keys = '<esc><esc>' ,163 + command = function () vim.cmd [[ nohlsearch ]] end ,167 + description = 'Toggle dark/light theme variant' ,169 + keys = '<leader>tt' ,170 + command = function ()171 + if vim.opt.background:get() == 'dark' then 172 + vim.opt.background = 'light' 174 + vim.opt.background = 'dark' 176 + vim.notify( 'Toggled background to ' .. vim.opt.background:get() .. '.' )170 180 map.insert {map.insert {171 - description = 'Exit normal mode' ,181 + description = 'Exit normal mode' ,177 187 map.normal {map.normal {178 - description = 'Goto matching bracket' ,179 - category = 'navigation' ,188 + description = 'Goto matching bracket' ,189 + category = 'navigation' ,184 194 map.normal {map.normal {185 - description = 'Redo undone operation' ,186 - category = 'history' ,188 - command = vim.cmd.redo,195 + description = 'Redo undone operation' ,196 + category = 'history' ,198 + command = vim.cmd.redo,196 206 map.normal {map.normal {197 - description = 'Move next in quickfix list' ,198 - category = 'navigation' ,200 - command = '<cmd>cnext<cr>' ,207 + description = 'Move next in quickfix list' ,208 + category = 'navigation' ,210 + command = '<cmd>cnext<cr>' ,203 213 map.normal {map.normal {204 - description = 'Move back in quickfix list' ,205 - category = 'navigation' ,207 - command = '<cmd>cprevious<cr>' ,214 + description = 'Move back in quickfix list' ,215 + category = 'navigation' ,217 + command = '<cmd>cprevious<cr>' ,210 220 map.normal {map.normal {218 228 description = 'Open nvim configuration' , description = 'Open nvim configuration' ,219 229 category = 'config' , category = 'config' ,220 230 keys = '<F2><F2>' , keys = '<F2><F2>' ,221 - command = '<cmd>tabedit ' .. vim.fn.stdpath'config' .. '<cr>' ,231 + command = '<cmd>tabedit ' .. vim.fn.stdpath 'config' .. '<cr>' ,224 234 map.normal {map.normal {neovim/lua/bugabinga/options/ui.lua Modified +2 / −1 text lines
114 114 vim.opt.guifont = 'BlexMono_Nerd_Font:h13:#e-subpixelantialias:#h-full' vim.opt.guifont = 'BlexMono_Nerd_Font:h13:#e-subpixelantialias:#h-full'
117 + vim.opt.linespace = - 3 119 120 if vim.g.neovide then if vim.g.neovide then neovim/lua/bugabinga/plugins/gitsigns.lua Modified +125 / −34 text lines
1 + local map = require 'std.map' 2 4 'lewis6991/gitsigns.nvim' , 'lewis6991/gitsigns.nvim' ,20 22 ignore_whitespace = true , ignore_whitespace = true ,22 24 current_line_blame_formatter = '<author>(<author_time:%d.%m.%Y>): <summary>' , current_line_blame_formatter = '<author>(<author_time:%d.%m.%Y>): <summary>' ,24 25 on_attach = function ( bufnr ) on_attach = function ( bufnr )25 - local gs = package .loaded .gitsigns26 + local gitsigns = require 'gitsigns' 27 - local function map ( mode, l, r, opts )30 - vim.keymap.set( mode, l, r, opts )29 + description = 'Goto next hunk' ,33 + command = gitsigns.next_hunk,34 - map( 'n' , ']c' , function ()35 - if vim.wo.diff then return ']c' end 36 - vim.schedule( function () gs.next_hunk() end )38 - end , { expr = true } )37 + description = 'Goto previous hunk' ,41 + command = gitsigns.prev_hunk,40 - map( 'n' , '[c' , function ()41 - if vim.wo.diff then return '[c' end 42 - vim.schedule( function () gs.prev_hunk() end )44 - end , { expr = true } )45 + description = 'Stage hunk' ,49 + command = gitsigns.stage_hunk,47 - map( 'n' , '<leader>hs' , gs.stage_hunk )48 - map( 'n' , '<leader>hr' , gs.reset_hunk )49 - map( 'v' , '<leader>hs' , function () gs.stage_hunk { vim.fn.line '.' , vim.fn.line 'v' } end )50 - map( 'v' , '<leader>hr' , function () gs.reset_hunk { vim.fn.line '.' , vim.fn.line 'v' } end )51 - map( 'n' , '<leader>hS' , gs.stage_buffer )52 - map( 'n' , '<leader>hu' , gs.undo_stage_hunk )53 - map( 'n' , '<leader>hR' , gs.reset_buffer )54 - map( 'n' , '<leader>hp' , gs.preview_hunk )55 - map( 'n' , '<leader>hb' , function () gs.blame_line { full = true } end )56 - map( 'n' , '<leader>hd' , gs.diffthis )57 - map( 'n' , '<leader>hD' , function () gs.diffthis '~' end )53 + description = 'Stage hunk' ,57 + command = function () gitsigns.stage_hunk { vim.fn.line '.' , vim.fn.line 'v' } end ,59 - map( 'n' , '<leader>tb' , gs.toggle_current_line_blame )60 - map( 'n' , '<leader>td' , gs.toggle_deleted )61 + description = 'Reset hunk' ,65 + command = gitsigns.reset_hunk,63 - map( { 'o' , 'x' }, 'ih' , ':<C-U>Gitsigns select_hunk<CR>' )69 + description = 'Reset hunk' ,73 + command = function () gitsigns.reset_hunk { vim.fn.line '.' , vim.fn.line 'v' } end ,77 + description = 'Undo stage hunk' ,81 + command = gitsigns.undo_stage_hunk,85 + description = 'Stage buffer' ,89 + command = gitsigns.stage_buffer,93 + description = 'Reset buffer' ,97 + command = gitsigns.reset_buffer,101 + description = 'Preview hunk' ,103 + keys = '<leader>hp' ,105 + command = gitsigns.preview_hunk,109 + description = 'Blame line' ,111 + keys = '<leader>hb' ,113 + command = function () gitsigns.blame_line { full = true } end ,117 + description = 'Diff this' ,119 + keys = '<leader>hd' ,121 + command = gitsigns.diffthis,125 + description = 'Diff this ~' ,127 + keys = '<leader>hD' ,129 + command = function () gitsigns.diffthis '~' end ,133 + description = 'Toggle current line blame' ,135 + keys = '<leader>tb' ,137 + command = gitsigns.toggle_current_line_blame,141 + description = 'Toggle deleted' ,143 + keys = '<leader>td' ,145 + command = gitsigns.toggle_deleted,148 + map.operator_pending.visual {149 + description = 'select hunk' ,153 + command = ':<C-U>Gitsigns select_hunk<CR>' neovim/lua/bugabinga/plugins/noice.lua Modified +67 / −70 text lines
1 - local map = require 'std.map' 2 - local ignored = require 'std.ignored' 1 + local map = require 'std.map' 2 + local ignored = require 'std.ignored' 9 - 'MunifTanjim/nui.nvim' ,10 - 'rcarriga/nvim-notify' ,19 - ['vim.lsp.util.convert_input_to_markdown_lines' ] = true ,20 - ['vim.lsp.util.stylize_markdown' ] = true ,21 - ['cmp.entry.get_documentation' ] = true ,24 - smart_move = { excluded_filetypes = ignored.filetypes },30 - size = { width = 'auto' , height = 'auto' },9 + 'MunifTanjim/nui.nvim' ,10 + 'rcarriga/nvim-notify' ,19 + ['vim.lsp.util.convert_input_to_markdown_lines' ] = true ,20 + ['vim.lsp.util.stylize_markdown' ] = true ,21 + ['cmp.entry.get_documentation' ] = true ,33 - border = { style = vim.g.border_style},24 + smart_move = { excluded_filetypes = ignored.filetypes },30 + size = { width = 'auto' , height = 'auto' },36 - border = { style = vim.g.border_style},33 + border = { style = vim.g.border_style },39 - border = { style = vim.g.border_style},36 + border = { style = vim.g.border_style },39 + border = { style = vim.g.border_style },40 40 position = { row = - 2 , col = 2 }, position = { row = - 2 , col = 2 },45 45 position = { row = 0 , col = 0 }, position = { row = 0 , col = 0 },46 - size = { min_width = 42 , width = 'auto' , height = 'auto' },47 - border = { style = vim.g.border_style},46 + size = { min_width = 42 , width = 'auto' , height = 'auto' },47 + border = { style = vim.g.border_style },49 49 cmdline_popupmenu = { cmdline_popupmenu = {51 51 position = { row = 1 , col = 0 }, position = { row = 1 , col = 0 },52 - size = { min_width = 42 , width = " auto" , height = 'auto' },52 + size = { min_width = 42 , width = ' auto' , height = 'auto' },53 53 border = { style = vim.g.border_style, padding = { 0 , 1 } }, border = { style = vim.g.border_style, padding = { 0 , 1 } },54 - win_options = { winhighlight = { Normal = " Normal" , FloatBorder = " NoiceCmdlinePopupBorder" } },54 + win_options = { winhighlight = { Normal = ' Normal' , FloatBorder = ' NoiceCmdlinePopupBorder' } },57 57 routes = { routes = {60 60 opts = { skip = true }, opts = { skip = true },63 - filter = { event = " msg_show" , find = " E42" },63 + filter = { event = ' msg_show' , find = ' E42' },64 64 opts = { skip = true }, opts = { skip = true },67 - filter = { event = " msg_show" , kind = " " , find = '^".*" %[.*%]' , },67 + filter = { event = ' msg_show' , kind = ' ' , find = '^".*" %[.*%]' , },68 68 opts = { skip = true }, opts = { skip = true },71 - filter = { event = " notify" , min_height = 15 },71 + filter = { event = ' notify' , min_height = 15 },75 - filter = { cmdline = " ^:%s*!" },75 + filter = { cmdline = ' ^:%s*!' },81 79 filter = { cmdline = true , min_height = 2 }, filter = { cmdline = true , min_height = 2 },82 - view = " cmdline_output" ,80 + view = ' cmdline_output' ,85 - filter = { any = { { cmdline = " ^:%s*lua%s+" }, { cmdline = " ^:%s*lua%s*=%s*" }, { cmdline = " ^:%s*=%s*" }, } },83 + filter = { any = { { cmdline = ' ^:%s*lua%s+' }, { cmdline = ' ^:%s*lua%s*=%s*' }, { cmdline = ' ^:%s*=%s*' }, } },86 84 view = 'cmdline_output' , view = 'cmdline_output' ,90 - config = function (_, opts)91 - local noice = require 'noice' 88 + config = function ( _, opts )89 + local noice = require 'noice' 94 92 map.normal { map.normal {95 93 description = 'Open search for notifications...' , description = 'Open search for notifications...' ,96 94 category = 'search' , category = 'search' ,97 95 keys = '<C-n><C-n>' , keys = '<C-n><C-n>' ,98 - command = function () noice.cmd'history' end ,96 + command = function () noice.cmd 'history' end ,101 99 map.command_line { map.command_line {102 100 description = 'Redirect Cmdline' , description = 'Redirect Cmdline' ,103 101 category = 'ui' , category = 'ui' ,104 102 keys = '<S-cr>' , keys = '<S-cr>' ,105 - command = function () noice.redirect(vim.fn.getcmdline()) end ,103 + command = function () noice.redirect( vim.fn.getcmdline() ) end ,108 106 map.normal { map.normal {109 107 description = 'Dismiss current notifications' , description = 'Dismiss current notifications' ,110 108 category = 'notify' , category = 'notify' ,111 109 keys = '<esc>' , keys = '<esc>' ,112 - command = function () noice.cmd 'dismiss' end ,110 + command = function () noice.cmd 'dismiss' end ,115 - local noice_lsp = require 'noice.lsp' 113 + local noice_lsp = require 'noice.lsp' 117 115 map.normal { map.normal {118 116 description = 'Scroll up in documentation popup' , description = 'Scroll up in documentation popup' ,119 117 category = 'ui' , category = 'ui' ,120 118 keys = '<C-f>' , keys = '<C-f>' ,121 - command = function ()122 - if not noice_lsp.scroll(- 4 ) then return '<C-f>' end 119 + command = function ()120 + if not noice_lsp.scroll( - 4 ) then return '<C-f>' end 124 122 options = { expr = true }, options = { expr = true },128 126 description = 'Scroll down in documentation popup' , description = 'Scroll down in documentation popup' ,129 127 category = 'ui' , category = 'ui' ,130 128 keys = '<C-b>' , keys = '<C-b>' ,131 - command = function ()132 - if not noice_lsp.scroll(4 ) then return '<C-b>' end 129 + command = function ()130 + if not noice_lsp.scroll( 4 ) then return '<C-b>' end 134 132 options = { expr = true }, options = { expr = true },140 137 'rcarriga/nvim-notify' , 'rcarriga/nvim-notify' ,142 - local notify = require 'notify' 143 - local fade = require 'notify.stages.fade' ( 'bottom_up' ) 138 + config = function ()139 + local notify = require 'notify' 140 + local fade = require 'notify.stages.fade' 'bottom_up' 145 - local shadow_fade = function (... )146 - local opts = fade[1 ](... )142 + local shadow_fade = function ( ... )143 + local opts = fade[1 ]( ... )147 144 if opts then if opts then 148 145 opts.border = vim.g.border_style opts.border = vim.g.border_style149 146 opts.row = opts.row - 1 opts.row = opts.row - 1 154 151 notify.setup { notify.setup {155 - stages = { shadow_fade, unpack (fade, 2 ) },152 + stages = { shadow_fade, unpack ( fade, 2 ) },156 153 render = 'compact' , render = 'compact' ,157 154 timeout = 2500 , timeout = 2500 ,158 155 fps = 60 , fps = 60 ,neovim/lua/bugabinga/plugins/nrpattern.lua Modified +1 / −1 text lines
3 3 keys = { '<C-a>' , '<C-x>' }, keys = { '<C-a>' , '<C-x>' },4 4 config = function () config = function ()5 5 local nrpattern = require 'nrpattern' local nrpattern = require 'nrpattern' 7 7 nrpattern.setup() nrpattern.setup()neovim/lua/bugabinga/plugins/starter.lua Modified +5 / −1 text lines
29 29 local name = vim.fn.fnamemodify( session_path, ':t:r:gs_%_/_:~' ) local name = vim.fn.fnamemodify( session_path, ':t:r:gs_%_/_:~' )30 - local action = 'silent! source ' .. vim.fn.fnameescape( session_path )30 + local session_restore = 'silent! source ' .. vim.fn.fnameescape( session_path )31 + local action = function ()32 + vim.cmd (session_restore)33 + vim.notify('Restored session: ' .. name)31 35 local section = 'Sessions' local section = 'Sessions' 33 37 return { name = name, action = action, section = section } return { name = name, action = action, section = section }neovim/lua/bugabinga/plugins/surround.lua Modified +4 / −6 text lines
4 4 lazy = false , lazy = false ,6 6 keymaps = { keymaps = {8 - insert_line = '<C-g>S' ,
9 7 normal = 'ms' , normal = 'ms' ,10 8 normal_cur = 'mss' , normal_cur = 'mss' ,11 9 normal_line = 'mS' , normal_line = 'mS' ,12 10 normal_cur_line = 'mSS' , normal_cur_line = 'mSS' ,15 13 delete = 'md' , delete = 'md' ,20 18 dependencies = { dependencies = {neovim/lua/bugabinga/plugins/todo-comments.lua Modified +1 / −0 text lines
2 2 'folke/todo-comments.nvim' , 'folke/todo-comments.nvim' ,
3 + dependencies = { 'nvim-lua/plenary.nvim' },3 4 event = 'BufReadPost' , event = 'BufReadPost' ,neovim/lua/bugabinga/plugins/treesitter.lua Modified +3 / −21 text lines
134 134 ['aa' ] = { query = '@assignment.outer' , desc = 'outer assignment' }, ['aa' ] = { query = '@assignment.outer' , desc = 'outer assignment' },135 135 ['ia' ] = { query = '@assignment.inner' , desc = 'inner assignment' }, ['ia' ] = { query = '@assignment.inner' , desc = 'inner assignment' },137 - ['la' ] = { query = '@assignment.lhs' , desc = 'left hand side of assignment' },138 - ['ra' ] = { query = '@assignment.rhs' , desc = 'right hand side of assignment' },140 141 ['ac' ] = { query = '@class.outer' , desc = 'outer class' }, ['ac' ] = { query = '@class.outer' , desc = 'outer class' },141 142 ['ic' ] = { query = '@class.inner' , desc = 'inner class' }, ['ic' ] = { query = '@class.inner' , desc = 'inner class' },209 - local ts_repeat_move = require 'nvim-treesitter.textobjects.repeatable_move' 214 - map.normal.visual.operator_pending {215 - description = 'This repeats the last query with always previous direction and to the start of the range.' ,217 - category = 'textobjects' ,218 - command = function () ts_repeat_move.repeat_last_move { forward = false } end 221 - map.normal.visual.operator_pending {222 - description = 'This repeats the last query with always next direction and to the end of the range.' ,223 - keys = '<PageDown>' ,224 - category = 'textobjects' ,225 - command = function () ts_repeat_move.repeat_last_move { forward = true } end
229 211 parsers.get_parser_configs().just = { parsers.get_parser_configs().just = {230 212 install_info = { install_info = {neovim/lua/bugabinga/plugins/whichkey.lua Modified +3 / −6 text lines
1 1 local ignored = require 'std.ignored' local ignored = require 'std.ignored'
2 + local icon = require 'std.icon' 4 5 'folke/which-key.nvim' , 'folke/which-key.nvim' ,5 6 event = 'VeryLazy' , event = 'VeryLazy' ,6 7 init = function () init = function ()7 8 vim.o.timeout = true vim.o.timeout = true 8 - vim.o.timeoutlen = 300 9 + vim.o.timeoutlen = 250 18 15 window = { window = {19 16 border = vim.g.border_style, border = vim.g.border_style,neovim/lua/bugabinga/ui.lua Modified +42 / −50 text lines
1 - local want = require 'std.want' 2 - local display = require 'std.display' 1 + local display = require 'std.display' 14 - local get_nui_popup = function ()15 - local popup = NuiPopup{25 - style = vim.g.border_style,32 - popup:map("n" , "q" , function () popup:unmount() end , { noremap = true })3 + local NuiPopup = require 'nui.popup' 4 + local NuiText = require 'nui.text' 5 + local NuiLine = require 'nui.line' 7 + local get_nui_popup = function ()8 + local popup = NuiPopup {18 + style = vim.g.border_style,25 + popup:map( 'n' , 'q' , function () popup:unmount() end , { noremap = true } )30 + show_tree = function ( tree )31 + local popup = get_nui_popup()32 + local bufnr = popup.bufnr33 + local text, _ = display( tree )35 + local line_number = 1 36 + for line in text:gmatch '[^\r\n]+' do 37 + local nui_line = NuiLine()38 + nui_line:append( NuiText( line, 'NormalFloat' ) )39 + nui_line:render( bufnr, - 1 , line_number )40 + line_number = line_number + 1 37 - show_tree = function (tree)38 - local popup = get_nui_popup()39 - local bufnr = popup.bufnr40 - local text, _ = display(tree)42 - local line_number = 1 43 - for line in text:gmatch('[^\r\n]+' ) do 44 - local nui_line = NuiLine()45 - nui_line:append(NuiText(line, 'NormalFloat' ))46 - nui_line:render(bufnr, - 1 , line_number)47 - line_number = line_number + 1 neovim/lua/std/project.lua Modified +0 / −1 text lines
206 206 return find_root( path, java_markers ) return find_root( path, java_markers )210 209 local lua_markers = {local lua_markers = {211 210 { name = '.luarc.json' , weight = 1 }, { name = '.luarc.json' , weight = 1 },212 211 { name = '.luarc.jsonc' , weight = 1 }, { name = '.luarc.jsonc' , weight = 1 },neovim/lua/std/want.lua Deleted deleted file mode 100644+0 / −32 text lines
7 - return function ( module_names )8 - return function ( block, error_handler )9 - local loaded_modules = {}10 - local failed_modules = {}11 - if type ( module_names ) == 'string' then 12 - module_names = { module_names }14 - for _, name in pairs ( module_names ) do 15 - local status_ok, module = pcall ( require , name )17 - table .insert ( loaded_modules, module )19 - table .insert ( failed_modules, module )22 - if # failed_modules > 0 then 23 - return error_handler and type ( error_handler ) == 'function' and error_handler( unpack ( failed_modules ) ) or 26 - for _, module in pairs ( failed_modules ) do 27 - vim.notify( 'A wanted module failed to load: ' .. module , 'error' )30 - return block and block( unpack ( loaded_modules ) )