Merge branch 'trunk' of github.com:bugabinga/dotfiles into trunk
0bacce5c4200feecaf509c4655c7ce39c0bf4473
Oliver Jan Krylow <oliver@bugabinga.net> ·
unsigned
- Parent 1: 97f822f8e283 · Showing diff
- Parent 2: d7dbe193daec · Diff against parent 2
bugabingas dorkfiles
0bacce5c4200feecaf509c4655c7ce39c0bf4473
Oliver Jan Krylow <oliver@bugabinga.net> ·
unsigned
+1022 / −380 text lines · all files grouped into 32 bars
+11 / −10 text lines
* navic highlights do not fit winbar* fix bg gihlight of treesitter-context* adapt config to respect `vim.g.nerdfont` (std.constants?)* Do I want multiple LSPs per buffer? In case of markdown and text it seems useful, for code it seems like a headache... But it seems inevitable, because more and more tools use the LSP infrastructure. For example, grammar checkers like harper or code transform tools like ast-grep* flesh out 'const.lua', move to std?+2 / −35 text lines
-- TODO: move this to std and refactor to retun bool-- Set color theme to light/dark based on current system preferences.function get_background_based_on_os() -- Default value local background = 'light' local uname = vim.uv.os_uname() -- First check whether we are on WSL or Windows if uname.sysname == "Windows_NT" or string.match(uname.release, "WSL") then -- Check if 'reg.exe' is executable if vim.fn.executable('reg.exe') ~= 0 then -- Execute command to check if the win32 appearance is set to Dark local appsUseLightTheme = vim.fn.system({"reg.exe", "Query", "HKCU\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize", "/v", "AppsUseLightTheme"}) if not appsUseLightTheme:find("0x1") then background = 'dark' end end -- Check if 'busctl' is executable (part of systemd) elseif vim.fn.executable('busctl') ~= 0 then -- Get the current color scheme from xdg-desktop-portal using busctl local result = vim.fn.system({ "busctl", "--user", "call", "org.freedesktop.portal.Desktop", "/org/freedesktop/portal/desktop", "org.freedesktop.portal.Settings", "ReadOne", "ss", "org.freedesktop.appearance", "color-scheme" }) -- The result is in the form of "v u 0" for light and "v u 1" for dark local color_scheme = result:match("u%s+(%d+)") if color_scheme == '1' then background = 'dark' end else end return backgroundendlocal const = require'std.const'+11 / −0 text lines
+15 / −11 text lines
---create special global, that serves as a more graceful alternative to `require`prequire 'bugabinga.options'prequire 'bugabinga.editorconfig'prequire 'bugabinga.sessions'prequire 'bugabinga.lazy'prequire 'bugabinga.save_actions'require 'patches'prequire 'bugabinga.lsp'+15 / −8 text lines
rm -r (run-external --redirect-combine nvim "--headless" "-n" "-R" +'lua = vim.fn.stdpath[[data]]' +:q | lines | last) rm -r (run-external --redirect-combine nvim "--headless" "-n" "-R" +'lua = vim.fn.stdpath[[cache]]' +:q | lines | last) rm -r (run-external --redirect-combine nvim "--headless" "-n" "-R" +'lua = vim.fn.stdpath[[state]]' +:q | lines | last) rm -r (run-external --redirect-combine nvim "--headless" "-n" "-R" +'lua = vim.fn.stdpath[[data]]' +:q | lines | last) rm -r (run-external --redirect-combine nvim "--headless" "-n" "-R" +'lua = vim.fn.stdpath[[cache]]' +:q | lines | last) rm -r (run-external --redirect-combine nvim "--headless" "-n" "-R" +'lua = vim.fn.stdpath[[state]]' +:q | lines | last)+38 / −3 text lines
"CopilotChat.nvim": { "branch": "canary", "commit": "9333944fde3c65868818e245c73aa29eef826e9b" }, "better-escape.nvim": { "branch": "master", "commit": "f45b52f8f87792e8659526f23261ffe278a54be5" }, "cmd-parser.nvim": { "branch": "master", "commit": "6363b8bddef968c3ec51a38172af44f675f01ef3" }, "cmp-dotenv": { "branch": "main", "commit": "4dd53aab60982f1f75848aec5e6214986263325e" }, "cmp-nvim-lsp-signature-help": { "branch": "main", "commit": "031e6ba70b0ad5eee49fd2120ff7a2e325b17fa7" }, "colorizer.nvim": { "branch": "master", "commit": "c1602ff3f11566bb7f16f90985b0c59d3d7db0ef" }, "eagle.nvim": { "branch": "main", "commit": "f590404f510be11ef2cf7c68e135441bfa48c9a8" }, "in-and-out.nvim": { "branch": "master", "commit": "ab24cafadc3418dffb0c7e9b0621cff60b9ac551" }, "indent-blankline.nvim": { "branch": "master", "commit": "3fe94b8034dd5241cb882bb73847303b58857ecf" }, "lazydev.nvim": { "branch": "main", "commit": "491452cf1ca6f029e90ad0d0368848fac717c6d2" }, "markdown-table-mode.nvim": { "branch": "main", "commit": "f830cd15a97deb3acc53d9f6607bc609f7f32e49" }, "nvim-autopairs": { "branch": "master", "commit": "f158dcb865c36f72c92358f87787dab2c272eaf3" }, "nvim-highlight-colors": { "branch": "main", "commit": "a411550ef85cae467b889ba7d1a96bd78332d90e" }, "nvim-neoclip.lua": { "branch": "main", "commit": "32e05f2d23dc5b6a284a688c0535a83d1bfc633f" }, "nvim-rulebook": { "branch": "main", "commit": "bc5e3874a9870709ec91152f9efce6dad49ca862" }, "nvim-treesitter": { "branch": "master", "commit": "f027762845fa35ff27fe0487c86537a74a480a0c" }, "nvim-treesitter": { "branch": "master", "commit": "707313b80a2f1e65fa06dba2052cc49ce6762a60" }, "nvim-treesitter-endwise": { "branch": "master", "commit": "8b34305ffc28bd75a22f5a0a9928ee726a85c9a6" }, "nvim-treesitter-textobjects": { "branch": "master", "commit": "4a2d05ec24eaa6b655c7d19092a3b6c0219d46b9" }, "nvim-web-devicons": { "branch": "master", "commit": "26220156aafb198b2de6a4cf80c1b120a3768da0" }, "nvim-web-devicons": { "branch": "master", "commit": "1e5a2a796a88b5d696acb07dd5c285b13d13da21" }, "precognition.nvim": { "branch": "main", "commit": "8a81c310b4e76b4884fc5350a5741cf683c645c7" }, "range-highlight.nvim": { "branch": "master", "commit": "8b5e8ccb3460b2c3675f4639b9f54e64eaab36d9" }, "refjump.nvim": { "branch": "main", "commit": "a78b585cff29505f7558f3a596bca567474cd663" }, "scratch.nvim": { "branch": "main", "commit": "3e3d2ad0d7f565bc794d9d3ad40e92509802ecad" }, "spellwarn.nvim": { "branch": "main", "commit": "2f4dbc58bb90bc63b295461216b91ccf4e7f782d" }, "surround-ui.nvim": { "branch": "main", "commit": "40abcba017a943d6d3dd304e523f34a43d80405b" }, "symbol-usage.nvim": { "branch": "main", "commit": "0f9b3da014b7e41559b643e7461fcabb2a7dc83a" }, "telescope-frecency.nvim": { "branch": "master", "commit": "f67baca08423a6fd00167801a54db38e0b878063" }, "telescope-fzf-native.nvim": { "branch": "main", "commit": "cf48d4dfce44e0b9a2e19a008d6ec6ea6f01a83b" }, "telescope-symbols.nvim": { "branch": "master", "commit": "a6d0127a53d39b9fc2af75bd169d288166118aec" }, "telescope-undo.nvim": { "branch": "main", "commit": "51be9ae7c42fc27c0b05505e3a0162e0f05fbb6a" }, "telescope-zoxide": { "branch": "main", "commit": "54bfe630bad08dc9891ec78c7cf8db38dd725c97" }, "telescope.nvim": { "branch": "master", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" }, "todo-comments.nvim": { "branch": "main", "commit": "ae0a2afb47cf7395dc400e5dc4e05274bf4fb9e0" }, "toggle.nvim": { "branch": "main", "commit": "50769ba8982d3d3a8fbd1d1a2e5cad63c73df662" }, "vim-vscode-snippets": { "branch": "master", "commit": "c34e9edee6a00cf3d0b8edb515e08e3df450bcfa" }, "virt-column.nvim": { "branch": "master", "commit": "b62b4ef0774d19452d4ed18e473e824c7a756f2f" }, "wezterm-types": { "branch": "main", "commit": "1518752906ba3fac0060d9efab6e4d3ec15d4b5a" },deleted file mode 100644+0 / −5 text lines
+1 / −2 text lines
+1 / −0 text lines
+20 / −20 text lines
content_normal = choose { light = '#494949', dark = '#cfcfcf', }, content_backdrop = choose { light = '#e3e3e3', dark = '#131313', }, content_accent = choose { light = '#800080', dark = '#800080', }, content_minor = choose { light = '#878787', dark = '#727272', }, content_focus = choose { light = '#646464', dark = '#a5bdb6', }, content_unfocus = choose { light = '#c9c9c9', dark = '#3f4543', }, content_important_global = choose { light = '#48256e', dark = '#8e58cc', }, content_important_local = choose { light = '#643398', dark = '#7a3bc3', }, content_normal = choose { light = '#494949', dark = '#cfcfcf' }, content_backdrop = choose { light = '#e3e3e3', dark = '#131313' }, content_accent = choose { light = '#800080', dark = '#800080' }, content_minor = choose { light = '#878787', dark = '#727272' }, content_focus = choose { light = '#646464', dark = '#a5bdb6' }, content_unfocus = choose { light = '#c9c9c9', dark = '#3f4543' }, content_important_global = choose { light = '#48256e', dark = '#8e58cc' }, content_important_local = choose { light = '#643398', dark = '#7a3bc3' }, ui_normal = choose { light = '#929292', dark = '#e2e2e2', }, ui_backdrop = choose { light = '#f9f9f9', dark = '#000000', }, ui_accent = choose { light = '#d43dd4', dark = '#7a067a', }, ui_minor = choose { light = '#d0d0d0', dark = '#424242', }, ui_focus = choose { light = '#646464', dark = '#788984', }, ui_unfocus = choose { light = '#c9c9c9', dark = '#121212', }, ui_important_global = choose { light = '#9170b5', dark = '#5f368d', }, ui_important_local = choose { light = '#ae95c8', dark = '#4c2b72', }, ui_normal = choose { light = '#929292', dark = '#e2e2e2' }, ui_backdrop = choose { light = '#f9f9f9', dark = '#000000' }, ui_accent = choose { light = '#d43dd4', dark = '#7a067a' }, ui_minor = choose { light = '#d0d0d0', dark = '#424242' }, ui_focus = choose { light = '#646464', dark = '#788984' }, ui_unfocus = choose { light = '#c9c9c9', dark = '#121212' }, ui_important_global = choose { light = '#9170b5', dark = '#5f368d' }, ui_important_local = choose { light = '#ae95c8', dark = '#4c2b72' },+50 / −12 text lines
local const = require 'std.const'-- integrate Nushell with nvimvim.opt.shell = 'nu'vim.opt.shellcmdflag = '--stdin --no-newline --commands'vim.opt.shellredir = 'out+err> %s'vim.opt.shellpipe = '| complete | update stderr { ansi strip } | tee { get stderr | save --force --raw %s} | into record'vim.opt.shelltemp = falsevim.opt.shellxquote = ''vim.opt.shellxescape = ''vim.opt.shellquote = ''if vim.fn.executable 'nu' then -- integrate Nushell with nvim vim.opt.shell = 'nu' -- flags for nu: -- * `--stdin` redirect all input to -c -- * `--no-newline` do not append `\n` to stdout -- * `--commands` execute a command vim.opt.shellcmdflag = '--stdin --no-newline --commands' -- string to be used to put the output of shell commands in a temp file -- 1. when 'shelltemp' is `true` -- 2. in the `diff-mode` (`nvim -d file1 file2`) when `diffopt` is set -- to use an external diff command: `set diffopt-=internal` vim.opt.shellredir = 'out+err> "%s"' -- string to be used with `:make` command to: -- 1. save the stderr of `makeprg` in the temp file which Neovim reads using `errorformat` to populate the `quickfix` buffer -- 2. show the stdout, stderr on the screen -- NOTE: `ansi strip` removes all ansi coloring from nushell errors vim.opt.shellpipe = '| complete | get stderr stdout | str join (char nl) | ansi strip | tee { save --force --raw "%s" }' -- WARN: disable the usage of temp files for shell commands -- because Nu doesn't support `input redirection` which Neovim uses to send buffer content to a command: -- `{shell_command} < {temp_file_with_selected_buffer_content}` -- When set to `false` the stdin pipe will be used instead. -- NOTE: some info about `shelltemp`: https://github.com/neovim/neovim/issues/1008 vim.opt.shelltemp = false vim.opt.shellxquote = '' vim.opt.shellxescape = '' vim.opt.shellquote = ''endif const.wsl then vim.g.clipboard = { name = 'WslClipboard', copy = { ['+'] = 'clip.exe', ['*'] = 'clip.exe', }, paste = { ['+'] = 'powershell.exe -c [Console]::Out.Write($(Get-Clipboard -Raw).tostring().replace("`r", ""))', ['*'] = 'powershell.exe -c [Console]::Out.Write($(Get-Clipboard -Raw).tostring().replace("`r", ""))', }, cache_enabled = 0, }end+1 / −22 text lines
map.normal.visual { description = 'Yanks the selected text (in normal mode or visual mode) to the system clipboard.', category = 'editing', keys = '<leader>y', command = '"+y',}map.normal { description = 'Pastes from the system clipboard (in normal mode or visual mode).', category = 'editing', keys = '<leader>p', command = '"+p',}map.normal.visual { description = 'Yanks the entire line (when used in normal mode with motion).', category = 'editing', keys = '<leader>Y', command = '"+Y',}+8 / −3 text lines
command = function () vim.highlight.on_yank() end,+7 / −1 text lines
+57 / −43 text lines
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 lspkind = prequire 'lspkind' local colors = prequire 'nvim-highlight-colors' local lspkind_params = { 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]', copilot = '[cop]', }, } local formatting = { format = function ( entry, item ) local color_item = colors.format( entry, { kind = item.kind } ) item = lspkind.cmp_format( lspkind_params )( entry, item ) if color_item.abbr_hl_group then item.kind_hl_group = color_item.abbr_hl_group item.kind = color_item.abbr end return item end, } { name = 'copilot' }, -- FIXME: depends on incubating plugin! { name = 'nvim_lsp_signature_help' }, { name = 'dotenv' }, { name = 'luasnip' },+7 / −30 text lines
filetypes = { '*' }, user_default_options = { RGB = true, -- #RGB hex codes RRGGBB = true, -- #RRGGBB hex codes RRGGBBAA = true, -- #RRGGBBAA hex codes AARRGGBB = true, -- 0xAARRGGBB hex codes rgb_fn = true, -- CSS rgb() and rgba() functions hsl_fn = true, -- CSS hsl() and hsla() functions css = false, -- Enable all CSS features: rgb_fn, hsl_fn, names, RGB, RRGGBB css_fn = false, -- Enable all CSS *functions*: rgb_fn, hsl_fn -- Available modes for `mode`: foreground, background, virtualtext mode = 'virtualtext', -- Set the display mode. -- names = function () return require 'bugabinga.nugu.palette' end, -- parsers can contain values used in |user_default_options| sass = { enable = false, parsers = { 'css' } }, -- Enable sass colors virtualtext = '██', -- update color values even if buffer is not focused -- example use: cmp_menu, cmp_docs always_update = false, }, -- all the sub-options of filetypes apply to buftypes buftypes = { '*', '!prompt', '!popup', '!nofile', }, render = 'virtual',+0 / −10 text lines
+1 / −1 text lines
+12 / −2 text lines
new file mode 100644+14 / −0 text lines
local map = require 'std.map'map.insert { description = 'Moves in or out of balanced tokens', category = 'editing', keys = '<c-space>', command = function () require 'in-and-out'.in_and_out() end,}return { 'ysmb-wtsg/in-and-out.nvim', commit = 'ab24cafadc3418dffb0c7e9b0621cff60b9ac551', event = 'VeryLazy',}new file mode 100644+384 / −0 text lines
-- this file lists plugins in their "incubation" phase.-- that means i am testing those out of curiosity, but am not sure yet i wish-- to use and depend on them.-- global toggle for all incubating plugins. set to false to quickly, but-- temporarily, get rid of all incubating plugins.local FUCK_STABILITY = truelocal ignored = require 'std.ignored'local icon = require 'std.icon'return { ------------------------------------------------------------------------------- { 'gregorias/toggle.nvim', lazy = false, version = '2.0', config = true, enable = FUCK_STABILITY, }, ------------------------------------------------------------------------------- { 'zbirenbaum/copilot-cmp', event = 'InsertEnter', config = function () require 'copilot_cmp'.setup() end, dependencies = { 'zbirenbaum/copilot.lua', cmd = 'Copilot', config = function () require 'copilot'.setup { suggestion = { enabled = false }, panel = { enabled = false }, } end, }, enable = FUCK_STABILITY, }, ------------------------------------------------------------------------------- { -- FIXME: if view stays open, when saving session, reloading the session results in borked view. 'amrbashir/nvim-docs-view', keys = { { '<leader>tk', '<cmd>DocsViewToggle<cr>', mode = { 'n' }, desc = 'Toggle stable documentation panel.', }, }, cmd = 'DocsViewToggle', opts = { position = 'right', width = 69, }, enable = FUCK_STABILITY, }, ------------------------------------------------------------------------------- { -- TODO: look into demicolon.nvim for ,; repition 'mawkler/refjump.nvim', dependencies = { }, keys = { ']r', '[r' }, opts = {}, enable = FUCK_STABILITY, }, ------------------------------------------------------------------------------- { 'CopilotC-Nvim/CopilotChat.nvim', branch = 'canary', cmd = 'CopilotChat', dependencies = { { 'zbirenbaum/copilot.lua' }, -- or github/copilot.vim { 'nvim-lua/plenary.nvim' }, -- for curl, log wrapper }, build = 'make tiktoken', -- Only on MacOS or Linux opts = { debug = true, -- Enable debugging }, enable = FUCK_STABILITY, }, ------------------------------------------------------------------------------- { 'chrisgrieser/nvim-rulebook', keys = { { '<leader>ri', function () require 'rulebook'.ignoreRule() end }, { '<leader>rl', function () require 'rulebook'.lookupRule() end }, { '<leader>ry', function () require 'rulebook'.yankDiagnosticCode() end }, { '<leader>sf', function () require 'rulebook'.suppressFormatter() end, mode = { 'n', 'x' } }, }, enable = FUCK_STABILITY, }, ------------------------------------------------------------------------------- { 'chrisgrieser/nvim-dr-lsp', event = 'LspAttach', opts = {}, enable = FUCK_STABILITY, }, ------------------------------------------------------------------------------- { 'Wansmer/symbol-usage.nvim', event = 'LspAttach', opts = {}, enable = FUCK_STABILITY, }, ------------------------------------------------------------------------------- { -- FIXME: no worky in wezterm ? -- mouse idle seems to send no event. 'soulis-1256/eagle.nvim', lazy = false, init = function () vim.o.mousemoveevent = true end, enable = FUCK_STABILITY, }, ------------------------------------------------------------------------------- { 'quentingruber/timespent.nvim', keys = { { '<leader>tS', '<cmd>:ShowTimeSpent<cr>', mode = { 'n' }, desc = 'Show time spent', }, }, enable = FUCK_STABILITY, }, ------------------------------------------------------------------------------- { 'nvim-telescope/telescope-frecency.nvim', config = function () require 'telescope'.load_extension 'frecency' end, keys = { { '<c-p><c-f>', '<cmd>Telescope frecency<cr>', mode = { 'n' }, desc = 'telescope: Show recently and frequently used files.', }, }, enable = FUCK_STABILITY, }, { 'cenk1cenk2/scratch.nvim', enable = FUCK_STABILITY, }, ------------------------------------------------------------------------------- { 'AdeAttwood/ivy.nvim', lazy = false, build = 'cargo build --release', opts = {}, enable = FUCK_STABILITY, }, ------------------------------------------------------------------------------- { 'roobert/surround-ui.nvim', lazy = false, dependencies = { 'kylechui/nvim-surround', 'folke/which-key.nvim', }, opts = { root_key = 'ms', }, enable = FUCK_STABILITY, }, ------------------------------------------------------------------------------- { 'rachartier/tiny-inline-diagnostic.nvim', event = 'LspAttach', config = function () require 'tiny-inline-diagnostic'.setup() end, enable = FUCK_STABILITY, }, ------------------------------------------------------------------------------- { 'winston0410/range-highlight.nvim', lazy = false, dependencies = { 'winston0410/cmd-parser.nvim' }, opts = { highlight = 'Visual' }, enable = FUCK_STABILITY, }, ------------------------------------------------------------------------------- { 'chrisgrieser/nvim-lsp-endhints', event = 'LspAttach', opts = { icons = { type = icon.type .. ' ', parameter = icon.paramter, offspec = '', -- hint kind not defined in official LSP spec unknown = icon.hint, -- hint kind }, label = { padding = 2, }, }, enable = FUCK_STABILITY, }, ------------------------------------------------------------------------------- { -- FIXME: does not seem to worky? at least for lua. 'zbirenbaum/neodim', event = 'LspAttach', opts = {}, enable = FUCK_STABILITY, }, ------------------------------------------------------------------------------- { 'rafcamlet/nvim-luapad', cmd = { 'Luapad', 'LuaRun' }, opts = {}, enable = FUCK_STABILITY, }, ------------------------------------------------------------------------------- { 'ravibrock/spellwarn.nvim', event = 'VeryLazy', config = true, enable = FUCK_STABILITY, }, ------------------------------------------------------------------------------- { 'emmanueltouzery/decisive.nvim', config = function () require 'decisive'.setup {} end, lazy = true, ft = { 'csv' }, keys = { { '<leader>cca', ":lua require('decisive').align_csv({})<cr>", { silent = true }, desc = 'Align CSV', mode = 'n' }, { '<leader>ccA', ":lua require('decisive').align_csv_clear({})<cr>", { silent = true }, desc = 'Align CSV clear', mode = 'n' }, { '[c', ":lua require('decisive').align_csv_prev_col()<cr>", { silent = true }, desc = 'Align CSV prev col', mode = 'n' }, { ']c', ":lua require('decisive').align_csv_next_col()<cr>", { silent = true }, desc = 'Align CSV next col', mode = 'n' }, }, enable = FUCK_STABILITY, }, ------------------------------------------------------------------------------- { 'tris203/precognition.nvim', event = 'VeryLazy', opts = { startVisible = true, showBlankVirtLine = true, highlightColor = { link = 'LineNr' }, -- hints = { -- Caret = { text = "^", prio = 2 }, -- Dollar = { text = "$", prio = 1 }, -- MatchingPair = { text = "%", prio = 5 }, -- Zero = { text = "0", prio = 1 }, -- w = { text = "w", prio = 10 }, -- b = { text = "b", prio = 9 }, -- e = { text = "e", prio = 8 }, -- W = { text = "W", prio = 7 }, -- B = { text = "B", prio = 6 }, -- E = { text = "E", prio = 5 }, -- }, -- gutterHints = { -- G = { text = "G", prio = 10 }, -- gg = { text = "gg", prio = 9 }, -- PrevParagraph = { text = "{", prio = 8 }, -- NextParagraph = { text = "}", prio = 8 }, -- }, disabled_fts = ignored.filetypes, }, enable = FUCK_STABILITY, }, ------------------------------------------------------------------------------- { 'folke/lazydev.nvim', dependencies = { 'justinsgithub/wezterm-types' }, ft = 'lua', -- only load on lua files opts = { library = { -- Or relative, which means they will be resolved from the plugin dir. 'lazy.nvim', -- It can also be a table with trigger words / mods -- Only load luvit types when the `vim.uv` word is found { path = 'luvit-meta/library', words = { 'vim%.uv' } }, -- Load the wezterm types when the `wezterm` module is required -- Needs `justinsgithub/wezterm-types` to be installed { path = 'wezterm-types', mods = { 'wezterm' } }, }, }, enable = FUCK_STABILITY, }, { 'shortcuts/no-neck-pain.nvim', lazy = false, enable = FUCK_STABILITY, }, ------------------------------------------------------------------------------- { -- TODO: bind IMove* to alt+h and alt+l with fallback to gomove -- NOTE: if this one does not work out, check https://github.com/Wansmer/sibling-swap.nvim 'mizlan/iswap.nvim', event = 'VeryLazy', enable = FUCK_STABILITY, }, ------------------------------------------------------------------------------- { 'mfussenegger/nvim-dap', dependencies = { { 'debugloop/layers.nvim', opts = {}, }, }, keys = { { '<leader>d', function () local dap = require 'dap' if dap.session() ~= nil then DEBUG_MODE:activate() return end dap.continue() end, desc = 'launch debugger', }, opts = {}, config = function ( _, opts ) local dap = require 'dap' -- do the setup you'd do anyway for your language of choice dap.adapters = opts.adapters dap.configurations = opts.configurations -- this is where the example starts DEBUG_MODE = Layers.mode.new() -- global, accessible from anywhere DEBUG_MODE:auto_show_help() -- this actually relates to the next example, but it is most convenient to add here DEBUG_MODE:add_hook( function ( _ ) vim.cmd 'redrawstatus' -- update status line when toggled end ) -- nvim-dap hooks dap.listeners.after.event_initialized['debug_mode'] = function () DEBUG_MODE:activate() end dap.listeners.before.event_terminated['debug_mode'] = function () DEBUG_MODE:deactivate() end dap.listeners.before.event_exited['debug_mode'] = function () DEBUG_MODE:deactivate() end -- map our custom mode keymaps DEBUG_MODE:keymaps { n = { { 's', function () dap.step_over() end, { desc = 'step forward' }, }, { 'c', function () dap.continue() end, { desc = 'continue' }, }, { -- this acts as a way to leave debug mode without quitting the debugger '<esc>', function () DEBUG_MODE:deactivate() end, { desc = 'exit' }, }, }, } end, }, enable = FUCK_STABILITY, },}new file mode 100644+6 / −0 text lines
+18 / −9 text lines
'debugloop/telescope-undo.nvim', local ivy = themes.get_ivy { layout_config = { preview_width = 0.23, }, } local ivy = themes.get_ivy { layout_config = { preview_width = 0.23 } } zoxide = { prompt_title = 'Navigate deez nuts!', }, zoxide = { prompt_title = 'Navigate deez nuts!' }, telescope.load_extension 'undo'+28 / −1 text lines
local map = require 'std.map'map.normal { description = 'Next todo comment', category = 'navigation', keys = ']t', command = function () require 'todo-comments'.jump_next() end,}map.normal { description = 'Previous todo comment', category = 'navigation', keys = '[t', command = function () require 'todo-comments'.jump_prev() end,}map.normal { description = 'Show TODOs', category = 'navigation', keys = '<leader>T', command = '<cmd>TodoQuickFix<cr>',} dependencies = { 'nvim-lua/plenary.nvim', }, dependencies = { 'nvim-lua/plenary.nvim' },+4 / −3 text lines
vim.api.nvim_cmd( parsed_command, { output = true, } )+4 / −5 text lines
new file mode 100644+1 / −0 text lines
require 'patches.snippet'new file mode 100644+20 / −0 text lines
--- source https://boltlessengineer.github.io/posts/neovim-config-without-plugins/------@param trigger string trigger string for snippet---@param body string snippet text that will be expanded---@param opts? vim.keymap.set.Opts------Refer to <https://microsoft.github.io/language-server-protocol/specification/#snippet_syntax>---for the specification of valid body.function vim.snippet.add( trigger, body, opts ) vim.keymap.set( 'ia', trigger, function () -- If abbrev is expanded with keys like "(", ")", "<cr>", "<space>", -- don't expand the snippet. Only accept "<c-]>" as trigger key. local c = vim.fn.nr2char( vim.fn.getchar( 0 ) ) if c ~= '' then vim.api.nvim_feedkeys( trigger .. c, 'i', true ) return end vim.snippet.expand( body ) end, opts )endnew file mode 100644+38 / −0 text lines
return { win32 = vim.loop.os_uname().sysname:match 'Win', wsl2 = vim.loop.os_uname().release:match 'WSL2', os_background = (function () -- Default value local background = 'light' local uname = vim.uv.os_uname() -- First check whether we are on WSL or Windows if vim.loop.os_uname().release:match 'WSL2' then -- Check if 'reg.exe' is executable if vim.fn.executable 'reg.exe' ~= 0 then -- Execute command to check if the win32 appearance is set to Dark local appsUseLightTheme = vim.fn.system { 'reg.exe', 'Query', 'HKCU\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize', '/v', 'AppsUseLightTheme' } if not appsUseLightTheme:find '0x1' then background = 'dark' end end -- Check if 'busctl' is executable (part of systemd) elseif vim.fn.executable 'busctl' ~= 0 then -- Get the current color scheme from xdg-desktop-portal using busctl local result = vim.fn.system { 'busctl', '--user', 'call', 'org.freedesktop.portal.Desktop', '/org/freedesktop/portal/desktop', 'org.freedesktop.portal.Settings', 'ReadOne', 'ss', 'org.freedesktop.appearance', 'color-scheme', } -- The result is in the form of "v u 0" for light and "v u 1" for dark local color_scheme = result:match 'u%s+(%d+)' if color_scheme == '1' then background = 'dark' end else end return background end)(),}+3 / −1 text lines
+4 / −0 text lines
+104 / −25 text lines
return { random = function () local selected = 'JetBrains Mono' -- safe default, because built in to wezterm local font_names = {} local weights = {} local total_weight = 1 -- to account for luas 1 based indexing local code_fonts = io.open( wez.config_dir .. '/bugabinga/code_fonts.csv', 'r' ) if code_fonts then for line in code_fonts:lines() do local weight, font_name = line:match '^%s*(%d*)%s*,%s*(.*)%s*$' table.insert( font_names, font_name ) table.insert( weights, tonumber( weight ) ) total_weight = total_weight + weightlocal adjust_font_randomness_weight = function ( font_family, adjust ) local code_fonts = io.open( wez.config_dir .. '/bugabinga/code_fonts.csv', 'r+' ) if code_fonts then local new_lines = {} for line in code_fonts:lines() do local weight, font_name = line:match '^%s*(%d+)%s*,%s*(.-)%s*$' if not weight or not font_name then wez.log_error 'Could not parse code_fonts.csv. Borked?' return code_fonts:close() weight = tonumber( weight ) if font_name == font_family then weight = math.max( 0, adjust( weight ) ) end table.insert( new_lines, weight .. ', ' .. font_name ) end code_fonts:seek( 'set', 0 ) for _, new_line in ipairs( new_lines ) do code_fonts:write( new_line, '\n' ) end code_fonts:close() else wez.log_error 'Unable to read and write code_fonts.csv!' endend local random_weight = math.random( total_weight ) local cursor = 0 for idx, weight in ipairs( weights ) do cursor = cursor + weight if cursor >= random_weight then selected = font_names[idx] break end-- like the current font.-- liked fonts have higher probablity of being picked on wezterm boot.-- increase the weight of the font in code_fonts.csv.-- not to be confused with a font weigth (aka bold).-- here weight means the likelyhood of being "randomly" picked.local like_current_font = function ( window ) local font = window:effective_config().font.font -- not sure why font is a list local family = font[1].family adjust_font_randomness_weight( family, function ( weight ) local new_weight = weight + 1 -- TODO: remove notification once weight is displayed in status window:toast_notification( 'code_fonts', 'Font ' .. family .. '(' .. new_weight .. ') liked! ', nil, 500 ) return new_weight end )endlocal dislike_current_font = function ( window ) local font = window:effective_config().font.font -- not sure why font is a list local family = font[1].family adjust_font_randomness_weight( family, function ( weight ) local new_weight = weight - 1 window:toast_notification( 'code_fonts', 'Font ' .. family .. '(' .. new_weight .. ') NOT liked! ', nil, 500 ) return new_weight end )endlocal ban_current_font = function ( window ) local font = window:effective_config().font.font -- not sure why font is a list local family = font[1].family adjust_font_randomness_weight( family, function () window:toast_notification( 'code_fonts', 'Font ' .. family .. ' BANNED!', nil, 500 ) return 0 end )end-- register those events with wezterm, so that key binds can trigger themwez.on( 'like-current-font', like_current_font )wez.on( 'dislike-current-font', dislike_current_font )wez.on( 'ban-current-font', ban_current_font )local random = function () local selected = 'JetBrains Mono' -- safe default, because built in to wezterm local font_names = {} local weights = {} local total_weight = 1 -- to account for luas 1 based indexing local code_fonts = io.open( wez.config_dir .. '/bugabinga/code_fonts.csv', 'r' ) if code_fonts then for line in code_fonts:lines() do local weight, font_name = line:match '^%s*(%d+)%s*,%s*(.-)%s*$' if not weight or not font_name then wez.log_error 'Could not parse code_fonts.csv. Borked?' break end weight = tonumber( weight ) table.insert( font_names, font_name ) table.insert( weights, weight ) total_weight = total_weight + weight end code_fonts:close() local random_weight = math.random( total_weight ) local cursor = 0 for idx, weight in ipairs( weights ) do cursor = cursor + weight if cursor >= random_weight then selected = font_names[idx] break end+110 / −110 text lines
1, Anonymous Pro 1, Anonymous Pro Minus 1, Aurulent Sans Mono 1, AverageMono 1, BPmono 1, BigBlue TerminalPlus 1, Bitstream Vera Sans Mono 1, Bront 1, CMU Typewriter Text 1, CPMono_v07 1, CamingoCode 1, Cascadia Code 1, Code New Roman 1, CodingFontTobi 1, Consola Mono 1, Courier Prime Code 1, Cousine 1, Crisp 1, Cutive Mono 1, D2Coding 1, DejaVu Sans Mono 1, Dina ttf 10px 1, Droid Sans Mono 1, Edlo 1, Envy Code R 1, Fantasque Sans Mono 1, Fira Code 1, Fira Mono 1, Fixedsys Excelsior 3.01 1, FreeMono 1, Geist Mono 1, Generic Mono II 1, GohuFont 1, Hack 1, Hasklig 10, Hermit 10, IBM Plex Mono 1, Inconsolata 1, Inconsolata LGC 1, Inconsolata-dz 1, Inconsolata-g 1, Intel One Mono 1, Iosevka 1, Iosevka Slab 1, JetBrains Mono 1, JetBrains Mono NL 1, Kawkab Mono 1, Latin Modern Mono Light 10, Lekton 1, Liberation Mono 1, Lilex 1, Linux Libertine Mono 1, Luculent 1, Luxi Mono 1, M+ 1m 1, M+ 1mn 1, M+ 2m 1, Martian Mono 1, Mensch 0, Meslo LG M DZ 1, Metrickal 1, Monaspace Argon Var 1, Monaspace Krypton Var 1, Monaspace Neon Var 1, Monaspace Radon Var 1, Monaspace Xenon Var 1, MonoSpatial 1, Monoid 1, Monospace 1, MonteCarlo Fixed 12 1, NanumGothic_Coding 1, NotCourierSans 1, Office Code Pro 1, Office Code Pro D 1, Oxygen Mono 1, PT Mono 1, Panic Sans 0, PixelCarnageMonoTT 1, Pointfree 1, ProFontWindows 1, ProggyCleanTT 1, ProggyCleanTTSZ 1, ProggySmallTT 1, ProggySquareTT 1, ProggySquareTTSZ 1, ProggyTinyTT 1, ProggyTinyTTSZ 1, Rec Mono Casual 1, Rec Mono Linear 1, Roboto Mono 1, SV Basic Manual 1, Share Tech Mono 1, Share-TechMonoTrue 1, SmallTypeWriting 1, Source Code Pro 1, Sudo 1, Symbols Nerd Font 1, Symbols Nerd Font Mono 1, TeX Gyre Cursor 1, Terminus 1, Ubuntu Mono 1, Verily Serif Mono 1, Victor Mono 1, Whois 1, agave 1, iA Writer Mono V 1, monoOne 1, monofur 1, mononoki 20, saxMono1, Anonymous Pro1, Anonymous Pro Minus1, Aurulent Sans Mono1, AverageMono1, BPmono1, BigBlue TerminalPlus1, Bitstream Vera Sans Mono1, Bront1, CMU Typewriter Text1, CPMono_v071, CamingoCode1, Cascadia Code1, Code New Roman1, CodingFontTobi1, Consola Mono1, Courier Prime Code1, Cousine1, Crisp1, Cutive Mono1, D2Coding1, DejaVu Sans Mono1, Dina ttf 10px1, Droid Sans Mono1, Edlo1, Envy Code R1, Fantasque Sans Mono1, Fira Code1, Fira Mono1, Fixedsys Excelsior 3.011, FreeMono1, Geist Mono20, Generic Mono II1, GohuFont1, Hack1, Hasklig11, Hermit11, IBM Plex Mono1, Inconsolata1, Inconsolata LGC1, Inconsolata-dz1, Inconsolata-g1, Intel One Mono1, Iosevka1, Iosevka Slab0, JetBrains Mono0, JetBrains Mono NL1, Kawkab Mono1, Latin Modern Mono Light11, Lekton1, Liberation Mono1, Lilex1, Linux Libertine Mono1, Luculent1, Luxi Mono1, M+ 1m1, M+ 1mn1, M+ 2m1, Martian Mono1, Mensch0, Meslo LG M DZ1, Metrickal1, Monaspace Argon Var1, Monaspace Krypton Var1, Monaspace Neon Var1, Monaspace Radon Var1, Monaspace Xenon Var1, MonoSpatial1, Monoid1, Monospace1, MonteCarlo Fixed 121, NanumGothic_Coding1, NotCourierSans1, Office Code Pro1, Office Code Pro D6, Oxygen Mono1, PT Mono1, Panic Sans0, PixelCarnageMonoTT1, Pointfree1, ProFontWindows1, ProggyCleanTT1, ProggyCleanTTSZ1, ProggySmallTT1, ProggySquareTT1, ProggySquareTTSZ1, ProggyTinyTT1, ProggyTinyTTSZ1, Rec Mono Casual1, Rec Mono Linear1, Roboto Mono1, SV Basic Manual1, Share Tech Mono1, Share-TechMonoTrue1, SmallTypeWriting1, Source Code Pro1, Sudo1, Symbols Nerd Font1, Symbols Nerd Font Mono1, TeX Gyre Cursor1, Terminus1, Ubuntu Mono0, Verily Serif Mono1, Victor Mono1, Whois1, agave1, iA Writer Mono V1, monoOne1, monofur1, mononoki0, saxMono+1 / −1 text lines
+24 / −5 text lines
wez.on("inc-font-size", function(window) local size = window:effective_config().font_size + 1 local overrides = window:get_config_overrides() or {} overrides.font_size = size window:set_config_overrides(overrides)end)wez.on("dec-font-size", function(window) local size = window:effective_config().font_size - 1 local overrides = window:get_config_overrides() or {} overrides.font_size = size window:set_config_overrides(overrides)end) action = wez.action.ActivateKeyTable { name = font_size_mode, one_shot = false, }, action = wez.action.ActivateKeyTable { name = font_mode, one_shot = false, }, -- FIXME: move to workspace module and use emitevent instead of custom_action+2 / −2 text lines