Merge branch 'trunk' of github.com:bugabinga/dotfiles into trunk
a78fd9add09bb4fb15e09b4b549b1cddaf0e704a
Oliver Krylow <o.krylow@isp-insoft.de> ·
unsigned
- Parent 1: b4acfdd43fce · Showing diff
- Parent 2: 43cb483f3cd0 · Diff against parent 2
bugabingas dorkfiles
a78fd9add09bb4fb15e09b4b549b1cddaf0e704a
Oliver Krylow <o.krylow@isp-insoft.de> ·
unsigned
+3332 / −2911 text lines · all files grouped into 32 bars · 3 binary (striped old/new sizes in 64-byte units, not churn) · lines and sizes scale separately
deleted file mode 100644+0 / −48 text lines
# GLOBAL VARIABLES$env.WIN32 = ( $nu.os-info.name =~ "windows" )$env.NURC_DIR = ( $nu.config-path | path expand | path dirname )$env.DOTFILES = ( $env.NURC_DIR | path join ".." | path expand )$env.WORKSPACE = if $env.WIN32 { "W:/" } else { "~/Workspace" | path expand }$env.NOTES = if $env.WIN32 { "N:/" } else { "~/Notes" | path expand }if ($env | get -i TERM_PROGRAM) == WezTerm { $env.TERM = "wezterm" if not $env.WIN32 { $env.TERMCAP = ~./termcap/w/wezterm }}# theme for ls and other programs, that use LS_COLORS$env.LS_COLORS = (try { vivid generate alabaster_dark | into string } catch {""})# Specifies how environment variables are:# - converted from a string to a value on Nushell startup (from_string)# - converted from a value back to a string when running external commands (to_string)# Note: The conversions happen *after* config.nu is loaded$env.ENV_CONVERSIONS = { "PATH": { from_string: { |s| $s | split row (char esep) } to_string: { |v| $v | str join (char esep) } } "Path": { from_string: { |s| $s | split row (char esep) } to_string: { |v| $v | str join (char esep) } }}# Directories to search for scripts when calling source or use$env.NU_LIB_DIRS = [ ($nu.config-path | path dirname | path join 'modules'), ($nu.config-path | path dirname | path join 'completions')]if $env.WIN32 { # TODO: insert scoop cargo path here # $env.CARGO_HOME = ( '~/.cargo' | path expand ) $env.Path = ( $env.Path | prepend '' )} else { $env.CARGO_HOME = ( '~/.cargo' | path expand ) $env.PATH = ( $env.PATH | prepend ( $env.CARGO_HOME | path join 'bin') ) $env.PATH = ( $env.PATH | prepend ( '~/.local/bin'| path expand ) )}deleted file mode 100644+0 / −680 text lines
---@diagnostic disable: param-type-mismatchlocal icon = require 'std.icon'local auto = require 'std.auto'local ignored = require 'std.ignored'local NEW_FILE = '~untitled~'return { { 'rebelot/heirline.nvim', tag = 'v1.0.3', event = 'BufEnter', dependencies = { 'nvim-tree/nvim-web-devicons', 'lewis6991/gitsigns.nvim', }, config = function () local heirline = require 'heirline' local conditions = require 'heirline.conditions' local utils = require 'heirline.utils' local nugu = require 'bugabinga.nugu.palette' heirline.load_colors( nugu ) auto 'reload_heirline_colors' { description = 'Reload dark/light nugu colors for Heirline', events = 'ColorScheme', command = function () utils.on_colorscheme( nugu ) end, } local vi_mode = { init = function ( self ) self.mode = vim.fn.mode( 1 ) -- :h mode() end, static = { mode_names = { n = icon.normal, no = icon.normal .. '?', nov = icon.normal .. '?', noV = icon.normal .. '?', ['no\22'] = icon.normal .. '?', niI = icon.normal .. 'i', niR = icon.normal .. 'r', niV = icon.normal .. 'v', nt = icon.normal .. 't', v = icon.visual, vs = icon.visual .. 's', V = icon.visual .. '_', Vs = icon.visual .. 's', ['\22'] = '^' .. icon.visual, ['\22s'] = '^' .. icon.visual, s = icon.select, S = icon.select .. '_', ['\19'] = '^' .. icon.select, i = icon.insert, ic = icon.insert .. 'c', ix = icon.insert .. 'x', R = icon.replace, Rc = icon.replace .. 'c', Rx = icon.replace .. 'x', Rv = icon.replace .. 'v', Rvc = icon.replace .. 'v', Rvx = icon.replace .. 'v', c = icon.command, cv = icon.command .. 'x', r = icon.pending, rm = icon.pending .. 'm', ['r?'] = icon.pending .. '?', ['!'] = icon.exclaim, t = icon.terminal, }, mode_colors = { n = 'ui_normal', i = 'ui_accent', v = 'ui_important_global', V = 'ui_important_global', ['\22'] = 'ui_important_global', c = 'ui_important_global', s = 'ui_important_global', S = 'ui_important_global', ['\19'] = 'ui_important_global', R = 'ui_important_global', r = 'ui_important_global', ['!'] = 'ui_important_global', t = 'ui_important_global', }, }, provider = function ( self ) local mode_name = self.mode_names[self.mode] return ' ' .. icon.vim .. ' %3(' .. mode_name .. '%) ' end, hl = function ( self ) local mode = self.mode:sub( 1, 1 ) -- get only the first mode character return { fg = self.mode_colors[mode], bold = true, } end, update = { 'ModeChanged', pattern = '*:*', callback = vim.schedule_wrap( function () vim.cmd.redrawstatus() end ), }, } local file_icon = { init = function ( self ) local filename = self.filename local extension = vim.fn.fnamemodify( filename, ':e' ) self.icon = require 'nvim-web-devicons'.get_icon_color( filename, extension, { default = true, } ) end, provider = function ( self ) return self.icon and (self.icon .. ' ') end, hl = 'DefaultIcon', } local file_name = { init = function ( self ) self.lfilename = vim.fs.normalize( vim.fn.fnamemodify( self.filename, ':.' ) ) if self.lfilename == '' then self.lfilename = NEW_FILE end end, flexible = 2, { provider = function ( self ) return self.lfilename end, }, { provider = function ( self ) return vim.fs.normalize( vim.fn.pathshorten( self.lfilename ) ) end, }, } local file_flags = { { condition = function () return vim.bo.modified end, provider = string.format( ' %s ', icon.modified ), hl = 'Comment', }, { condition = function () return not vim.bo.modifiable or vim.bo.readonly end, provider = string.format( ' %s ', icon.lock ), hl = 'ErrorMsg', }, } local file_name_block = { init = function ( self ) self.filename = vim.fs.normalize( vim.api.nvim_buf_get_name( 0 ) ) end, file_icon, { provider = ' ', }, file_name, file_flags, { provider = '%<', }, -- this means that the statusline is cut here when there's not enough space } local file_type = { provider = function () return icon.file .. ' ' .. string.upper( vim.bo.filetype ) end, } local file_encoding = { provider = function () local enc = (vim.bo.fenc ~= '' and vim.bo.fenc) or vim.o.enc -- :h 'enc' return enc ~= 'utf-8' and enc:upper() end, } local file_format = { static = { dos = icon.newline .. icon.carriage_return, unix = icon.newline, mac = icon.carriage_return, }, provider = function ( self ) local fileformat = vim.bo.fileformat return self[fileformat] end, } local file_size = { provider = function () -- stackoverflow, compute human readable file size -- i want to see vim opening a 1EiB file local suffix = { 'b', 'k', 'M', 'G', 'T', 'P', 'E', } local fsize = vim.fn.getfsize( vim.api.nvim_buf_get_name( 0 ) ) fsize = (fsize < 0 and 0) or fsize if fsize < 1024 then return fsize .. suffix[1] end local i = math.floor( (math.log( fsize ) / math.log( 1024 )) ) return string.format( '%.2g%s', fsize / math.pow( 1024, i ), suffix[i + 1] ) end, } local file_last_modified = { provider = function () local ftime = vim.fn.getftime( vim.api.nvim_buf_get_name( 0 ) ) if ftime > 0 then local timeago = require 'std.timeago' return timeago.format( ftime ) end end, } local lsp_active = { condition = conditions.lsp_attached, -- FIXME: updates from parent components do not seem to update children, -- if those have their own updates? update = { 'LspAttach', 'LspDetach', 'BufEnter', 'BufLeave', }, provider = function () local names = {} for _, client in pairs( vim.lsp.get_clients { bufnr = 0, } ) do table.insert( names, client.name ) end return icon.lsp .. ' ' .. table.concat( names, ' ' ) end, } local diagnostic_enabled = { init = function ( self ) self.icon = vim.diagnostic.is_disabled() and icon.toggle_off or icon.toggle_on end, provider = function ( self ) return icon.diagnostic .. ' ' .. self.icon end, } local diagnostic = { condition = conditions.has_diagnostics, static = { error_icon = icon.error, warn_icon = icon.warn, info_icon = icon.info, hint_icon = icon.hint, }, init = function ( self ) self.errors = #vim.diagnostic.get( 0, { severity = vim.diagnostic.severity.ERROR, } ) self.warnings = #vim.diagnostic.get( 0, { severity = vim.diagnostic.severity.WARN, } ) self.hints = #vim.diagnostic.get( 0, { severity = vim.diagnostic.severity.HINT, } ) self.info = #vim.diagnostic.get( 0, { severity = vim.diagnostic.severity.INFO, } ) end, update = { 'DiagnosticChanged', 'BufEnter', }, { provider = function ( self ) -- 0 is just another output, we can decide to print it or not! return self.errors > 0 and (self.error_icon .. ' ' .. self.errors .. ' ') end, hl = 'DiagnosticError', }, { provider = function ( self ) return self.warnings > 0 and (self.warn_icon .. ' ' .. self.warnings .. ' ') end, hl = 'DiagnosticWarn', }, { provider = function ( self ) return self.info > 0 and (self.info_icon .. ' ' .. self.info .. ' ') end, hl = 'DiagnosticInfo', }, { provider = function ( self ) return self.hints > 0 and (self.hint_icon .. ' ' .. self.hints) end, hl = 'DiagnosticHint', }, } local is_svn_repo = function () local svn_dir = vim.fs.find( '.svn', { upward = true, stop = vim.uv.os_homedir(), path = vim.fs.dirname( vim.api.nvim_buf_get_name( 0 ) ), type = 'directory', } ) return not vim.tbl_isempty( svn_dir ) end local svn_get_relative_url = function () -- FIXME: replace with vim.system local job = require 'plenary.job' local relative_url = { '[ERR]', } job:new { command = 'svn', args = { 'info', '--show-item', 'relative-url', '--no-newline', }, on_exit = function ( current_job, exit_code ) if exit_code == 0 then relative_url = current_job:result() end end, }:sync() return relative_url[1] end local svn = { condition = is_svn_repo, update = 'BufEnter', init = function ( self ) self.relative_url = svn_get_relative_url() end, { provider = function ( self ) return icon.subversion .. ' ' .. icon.branch .. ' ' .. self.relative_url end, }, } local git = { condition = conditions.is_git_repo, init = function ( self ) self.status_dict = vim.b.gitsigns_status_dict end, { provider = function ( self ) return icon.git .. ' ' .. icon.branch .. ' ' .. self.status_dict.head .. ' ' end, }, { provider = function ( self ) local count = self.status_dict.added or 0 return count > 0 and (icon.diff_add .. ' ' .. count .. ' ') end, hl = 'DiffAdd', }, { provider = function ( self ) local count = self.status_dict.removed or 0 return count > 0 and (icon.diff_remove .. ' ' .. count .. ' ') end, hl = 'DiffDelete', }, { provider = function ( self ) local count = self.status_dict.changed or 0 return count > 0 and (icon.diff_change .. ' ' .. count .. ' ') end, hl = 'DiffChange', }, } local work_dir = { init = function ( self ) self.icon = (vim.fn.haslocaldir( 0 ) == 1 and icon['local'] or '') .. ' ' .. icon.global .. ' ' self.cwd = vim.fs.normalize( vim.uv.cwd() ):gsub( vim.fs.normalize( vim.uv.os_homedir() ), '~' ) end, flexible = 1, { provider = function ( self ) return self.icon .. self.cwd end, }, { provider = function ( self ) local cwd = vim.fn.pathshorten( self.cwd ) return self.icon .. cwd end, }, { provider = '', }, } local help_file_name = { condition = function () return vim.bo.filetype == 'help' end, provider = function () local filename = vim.api.nvim_buf_get_name( 0 ) return vim.fn.fnamemodify( filename, ':t' ) end, hl = 'Question', } local terminal_name = { provider = function () local name, _ = vim.api.nvim_buf_get_name( 0 ):gsub( '.*:', '' ) local basename = vim.fs.basename( name ) return icon.terminal .. ' ' .. (basename or 'noname') end, hl = 'Bold', } local togglers = { provider = function () local togglers = require 'bugabinga.options.togglers' return tostring( togglers ) end, } local macro_recording = { condition = function () return vim.fn.reg_recording() ~= '' and vim.o.cmdheight == 0 end, provider = icon.macro .. ' ', hl = 'PreProc', utils.surround( { '░▒▓ ', ' ▓▒░', }, nil, { provider = function () return vim.fn.reg_recording() end, hl = 'Bold', } ), update = { 'RecordingEnter', 'RecordingLeave', }, } local lazy = { condition = function () local ok, lazy_status = pcall( require, 'lazy.status' ) return ok and lazy_status.has_updates() end, update = { 'User', pattern = 'LazyUpdate', }, provider = function () return ' ' .. icon.lazy .. ' ' .. require 'lazy.status'.updates() .. ' ' end, on_click = { callback = function () require 'lazy'.update() end, name = 'update_plugins', }, } local align = { provider = '%=', } local space = { provider = ' ', } local default_statusline = { vi_mode, macro_recording, align, work_dir, space, git, svn, align, diagnostic_enabled, space, diagnostic, space, lsp_active, align, togglers, align, lazy, space, file_encoding, space, file_format, space, file_type, space, file_size, space, file_last_modified, } local special_statusline = { condition = function () return conditions.buffer_matches { buftype = ignored.buftypes, filetype = ignored.filetypes, } end, file_type, space, help_file_name, align, } local terminal_statusline = { condition = function () return conditions.buffer_matches { buftype = { 'terminal', }, } end, { condition = conditions.is_active, vi_mode, space, }, file_type, space, terminal_name, align, } local inactive_statusline = { condition = conditions.is_not_active, file_type, space, file_name, align, } local statuslines = { hl = function () if conditions.is_active() then return 'StatusLine' else return 'StatusLineNC' end end, fallthrough = false, special_statusline, terminal_statusline, inactive_statusline, default_statusline, } local winbars = { hl = function () if conditions.is_active() then return 'Winbar' else return 'WinbarNC' end end, fallthrough = false, { condition = function () return conditions.buffer_matches { buftype = { 'terminal', }, } end, file_type, space, terminal_name, }, file_name_block, } local tabline_buffer_number = { provider = function ( self ) return '(' .. tostring( self.bufnr ) .. ')' end, hl = function ( self ) if self.is_active then return { fg = utils.get_highlight 'TabLineSel'.fg, } elseif not vim.api.nvim_buf_is_loaded( self.bufnr ) then return { fg = utils.get_highlight 'StatusLineNc'.fg, } else return { fg = utils.get_highlight 'TabLine'.fg, } end end, } local tabline_file_name = { provider = function ( self ) local name = self.file_name return name == '' and NEW_FILE or vim.fs.normalize( vim.fn.fnamemodify( name, ':t' ) ) end, hl = function ( self ) return { bold = self.is_active or self.is_visible, italic = true, } end, } local tabline_file_flags = { { condition = function ( self ) return vim.api.nvim_get_option_value( 'modified', { buf = self.bufnr, } ) end, provider = icon.modified .. ' ', }, { condition = function ( self ) return not vim.api.nvim_get_option_value( 'modifiable', { buf = self.bufnr, } ) or vim.api.nvim_get_option_value( 'readonly', { buf = self.bufnr, } ) end, provider = function ( self ) if vim.api.nvim_get_option_value( 'buftype', { buf = self.bufnr, } ) == 'terminal' then return icon.terminal else return icon.lock end end, }, hl = 'Bold', } local tabline_file_name_block = { init = function ( self ) self.file_name = vim.api.nvim_buf_get_name( self.bufnr ) end, hl = function ( self ) if self.is_active then return 'TabLineSel' elseif not vim.api.nvim_buf_is_loaded( self.bufnr ) then return { fg = utils.get_highlight 'StatusLineNc'.fg, } else return 'TabLine' end end, on_click = { callback = function ( _, minwid, _, button ) if button == 'm' then --m = middle click vim.schedule( function () vim.api.nvim_buf_delete( minwid, { force = false, } ) vim.cmd.redrawtabline() end ) else vim.api.nvim_win_set_buf( 0, minwid ) end end, minwid = function ( self ) return self.bufnr end, name = 'heirline_tabline_buffer_callback', }, file_icon, { provider = ' ', }, tabline_file_name, tabline_buffer_number, tabline_file_flags, } local tabline_buffer_block = utils.surround( { ' ' .. icon.slant_left, icon.slant_right .. ' ', }, function ( self ) if self.is_active then return utils.get_highlight 'TabLine'.bg else return utils.get_highlight 'TabLineFill'.bg end end, { tabline_file_name_block, } ) local buffer_line = utils.make_buflist( tabline_buffer_block, { provider = icon.arrow_left .. ' ', hl = 'TabLine', }, { provider = ' ' .. icon.arrow_right, hl = 'TabLine', } ) local tabpage = { provider = function ( self ) return '%' .. self.tabnr .. 'T ' .. self.tabpage .. ' %T' end, hl = function ( self ) if self.is_active then return 'TabLineSel' else return 'TabLine' end end, } local tab_pages = { { provider = '%=', }, utils.make_tablist( tabpage ), } local tabline = { buffer_line, tab_pages, } -- local statuscolumn = {} heirline.setup { statusline = statuslines, winbar = winbars, tabline = tabline, -- statuscolumn = statuscolumn, opts = { colors = nugu, disable_winbar_cb = function ( args ) return conditions.buffer_matches( { buftype = ignored.buftypes, filetype = ignored.filetypes, }, args.buf ) end, }, } end, },}+8 / −2 text lines
new file mode 100644+22 / −0 text lines
new file mode 100644+8 / −0 text lines
deleted file mode 100644+0 / −21 text lines
{ "$schema": "https://raw.githubusercontent.com/sumneko/vscode-lua/master/setting/schema.json", "diagnostics": { "globals": [ "vim" ], "neededFileStatus": { "codestyle-check": "Any" } }, "workspace": { "checkThirdParty": false }, "runtime": { "version": "LuaJIT", "pathStrict": true, "special": { "want": "require" } }}new file mode 100644+1 / −0 text lines
return { 'Format', }+27 / −12 text lines
: config modules. in aggregation, defines all of the config. can depend on itself, std and plugins.Have withstood pain to create many programs, yet those hands will never hold a working program.* write plugin to parse lsp settings,plugin options and neovim settings locally and apply them ( can we repurpose editorconfig support in neovim for that?)* pandoc with lua filters for diagrams for generating documents and previewing --> https://github.com/tex/vimpreviewpandoc* create a floating window that shows plugins, that have commands, as reminder* add nu-check to nvim-lint* create skeleton-plugin for default file content based on file type (BufNewFile?)* make lsp config extensible, so that plugin configs can hook into it (e.g. on_attach)* split parts of config into plugins* add support for Java multi line string in autopairs* pandoc with lua filters for diagrams for generating documents and previewing --> https://github.com/tex/vimpreviewpandoc outside of vim?+28 / −0 text lines
local map = require 'std.map'map.normal { description = 'Wrap word under cursor with require call', keys = '<leader>rq', category = 'refactor', -- surround word with ' -- insert `require` -- move 3 words command = "ebi'<esc>ea'<esc>bbirequire <esc>www", buffer = true, remap = true,}--TODO: add dbg.print, require, prequireprequire 'nvim-surround'.buffer_setup { surrounds = { ['P'] = { add = { 'vim.print(', ')', }, find = 'vim%.print%b()', delete = '^(vim%.print%()().-(%))()$', change = { target = '^(vim%.print%()().-(%))()$', }, }, },}new file mode 100644+1 / −0 text lines
vim.opt_local.syntax = 'on'+35 / −8 text lines
if not ok then vim.print( 'error while loading options', loaded ) endif not ok then vim.print( 'error while loading lazy', loaded ) endif not ok then vim.print( 'error while loading diagnostic', loaded ) endif not ok then vim.print( 'error while loading mark', loaded ) end+1 / −1 text lines
+54 / −4 text lines
"LuaSnip": { "branch": "master", "commit": "be7be2ca7f55bb881a7ffc16b2efa5af034ab06b" }, "actions-preview.nvim": { "branch": "master", "commit": "5072b1b1065a6b22bdd46b5c21780a91d6a08071" }, "auto-dark-mode.nvim": { "branch": "master", "commit": "e328dc463d238cb7d690fb4daf068eba732a5a14" }, "better-escape.nvim": { "branch": "master", "commit": "7e86edafb8c7e73699e0320f225464a298b96d12" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, "cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" }, "cmp-nvim-lua": { "branch": "main", "commit": "f12408bdb54c39c23e67cab726264c10db33ada8" }, "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, "conform.nvim": { "branch": "master", "commit": "9d5ba06d6ee7418c674f498634617416d15b6239" }, "fidget.nvim": { "branch": "main", "commit": "4e854f3299e21d1c18279add340428a97520fc44" }, "fidget.nvim": { "branch": "main", "commit": "1ba38e4cbb24683973e00c2e36f53ae64da38ef5" }, "mason-tool-installer.nvim": { "branch": "main", "commit": "1212fb6082b7177dde17ea65e429e027835aeb40" }, "gitsigns.nvim": { "branch": "main", "commit": "6ef8c54fb526bf3a0bc4efb0b2fe8e6d9a7daed2" }, "glow.nvim": { "branch": "main", "commit": "238070a686c1da3bccccf1079700eb4b5e19aea4" }, "heirline.nvim": { "branch": "master", "commit": "03cff30d7e7d3ba6fdc00925f015822f79cef908" }, "indent-blankline.nvim": { "branch": "master", "commit": "3d08501caef2329aba5121b753e903904088f7e6" }, "lazy.nvim": { "branch": "main", "commit": "31ddbea7c10b6920c9077b66c97951ca8682d5c8" }, "lspkind.nvim": { "branch": "master", "commit": "1735dd5a5054c1fb7feaf8e8658dbab925f4f0cf" }, "lua-utils.nvim": { "branch": "main", "commit": "e565749421f4bbb5d2e85e37c3cef9d56553d8bd" }, "mason-tool-installer.nvim": { "branch": "main", "commit": "6c15772d5e4a01d0b2ad3ad6df23cf38517c4ad2" }, "mason.nvim": { "branch": "main", "commit": "c43eeb5614a09dc17c03a7fb49de2e05de203924" }, "mini.starter": { "branch": "main", "commit": "ce222a5b6de50a9963c1eb62aa16ec6d5efca7ee" }, "nrpattern.nvim": { "branch": "master", "commit": "f862ce687761078ef3155688151c55f69d28453e" }, "nvim-autopairs": { "branch": "master", "commit": "4f41e5940bc0443fdbe5f995e2a596847215cd2a" }, "neorg": { "branch": "main", "commit": "7c5464722a4e8240efd9ecd7bef85d38f94c1ab5" }, "neotest": { "branch": "master", "commit": "f03a78cef74db5638e4312e18b767294a90de8da" }, "neotest-plenary": { "branch": "master", "commit": "dcaf5ed67a9e28a246e9783319e5aa6c9ea1c584" }, "nrpattern.nvim": { "branch": "master", "commit": "f862ce687761078ef3155688151c55f69d28453e" }, "nui.nvim": { "branch": "main", "commit": "a0fd35fcbb4cb479366f1dc5f20145fd718a3733" }, "nvim-autopairs": { "branch": "master", "commit": "4f41e5940bc0443fdbe5f995e2a596847215cd2a" }, "nvim-cmp": { "branch": "main", "commit": "ce16de5665c766f39c271705b17fff06f7bcb84f" }, "nvim-dap": { "branch": "master", "commit": "405df1dcc2e395ab5173a9c3d00e03942c023074" }, "nvim-dap-ui": { "branch": "master", "commit": "edfa93f60b189e5952c016eee262d0685d838450" }, "nvim-dap-virtual-text": { "branch": "master", "commit": "3e8e207513e6ef520894950acd76b79902714103" }, "nvim-lint": { "branch": "master", "commit": "3317b73ec3eb76cd8ca83e05880c07c83e368c1e" }, "nvim-lsp-file-operations": { "branch": "master", "commit": "223aca86b737dc66e9c51ebcda8788a8d9cc6cf2" }, "persistence.nvim": { "branch": "main", "commit": "ad538bfd5336f1335cdb6fd4e0b0eebfa6e12f32" }, "nvim-nio": { "branch": "master", "commit": "5a3a06e5df34f1b4fc1500622b10620c49c60da6" }, "nvim-spectre": { "branch": "master", "commit": "2b012554a2536465243c0dff3605b5927c49ed23" }, "nvim-surround": { "branch": "main", "commit": "84a26afce16cffa7e3322cfa80a42cddf60616eb" }, "nvim-tree.lua": { "branch": "master", "commit": "ddd1d6eb21c45433bdc65cc8015f2457998f2bf2" }, "nvim-treesitter": { "branch": "master", "commit": "e9321bb914b3a5a88b7dff5392f0f5f8d83bee67" }, "nvim-treesitter-endwise": { "branch": "master", "commit": "60e8c288e011403f248b5f6478dde12bed8a6c55" }, "nvim-treesitter-textobjects": { "branch": "master", "commit": "2aa454e4037424c678a8ff033951a5be39e54b9c" }, "nvim-ts-autotag": { "branch": "main", "commit": "531f48334c422222aebc888fd36e7d109cb354cd" }, "nvim-ts-context-commentstring": { "branch": "main", "commit": "734ebad31c81c6198dfe102aa23280937c937c42" }, "nvim-web-devicons": { "branch": "master", "commit": "fd4abfc5237246670977972c6f518186b621a32d" }, "nvim-window": { "branch": "main", "commit": "fad0dc96de265b0bdcb21d1071329e5ab1deb4af" }, "oil.nvim": { "branch": "master", "commit": "e462a3446505185adf063566f5007771b69027a1" }, "overseer.nvim": { "branch": "master", "commit": "b04b0b105c07b4f02b3073ea3a98d6eca90bf152" }, "pair-ls.nvim": { "branch": "master", "commit": "e7a8f55f54a6a1956b782ddefba79dc6bb308d1d" }, "playground": { "branch": "master", "commit": "ba48c6a62a280eefb7c85725b0915e021a1a0749" }, "plenary.nvim": { "branch": "master", "commit": "50012918b2fc8357b87cff2a7f7f0446e47da174" }, "qf_helper.nvim": { "branch": "master", "commit": "91dad029c11d1c39b0d1276eda52616f651072be" }, "resession.nvim": { "branch": "master", "commit": "dc8825439c619030925543a444c4186a2487c200" }, "schemastore.nvim": { "branch": "main", "commit": "80d701841487f72bf9d3fa56b25146b95e190502" }, "telescope-symbols.nvim": { "branch": "master", "commit": "a6d0127a53d39b9fc2af75bd169d288166118aec" }, "telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" }, "telescope-zoxide": { "branch": "main", "commit": "68966349aa1b8e9ade403e18479ecf79447389a7" }, "telescope.nvim": { "branch": "master", "commit": "6312868392331c9c0f22725041f1ec2bef57c751" }, "todo-comments.nvim": { "branch": "main", "commit": "8febc60a76feefd8203077ef78b6a262ea1a41f9" }, "toggleterm.nvim": { "branch": "main", "commit": "193786e0371e3286d3bc9aa0079da1cd41beaa62" },new file mode 100644+5 / −0 text lines
new file mode 100644+38 / −0 text lines
local editorconfig = require 'editorconfig'-- extends the parsing of '.editorconfig' files, if present, with some neovim options, that i care about.-- theoretically, this could also be achieved by enabling the 'exrc' feature in neovim or by using my 'localrc' module.-- however, i prefer editorconfig in this case, because:-- 1. it is its intended use case-- 2. it does not require a manual step (`vim.secure.read`)-- 3. there is no chance of random code execution by third parties-- 4. there is a miniscule chance to share those options with others in the future---- NOTE: editorconfig options are not re-evaluated, when loading a sessionlocal tobool = function ( str ) -- intentionally strict return str == 'true'endlocal expose_option = function ( option_name, parser ) editorconfig.properties[option_name] = function ( _, value ) vim.opt_local[option_name] = parser( value ) endend-- even those options are the same as my togglers, the code is not shared for the-- small off chance, that this ever gets shared as a neovim pluginexpose_option( 'spell', tobool )expose_option( 'number', tobool )expose_option( 'cursorline', tobool )expose_option( 'virtualedit', tostring )editorconfig.properties.diagnostic = function ( bufnr, value ) local option = tobool( value ) if option then vim.diagnostic.enable( bufnr ) else vim.diagnostic.disable( bufnr ) endend+46 / −15 text lines
lazy.setup( 'bugabinga.plugins', {local overrides = require 'std.localrc' ( '.lazy.specs.lua', 'table' )--- a couple of vim events, that collectively represent "a file has been opened".--- this is useful for plugins that want to be lazy loaded, when some file is shown in a buffer/windowvim.g.FILE_LOADED_EVENTS = { 'BufRead', 'BufNew', 'SessionLoadPost', }lazy.setup { spec = { { import = 'bugabinga.plugins', }, overrides, }, custom_keys = { ['<localleader>l'] = { function ( plugin ) require 'lazy.util'.float_term( { 'gitui', }, { cwd = plugin.dir, } ) end, desc = 'Open gitui', }, ['<localleader>t'] = { function ( plugin ) require 'lazy.util'.float_term( nil, { cwd = plugin.dir, } ) end, desc = 'Open terminal in plugin dir', }, }, custom_keys = { ['<localleader>l'] = function ( plugin ) require 'lazy.util'.float_term( 'gitui', { cwd = plugin.dir, } ) end, ['<localleader>t'] = function ( plugin ) require 'lazy.util'.float_term( nil, { cwd = plugin.dir, } ) end, }, diff = { cmd = 'diffview.nvim', },local auto = require 'std.auto'auto 'display_startup_time' { description = 'Display startup time on starter screen', events = 'User', pattern = 'LazyVimStarted', once = true, command = vim.schedule_wrap( function () local startuptime = lazy.stats().startuptime vim.notify( 'neovim started in ' .. startuptime .. 'ms' ) end ),}deleted file mode 100644+0 / −22 text lines
local project = require 'std.project'return { name = 'bash-lsp', command = { 'bash-language-server', 'start', }, filetypes = { 'sh', }, root_dir = project.find_vcs_project_root, single_file_support = true, workspaces = false, settings = { bashIde = { -- Glob pattern for finding and parsing shell script files in the workspace. -- Used by the background analysis features across files. -- Prevent recursive scanning which will cause issues when opening a file -- directly in the home directory (e.g. ~/foo.sh). -- -- Default upstream pattern is "**/*@(.sh|.inc|.bash|.command)". globPattern = vim.env.GLOB_PATTERN or '*@(.sh|.inc|.bash|.command)', }, },}+0 / −1 text lines
+19 / −15 text lines
vim.fn.glob( java_debug_path .. '/extension/server/com.microsoft.java.debug.plugin-*.jar' ), '\n' ) ) vim.list_extend( bundles, vim.split( vim.fn.glob( java_test_path .. '/extension/server/*.jar' ), '\n' ) )+2 / −3 text lines
+88 / −66 text lines
local user_command = vim.api.nvim_create_user_commandlocal user_command = require 'std.user_command'local token_update = function ( lsp_client ) local root_dir = type( config.root_dir ) == 'string' and config.root_dir or config.root_dir( buffer_path ) local settings = config.settings local settings_override = project_local_lsp_settings[config.name] if settings_override then debug.print( 'overriding settings with project local settings', settings, settings_override ) settings = vim.tbl_deep_extend( 'force', settings, settings_override ) end -- workspace_folders = { config.root_dir(buffer_path) }, -- TODO: i think workspaces can only ever be declared per project. i cannot think of a generic way to calculate those, like with root_dir. maybe a toml/ini file in root_dir sets these? table.insert( keybinds[client_id], keybind ) table.insert( keybinds[client_id], keybind_remover ) local client = vim.lsp.get_client_by_id( args.data.client_id )-- TODO: lsp restart, lsp exit-- TODO: move to std.icons.lua Class = ' ', Color = ' ', Constant = ' ', Constructor = ' ', Enum = ' ', EnumMember = ' ', Field = ' ', File = ' ', Folder = ' ', Function = ' ', Interface = '', Keyword = ' ', Method = 'ƒ ', Module = ' ', Property = ' ', Snippet = ' ', Struct = ' ', Text = ' ', Unit = ' ', Value = ' ', Variable = ' ', Class = icon.class, Color = icon.color, Constant = icon.constant, Constructor = icon.constructor, Enum = icon.enum, EnumMember = icon.enum_member, Field = icon.field, File = icon.file, Folder = icon.folder, Function = icon['function'], Interface = icon.interface, Keyword = icon.keyword, Method = icon.method, Module = icon.module, Property = icon.property, Snippet = icon.snippet, Struct = icon.struct, Text = icon.text, Unit = icon.unit, Value = icon.value, Variable = icon.variable,+73 / −72 text lines
vim.validate { properties = { properties, 'table', }, -- • fg (or foreground): color name or "#RRGGBB", see note. ['properties.fg'] = { properties.fg, 'string', true, }, -- • bg (or background): color name or "#RRGGBB", see note. ['properties.bg'] = { properties.bg, 'string', true, }, -- • sp (or special): color name or "#RRGGBB" ['properties.sp'] = { properties.sp, 'string', true, }, -- • blend: integer between 0 and 100 ['properties.blend'] = { properties.blend, 'number', true, }, -- • bold: boolean ['properties.bold'] = { properties.bold, 'boolean', true, }, -- • standout: boolean ['properties.standout'] = { properties.standout, 'boolean', true, }, -- • underline: boolean ['properties.underline'] = { properties.underline, 'boolean', true, }, -- • undercurl: boolean ['properties.undercurl'] = { properties.undercurl, 'boolean', true, }, -- • underdotted: boolean ['properties.underdotted'] = { properties.underdotted, 'boolean', true, }, -- • underdashed: boolean ['properties.underdashed'] = { properties.underdashed, 'boolean', true, }, -- • strikethrough: boolean ['properties.strikethrough'] = { properties.strikethrough, 'boolean', true, }, -- • italic: boolean ['properties.italic'] = { properties.italic, 'boolean', true, }, -- • reverse: boolean ['properties.reverse'] = { properties.reverse, 'boolean', true, }, -- • nocombine: boolean ['properties.nocombine'] = { properties.nocombine, 'boolean', true, }, -- • default: Don't override existing definition |:hi-default| ['properties.default'] = { properties.default, 'boolean', true, }, -- • ctermfg: Sets foreground of cterm color |ctermfg| ['properties.ctermfg'] = { properties.ctermfg, 'string', true, }, -- • ctermbg: Sets background of cterm color |ctermbg| ['properties.ctermbg'] = { properties.ctermbg, 'string', true, }, -- • cterm: cterm attribute map, like |highlight-args|. If not set, cterm attributes will match those from the attribute map documented above. ['properties.cterm'] = { properties.cterm, 'table', true, }, -- • force: if true force update the highlight group when it exists. ['properties.force'] = { properties.force, 'boolean', true, }, } -- vim.print( 'SET GROUP PROPERTIES', self, properties ) for key, value in pairs( properties ) do self[key] = value end vim.validate { properties = { properties, 'table', }, -- • fg (or foreground): color name or "#RRGGBB", see note. ['properties.fg'] = { properties.fg, 'string', true, }, -- • bg (or background): color name or "#RRGGBB", see note. ['properties.bg'] = { properties.bg, 'string', true, }, -- • sp (or special): color name or "#RRGGBB" ['properties.sp'] = { properties.sp, 'string', true, }, -- • blend: integer between 0 and 100 ['properties.blend'] = { properties.blend, 'number', true, }, -- • bold: boolean ['properties.bold'] = { properties.bold, 'boolean', true, }, -- • standout: boolean ['properties.standout'] = { properties.standout, 'boolean', true, }, -- • underline: boolean ['properties.underline'] = { properties.underline, 'boolean', true, }, -- • undercurl: boolean ['properties.undercurl'] = { properties.undercurl, 'boolean', true, }, -- • underdotted: boolean ['properties.underdotted'] = { properties.underdotted, 'boolean', true, }, -- • underdashed: boolean ['properties.underdashed'] = { properties.underdashed, 'boolean', true, }, -- • strikethrough: boolean ['properties.strikethrough'] = { properties.strikethrough, 'boolean', true, }, -- • italic: boolean ['properties.italic'] = { properties.italic, 'boolean', true, }, -- • reverse: boolean ['properties.reverse'] = { properties.reverse, 'boolean', true, }, -- • nocombine: boolean ['properties.nocombine'] = { properties.nocombine, 'boolean', true, }, -- • default: Don't override existing definition |:hi-default| ['properties.default'] = { properties.default, 'boolean', true, }, -- • ctermfg: Sets foreground of cterm color |ctermfg| ['properties.ctermfg'] = { properties.ctermfg, 'string', true, }, -- • ctermbg: Sets background of cterm color |ctermbg| ['properties.ctermbg'] = { properties.ctermbg, 'string', true, }, -- • cterm: cterm attribute map, like |highlight-args|. If not set, cterm attributes will match those from the attribute map documented above. ['properties.cterm'] = { properties.cterm, 'table', true, }, -- • force: if true force update the highlight group when it exists. ['properties.force'] = { properties.force, 'boolean', true, }, } -- vim.print( 'SET GROUP PROPERTIES', self, properties ) for key, value in pairs( properties ) do self[key] = value end_.NotifyBackground { bg = ui_backdrop, }_.NotifyBackground { bg = ui_backdrop, }_.Parameter { fg = content_focus, }_.Hlargs { fg = content_important_local, }+8 / −6 text lines
new file mode 100644+12 / −0 text lines
local light_up = require 'std.light_up'local user_command = require 'std.user_command'local light_up_current_buffer = function () local group_names = light_up.get_vim_highlight_groups() light_up.buffer( 0, group_names )enduser_command.LightUp'Highlight hl-group names in current buffer' ( light_up_current_buffer )+8 / −0 text lines
+1 / −0 text lines
+17 / −57 text lines
local const = require 'bugabinga.const' vim.api.nvim_buf_set_lines( current_buffer, current_line, current_line, strict_indexing, newline ) vim.api.nvim_buf_set_lines( current_buffer, current_line, current_line, strict_indexing, newline )-- system clipboard copy and pastemap.normal.visual { description = 'system clipboard motion', category = 'editing', keys = '<c-s-v>', command = '"+',}map.insert { description = 'Cycle through autocomplete popup', category = 'editing', keys = '<tab>', options = { expr = true }, command = function () return vim.fn.pumvisible() == 1 and '<C-n>' or '<tab>' end,}--TODO make globallocal win32 = vim.loop.os_uname().sysname:match 'Win'local wsl2 = vim.loop.os_uname().release:match 'WSL2' vim.schedule( function () vim.notify( 'Opened ' .. file_under_cursor ) end ) command = function () vim.cmd [[ nohlsearch ]] end, ---@diagnostic disable-next-line: undefined-field---@diagnostic disable-next-line: undefined-fieldmap.normal { description = 'Run save actions', category = 'edit', keys = '<c-s>', command = function () -- trim vim.cmd 'TrimTrailingWhitespace' -- format vim.lsp.buf.format { async = false } -- TODO: run makeprg -- vim.cmd [[silent make]] -- save vim.cmd [[wa]] -- workaround for neovim bug:https://github.com/neovim/neovim/issues/25370 vim.api.nvim_feedkeys( 'zz', 'n', true ) end,} command = function () toggler:toggle() end,+67 / −81 text lines
-- TODO: this should probably live in nugu?-- local hl_to_mode = {-- n = { bg = 'black' },-- i = { bg = 'blue' },-- v = { bg = 'green' },-- }---- auto 'change_cursor_highlight_based_on_mode' {-- description = 'Changes the highlight of the cursor based on the current mode.',-- events = 'ModeChanged',-- command = function ()-- local current_mode = vim.fn.mode()-- local hl = hl_to_mode[current_mode]-- vim.notify( 'changing Cursor highlight for mode ' .. current_mode .. ' to ' .. vim.inspect( hl ) )-- if hl then-- vim.api.nvim_set_hl( 0, 'Cursor', hl )-- end-- end,-- }vim.opt.wrap = true-- do not conceal special characters by default. filestypes can enable this on demand.-- do not conceal special characters by default. ftplugin can enable this on demand. -- vim.g.neovide_floating_blur_amount_x = 12.0 -- vim.g.neovide_floating_blur_amount_y = 12.0 -- vim.g.neovide_scroll_animation_length = 0.69 -- vim.g.neovide_fullscreen = true vim.g.neovide_remember_window_size = true vim.g.neovide_profiler = false -- vim.g.neovide_cursor_animation_length = 0.42 -- vim.g.neovide_cursor_trail_length = 0.42 vim.g.neovide_cursor_vfx_mode = 'railgun' -- vim.g.neovide_cursor_unfocused_outline_width = 0.125 vim.g.neovide_cursor_antialiasing = true vim.g.neovide_padding_top = 0 vim.g.neovide_padding_bottom = 0 vim.g.neovide_padding_right = 0 vim.g.neovide_padding_left = 0 vim.g.neovide_hide_mouse_when_typing = true vim.g.neovide_theme = 'auto' vim.g.neovide_refresh_rate = vim.uv.os_gethostname() == 'pop-os' and 144 or 60 vim.g.neovide_refresh_rate_idle = 5 -- vim.g.neovide_floating_blur_amount_x = 12.0 -- vim.g.neovide_floating_blur_amount_y = 12.0 -- vim.g.neovide_scroll_animation_length = 0.69 -- vim.g.neovide_fullscreen = true vim.g.neovide_remember_window_size = true vim.g.neovide_profiler = false -- vim.g.neovide_cursor_animation_length = 0.42 -- vim.g.neovide_cursor_trail_length = 0.42 vim.g.neovide_cursor_vfx_mode = 'railgun' -- vim.g.neovide_cursor_unfocused_outline_width = 0.125 vim.g.neovide_cursor_antialiasing = true vim.g.neovide_padding_top = 0 vim.g.neovide_padding_bottom = 0 vim.g.neovide_padding_right = 0 vim.g.neovide_padding_left = 0 vim.g.neovide_hide_mouse_when_typing = true vim.g.neovide_theme = 'auto' vim.g.neovide_refresh_rate = vim.uv.os_gethostname() == 'pop-os' and 144 or 60 vim.g.neovide_refresh_rate_idle = 5+21 / −25 text lines
keys = { '<leader>lap', mode = { 'n', 'v' } }, config = function () local actions_preview = require 'actions-preview' actions_preview.setup { telescope = { sorting_strategy = 'ascending', layout_strategy = 'vertical', layout_config = { width = 0.69, height = 0.42, prompt_position = 'top', preview_cutoff = 21, preview_height = function ( _, _, max_lines ) return max_lines - 16 end, },deleted file mode 100644+0 / −15 text lines
return { 'echasnovski/mini.align', keys = { { 'gA', mode = 'x' } }, config = function () local align = require 'mini.align' align.setup { -- these need to be consistent with treesitter-textobject movements comment = { suffix = 't' }, file = { suffix = 'e' }, oldfile = { suffix = '' }, } end,}+2 / −1 text lines
new file mode 100644+142 / −0 text lines
local map = require 'std.map'local user_command = require 'std.user_command'local icon = require 'std.icon'return { 'hrsh7th/nvim-cmp', lazy = false, dependencies = { 'hrsh7th/cmp-nvim-lsp', 'hrsh7th/cmp-buffer', 'hrsh7th/cmp-path', 'hrsh7th/cmp-nvim-lua', 'saadparwaiz1/cmp_luasnip', 'onsails/lspkind.nvim', 'L3MON4D3/LuaSnip', }, config = function () local cmp = require 'cmp' local luasnip = require 'luasnip' local MAX_INDEX_FILE_SIZE = 4000 local has_words_before = function () local line, col = unpack( vim.api.nvim_win_get_cursor( 0 ) ) return col ~= 0 and vim.api.nvim_buf_get_lines( 0, line - 1, line, true )[1]:sub( col, col ):match '%s' == nil end local snippet_next = function ( fallback ) if luasnip.expand_or_jumpable() then luasnip.expand_or_jump() elseif cmp.visible() then cmp.select_next_item() elseif has_words_before() then cmp.complete() else fallback() end end local snippet_prev = function ( fallback ) if luasnip.jumpable( -1 ) then luasnip.jump( -1 ) elseif cmp.visible() then cmp.select_prev_item() else fallback() end end local mapping = cmp.mapping.preset.insert { ['<C-d>'] = cmp.mapping.scroll_docs( -4 ), ['<C-f>'] = cmp.mapping.scroll_docs( 4 ), ['<C-e>'] = cmp.mapping.close(), ['<C-y>'] = cmp.mapping.confirm { behavior = cmp.ConfirmBehavior.Replace, select = true, }, ['<C-space>'] = cmp.mapping.complete(), ['<Tab>'] = cmp.mapping( snippet_next, { 'i', 's', } ), ['<S-Tab>'] = cmp.mapping( snippet_prev, { 'i', 's', } ), } --TODO: use custom icons local formatting = {} local ok, lspkind = pcall( require, 'lspkind' ) if ok then formatting.format = lspkind.cmp_format { mode = 'symbol', symbol_map = { Copilot = icon.copilot, Class = icon.class, Color = icon.color, Constant = icon.constant, Constructor = icon.constructor, Enum = icon.enum, EnumMember = icon.enum_member, Event = icon.event, Field = icon.field, File = icon.file, Folder = icon.folder, Function = icon['function'], Interface = icon.interface, Keyword = icon.keyword, Method = icon.method, Module = icon.module, Operator = icon.operator, Property = icon.property, Reference = icon.reference, Snippet = icon.snippet, Struct = icon.struct, Text = icon.text, TypeParameter = icon.type_parameter, Unit = icon.unit, Value = icon.value, Variable = icon.variable, }, menu = { buffer = '[buf]', nvim_lsp = '[LSP]', nvim_lua = '[nvim]', path = '[path]', luasnip = '[snip]', }, } end local sources = { { name = 'nvim_lua', }, { name = 'nvim_lsp', }, { name = 'path', }, { name = 'luasnip', }, { name = 'neorg', }, { name = 'buffer', keyword_length = 4, options = { get_bufnrs = function () local bufs = {} for _, bufnr in ipairs( vim.api.nvim_list_bufs() ) do -- Don't index giant files if vim.api.nvim_buf_is_loaded( bufnr ) and vim.api.nvim_buf_line_count( bufnr ) < MAX_INDEX_FILE_SIZE then table.insert( bufs, bufnr ) end end return bufs end, }, }, } cmp.setup { mapping = mapping, formatting = formatting, sources = sources, completion = { autocomplete = false, }, snippet = { expand = function ( args ) luasnip.lsp_expand( args.body ) end, }, -- experimental = { native_menu = false, }, } end,}+2 / −2 text lines
+1 / −1 text lines
+1 / −1 text lines
new file mode 100644+59 / −0 text lines
--FIXME: own thisreturn { { 'mfussenegger/nvim-dap', dependencies = { 'rcarriga/nvim-dap-ui', { 'theHamsta/nvim-dap-virtual-text', config = true, }, { 'stevearc/overseer.nvim', }, }, keys = { { '<leader>dc', "<cmd>lua require'dap'.continue()<CR>", mode = 'n', desc = '[D]ebug [C]ontinue', }, { '<leader>dj', "<cmd>lua require'dap'.step_over()<CR>", mode = 'n', desc = '[D]ebug step over', }, { '<leader>di', "<cmd>lua require'dap'.step_into()<CR>", mode = 'n', desc = '[D]ebug step [I]nto', }, { '<leader>do', "<cmd>lua require'dap'.step_out()<CR>", mode = 'n', desc = '[D]ebug step [O]ut', }, { '<leader>dl', "<cmd>lua require'dap'.run_last()<CR>", mode = 'n', desc = '[D]ebug run [L]ast', }, { '<leader>dr', "<cmd>lua require'dap'.repl.open()<CR>", mode = 'n', desc = '[D]ebug open [R]epl', }, { '<leader>dq', "<cmd>lua require'dap'.terminate()<CR>", mode = 'n', desc = '[D]ebug [Q]uit', }, { '<leader>db', "<cmd>lua require'dap'.toggle_breakpoint()<CR>", mode = 'n', desc = '[D]ebug set [B]reakpoint', }, { '<leader>dB', function () vim.ui.input( { prompt = 'Breakpoint condition', }, function ( cond ) if cond then require 'dap' .set_breakpoint( cond ) end end ) end, mode = 'n', desc = '[D]ebug set conditional [B]reakpoint', }, }, config = function () -- dap.set_log_level("DEBUG") vim.fn.sign_define( 'DapBreakpoint', { text = '•', texthl = 'DiagnosticError', linehl = '', numhl = '', } ) vim.fn.sign_define( 'DapBreakpointCondition', { text = '?', texthl = 'DiagnosticError', linehl = '', numhl = '', } ) vim.fn.sign_define( 'DapLogPoint', { text = '⁋', texthl = '', linehl = '', numhl = '', } ) vim.fn.sign_define( 'DapStopped', { text = ' ', texthl = 'DiagnosticInfo', linehl = '', numhl = '', } ) vim.fn.sign_define( 'DapBreakpointRejected', { text = 'X', texthl = 'DiagnosticError', linehl = '', numhl = '', } ) local dapui = require 'dapui' local dap = require 'dap' dapui.setup() dap.listeners.after.event_initialized['dapui_config'] = function () dapui.open() end dap.listeners.before.event_terminated['dapui_config'] = function () dapui.close() end dap.listeners.before.event_exited['dapui_config'] = function () dapui.close() end vim.schedule( function () require 'dap.ext.vscode' .json_decode = require 'overseer.json' .decode require 'dap.ext.vscode' .load_launchjs( nil, { node = { 'typescript', 'javascript', }, } ) require 'overseer' .patch_dap( true ) end ) end, },}+2 / −2 text lines
+10 / −1 text lines
+66 / −2 text lines
--FIXME: own this. is vim.ui.open shim still necessary? opts = {}, opts = { input = { insert_only = false, -- relative = "editor", win_options = { sidescrolloff = 4, }, get_config = function() if vim.api.nvim_win_get_width(0) < 50 then return { relative = "editor", } end end, }, select = { backend = { "telescope", "builtin", "fzf_lua" }, }, }, config = function(_, opts) require("dressing").setup(opts) -- Shim for vim.ui.open if vim.ui.open then return end ---Copied from vim.ui.open in Neovim 0.10+ ---@param path string ---@return nil|string[] cmd ---@return nil|string error local function get_open_cmd(path) if vim.fn.has("mac") == 1 then return { "open", path } elseif vim.fn.has("win32") == 1 then if vim.fn.executable("rundll32") == 1 then return { "rundll32", "url.dll,FileProtocolHandler", path } else return nil, "rundll32 not found" end elseif vim.fn.executable("wslview") == 1 then return { "wslview", path } elseif vim.fn.executable("xdg-open") == 1 then return { "xdg-open", path } else return nil, "no handler found" end end vim.ui.open = function(path) local is_uri = path:match("%w+:") if not is_uri then path = vim.fn.expand(path) end local cmd, err = get_open_cmd(path) if not cmd or err then return nil, err end local jid = vim.fn.jobstart(cmd, { detach = true }) if jid <= 0 then return nil, "Failed to start job" end end end,+7 / −6 text lines
suppress_on_insert = false, -- Suppress new messages while in insert mode log_handler = debug.get, -- Log `$/progress` handler invocations (for debugging) log_handler = debug.get(), -- Log `$/progress` handler invocations (for debugging)+10 / −16 text lines
new file mode 100644+54 / −0 text lines
local debug = require 'std.dbg'local map = require 'std.map'local user_command = require 'std.user_command'local format = function () prequire 'conform'.format( { async = false, lsp_fallback = true, }, function ( err ) if err and debug.get() then vim.print( 'Format failed', err ) end end )endmap.N { description = 'Format buffer', category = 'format', keys = '=', command = format,}user_command.Format'Format the current buffer' ( format )return { 'stevearc/conform.nvim', cmd = { 'ConformInfo', }, opts = { formatters_by_ft = { -- https://github.com/razziel89/mdslw/issues/14 markdown = { 'mdslw', }, -- lua = { "stylua" }, toml = { 'taplo', }, sh = { 'shfmt', }, just = { 'just', }, zig = { 'zigfmt', }, -- Use the "*" file type to run formatters on all file types. ['*'] = { 'injected', 'typos', }, -- Use the "_" file type to run formatters on file types that don't -- have other formatters configured. ['_'] = { 'trim_whitespace', 'trim_newlines', }, }, formatters = { mdslw = { -- remove `:` from the default set of end markers -- prepend_args = { '--end-markers', '?!.', }, }, }, log_level = debug.get() and vim.log.levels.TRACE or vim.log.levels.INFO, }, init = function () vim.o.formatexpr = "v:lua.require'conform'.formatexpr()" end,}deleted file mode 100644+0 / −17 text lines
require 'bugabinga.health'.add_dependency{ name_of_executable = 'ollama',}return { 'David-Kunz/gen.nvim', cmd = 'Gen', opts = { -- model = 'codellama:7b-instruct', model = 'codellama', display_mode = 'split', show_prompt = true, show_model = true, no_auto_close = true, debug = require 'std.debug'.get(), }}+72 / −14 text lines
local map = require 'std.map'map.normal { keys = '<leader>fn', category = 'files', description = 'Create new file', command = function () require 'genghis'.createNewFile() end,}map.visual { keys = '<leader>fx', category = 'files', description = 'Move selection to new file', command = function () require 'genghis'.moveSelectionToNewFile() end,}map.normal { keys = '<leader>fy', category = 'files', description = 'Yank file name', command = function () require 'genghis'.copyFilename() end,}map.normal { keys = '<leader>fY', category = 'files', description = 'Yank file path', command = function () require 'genghis'.copyFilepath() end,}map.normal { keys = '<leader>fc', category = 'files', description = 'Change file mode/permissions', command = function () require 'genghis'.chmodx() end,}map.normal { keys = '<leader>fr', category = 'files', description = 'Rename file', command = function () require 'genghis'.renameFile() end,}map.normal { keys = '<leader>fm', category = 'files', description = 'Move file', command = function () require 'genghis'.moveAndRenameFile() end,}map.normal { keys = '<leader>fM', category = 'files', description = 'Move file to current working directory', command = function () require 'genghis'.moveToFolderInCwd() end,}map.normal { keys = '<leader>ff', category = 'files', description = 'Duplicate file', command = function () require 'genghis'.duplicateFile() end,}map.normal { keys = '<leader>fd', category = 'files', description = 'Move file to system trash', command = function () require 'genghis'.trashFile() end,} config = function () local genghis = require 'genghis' -- no setup needed local keymap = vim.keymap.set keymap( 'n', '<leader>fp', genghis.copyFilepath ) keymap( 'n', '<leader>fN', genghis.copyFilename ) keymap( 'n', '<leader>fc', genghis.chmodx ) keymap( 'n', '<leader>fr', genghis.renameFile ) keymap( 'n', '<leader>fm', genghis.moveAndRenameFile ) keymap( 'n', '<leader>fi', genghis.moveToFolderInCwd ) keymap( 'n', '<leader>fn', genghis.createNewFile ) keymap( 'n', '<leader>fy', genghis.duplicateFile ) keymap( 'n', '<leader>fd', genghis.trashFile ) keymap( 'x', '<leader>fx', genghis.moveSelectionToNewFile ) end,+106 / −98 text lines
+10 / −0 text lines
deleted file mode 100644+0 / −11 text lines
+355 / −318 text lines
n = 'ui_normal', i = 'ui_accent', v = 'ui_important_global', V = 'ui_important_global', ['\22'] = 'ui_important_global', c = 'ui_important_global', s = 'ui_important_global', S = 'ui_important_global', ['\19'] = 'ui_important_global', R = 'ui_important_global', r = 'ui_important_global', ['!'] = 'ui_important_global', t = 'ui_important_global', n = "ui_normal", i = "ui_accent", v = "ui_important_global", V = "ui_important_global", ["\22"] = "ui_important_global", c = "ui_important_global", s = "ui_important_global", S = "ui_important_global", ["\19"] = "ui_important_global", R = "ui_important_global", r = "ui_important_global", ["!"] = "ui_important_global", t = "ui_important_global", return ' ' .. icon.vim .. ' %3(' .. mode_name .. '%) ' return " " .. icon.vim .. " %3(" .. mode_name .. "%) " { provider = '%<', }, -- this means that the statusline is cut here when there's not enough space { provider = "%<" }, -- this means that the statusline is cut here when there's not enough space update = { 'LspAttach', 'LspDetach', 'BufEnter', 'BufLeave', }, update = { "LspAttach", "LspDetach", "BufEnter", "BufLeave" }, return icon.lsp .. ' ' .. table.concat( names, ' ' ) return icon.lsp .. " " .. table.concat(names, " ") File = 'Directory', Module = '@include', Namespace = '@namespace', Package = '@include', Class = '@structure', Method = '@method', Property = '@property', Field = '@field', Constructor = '@constructor', Enum = '@field', Interface = '@type', Function = '@function', Variable = '@variable', Constant = '@constant', String = '@string', Number = '@number', Boolean = '@boolean', Array = '@field', Object = '@type', Key = '@keyword', Null = '@comment', EnumMember = '@field', Struct = '@structure', Event = '@keyword', Operator = '@operator', TypeParameter = '@type', File = "Directory", Module = "@include", Namespace = "@namespace", Package = "@include", Class = "@structure", Method = "@method", Property = "@property", Field = "@field", Constructor = "@constructor", Enum = "@field", Interface = "@type", Function = "@function", Variable = "@variable", Constant = "@constant", String = "@string", Number = "@number", Boolean = "@boolean", Array = "@field", Object = "@type", Key = "@keyword", Null = "@comment", EnumMember = "@field", Struct = "@structure", Event = "@keyword", Operator = "@operator", TypeParameter = "@type", local pos = self.enc( d.scope.start.line, d.scope.start.character, self.winnr ) local pos = self.enc(d.scope.start.line, d.scope.start.character, self.winnr) provider = d.name:gsub( '%%', '%%%%' ):gsub( '%s*->%s*', '' ), provider = d.name:gsub("%%", "%%%%"):gsub("%s*->%s*", ""), init = function ( self ) self.errors = #vim.diagnostic.get( 0, { severity = vim.diagnostic.severity.ERROR, } ) self.warnings = #vim.diagnostic.get( 0, { severity = vim.diagnostic.severity.WARN, } ) self.hints = #vim.diagnostic.get( 0, { severity = vim.diagnostic.severity.HINT, } ) self.info = #vim.diagnostic.get( 0, { severity = vim.diagnostic.severity.INFO, } ) init = function(self) self.errors = #vim.diagnostic.get(0, { severity = vim.diagnostic.severity.ERROR }) self.warnings = #vim.diagnostic.get(0, { severity = vim.diagnostic.severity.WARN }) self.hints = #vim.diagnostic.get(0, { severity = vim.diagnostic.severity.HINT }) self.info = #vim.diagnostic.get(0, { severity = vim.diagnostic.severity.INFO }) update = { 'DiagnosticChanged', 'BufEnter', 'BufLeave', }, update = { "DiagnosticChanged", "BufEnter", "BufLeave" }, return self.errors > 0 and (self.error_icon .. ' ' .. self.errors .. ' ') return self.errors > 0 and (self.error_icon .. " " .. self.errors .. " ") return count > 0 and (icon.diff_add .. ' ' .. count .. ' ') return count > 0 and (icon.diff_add .. " " .. count .. " ") return count > 0 and (icon.diff_remove .. ' ' .. count .. ' ') return count > 0 and (icon.diff_remove .. " " .. count .. " ") return count > 0 and (icon.diff_change .. ' ' .. count .. ' ') return count > 0 and (icon.diff_change .. " " .. count .. " ") local default_statusline = { vi_mode, macro_recording, work_dir, space, git, svn, align, diagnostic, space, lsp_active, align, togglers, space, space, diagnostic_enabled, space, lazy, space, file_encoding, space, file_format, space, file_type, space, file_size, space, file_last_modified, local default_statusline = { vi_mode, macro_recording, work_dir, space, git, svn, align, diagnostic, space, lsp_active, align, togglers, space, space, diagnostic_enabled, space, lazy, space, file_encoding, space, file_format, space, file_type, space, file_size, space, file_last_modified, { condition = conditions.is_active, vi_mode, space, }, { condition = conditions.is_active, vi_mode, space },deleted file mode 100644+0 / −8 text lines
+9 / −13 text lines
+1 / −1 text lines
new file mode 100644+45 / −0 text lines
--FIXME: own thislocal uv = vim.uv or vim.loopreturn { 'mfussenegger/nvim-lint', ft = { 'lua', 'sh', 'vim', }, opts = { linters_by_ft = { lua = { 'luacheck', }, sh = { 'shellcheck', }, vim = { 'vint', }, }, linters = {}, }, config = function ( _, opts ) local lint = require 'lint' lint.linters_by_ft = opts.linters_by_ft for k, v in pairs( opts.linters ) do lint.linters[k] = v end local timer = assert( uv.new_timer() ) local DEBOUNCE_MS = 500 local aug = vim.api.nvim_create_augroup( 'Lint', { clear = true, } ) vim.api.nvim_create_autocmd( { 'BufEnter', 'BufWritePost', 'TextChanged', 'InsertLeave', }, { group = aug, callback = function () local bufnr = vim.api.nvim_get_current_buf() timer:stop() timer:start( DEBOUNCE_MS, 0, vim.schedule_wrap( function () if vim.api.nvim_buf_is_valid( bufnr ) then vim.api.nvim_buf_call( bufnr, function () lint.try_lint( nil, { ignore_errors = true, } ) end ) end end ) ) end, } ) lint.try_lint( nil, { ignore_errors = true, } ) end,}+14 / −14 text lines
cmd = { 'MasonToolsInstall', 'MasonToolsInstallSync', 'MasonToolsUpdate', 'MasonToolsUpdateSync', 'MasonToolsClean', },+1 / −1 text lines
+1 / −6 text lines
+14 / −20 text lines
+3 / −6 text lines
+29 / −34 text lines
map.normal { description = 'Generate doc comment for outer element', category = 'editing', keys = '<leader>gd', command = function () require 'neogen'.generate() end,}map.normal { name = 'Generate Doc Comment for Function', category = 'editing', keys = '<leader>gdf', command = function () require 'neogen'.generate { type = 'func', } end,}map.normal { description = 'Generate Doc Comment for File', category = 'editing', keys = '<leader>gdF', command = function () require 'neogen'.generate { type = 'file', } end,}map.normal { description = 'Generate Doc Comment for Class', category = 'editing', keys = '<leader>gdc', command = function () require 'neogen'.generate { type = 'class', } end,} keys = { '<leader>gd', }, config = function () local neogen = require 'neogen' neogen.setup {} map.normal { description = 'Generate doc comment for outer element', category = 'editing', keys = '<leader>gd', command = neogen.generate, } map.normal { name = 'Generate Doc Comment for Function', category = 'editing', keys = '<leader>gd' .. 'f', command = function () neogen.generate { type = 'func', } end, } map.normal { description = 'Generate Doc Comment for File', category = 'editing', keys = '<leader>gd' .. 'F', command = function () neogen.generate { type = 'file', } end, } map.normal { description = 'Generate Doc Comment for Class', category = 'editing', keys = '<leader>gd' .. 'c', command = function () neogen.generate { type = 'class', } end, } end, opts = {},new file mode 100644+45 / −0 text lines
return { 'nvim-neorg/neorg', version = '8.*', dependencies = { { 'nvim-lua/plenary.nvim', version = '0.1.4', }, { 'nvim-neorg/lua-utils.nvim', version = '1.0.2', }, { 'nvim-neotest/nvim-nio', version = '1.7.*', }, { 'MunifTanjim/nui.nvim', version = '0.3.0', }, { 'nvim-treesitter/nvim-treesitter', }, }, build = function () package.loaded['neorg'] = nil require 'neorg'.setup_after_build() pcall( vim.cmd.Neorg, 'sync-parsers' ) end, ft = 'norg', cmd = 'Neorg', opts = { load = { ['core.defaults'] = {}, -- Loads default behaviour ['core.concealer'] = { -- Adds pretty icons to your documents config = { icons = { todo = { undone = { icon = ' ', }, }, }, }, }, ['core.completion'] = { config = { engine = 'nvim-cmp', }, }, ['core.presenter'] = { config = { zen_mode = 'zen-mode', }, }, }, },}deleted file mode 100644+0 / −156 text lines
local map = require 'std.map'return { { 'folke/noice.nvim', event = 'VeryLazy', dependencies = { 'MunifTanjim/nui.nvim', 'rcarriga/nvim-notify', }, opts = { -- cmdline = { -- view = 'cmdline', -- cmdline on cursor -- }, lsp = { signature = { auto_open = { trigger = false }, }, -- override markdown rendering so that **cmp** and other plugins use **Treesitter** override = { ['vim.lsp.util.convert_input_to_markdown_lines'] = true, ['vim.lsp.util.stylize_markdown'] = true, ['cmp.entry.get_documentation'] = true, }, }, presets = { inc_rename = true, -- enables an input dialog for inc-rename.nvim long_message_to_split = true, -- long messages will be sent to a split }, views = { vsplit = { size = { width = 'auto', height = 'auto' }, }, popupmenu = { border = { style = vim.g.border_style }, }, popup = { border = { style = vim.g.border_style }, }, hover = { border = { style = vim.g.border_style }, position = { row = -2, col = 2 }, }, cmdline = { relative = 'cursor', position = { row = 0, col = 2 }, size = { width = '42', height = 'auto' }, border = { style = 'solid' }, zindex = 9999, }, cmdline_popupmenu = { relative = 'cursor', position = { row = 1, col = 0 }, size = { width = '42', height = 'auto' }, border = { style = vim.g.border_style }, zindex = 9999, }, }, routes = { { filter = { cmdline = '^:%s*!' }, view = 'vsplit' }, { filter = { event = 'msg_show', kind = 'echomsg' }, view = 'mini' }, { filter = { event = 'msg_show', kind = 'echo' }, view = 'mini' }, { filter = { event = 'msg_show', kind = '', find = 'written' }, view = 'mini' }, { filter = { any = { { cmdline = '^:%s*lua%s+' }, { cmdline = '^:%s*lua%s*=%s*' }, { cmdline = '^:%s*=%s*' }, } }, view = 'cmdline_output', } }, }, config = function ( _, opts ) local noice = require 'noice' noice.setup( opts ) map.normal { description = 'Open search for notifications...', category = 'search', keys = '<C-n><C-n>', command = function () noice.cmd 'history' end, } map.command_line { description = 'Redirect Cmdline', category = 'ui', keys = '<S-cr>', ---@diagnostic disable-next-line: param-type-mismatch command = function () noice.redirect( vim.fn.getcmdline() ) end, } map.normal { description = 'Dismiss current notifications', category = 'notify', keys = '<esc>', command = function () noice.cmd 'dismiss' end, } local noice_lsp = require 'noice.lsp' map.normal { description = 'Scroll up in documentation popup', category = 'ui', keys = '<C-f>', command = function () if not noice_lsp.scroll( -4 ) then return '<C-f>' end end, options = { expr = true }, } map.normal { description = 'Scroll down in documentation popup', category = 'ui', keys = '<C-b>', command = function () if not noice_lsp.scroll( 4 ) then return '<C-b>' end end, options = { expr = true }, } end, }, { 'rcarriga/nvim-notify', config = function () local notify = require 'notify' local fade = require 'notify.stages.fade' 'bottom_up' local shadow_fade = function ( ... ) local opts = fade[1]( ... ) if opts then opts.border = vim.g.border_style opts.row = opts.row - 1 end return opts end ---@diagnostic disable-next-line: missing-fields notify.setup { stages = { shadow_fade, unpack( fade, 2 ) }, render = 'compact', timeout = 2500, fps = 60, top_down = false, } end, },}+3 / −3 text lines
+1 / −3 text lines
+1 / −3 text lines
+57 / −39 text lines
keys = '-', cmd = { 'Oil' }, dependencies = { 'nvim-tree/nvim-web-devicons' }, config = function () local oil = require 'oil' oil.setup { skip_confirm_for_simple_edits = true, delete_to_trash = true, -- trash_command = 'rm --trash', --nu command lazy = false, cmd = { 'Oil', }, dependencies = { 'nvim-tree/nvim-web-devicons', }, opts = { -- default_file_explorer = true, -- Set to true to watch the filesystem for changes and reload oil -- experimental_watch_for_changes = true, skip_confirm_for_simple_edits = true, prompt_save_on_select_new_entry = false, delete_to_trash = true, columns = { 'icon', }, buf_options = { cursorline = true, }, keymaps = { ['q'] = 'actions.close', ['<C-v>'] = 'actions.select_vsplit', ['<C-s>'] = 'actions.select_split', ['`'] = 'actions.tcd', ['~'] = '<cmd>edit $HOME<CR>', ['<F7>'] = 'actions.open_terminal', ['gd'] = { desc = 'Toggle detail view', callback = function () local oil = require 'oil' local config = require 'oil.config' if #config.columns == 1 then oil.set_columns { 'icon', 'permissions', 'size', { 'mtime', format = '%d/%m/%y %T', }, } else oil.set_columns { 'icon', } end end, keymaps = { ['q'] = 'actions.close', ['<esc>'] = 'actions.close', ['<C-/>'] = 'actions.show_help', ['<C-v>'] = 'actions.select_vsplit', ['<C-s>'] = 'actions.select_split', ['<C-h>'] = 'actions.toggle_hidden', }, float = { max_width = 69, min_width = 42, border = vim.g.border_style, padding = 2, win_options = { winblend = vim.o.winblend }, }, } map.normal { description = 'Open parent directory in buffer.', category = 'files', keys = '-', -- command = oil.open, command = oil.open_float, } end, }, float = { max_width = 69, min_width = 69, border = vim.g.border_style, padding = 2, }, -- Configuration for the floating keymaps help window keymaps_help = { border = vim.g.border_style, }, view_options = { is_always_hidden = function ( name, bufnr ) return name == '..' end, show_hidden = true, }, },deleted file mode 100644+0 / −6 text lines
new file mode 100644+14 / −0 text lines
new file mode 100644+11 / −0 text lines
return { 'stevearc/pair-ls.nvim', cmd = { 'Pair', 'PairConnect', }, opts = { cmd = { 'pair-ls', 'lsp', }, -- cmd = { "pair-ls", "lsp", "-port", "8080" }, -- cmd = { "pair-ls", "lsp", "-port", "8081" }, -- cmd = { "pair-ls", "lsp", "-signal", "wss://localhost:8080" }, -- cmd = { "pair-ls", "lsp", "-forward", "wss://localhost:8080" }, },}deleted file mode 100644+0 / −26 text lines
local map = require 'std.map'return { 'folke/persistence.nvim', tag = 'v2.0.0', event = 'BufReadPre', opts = {}, config = function ( _, opts ) local persistence = require 'persistence' persistence.setup( opts ) map.normal { description = 'Restore session for current directory', category = 'history', keys = '<F4>', command = function () persistence.load() end, } map.normal { description = 'Restore last session', category = 'history', keys = '<F4><F4>', command = function () persistence.load { last = true, } end, } end,}new file mode 100644+45 / −0 text lines
local map = require 'std.map'map.normal { description = 'Grep search for word under cursor', category = 'search', keys = 'gw', command = '<cmd>cclose <bar> Grep <cword><cr>',}map.normal { description = 'Goto next quickfix item', category = 'navigation', keys = ']q', command = '<cmd>QNext<cr>',}map.normal { description = 'Goto previous quickfix item', category = 'navigation', keys = '[q', command = '<cmd>QPrev<cr>',}map.normal { description = 'Toggle open quickfix window', category = 'navigation', keys = '<leader>Q', command = '<cmd>QFToggle!<CR>',}map.normal { description = 'Toggle open loclist window', category = 'navigation', keys = '<leader>L', command = '<cmd>LLToggle!<CR>',}return { 'stevearc/qf_helper.nvim', ft = 'qf', cmd = { 'QNext', 'QPrev', 'QFToggle', 'QFOpen', 'LLToggle', }, opts = { prefer_loclist = false, },}+1 / −3 text lines
new file mode 100644+98 / −0 text lines
local map = require 'std.map'local auto = require 'std.auto'local LAST_SESSION = 'last'auto 'automatic_session_management' { { events = 'VimEnter', description = 'Load automatically saved session for the CWD', command = function () -- Only load the session if nvim was started with no args if vim.fn.argc( -1 ) == 0 then -- Save these to a different directory, so our manual sessions don't get polluted prequire 'resession'.load( vim.fn.getcwd(), { dir = 'autosession', silence_errors = true, } ) end end, }, { events = 'VimLeavePre', description = 'Automatically save sessions for the CWD (tab)', command = function () prequire 'resession'.save_tab( vim.fn.getcwd(), { dir = 'autosession', notify = false, } ) end, }, { events = 'VimLeavePre', description = 'Automatically save last session (all tabs)', command = function () prequire 'resession'.save( LAST_SESSION ) end, },}map.normal { description = 'Restore last session', category = 'history', keys = '<leader>sl', command = function () prequire 'resession'.load( LAST_SESSION ) end,}map.normal { description = 'Restore a session', category = 'history', keys = '<leader>sL', command = function () prequire 'resession'.load() end,}map.normal { description = 'Delete session', category = 'history', keys = '<leader>sd', command = function () prequire 'resession'.delete() end,}map.normal { description = 'Save session (tab)', category = 'history', keys = '<leader>ss', command = function () prequire 'resession'.save_tab() end,}map.normal { description = 'Save session (all tabs)', category = 'history', keys = '<leader>sS', command = function () prequire 'resession'.save() end,}return { 'stevearc/resession.nvim', version = '1.*', event = 'VeryLazy', opts = { autosave = { enable = true, }, -- Save and restore these options options = { 'binary', 'bufhidden', 'buflisted', 'cmdheight', 'diff', 'filetype', 'modifiable', 'previewwindow', 'readonly', 'scrollbind', 'winfixheight', 'winfixwidth', 'cursorline', 'virtualedit', 'number', 'spell', }, -- only save buffers that are associated with the cwd of the current tab tab_buf_filter = function ( tabpage, bufnr ) local dir = vim.fn.getcwd( -1, vim.api.nvim_tabpage_get_number( tabpage ) ) -- ensure dir has trailing / dir = dir:sub( -1 ) ~= '/' and dir .. '/' or dir return vim.startswith( vim.api.nvim_buf_get_name( bufnr ), dir ) end, },}new file mode 100644+114 / −0 text lines
--FIXME: own thisreturn { 'L3MON4D3/LuaSnip', dependencies = { 'stevearc/vim-vscode-snippets', }, config = function () local luasnip = require 'luasnip' local has_vim_snippet, snippet = pcall( require, 'vim.snippet' ) require 'luasnip.loaders.from_vscode'.lazy_load() vim.keymap.set( 's', '<Tab>', '<Plug>luasnip-jump-next' ) vim.keymap.set( 's', '<C-h>', '<Plug>luasnip-jump-prev' ) vim.keymap.set( 's', '<C-l>', '<Plug>luasnip-jump-next' ) vim.keymap.set( { 'i', 's', }, '<C-k>', function () pcall( luasnip.change_choice, -1 ) end ) vim.keymap.set( { 'i', 's', }, '<C-j>', function () pcall( luasnip.change_choice, 1 ) end ) local aug = vim.api.nvim_create_augroup( 'ClearLuasnipSession', { clear = true, } ) -- Can't use InsertLeave here because that fires when we go to select mode vim.api.nvim_create_autocmd( 'CursorHold', { desc = 'Deactivate snippet after leaving insert/select mode', pattern = '*', group = aug, callback = function () vim.cmd.LuaSnipUnlinkCurrent { mods = { emsg_silent = true, }, } if has_vim_snippet then snippet.exit() end end, } ) vim.keymap.set( 'i', '<C-h>', function () if luasnip.get_active_snip() then luasnip.jump( -1 ) elseif has_vim_snippet and snippet.active() then snippet.jump( -1 ) else local cur = vim.api.nvim_win_get_cursor( 0 ) pcall( vim.api.nvim_win_set_cursor, 0, { cur[1], cur[2] - 1, } ) end end ) vim.keymap.set( 'i', '<C-l>', function () if luasnip.get_active_snip() then luasnip.jump( 1 ) elseif has_vim_snippet and snippet.active() then snippet.jump( 1 ) else local cur = vim.api.nvim_win_get_cursor( 0 ) pcall( vim.api.nvim_win_set_cursor, 0, { cur[1], cur[2] + 1, } ) end end ) -- Required to support nested placeholders -- From https://github.com/L3MON4D3/LuaSnip/wiki/Nice-Configs#imitate-vscodes-behaviour-for-nested-placeholders local util = require 'luasnip.util.util' luasnip.config.setup { store_selection_keys = '<Tab>', updateevents = 'TextChanged,TextChangedI', parser_nested_assembler = function ( _, snippet ) local select = function ( snip, no_move ) snip.parent:enter_node( snip.indx ) -- upon deletion, extmarks of inner nodes should shift to end of -- placeholder-text. for _, node in ipairs( snip.nodes ) do node:set_mark_rgrav( true, true ) end -- SELECT all text inside the snippet. if not no_move then vim.api.nvim_feedkeys( vim.api.nvim_replace_termcodes( '<Esc>', true, false, true ), 'n', true ) local pos_begin, pos_end = snip.mark:pos_begin_end() util.normal_move_on( pos_begin ) vim.api.nvim_feedkeys( vim.api.nvim_replace_termcodes( 'v', true, false, true ), 'n', true ) util.normal_move_before( pos_end ) vim.api.nvim_feedkeys( vim.api.nvim_replace_termcodes( 'o<C-G>', true, false, true ), 'n', true ) end end function snippet:jump_into( dir, no_move ) if self.active then -- inside snippet, but not selected. if dir == 1 then self:input_leave() return self.next:jump_into( dir, no_move ) else select( self, no_move ) return self end else -- jumping in from outside snippet. self:input_enter() if dir == 1 then select( self, no_move ) return self else return self.inner_last:jump_into( dir, no_move ) end end end -- this is called only if the snippet is currently selected. function snippet:jump_from( dir, no_move ) if dir == 1 then return self.inner_first:jump_into( dir, no_move ) else self:input_leave() return self.prev:jump_into( dir, no_move ) end end return snippet end, } end,}+26 / −29 text lines
specs.setup { map.normal { description = 'Find cursor!', category = 'fun', keys = '<leader><leader>', command = specs.show_specs, } map.normal { description = 'Find cursor, for real!', category = 'fun', keys = '<leader><leader><leader>', command = function () specs.show_specs { width = 69, delay_ms = 69, inc_ms = 42 } end, } end,} }+62 / −30 text lines
name_of_executable = 'rg' name_of_executable = 'rg',}map.normal { description = 'Search and replace', category = 'search', keys = '<leader>rs', command = function () spectre.open() end,}map.normal { description = 'Search current word', category = 'search', keys = '<leader>rw', command = function () spectre.open_visual { select_word = true, } end,}map.visual { description = 'Search current word', category = 'search', keys = '<leader>rw', command = function () spectre.open_visual() end,}map.normal { description = 'Search on current file', category = 'search', keys = '<leader>rf', command = function () spectre.open_file_search { select_word = true, } end, map.normal { description = 'Open Spectre', category = 'search', keys = '<leader>s', command = function () spectre.open() end, } local copy_cmd = {} if sysname == 'Darwin' then copy_cmd = { 'cp', 'target/release/libspectre_oxi.dylib', '../lua/spectre_oxi.so', } elseif sysname == 'Linux' then copy_cmd = { 'cp', 'target/release/libspectre_oxi.so', '../lua/spectre_oxi.so', } elseif sysname == 'Windows_NT' then copy_cmd = { 'cp', 'target/release/libspectre_oxi.dll', '../lua/spectre_oxi.dll', } else error 'unsupported os' end map.normal { description = 'Search current word', category = 'search', keys = '<leader>sw', command = function () spectre.open_visual { select_word = true } end, } local spectre_oxi_dir = vim.fs.joinpath( plugin_spec.dir, 'spectre_oxi' ) map.normal { description = 'Search on current file', category = 'search', keys = '<leader>sp', command = function () spectre.open_file_search { select_word = true } end, } local cp_proc = vim.system( copy_cmd, { text = true, cwd = spectre_oxi_dir, } ):wait() if cp_proc.code ~= 0 then error( cp_proc.stderr ) end local rm_proc = vim.system( { 'rm', '-r', '-f', 'target', }, { text = true, cwd = spectre_oxi_dir, } ):wait() if rm_proc.code ~= 0 then error( rm_proc.stderr ) end vim.print 'Building oxi done'+31 / −32 text lines
local user_command = require 'std.user_command'local open_ssr = function () prequire 'ssr'.open() endmap.normal.visual { description = 'Open structural search and replace', category = 'refactoring', keys = '<leader>rr', command = open_ssr,}user_command.StructuralSearchAndReplace'Open structural search and replace view' ( open_ssr ) 'cshuaimin/ssr.nvim', cmd = 'StructuralSearchAndReplace', keys = { '<leader>rs', mode = { 'n', 'x' } }, config = function () local ssr = require 'ssr' ssr.setup { border = vim.g.border_style, min_width = 69, min_height = 42, max_width = 3 * 69, max_height = 3 * 42, adjust_window = true, keymaps = { close = 'q', next_match = 'n', prev_match = 'N', replace_confirm = '<cr>', replace_all = '<c-cr>', }, } local open_ssr = function () ssr.open() end map.normal.visual { description = 'Open structural search and replace', category = 'refactoring', keys = '<leader>rs', command = open_ssr, } vim.api.nvim_create_user_command( 'StructuralSearchAndReplace', open_ssr, { bang = true } ) end 'cshuaimin/ssr.nvim', opts = { border = vim.g.border_style, min_width = 69, min_height = 42, max_width = 3 * 69, max_height = 3 * 42, adjust_window = true, keymaps = { close = 'q', next_match = 'n', prev_match = 'N', replace_confirm = '<cr>', replace_all = '<c-cr>', }, },deleted file mode 100644+0 / −85 text lines
local auto = require 'std.auto'local icon = require 'std.icon'return { 'echasnovski/mini.starter', lazy = false, config = function () local starter = require 'mini.starter' local is_home = vim.uv.cwd() == vim.uv.os_homedir() local custom_actions = { { name = 'Find files', action = 'Telescope find_files', section = 'Builtin actions', }, { name = 'Oil', action = 'Oil', section = 'Builtin actions', }, } local sessions = function ( limit ) limit = limit or 8 local persistence = require 'persistence' local sessions = persistence.list() table.sort( sessions, function ( a, b ) return vim.loop.fs_stat( a ).mtime.sec > vim.loop.fs_stat( b ).mtime.sec end ) return vim.iter( sessions ) :slice( 1, limit ) :filter( function ( session_path ) return vim.fn.filereadable( session_path ) ~= 0 end ) :map( function ( session_path ) -- session files encode their cwd as an escaped path in their file name local name = vim.fs.basename( session_path:gsub( '%%%%', '/:' ):gsub( '%%', '/' ):gsub( '%.vim', '' ) ) local action = function () local session_restore = 'silent! source ' .. vim.fn.fnameescape( session_path ) vim.cmd( session_restore ) vim.notify( 'Restored session: ' .. name ) end local section = 'Sessions' return { name = name, action = action, section = section, } end ) :totable() end starter.setup { footer = (function () local startuptime auto 'display_startup_time' { description = 'Display startup time on starter screen', events = 'User', pattern = 'LazyVimStarted', once = true, command = vim.schedule_wrap( function () if vim.bo.filetype == 'starter' then startuptime = require 'lazy'.stats().startuptime starter.refresh() end end ), } return function () return icon.start .. ' ' .. (startuptime or ' ') .. 'ms' end end)(), header = [[███ ▄ ▄▀ ██ ███ ▄█ ▄ ▄▀ ███ █ █ ▄▀ █ █ █ █ ██ █ ▄▀ █ ██ ▀ ▄ █ █ █ ▀▄ █▄▄█ █ ▀ ▄ ██ ██ █ █ ▀▄ █▄▄██ ▄▀ █ █ █ █ █ █ █ ▄▀ ▐█ █ █ █ █ █ █ ████ █▄ ▄█ ███ █ ███ ▐ █ █ █ ███ █ ▀▀▀ █ █ ██ █ ▀ ▀]], items = { starter.sections.builtin_actions(), custom_actions, sessions, starter.sections.recent_files( is_home and 24 or 8, not is_home, is_home ), }, content_hooks = { starter.gen_hook.adding_bullet(), starter.gen_hook.aligning( 'center', 'center' ), starter.gen_hook.indexing( 'all', { 'Recent files', 'Recent files (current directory)', 'Builtin actions', } ), }, } end,}+30 / −33 text lines
new file mode 100644+1 / −0 text lines
return { 'lambdalisue/suda.vim', cmd = { 'SudaRead', 'SudaWrite', }, }+19 / −31 text lines
deleted file mode 100644+0 / −13 text lines
new file mode 100644+162 / −0 text lines
local map = require 'std.map'local user_command = require 'std.user_command'map.normal { description = 'Toggle task view', category = 'tasks', keys = '<leader>99', command = function () prequire 'overseer'.toggle { enter = true, direction = 'right', } end,}map.normal { description = 'Run task', category = 'tasks', keys = '<leader>9r', command = function () prequire 'overseer'._run_template() end,}map.normal { description = 'Run any command as task', category = 'tasks', keys = '<leader>9c', command = function () prequire 'overseer'._run_command() end,}map.normal { description = 'Load task bundle', category = 'tasks', keys = '<leader>9r', command = function () prequire 'overseer'._load_bundle() end,}map.normal { description = 'Run an action on the most recent task, or the task under the cursor', category = 'tasks', keys = '<leader>9d', command = function () prequire 'overseer'._quick_action() end,}map.normal { description = 'Select a task to run an action on', category = 'tasks', keys = '<leader>9s', command = function () prequire 'overseer'._task_action() end,}map.normal { description = 'Display diagnostic information about overseer', category = 'tasks', keys = '<leader>9i', command = function () prequire 'overseer'._info() end,}user_command.OverseerDebugParser'Open a tab with windows laid out for debugging a parser' ( function () prequire 'overseer'.debug_parser() end )user_command.Grep'Run your grepprg as an Overseer task' { nargs = '*', bang = true, bar = true, complete = 'file', } ( function ( params ) local args = vim.fn.expandcmd( params.args ) -- Insert args at the '$*' in the grepprg local cmd, num_subs = vim.o.grepprg:gsub( '%$%*', args ) if num_subs == 0 then cmd = cmd .. ' ' .. args end local cwd prequire( 'oil', function ( oil ) cwd = oil.get_current_dir() end ) local task = prequire 'overseer'.new_task { cmd = cmd, cwd = cwd, name = 'grep ' .. args, components = { { 'on_output_quickfix', errorformat = vim.o.grepformat, open = not params.bang, open_height = 8, items_only = true, }, -- We don't care to keep this around as long as most tasks { 'on_complete_dispose', timeout = 30, }, 'default', }, } task:start() end )user_command.Make'Run your makeprg as an Overseer task' { nargs = '*', bang = true, } ( function ( params ) -- Insert args at the '$*' in the makeprg local cmd, num_subs = vim.o.makeprg:gsub( '%$%*', params.args ) if num_subs == 0 then cmd = cmd .. ' ' .. params.args end local task = prequire 'overseer'.new_task { cmd = vim.fn.expandcmd( cmd ), components = { { 'on_output_quickfix', open = not params.bang, open_height = 8, }, 'unique', 'default', }, } task:start() end )return { { 'stevearc/resession.nvim', lazy = true, opts = { extensions = { overseer = { status = { 'RUNNING', }, }, }, }, }, { 'stevearc/overseer.nvim', opts = { strategy = { 'jobstart', }, dap = false, log = { { type = 'echo', level = vim.log.levels.WARN, }, { type = 'file', filename = 'overseer.log', level = vim.log.levels.DEBUG, }, }, component_aliases = { default = { { 'display_duration', detail_level = 2, }, 'on_output_summarize', 'on_exit_set_status', { 'on_complete_notify', system = 'unfocused', }, 'on_complete_dispose', }, default_neotest = { 'unique', { 'on_complete_notify', system = 'unfocused', on_change = true, }, 'default', }, }, }, }, }+170 / −155 text lines
name = 'ripgrep', name_of_executable = 'rg',} { name = 'find-fd', name_of_executable = 'fd', } { name = 'CMake', name_of_executable = 'cmake', }local map = require 'std.map'local icon = require 'std.icon'map.normal { description = 'Switch to recently used folders', category = 'navigation', keys = '<c-p><c-z>', command = function () require 'telescope'.extensions.zoxide.list() end,}map.normal.visual.terminal { description = 'Search help files', category = 'help', keys = '<F1>', command = function () require 'telescope.builtin'.help_tags() end,}map.normal { description = 'Open last search...', category = 'plugins', keys = '<c-p>', command = function () require 'telescope.builtin'.resume() end,}map.normal { description = 'Open search for all files...', category = 'search', keys = '<c-p><c-p>', command = function () require 'telescope.builtin'.find_files() end,}map.normal { description = 'Open search for keymaps...', category = 'search', keys = '<c-p><c-k>', command = function () require 'telescope.builtin'.keymaps() end,}map.normal { description = 'Open search for symbols...', category = 'search', keys = '<c-p><c-s>', command = function () require 'telescope.builtin'.symbols() end,}map.normal { description = 'Open search for all file contents...', category = 'search', keys = '<c-p><c-g>', command = function () require 'telescope.builtin'.live_grep() end,}map.normal { description = 'Open search for current buffer content...', category = 'search', keys = '<c-p><c-/>', command = function () require 'telescope.builtin'.current_buffer_fuzzy_find() end,}map.normal { description = 'Open search for buffers...', category = 'search', keys = '<c-e>', command = function () require 'telescope.builtin'.buffers() end, 'nvim-telescope/telescope.nvim', tag = '0.1.6', cmd = 'Telescope', event = 'VeryLazy', dependencies = { 'nvim-lua/plenary.nvim', 'nvim-tree/nvim-web-devicons', 'nvim-telescope/telescope-symbols.nvim', 'nvim-telescope/telescope-ui-select.nvim', 'jvgrootveld/telescope-zoxide', }, config = function () local telescope = require 'telescope' local builtin = require 'telescope.builtin' local actions = require 'telescope.actions' local themes = require 'telescope.themes' 'nvim-telescope/telescope.nvim', version = '0.*', cmd = 'Telescope', event = 'VeryLazy', dependencies = { { 'nvim-telescope/telescope-fzf-native.nvim', build = function ( plugin_spec ) local result result = vim.system( { 'cmake', '-S.', '-Bbuild', '-DCMAKE_BUILD_TYPE=Release', }, { text = true, cwd = plugin_spec.dir, } ):wait() if result.code ~= 0 then error( result.stderr ) end result = vim.system( { 'cmake', '--build', 'build', '--config', 'Release', }, { text = true, cwd = plugin_spec.dir, } ):wait() if result.code ~= 0 then error( result.stderr ) end result = vim.system( { 'cmake', '--install', 'build', '--prefix', 'build', }, { text = true, cwd = plugin_spec.dir, } ):wait() if result.code ~= 0 then error( result.stderr ) end end, }, 'nvim-lua/plenary.nvim', 'nvim-tree/nvim-web-devicons', 'nvim-telescope/telescope-symbols.nvim', 'jvgrootveld/telescope-zoxide', }, config = function () local telescope = require 'telescope' local actions = require 'telescope.actions' local themes = require 'telescope.themes' telescope.setup { defaults = { path_display = { 'truncate', }, sorting_strategy = 'ascending', layout_config = { horizontal = { prompt_position = 'bottom', preview_width = 0.69, }, vertical = { mirror = false, }, width = 0.69, height = 0.42, preview_cutoff = 124, }, prompt_prefix = icon.telescope .. ' ', selection_caret = icon.arrow_right .. ' ', border = true, file_ignore_patterns = { '.git/', '.svn/', '.cache', '%.o', '%.a', '%.out', '%.class', '%.pdf', '%.mkv', '%.mp4', '%.zip', }, mappings = { i = { ['<c-j>'] = actions.cycle_history_next, ['<c-k>'] = actions.cycle_history_prev, ['<c-n>'] = actions.move_selection_next, ['<c-p>'] = actions.move_selection_previous, ['<c-s>'] = actions.file_split, }, n = { q = actions.close, }, }, }, pickers = { find_files = ivy, fd = ivy, keymaps = dropdown, diagnostics = dropdown, symbols = cursor, live_grep = ivy, current_buffer_fuzzy_find = cursor, buffers = cursor, }, extensions = { ['ui-select'] = { cursor, }, zoxide = { prompt_title = 'Navigate deez nuts!', }, }, } telescope.setup { defaults = { selection_strategy = 'reset', hidden = true, scroll_strategy = 'limit', wrap_results = true, layout_config = { horizontal = { prompt_position = 'bottom', preview_width = 0.69, }, vertical = { mirror = false, }, width = 0.69, height = 0.42, preview_cutoff = 124, }, prompt_prefix = icon.telescope .. ' ', selection_caret = icon.arrow_right .. ' ', file_ignore_patterns = { '.git/', '.svn/', '.cache', '%.o', '%.a', '%.out', '%.class', '%.pdf', '%.mkv', '%.mp4', '%.zip', '%.spl', }, mappings = { i = { ['<c-j>'] = actions.cycle_history_next, ['<c-k>'] = actions.cycle_history_prev, ['<c-n>'] = actions.move_selection_next, ['<c-p>'] = actions.move_selection_previous, ['<c-s>'] = actions.file_split, ['g?'] = actions.which_key, }, n = { q = actions.close, }, }, }, -- FIXME: some themes have an issue, where filtered results do not get -- selected and are not in view pickers = { find_files = ivy, fd = ivy, keymaps = dropdown, diagnostics = dropdown, symbols = cursor, live_grep = ivy, current_buffer_fuzzy_find = cursor, buffers = cursor, help_tags = dropdown, }, extensions = { zoxide = { prompt_title = 'Navigate deez nuts!', }, }, } telescope.load_extension 'ui-select' telescope.load_extension 'zoxide' map.normal { description = 'Switch to recently used folders', category = 'navigation', keys = '<c-z>', command = telescope.extensions.zoxide.list, } map.normal.visual.terminal { description = 'Search help files', category = 'help', keys = '<F1>', command = function () builtin.help_tags( dropdown ) end, } map.normal { description = 'Open last search...', category = 'plugins', keys = '<c-p>', command = function () builtin.resume() end, } map.normal { description = 'Open search for commands...', category = 'plugins', keys = '<c-p><c-m>', command = function () builtin.commands() end, } map.normal { description = 'Open search for all files...', category = 'search', keys = '<c-p><c-p>', command = function () builtin.find_files() end, } map.normal { description = 'Open search for keymaps...', category = 'search', keys = '<c-p><c-k>', command = function () builtin.keymaps() end, } map.normal { description = 'Open search for symbols...', category = 'search', keys = '<c-p><c-s>', command = function () builtin.symbols() end, } map.normal { description = 'Open search for all file contents...', category = 'search', keys = '<c-p><c-g>', command = function () builtin.live_grep() end, } map.normal { description = 'Open search for current buffer content...', category = 'search', keys = '<c-p><c-b>', command = function () builtin.current_buffer_fuzzy_find() end, } map.normal { description = 'Open search for buffers...', category = 'search', keys = '<c-e>', command = function () builtin.buffers() end, } end,new file mode 100644+137 / −0 text lines
local debug = require 'std.dbg'local icon = require 'std.icon'local map = require 'std.map'map.normal { description = 'Run all tests', category = 'test', keys = '<leader>7n', command = function () prequire 'neotest'.run.run {} end,}map.normal { description = 'Run all tests', category = 'test', keys = '<leader>7n', command = function () prequire 'neotest'.run.run {} end,}map.normal { description = 'Run tests for current file', category = 'test', keys = '<leader>7t', command = function () prequire 'neotest'.run.run { vim.api.nvim_buf_get_name( 0 ), } end,}map.normal { description = 'Run all test suites', category = 'test', keys = '<leader>7a', command = function () for _, adapter_id in ipairs( require 'neotest'.run.adapters() ) do prequire 'neotest'.run.run { suite = true, adapter = adapter_id, } end end,}map.normal { description = 'Run last test', category = 'test', keys = '<leader>7l', command = function () prequire 'neotest'.run.run_last() end,}map.normal { description = 'Run all tests in debugger', category = 'test', keys = '<leader>7d', command = function () prequire 'neotest'.run.run { strategy = 'dap', } end,}map.normal { description = 'Show test summary', category = 'test', keys = '<leader>7p', command = function () prequire 'neotest'.summary.toggle() end,}map.normal { description = 'Show test output', category = 'test', keys = '<leader>7o', command = function () prequire 'neotest'.output.open { short = true, } end,}-- Investigate:-- * Does neotest have ability to throttle groups of individual test runs?-- * Tangential, but also check out https://github.com/andythigpen/nvim-coveragereturn { 'nvim-neotest/neotest', dependencies = { 'nvim-lua/plenary.nvim', 'nvim-neotest/neotest-plenary', 'nvim-neotest/nvim-nio', 'stevearc/overseer.nvim', }, config = function () local neotest = require 'neotest' if debug.get() then require 'neotest.logging':set_level 'trace' end neotest.setup { adapters = { require 'neotest-plenary', }, discovery = { enabled = false, }, consumers = { overseer = prequire 'neotest.consumers.overseer', }, summary = { mappings = { attach = 'a', expand = 'l', expand_all = 'L', jumpto = 'gf', output = 'o', run = '<C-r>', short = 'p', stop = 'u', }, }, icons = { passed = icon.passed, running = icon.running, failed = icon.failed, unknown = icon.unknown, running_animated = vim.tbl_map( function ( s ) return s .. ' ' end, { icon.progress_0, icon.progress_1, icon.progress_2, icon.progress_3, icon.progress_4, icon.progress_5, icon.progress_6, icon.progress_7, icon.progress_8, icon.progress_9, } ), }, diagnostic = { enabled = true, }, output = { enabled = true, open_on_run = false, }, status = { enabled = true, }, } end,}new file mode 100644+5 / −0 text lines
+2 / −2 text lines
deleted file mode 100644+0 / −105 text lines
local map = require 'std.map'local auto = require 'std.auto'require 'bugabinga.health'.add_dependency{ name_of_executable = 'gitui',} { name_of_executable = 'mdcat', } { name_of_executable = 'dot', }return { 'akinsho/toggleterm.nvim', tag = 'v2.10.0', keys = { '<F7>', '<F8>', '<F9>', '<F10>', }, cmd = { 'ToggleTerm', 'TermExec', 'Gitui', 'Mdcat', 'Graphviz', 'Graphviz', }, opts = { open_mapping = '<F7>', direction = 'float', float_opts = { border = vim.g.border_style, winblend = vim.o.winblend, }, size = function ( term ) if term.direction == 'horizontal' then return 18 elseif term.direction == 'vertical' then return vim.o.columns * 0.42 end end, }, config = function ( _, opts ) local toggleterm = require 'toggleterm' toggleterm.setup( opts ) local set_terminal_keymaps = function () local local_to_buffer = { buffer = 0, } map.terminal { description = 'Quit insert mode', category = 'terminal', keys = '<esc>', options = local_to_buffer, command = [[ <C-\><C-n> ]], } end auto 'normalize_terminal_windows' { description = 'Make terminal windows behave more normally.', events = 'TermOpen', pattern = 'term://*', command = set_terminal_keymaps, } map.normal { description = 'Open vertical Terminal', category = 'terminal', keys = '<F8>', command = '<CMD>exe v:count1 . "ToggleTerm size=60 direction=vertical"<CR>', } map.normal { description = 'Open horizontal Terminal', category = 'terminal', keys = '<F9>', command = '<CMD>exe v:count1 . "ToggleTerm size=20 direction=horizontal"<CR>', } local Terminal = require 'toggleterm.terminal'.Terminal --[ GITUI ] local gitui = Terminal:new { hidden = true, cmd = 'gitui', dir = 'git_dir', direction = 'tab', } local toggle_gitui = function () gitui:toggle() end map.normal.terminal.insert { description = 'Toggle gitui terminal in tab', category = 'terminal', keys = '<F10>', command = toggle_gitui, } vim.api.nvim_create_user_command( 'Gitui', toggle_gitui, { desc = 'Toggle Gitui', } ) end,}+24 / −8 text lines
+29 / −31 text lines
'windwp/nvim-ts-autotag', local parsers = require 'nvim-treesitter.parsers' 'just', autotag = { enable = false, }, disable = function ( _, buf ) local max_filesize = 1000 * 1024 -- 1000 KiB local ok, stats = pcall( vim.loop.fs_stat, vim.api.nvim_buf_get_name( buf ) ) if ok and stats and stats.size > max_filesize then return true end end, disable = should_disable, disable = should_disable, disable = should_disable, disable = should_disable, ['<leader>spn'] = { query = '@parameter.inner', desc = 'Swap parameter with next', }, ['<leader>rwn'] = { query = '@parameter.inner', desc = 'Swap parameter with next', }, ['<leader>spp'] = { query = '@parameter.inner', desc = 'Swap parameter with previous', }, ['<leader>rwp'] = { query = '@parameter.inner', desc = 'Swap parameter with previous', }, disable = should_disable, disable = should_disable, ---@diagnostic disable-next-line: inject-field parsers.get_parser_configs().just = { install_info = { url = 'https://github.com/IndianBoy42/tree-sitter-just', -- local path or git repo files = { 'src/parser.c', 'src/scanner.cc', }, branch = 'main', }, maintainers = { '@IndianBoy42', }, }+15 / −17 text lines
dependencies = { 'nvim-treesitter/nvim-treesitter' }, opts = { use_default_keymaps = false, }, config = function ( _, opts ) local treesj = require 'treesj' treesj.setup( opts ) map.normal { description = 'Toggle Tree Join/Split', category = 'editing', -- WARN: <C-j> produces the same keycode as <C-enter> on some terminals keys = '<C-j>', command = treesj.toggle, }new file mode 100644+13 / −0 text lines
+8 / −12 text lines
+19 / −14 text lines
m = { name = 'mark', _ = 'which_key_ignore', }, h = { name = 'hunk', _ = 'which_key_ignore', }, l = { name = 'lsp', _ = 'which_key_ignore', }, r = { name = 'refactor', _ = 'which_key_ignore', }, s = { name = 'swap', _ = 'which_key_ignore', ['7'] = { name = 'tests', _ = 'which_key_ignore', }, m = { name = '|m|ark', _ = 'which_key_ignore', }, h = { name = '|h|unk', _ = 'which_key_ignore', }, f = { name = '|f|iles', _ = 'which_key_ignore', }, g = { name = '|g|enerate', _ = 'which_key_ignore', }, d = { name = '|d|ebug', _ = 'which_key_ignore', }, v = { name = '|v|ersion control', _ = 'which_key_ignore', }, s = { name = '|s|essions', _ = 'which_key_ignore', }, r = { name = '|r|efactor', _ = 'which_key_ignore', }, w = { name = 's|w|ap', _ = 'which_key_ignore', p = { name = 'parameter', _ = 'which_key_ignore', }, p = { name = '|p|arameter', _ = 'which_key_ignore', }, o = { name = 'options', _ = 'which_key_ignore', }, o = { name = '|o|ptions', _ = 'which_key_ignore', },+15 / −46 text lines
local user_command = require 'std.user_command'map.normal { description = 'Open window picker...', category = 'navigation', keys = '<c-w>a', command = function () prequire 'nvim-window'.pick() end,}user_command.PickWindow'Pick a window with a simple char motion' ( function () prequire 'nvim-window'.pick() end ) config = function ( _, opts ) local window = require 'nvim-window' window.setup( opts ) map.normal { description = 'Open window picker...', category = 'navigation', keys = '<c-w>a', command = function () window.pick() end, } vim.api.nvim_create_user_command( 'PickWindow', window.pick, { bang = true } ) end+14 / −5 text lines
dependencies = { { 'folke/twilight.nvim', opts = { dimming = { inactive = true } } } }, dependencies = { { 'folke/twilight.nvim', opts = { dimming = { inactive = true, }, }, }, },new file mode 100644+31 / −0 text lines
local map = require 'std.map'local localrc = require 'std.localrc'local user_command = require 'std.user_command'local global_actions = vim.g.save_actions or {}local project_local_actions = localrc( '.save.actions.lua', 'table' ) or {}local all_actions = vim.tbl_deep_extend( 'force', global_actions, project_local_actions )local apply_save_actions = function () vim.iter( all_actions ):each( function ( action ) vim.validate { action = { action, 'string', }, } local parsed_command = vim.api.nvim_parse_cmd( action, {} ) vim.api.nvim_cmd( parsed_command, { output = true, } ) end ) --save all vim.cmd [[wa]]enduser_command.SaveActions 'Execute all declared save actions' ( apply_save_actions )map.normal.visual { description = 'Save all buffers and apply save actions', category = 'actions', keys = '<c-s>', command = '<cmd>SaveActions<cr>',}new file mode 100644+44 / −0 text lines
local map = require 'std.map'local auto = require 'std.auto'map.normal { description = 'Open terminal in a split', category = 'terminal', keys = '<F7>', command = function () local cwd = vim.uv.cwd() ---@diagnostic disable-next-line: undefined-field local shell = vim.opt.shell:get() local open_term_cmd = string.format( 'split term://%s//%s', cwd, shell ) vim.cmd( open_term_cmd ) end,}local terminal_settings = function () map.terminal { description = 'Quit insert mode via <esc>', category = 'terminal', keys = '<esc>', buffer = true, command = [[ <C-\><C-n> ]], } map.terminal.normal { description = 'Close current terminal', category = 'terminal', keys = '<F7>', buffer = true, command = [[ <C-\><C-n><cmd>q<cr> ]], } vim.opt_local.spell = false vim.cmd.startinsert()endauto 'normalize_terminal_windows' { description = 'Make terminal windows behave more normally.', events = 'TermOpen', pattern = 'term://*', command = terminal_settings,}deleted file mode 100644+0 / −65 text lines
-- If invoked as a preview callback, performs 'inccommand' preview by-- highlighting trailing whitespace in the current buffer.local function trim_space_preview(opts, preview_ns, preview_buf) vim.cmd('hi clear Whitespace') local line1 = opts.line1 local line2 = opts.line2 local buf = vim.api.nvim_get_current_buf() local lines = vim.api.nvim_buf_get_lines(buf, line1 - 1, line2, false) local preview_buf_line = 0 for i, line in ipairs(lines) do local start_idx, end_idx = string.find(line, '%s+$') if start_idx then -- Highlight the match vim.api.nvim_buf_add_highlight( buf, preview_ns, 'Substitute', line1 + i - 2, start_idx - 1, end_idx ) -- Add lines and set highlights in the preview buffer -- if inccommand=split if preview_buf then local prefix = string.format('|%d| ', line1 + i - 1) vim.api.nvim_buf_set_lines( preview_buf, preview_buf_line, preview_buf_line, false, { prefix .. line } ) vim.api.nvim_buf_add_highlight( preview_buf, preview_ns, 'Substitute', preview_buf_line, #prefix + start_idx - 1, #prefix + end_idx ) preview_buf_line = preview_buf_line + 1 end end end -- Return the value of the preview type return 2end-- Trims all trailing whitespace in the current buffer.local function trim_space(opts) local line1 = opts.line1 local line2 = opts.line2 local buf = vim.api.nvim_get_current_buf() local lines = vim.api.nvim_buf_get_lines(buf, line1 - 1, line2, false) local new_lines = {} for i, line in ipairs(lines) do new_lines[i] = string.gsub(line, '%s+$', '') end vim.api.nvim_buf_set_lines(buf, line1 - 1, line2, false, new_lines)end-- Create the user commandvim.api.nvim_create_user_command( 'TrimTrailingWhitespace', trim_space, { nargs = '?', range = '%', addr = 'lines', preview = trim_space_preview })+3 / −3 text lines
+5 / −2 text lines
new file mode 100644+29 / −0 text lines
local user_command = require 'std.user_command'if vim.g.bugabinga_debug_mode == nil then vim.g.bugabinga_debug_mode = falseendlocal function is_debug_mode() return vim.g.bugabinga_debug_modeendlocal function print_debug( message, ... ) if is_debug_mode() then -- TODO: pipe messages into custom debug buffer and file vim.print( message, ... ) endendlocal function toggle_debug_mode() vim.g.bugabinga_debug_mode = not vim.g.bugabinga_debug_mode vim.notify( 'Toggled debug mode to ' .. tostring( is_debug_mode() ) )enduser_command.Debug 'Toggle global vim config debug mode.' ( toggle_debug_mode )return { print = print_debug, toggle = toggle_debug_mode, get = is_debug_mode,}deleted file mode 100644+0 / −27 text lines
if vim.g.bugabinga_debug_mode == nil then vim.g.bugabinga_debug_mode = falseendlocal function is_debug_mode() return vim.g.bugabinga_debug_modeendlocal function print_debug( message, ... ) if is_debug_mode() then -- TODO: pipe messages into custom debug buffer and file vim.print( message, ... ) endendlocal function toggle_debug_mode() vim.g.bugabinga_debug_mode = not vim.g.bugabinga_debug_mode vim.notify( 'Toggled debug mode to ' .. tostring( is_debug_mode() ) )endvim.api.nvim_create_user_command( 'Debug', toggle_debug_mode, {} )return { print = print_debug, toggle = toggle_debug_mode, get = is_debug_mode,}+50 / −12 text lines
new file mode 100644+65 / −0 text lines
local _ = {}--- Highlights given words in a buffer.--- Word matching is case sensitive.--- @param bufnr number Number of buffer to highlight. If 0, current buffer is used.--- @param words table Word to highlight group name mapping. Every occurrence with keys in this table, will be--- highlighted with its mapped value, which is expected to be a highlight group name._.buffer = function ( bufnr, words ) vim.validate { bufnr = { bufnr, 'number', }, words = { words, 'table', }, } local namespace = vim.api.nvim_create_namespace 'light_up_ns' vim.api.nvim_buf_clear_namespace( bufnr, namespace, 0, -1 ) local handler = function ( event, buffer_handle, tick, first_line, last_line_changed, last_line_updated, bytes ) -- vim.print( event, buffer_handle, tick, first_line, last_line_changed, last_line_updated, bytes ) assert( event == 'lines', 'this handler is for `on_lines` notification' ) local last = math.max( last_line_updated, last_line_changed ) local lines = vim.api.nvim_buf_get_lines( bufnr, first_line, last, true ) --NOTE: dubbel loop. can we faster? for index, line in ipairs( lines ) do local current_line = first_line + index - 1 -- adjust for 0-based indexing for word, highlight_group in pairs( words ) do -- NOTE: the way find is used here, we can only ever match one word per line -- vim.print( 'looking for word ', word, line ) local start_offset, end_offset = line:find( '[%s%.](' .. word .. ')[%s$]' ) if start_offset then -- vim.print( 'marking line ' .. current_line, start_offset, end_offset, highlight_group ) vim.api.nvim_buf_set_extmark( bufnr, namespace, current_line, start_offset, { end_col = end_offset - 1, hl_group = highlight_group, } ) break end end end end local ok = vim.api.nvim_buf_attach( bufnr, false, { on_lines = handler, } ) if not ok then error( 'unable to attach to buffer ' .. bufnr ) end -- initial scan of whole buffer handler( 'lines', bufnr, nil, 0, -1, -1, nil )end--- @return table groups A map of all highlight group names, mapping to themselves g:match('^([%w@%._]+)%s')._.get_vim_highlight_groups = function () local groups = {} local highlight_command_output = vim.fn.execute 'highlight' for line in highlight_command_output:gmatch '[^\n]+' do -- Delimiter xxx guifg=#727272 -- @punctuation.special xxx links to Special -- Match anything that could be a valid highlight name local match = line:match '^([%w@%._]+)%s' if match then groups[match] = match end end return groupsendreturn _new file mode 100644+29 / −0 text lines
local debug = require 'std.dbg'--- loads given lua file path in current working directory into the current neovim lua runtime.--- @param file_name string path to lua file, that should be loaded--- @param validator function|string|table a validation function, that checks, if the loaded value fulfills your requirements.--- If `validator` is a string or table, then it should contain the allowed types of the value.--- @return any returns the evaluated value of the loaded lua file or `nil`, if it does not exists or did not pass--- validation.return function ( file_name, validator ) local filepath = vim.fn.fnamemodify( file_name, ':p' ) local file = vim.secure.read( filepath ) if not file then return nil end local fn, err = loadstring( file ) if not fn or err then debug.print( 'unable to load ' .. file_name .. '. ' .. err ) return nil end local value = fn() local validator_type = type( validator ) if validator_type == 'string' or validator_type == table then local expected_types = validator_type == table and validator or { validator, } local value_type = type( value ) local is_valid = vim.iter( expected_types ):any( function ( t ) return t == value_type end ) return is_valid and value or nil end return validator( value ) and value or nilend+53 / −50 text lines
map.description = map.category .. ': ' .. map.description map.description = map.category .. ": " .. map.description local options = vim.tbl_extend( 'keep', map.options, { local options = vim.tbl_extend("keep", map.options, { if vim.tbl_isempty( self.modes ) then self.modes[1] = available_modes.normal_visual_select_operator_pending end vim.keymap.set( self.modes, keys, command, options ) vim.keymap.set(self.modes, keys, command, options) vim.keymap.del( self.modes, keys, delete_options ) vim.keymap.del(self.modes, keys, delete_options) if new_mode == nil then error( 'unknown keymap mode requested: ' .. key ) endnew file mode 100644+60 / −0 text lines
local dbg = require 'std.dbg'local function printStackTrace() local level = 2 while true do local info = debug.getinfo( level, 'nSl' ) if not info then break end dbg.print( string.format( "%s:%d in function '%s'", info.short_src, info.currentline, info.name or '' ) ) level = level + 1 endend---Require one or more modules gracefully.---Calls `require` in protected mode.---@example--- local want = require 'std.prequire'--- prequire 'foo'.setup {}--- prequire('foo', 'bar', function(foo, bar)--- foo.setup{arg = bar}--- end)---@see pcall---@param ... ... or more module names. The last argument may optionally be a function, consuming all modules---previously given.---@return any module The first module, when loaded successfully. Otherwise a proxy object, that does nothing when called or---indexed into. This prevents nil dereferencing errors when using the pattern `require('std.prequire')('this mod does---not exist').setup()`.return function ( ... ) local args = { ..., } local mods = {} local first_mod for _, arg in ipairs( args ) do if type( arg ) == 'function' then arg( unpack( mods ) ) break end local ok, mod = pcall( require, arg ) if ok then if not first_mod then first_mod = mod end table.insert( mods, mod ) else printStackTrace() vim.notify_once( string.format( 'Missing module: %s', arg ), vim.log.levels.WARN ) -- Return a proxy item that returns itself, so we can do things like -- prequire("module").setup() local proxy = {} setmetatable( proxy, { __call = function () return proxy end, __index = function () return proxy end, } ) return proxy end end return first_modend+80 / −74 text lines
local create_hash = function ( path, markers )local create_hash = function ( path, markers, stop ) local stop_hash = hasher( stop ) return path_hash .. '|' .. markers_hash--- the weight of a project marker, when the likelyhood is low--- the weight of a project marker, when the likelihood is low-- Project root: `/home/user/workspace/some\_project`-- -> contains `.git`, `README` and `Makefile`-- Project root: `/home/user/workspace/some\_project` -> contains `.git`, `README` and `Makefile` local cache_hit = cache_get( path, markers ) local cache_hit = cache_get( path, markers, stop ) debug.print( 'found project root', project_root, directory_scores ) { name = '.git', weight = LIKELY, }, { name = '.gitignore', weight = LIKELY, }, { name = '.svn', weight = LIKELY, }, { name = 'justfile', weight = LIKELY, }, { name = 'Jenkinsfile', weight = MAYBE, }, { name = '.editorconfig', weight = MAYBE, }, { name = 'LICENSE', weight = MAYBE, }, { name = 'LICENSE.md', weight = MAYBE, }, { name = 'LICENSE.txt', weight = MAYBE, }, { name = 'COPYING', weight = MAYBE, }, { name = 'README', weight = MAYBE, }, { name = 'README.md', weight = MAYBE, }, { name = 'Makefile', weight = LIKELY, }, { name = 'flake.nix', weight = MAYBE, }, { name = 'flake.nix', weight = MAYBE, }, { name = '.project_model', weight = DEFINITLY, }, { name = '.save.actions.lua', weight = DEFINITELY, }, { name = '.lsp.settings.lua', weight = DEFINITELY, }, { name = '.lazy.specs.lua', weight = DEFINITELY, }, { name = '.editorconfig', weight = LIKELY, }, { name = '.git', weight = LIKELY, }, { name = '.gitignore', weight = LIKELY, }, { name = '.svn', weight = LIKELY, }, { name = 'justfile', weight = LIKELY, }, { name = 'Makefile', weight = LIKELY, }, { name = 'Jenkinsfile', weight = MAYBE, }, { name = 'LICENSE', weight = MAYBE, }, { name = 'LICENSE.md', weight = MAYBE, }, { name = 'LICENSE.txt', weight = MAYBE, }, { name = 'COPYING', weight = MAYBE, }, { name = 'README', weight = MAYBE, }, { name = 'README.md', weight = MAYBE, }, { name = 'flake.nix', weight = MAYBE, }, { name = 'flake.nix', weight = MAYBE, }, { name = 'mvnw', weight = DEFINITLY, }, { name = '.mvn', weight = DEFINITLY, }, { name = 'mvnw.cmd', weight = DEFINITLY, }, { name = 'build.gradle', weight = DEFINITLY, }, { name = 'gradle.properties', weight = DEFINITLY, }, { name = 'settings.gradle', weight = DEFINITLY, }, { name = 'gradlew', weight = DEFINITLY, }, { name = 'gradlew.bat', weight = DEFINITLY, }, { name = 'mvnw', weight = DEFINITELY, }, { name = '.mvn', weight = DEFINITELY, }, { name = 'mvnw.cmd', weight = DEFINITELY, }, { name = 'build.gradle', weight = DEFINITELY, }, { name = 'gradle.properties', weight = DEFINITELY, }, { name = 'settings.gradle', weight = DEFINITELY, }, { name = 'gradlew', weight = DEFINITELY, }, { name = 'gradlew.bat', weight = DEFINITELY, },local lua_markers = { { name = '.luarc.json', weight = MAYBE, }, { name = '.luarc.jsonc', weight = MAYBE, }, { name = '.luacheckrc', weight = MAYBE, }, { name = '.stylua.toml', weight = MAYBE, }, { name = 'stylua.toml', weight = MAYBE, }, { name = 'selene.toml', weight = MAYBE, }, { name = 'selene.yml', weight = MAYBE, }, { name = 'neovim.yml', weight = MAYBE, }, { name = 'lua', weight = MAYBE, },} return find_root( path, lua_markers ) local lua_markers = { { name = '.luarc.json', weight = MAYBE, }, { name = '.luarc.jsonc', weight = MAYBE, }, { name = '.luacheckrc', weight = MAYBE, }, { name = '.stylua.toml', weight = MAYBE, }, { name = 'stylua.toml', weight = MAYBE, }, { name = 'selene.toml', weight = MAYBE, }, { name = 'selene.yml', weight = MAYBE, }, { name = 'neovim.yml', weight = MAYBE, }, { name = 'lua', weight = MAYBE, }, } return find_project_root( path, lua_markers ) return find_root( path, zig_markers ) local zig_markers = { { name = 'build.zig', weight = DEFINITELY, }, { name = 'zls.build.json', weight = DEFINITELY, }, { name = 'zig-cache', weight = MAYBE, }, { name = 'zig-out', weight = MAYBE, }, } --FIXME: can we ask the zig build system for this info? return find_project_root( path, zig_markers )new file mode 100644+66 / −0 text lines
--- Creates a new user command--- @param user_command table Necessary data to create a new user command.local create_user_command = function ( user_command ) local options = { desc = user_command.description, } local merged_options = vim.tbl_deep_extend( 'force', options, user_command.options or {} ) vim.api.nvim_create_user_command( user_command.name, user_command.command, merged_options )end--- Sets the field `command` in `self` to given value in `command`--- Then creates a new user command with data in `self`.--- @param self table any table.--- @param command function command to be executed when the user command is run.--- @return function deleter A function that deletes the created user command.local set_command = function ( self, command ) self.command = command create_user_command( self ) --- Deletes the created user command return function () vim.api.nvim_del_user_command( self.name ) endend--- meta table, that sets the function value, when called, to a field named `command`local COMMAND_SETTER = { __call = function ( self, command ) vim.validate { command = { command, 'function', }, } return set_command( self, command ) end,}--- meta table, that either sets the table value to a field named `options`,--- or the function value to a field named `command`, when called.local OPTIONS_OR_COMMAND_SETTER = { __call = function ( self, options_or_command ) vim.validate { options_or_command = { options_or_command, { 'table', 'function', }, }, } if type( options_or_command ) == 'table' then self.options = options_or_command return setmetatable( self, COMMAND_SETTER ) end return set_command( self, options_or_command ) end,}--- meta table, that sets the string value to a field named `description`, when called.local DESCRIPTION_SETTER = { __call = function ( self, description ) vim.validate { description = { description, 'string', }, } self.description = description return setmetatable( self, OPTIONS_OR_COMMAND_SETTER ) end,}--- meta table, that sets the string value to a field named `name`, when indexed into.local COMMAND_NAME_SETTER = { __index = function ( _, command_name ) vim.validate { command_name = { command_name, 'string', }, } local new_user_command = { name = command_name, } return setmetatable( new_user_command, DESCRIPTION_SETTER ) end,}--TODO: think about how to create buffer commandsreturn setmetatable( {}, COMMAND_NAME_SETTER )deleted file mode 100644+0 / −25 text lines
---base: lua51name: neovimglobals: after_each: args: - type: function assert: args: - type: bool - required: false type: string before_each: args: - type: function describe: args: - type: string - type: function it: args: - type: string - type: function vim: any: truedeleted file mode 100644+0 / −14 text lines
+1 / −0 text lines
Binary size (old → new): 53 → 74 bytes.
new file mode 100644+1 / −0 text lines
stevearcBinary size (old → new): 40 → 41 bytes.
+33 / −0 text lines
resessionconfigsBufNewFileLuaLSeditorconfigexrclocalrcsigncolumntogglersripgrepprequirepcallargsipairssetmetatablecolorschemecmdlinetreesittercmdpopupsneovideweztermfullscreencheckhealthplsstyluaeolkoolgrepprgmakeprgmodulepathFFIjdtlsnew file mode 100644+1 / −0 text lines
dotfilesnew file mode 100644Binary size (old → new): 0 → 41 bytes.
+3 / −5 text lines
export def list [] { ls --all --long --du --mime-type | where type == dir | append (ls --all --long --du --mime-type | where type != dir) }
# FIXME: README preview does not work (in WSL2)
fd --type directory --max-depth 1 . $env.WORKSPACE | fzf --ansi --preview 'mdcat {}README.md' --preview-window 'up:69%,border-bottom' | cd $in
rg --color=always --line-number --no-heading --smart-case $initial_query | fzf --ansi --delimiter : --preview 'bat --color=always {1} --highlight-line {2}' --color "hl:-1:underline,hl+:-1:underline:reverse" --preview-window 'up,60%,border-bottom,+{2}+3/3,~3' | parse '{file}:{number}:{line}' | each { nvim -c $in.number -c $"?\\V($in.line | str trim )" $in.file }