Merge branch 'trunk' of https://github.com/bugabinga/dotfiles into trunk
c2566d15a45a9b5634238e3d6fd0a67f9fd2e91e
Oliver Krylow <o.krylow@isp-insoft.de> ·
unsigned
- Parent 1: 959c2b234e2c · Showing diff
- Parent 2: 6cff3dc326ff · Diff against parent 2
bugabingas dorkfiles
c2566d15a45a9b5634238e3d6fd0a67f9fd2e91e
Oliver Krylow <o.krylow@isp-insoft.de> ·
unsigned
+615 / −212 text lines · all files grouped into 32 bars · 1 binary (striped old/new sizes in 64-byte units, not churn) · lines and sizes scale separately
+2 / −1 text lines
new file mode 100644+5 / −0 text lines
+2 / −6 text lines
new file mode 100644+1 / −0 text lines
+7 / −3 text lines
+22 / −10 text lines
local start_time = vim.uv.hrtime()local start_time = vim.uv.hrtime() ---@diagnostic disable-line: undefined-field--[[ MY STUFF ]] --require 'bugabinga.search_and_replace'require 'bugabinga.pairs'+6 / −0 text lines
+1 / −0 text lines
+3 / −1 text lines
+25 / −13 text lines
puk.defer 'symbol-usage'(function(symbolusage)puk.defer 'symbol-usage' ( function ( symbolusage )end)end )-------------------------------------------------------------------------------puk.defer 'tiny-inline-diagnostic' ( function ( tiny ) tiny.setup { options = { -- Show the source of the diagnostic. show_source = true, -- Use your defined signs in the diagnostic config table. use_icons_from_diagnostic = true, }, }end )+17 / −1 text lines
jump2d.setup {} jump2d.setup { -- Function producing jump spots (byte indexed) for a particular line. spotter = jump2d.builtin_opts.word_start.spotter, -- Characters used for labels of jump spots (in supplied order) labels = 'hjklgfdsabceimnoyrtuvwxzpq', -- Options for visual effects view = { -- How many steps ahead to show. Set to big number to show all steps. n_steps_ahead = 1, }, -- Which lines are used for computing spots allowed_lines = { blank = false, -- Blank line (not sent to spotter even if `true`) fold = false, -- Start of fold (not sent to spotter even if `true`) }, silent = true, }+8 / −3 text lines
+93 / −2 text lines
config.capabilities = require('bugabinga.completion').get_lsp_capabilities(config.capabilities) -- the following are already set by default -- but i will remap them anyways for consistency map.normal { description = 'code action', category = 'lsp', keys = 'gra', command = vim.lsp.buf.code_action, } map.normal { description = 'implementation', category = 'lsp', keys = 'gri', command = vim.lsp.buf.implementation, } map.normal { description = 'rename', category = 'lsp', keys = 'grn', command = vim.lsp.buf.rename, } map.normal { description = 'references', category = 'lsp', keys = 'grr', command = vim.lsp.buf.references, } -- create mappings for rest of lsp functions in the default style: gr prefix map.normal { description = 'definition', category = 'lsp', keys = 'grd', command = vim.lsp.buf.definition, } map.normal { description = 'list workspace folders', category = 'lsp', keys = 'grwl', command = vim.lsp.buf.list_workspace_folders, } map.normal { description = 'add workspace folder', category = 'lsp', keys = 'grwa', command = vim.lsp.buf.add_workspace_folder, } map.normal { description = 'remove workspace folder', category = 'lsp', keys = 'grwr', command = vim.lsp.buf.remove_workspace_folder, } map.normal { description = 'incoming calls', category = 'lsp', keys = 'grc', command = vim.lsp.buf.incoming_calls, } map.normal { description = 'outgoing calls', category = 'lsp', keys = 'grC', command = vim.lsp.buf.outgoing_calls, } map.normal { description = 'type definition', category = 'lsp', keys = 'grt', command = vim.lsp.buf.type_definition, } map.normal { description = 'type hierarchy (subtypes)', category = 'lsp', keys = 'grh', command = function() vim.lsp.buf.typehierarchy 'subtypes' end, } map.normal { description = 'type hierarchy (supertypes)', category = 'lsp', keys = 'grH', command = function() vim.lsp.buf.typehierarchy 'supertypes' end, } map.insert { description = 'signature help', category = 'lsp', keys = '<c-space>', command = vim.lsp.buf.signature_help, }+0 / −1 text lines
+36 / −14 text lines
local set_group_properties = function ( self, properties )local set_group_properties = function(self, properties)_.FloatBorderCorner { fg = ui_accent, bg = _.Normal.bg }-- NeoTreeGitAdded File name when the git status is added._.NeoTreeGitAdded = _.DiffAdd-- NeoTreeGitConflict File name when the git status is conflict._.NeoTreeGitConflict = _.DiffChange-- NeoTreeGitDeleted File name when the git status is deleted._.NeoTreeGitDeleted = _.DiffDelete-- NeoTreeGitIgnored File name when the git status is ignored.-- NeoTreeGitModified File name when the git status is modified._.NeoTreeGitModified = _.DiffChange-- NeoTreeGitUnstaged Used for git unstaged symbol._.NeoTreeGitUnstaged = _.DiffChange-- NeoTreeGitUntracked File name when the git status is untracked._.NeoTreeGitUntracked = _.DiffChange-- NeoTreeGitStaged Used for git staged symbol._.NeoTreeGitStaged = _.DiffText_.MiniHipatternsFixme { fg = ui_normal, bg = _.DiagnosticError.fg }_.MiniHipatternsHack { fg = ui_normal, bg = _.DiagnosticWarn.fg }_.MiniHipatternsTodo { fg = ui_normal, bg = _.DiagnosticHint.fg }_.MiniHipatternsNote { fg = ui_normal, bg = _.DiagnosticInfo.fg }+13 / −2 text lines
puk.defer 'mini.operators' (function(operators) operators.setup { -- Evaluate text and replace with output evaluate = { prefix = '<leader>o=' }, -- Exchange text regions exchange = { prefix = '<leader>ox' }, -- Multiply (duplicate) text multiply = { prefix = '<leader>om' }, -- Replace text with register replace = { prefix = '<leader>or' }, -- Sort text sort = { prefix = '<leader>os' } }+0 / −40 text lines
-- Stolen from mini.misc plugin at https://github.com/echasnovski/mini.misclocal restore_cursor = function() -- Stop if not a normal buffer if vim.bo.buftype ~= '' then return end -- Stop if filetype is ignored if vim.tbl_contains(ignored.filetypes, vim.bo.filetype) then return end -- Stop if line is already specified (like during start with `nvim file +num`) local cursor_line = vim.api.nvim_win_get_cursor(0)[1] if cursor_line > 1 then return end -- Stop if can't restore proper line for some reason local mark_line = vim.api.nvim_buf_get_mark(0, [["]])[1] local n_lines = vim.api.nvim_buf_line_count(0) if not (1 <= mark_line and mark_line <= n_lines) then return end -- Restore cursor and open just enough folds vim.cmd [[normal! g`"zv]] -- Center window vim.cmd 'normal! zz'end-- Create autocommand which runs once on `FileType` for every new bufferauto 'restore_cursor_position_setup' { description = 'Setup function to restore cursor position', events = 'BufReadPre', command = function(data) auto 'restore_cursor_position' { description = 'Restores last known cursor position when opening a buffer.', events = 'FileType', buffer = data.buf, once = true, command = restore_cursor, } end,}+54 / −37 text lines
-- if vim.fn.executable 'nu' then-- -- integrate Nushell with nvim-- vim.opt.shell = 'nu'-- -- flags for nu:-- -- * `--stdin` redirect all input to -c-- -- * `--no-newline` do not append `\n` to stdout-- -- * `--commands` execute a command-- vim.opt.shellcmdflag = '--stdin --no-newline --commands'-- -- string to be used to put the output of shell commands in a temp file-- -- 1. when 'shelltemp' is `true`-- -- 2. in the `diff-mode` (`nvim -d file1 file2`) when `diffopt` is set-- -- to use an external diff command: `set diffopt-=internal`-- vim.opt.shellredir = 'out+err> "%s"'-- -- string to be used with `:make` command to:-- -- 1. save the stderr of `makeprg` in the temp file which Neovim reads using `errorformat` to populate the `quickfix` buffer-- -- 2. show the stdout, stderr on the screen-- -- NOTE: `ansi strip` removes all ansi coloring from nushell errors-- vim.opt.shellpipe =-- '| complete | get stderr stdout | str join (char nl) | ansi strip | tee { save --force --raw "%s" }'-- -- WARN: disable the usage of temp files for shell commands-- -- because Nu doesn't support `input redirection` which Neovim uses to send buffer content to a command:-- -- `{shell_command} < {temp_file_with_selected_buffer_content}`-- -- When set to `false` the stdin pipe will be used instead.-- -- NOTE: some info about `shelltemp`: https://github.com/neovim/neovim/issues/1008-- vim.opt.shelltemp = false-- vim.opt.shellxquote = ''-- vim.opt.shellxescape = ''-- vim.opt.shellquote = ''-- endif vim.fn.executable 'nu' then -- setting the shell too early can block startup vim.schedule(function() -- integrate Nushell with nvim vim.opt.shell = 'nu' -- flags for nu: -- * `--stdin` redirect all input to -c -- * `--no-newline` do not append `\n` to stdout -- * `--commands` execute a command vim.opt.shellcmdflag = '--stdin --no-newline --commands' -- string to be used to put the output of shell commands in a temp file -- 1. when 'shelltemp' is `true` -- 2. in the `diff-mode` (`nvim -d file1 file2`) when `diffopt` is set -- to use an external diff command: `set diffopt-=internal` vim.opt.shellredir = 'out+err> "%s"' -- string to be used with `:make` command to: -- 1. save the stderr of `makeprg` in the temp file which Neovim reads using `errorformat` to populate the `quickfix` buffer -- 2. show the stdout, stderr on the screen -- NOTE: `ansi strip` removes all ansi coloring from nushell errors vim.opt.shellpipe = '| complete | get stderr stdout | str join (char nl) | ansi strip | tee { save --force --raw "%s" }' -- WARN: disable the usage of temp files for shell commands -- because Nu doesn't support `input redirection` which Neovim uses to send buffer content to a command: -- `{shell_command} < {temp_file_with_selected_buffer_content}` -- When set to `false` the stdin pipe will be used instead. -- NOTE: some info about `shelltemp`: https://github.com/neovim/neovim/issues/1008 vim.opt.shelltemp = false vim.opt.shellxquote = '' vim.opt.shellxescape = '' vim.opt.shellquote = '' end)endvim.opt.wildoptions = 'fuzzy,pum'vim.g.border_style = 'single'vim.g.border_style = { { "🬷", 'FloatBorderCorner' }, -- top left { "▔", 'FloatBorder' }, -- top { "🬲", 'FloatBorderCorner' }, -- top right { "🮈", 'FloatBorder' }, -- right { "🬕", 'FloatBorderCorner' }, -- bottom right { "▁", 'FloatBorder' }, -- bottom { "🬨", 'FloatBorderCorner' }, -- bottom left { "▍", 'FloatBorder' }, -- left}require 'bugabinga.options.menus'new file mode 100644+10 / −0 text lines
-- disable friendly beginner message in context menuvim.cmd.aunmenu [[PopUp.How-to\ disable\ mouse]]vim.iter(pairs(vim.lsp.buf)) :filter(function(_, action) return type(action) == 'function' end) :each(function(name, _) vim.cmd.anoremenu('PopUp.' .. name .. ' <cmd>lua vim.lsp.buf.' .. name .. '()<cr>') end)new file mode 100644+5 / −0 text lines
+3 / −3 text lines
new file mode 100644+30 / −0 text lines
--- Starts `profile.nvim`, if special `NVIM_PROFILE` environment variable is set.--- This file intentionally does not import any other Lua files, in order to not--- skew the later profiling results with cached modules.local should_profile = os.getenv 'NVIM_PROFILE'if should_profile then vim.cmd.packadd 'profile' require 'profile'.instrument_autocmds() if should_profile:lower():match '^start' then require 'profile'.start '*' else require 'profile'.instrument '*' endendlocal function toggle_profile() local prof = require 'profile' if prof.is_recording() then prof.stop() vim.ui.input( { prompt = 'Save profile to:', completion = 'file', default = 'profile.json' }, function ( filename ) if filename then prof.export( filename ) vim.notify( string.format( 'Wrote %s', filename ) ) end end ) else prof.start '*' endendvim.keymap.set( '', '<F12>', toggle_profile )new file mode 100644+15 / −0 text lines
local puk = require 'std.puk'local map = require 'std.map'puk.defer 'grug-far' ( function ( grug ) grug.setup {} map.normal { description = 'search and replace current word', category = 'find', keys = '<F4>', command = function () grug.open { prefills = { search = vim.fn.expand '<cword>' } } end, }end )-- TODO: check grug-far README for binding in oil.nvim+10 / −22 text lines
local auto = require 'std.auto'local treesj = puk 'treesj'local splitjoin = puk 'mini.splitjoin'treesj.setup { use_default_keymaps = false, max_join_length = 360,}splitjoin.setup()map.normal { description = 'Toggle Tree Join/Split', category = 'editing', keys = '<c-j>', command = function() local langs = require 'treesj.langs'['presets'] if langs[vim.bo.filetype] then treesj.toggle { split = { recursive = false } } else+78 / −14 text lines
local puk = require 'std.puk'local user_command = require 'std.user_command'puk.defer 'neoterm' (function(neoterm) neoterm.setup { clear_on_run = true, -- Run clear command before user specified commands position = 'center', -- Position of the terminal window: fullscreen (0), top (1), right (2), bottom (3), left (4), center (5) (string or integer value) noinsert = false, -- Disable entering insert mode when opening the neoterm window width = 0.69, -- Width of the terminal window (percentage, ratio, or range between 0-1) height = 0.69, -- Height of the terminal window (percentage, ratio, or range between 0-1)} map.normal.terminal { description = 'Toggle terminal', category = 'terminal', keys = '<leader>tt', command = neoterm.toggle,local open_float = function(options) options = options or {} local max_width = vim.o.columns local max_height = vim.o.lines local size = options.size or 0.88 local width = options.width or math.floor(max_width * size) local height = options.height or math.floor(max_height * size) local center_col = math.floor((max_width - width) / 2) local center_row = math.floor((max_height - height) / 2) local buffer_created = false local create_buffer = function() buffer_created = true return vim.api.nvim_create_buf(false, true) end local buffer = vim.api.nvim_buf_is_valid(options.buffer) and options.buffer or create_buffer() local window_settings = { relative = "editor", width = width, height = height, col = center_col, row = center_row, style = 'minimal', border = options.border or vim.g.border_style,end) local window = vim.api.nvim_open_win(buffer, true, window_settings) if buffer_created then vim.cmd.terminal('nu --login') end vim.cmd.startinsert() local buffer_options = { buflisted = false, } for buffer_option, value in pairs(buffer_options) do vim.api.nvim_set_option_value(buffer_option, value, { buf = buffer, }) end local window_options = { winbar = '', } for window_option, value in pairs(window_options) do vim.api.nvim_set_option_value(window_option, value, { win = window, }) end return { buffer = buffer, window = window, }endlocal toggle_terminal = function() if vim.api.nvim_win_is_valid(state.float.window) then vim.api.nvim_win_hide(state.float.window) else state.float = open_float(state.float) endenduser_command.Terminal 'Toggle Terminal in floating window' (toggle_terminal)map.normal.terminal { description = 'Toggle terminal', category = 'terminal', keys = '<F7>', command = toggle_terminal,}map.terminal { description = 'Enter normal mode', category = 'terminal', keys = '<esc><esc>', command = '<c-\\><c-n>'}new file mode 100644+72 / −0 text lines
local buffer_options = { bufhidden = 'hide', modifiable = false, filetype = 'markdown', -- Alternative: use help ft}local window_border = 'shadow'local window_options = { winblend = 42,}local open = function() -- create unlisted scratch buffer local buffer = vim.api.nvim_create_buf(false, true) -- must be done, before buffer is set to unmodifiable vim.api.nvim_buf_set_lines(buffer, 0, 1, false, { '# Cheat Sheet', '', '> Remember the following keymaps!' -- TODO: where to get this from? from std.map }) for name, value in pairs(buffer_options) do vim.api.nvim_set_option_value(name, value, { scope = 'local', buf = buffer, }) end local half_height = math.ceil(vim.o.lines * 0.5) local half_width = math.ceil(vim.o.columns * 0.5) local window = vim.api.nvim_open_win(buffer, true, { border = window_border, relative = 'editor', style = 'minimal', height = half_height, width = half_width, row = math.ceil(half_height * 0.5), col = math.ceil(half_width * 0.5), }) for name, value in pairs(window_options) do vim.api.nvim_set_option_value(name, value, { scope = 'local', win = window, }) end local close = function() vim.api.nvim_win_hide(window) end local buffer_keymaps = { { 'n', '<esc>', close }, { 'n', 'q', close }, } for _, map in ipairs(buffer_keymaps) do vim.keymap.set(map[1], map[2], map[3]) endendreturn setmetatable( { open = open, }, { })+2 / −2 text lines
+2 / −0 text lines
+11 / −2 text lines
+53 / −29 text lines
"6b46370d02cd001509a765591a3ffc481b538794", null ], [ treesj, github, Wansmer/treesj, main, "03415ac60791d48e120a80d37e080744faf3ac15", "1fea92f1d9908eaa5eb8bafe08b4293d7aadaa55", ], [ profile, github, "nvim-lua/plenary.nvim", master, "2d9b06177a975543726ce5c73fca176cedbffe9d", null ], [ friendly-snippets, github, rafamadriz/friendly-snippets, main, "efff286dd74c22f731cdec26a70b46e5b203c619", null ], [ tiny-inline-diagnostic, github, "rachartier/tiny-inline-diagnostic.nvim", main, "66d9166520a0cb3392a5ef68946fd3980d57383f", null ], [ grug-far, github, "MagicDuck/grug-far.nvim", main, "11d0fbd6fff6f4e394af95319deeaab4ef88ce97", nullnew file mode 100644+9 / −0 text lines
+9 / −0 text lines
Binary size (old → new): 1967 → 2095 bytes.
+1 / −1 text lines
+5 / −0 text lines
+1 / −1 text lines
+4 / −4 text lines