Merge branch 'trunk' of github.com:bugabinga/dotfiles into trunk
0bacce5c4200feecaf509c4655c7ce39c0bf4473
Oliver Jan Krylow <oliver@bugabinga.net> ·
unsigned
- Parent 1: 97f822f8e283 · Diff against parent 1
- Parent 2: d7dbe193daec · Showing diff
bugabingas dorkfiles
0bacce5c4200feecaf509c4655c7ce39c0bf4473
Oliver Jan Krylow <oliver@bugabinga.net> ·
unsigned
+1009 / −419 text lines · all files grouped into 32 bars · 1 binary (striped old/new sizes in 64-byte units, not churn) · lines and sizes scale separately
+3 / −0 text lines
+1 / −0 text lines
* stabilize plugins that are only dependencies. move to own file?+25 / −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" }, "iswap.nvim": { "branch": "master", "commit": "e02cc91f2a8feb5c5a595767d208c54b6e3258ec" }, "layers.nvim": { "branch": "main", "commit": "67666f59a2dbe36a469766be6a4c484ae98c4895" }, "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-lsp-endhints": { "branch": "main", "commit": "391ef40521b631a8a2fb7aef78db6967ead6b39d" }, "nvim-luapad": { "branch": "master", "commit": "176686eb616a5ada5dfc748f2b5109194bbe8a71" }, "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" }, "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" }, "vim-vscode-snippets": { "branch": "master", "commit": "c34e9edee6a00cf3d0b8edb515e08e3df450bcfa" }, "virt-column.nvim": { "branch": "master", "commit": "b62b4ef0774d19452d4ed18e473e824c7a756f2f" }, "wezterm-types": { "branch": "main", "commit": "1518752906ba3fac0060d9efab6e4d3ec15d4b5a" },+1 / −1 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' },+0 / −21 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',}+6 / −1 text lines
command = function () vim.highlight.on_yank() end,+55 / −43 text lines
'SergioRibera/cmp-dotenv', 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 = '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',+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'+2 / −1 text lines
---@diagnostic disable-next-line: param-type-mismatchnew 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)(),}+4 / −0 text lines
+1 / −0 text lines
Binary size (old → new): 1393 → 1398 bytes.
+1 / −0 text lines
new file mode 100644+85 / −0 text lines
### bugabingas custom note taking and organizing system###### notes are grouped into contexts (folders), so that i can distinguish between### personal and work related notes.def validate_context [ context: string] { if not ($env.NOTES | path exists) { error make { msg: "No notes folder found in environment variables. Make sure a NOTES variable exists in $env." } } if not ($env.NOTES | path join $context | path exists) {error make { msg: $"The given context ($context) does not exist in ($env.NOTES). Create it and try again." } }} export def main [ --context: string = "bugabinga" # which context do the notes belong to] { # TODO: the context needs to get overridden by env var, so that switch between work and personal is easy validate_context $context ls --short-names ($env.NOTES | path join $context) # TODO: print some high level view of the notes. tree, graph, text ?}def new_note_id [] { random binary 3 | encode new-base64 --nopad --url }def new_note [ title: string # title of note. will be used for title and initial heading author: string # author, usually me... date: string # creation date of note tags: list<string> # a list of tags, if already known context: string # note context] { $"---title: ($title)author: ($author)date: ($date)tags:- ($context)($tags | each { '- ' + $in } | str join (char nl))---"}export def new [ title?: string # title of new node --tags: list<string> # some optional tags for the note --context: string = "bugabinga" # which context do the notes belong to] { validate_context $context let title = if ($title | is-empty) { input "gimme title: " } else { $title } let author = 'Oliver Jan Krylow' let now = date now | date to-record let date = $"($now.day)/($now.month)/($now.year)" # german dates. what can i say... let tags = if ($tags == null) { [] } else { $tags } let note_content = new_note $title $author $date $tags $context let note_file_name = $"(new_note_id)-($title | str kebab-case).md" let note_file = [ $env.NOTES $context $note_file_name] | path join if ($note_file | path exists) { error make { msg: "the note you are trying to create exists already" } } $note_content | save --raw $note_file let editor = if ( $env.EDITOR == null ) { 'vi' } else { $env.EDITOR } let editor = if ( $env.VISUAL == null ) { $editor } else { $env.VISUAL } run-external $editor $note_file}+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 enddeleted file mode 100644+0 / −116 text lines
Anonymous ProAnonymous Pro MinusAurulent Sans MonoAverageMonoBPmonoBigBlue TerminalPlusBitstream Vera Sans MonoBrontCMU Typewriter TextCPMono_v07CamingoCodeCascadia CodeCode New RomanCodingFontTobiConsola MonoCourier Prime CodeCousineCrispCutive MonoD2CodingDejaVu Sans MonoDina ttf 10pxDroid Sans MonoEdloEnvy Code RFantasque Sans MonoFira CodeFira MonoFixedsys Excelsior 3.01FreeMonoGeist MonoGeneric Mono IIGohuFontHackHaskligHermit# IBM Plex MathIBM Plex Mono# IBM Plex Sans# IBM Plex Sans Condensed# IBM Plex SerifInconsolataInconsolata LGCInconsolata-dzInconsolata-gIntel One MonoIosevkaIosevka SlabJetBrains MonoJetBrains Mono NLKawkab MonoLatin Modern Mono LightLektonLiberation MonoLilexLinux Libertine MonoLuculentLuxi MonoM+ 1mM+ 1mnM+ 2mMartian MonoMenschMeslo LG M DZMetrickalMonaspace Argon VarMonaspace Krypton VarMonaspace Neon VarMonaspace Radon VarMonaspace Xenon VarMonoSpatialMonoidMonospaceMonospaceTypewriterMonteCarlo Fixed 12NanumGothic_CodingNimbus MonoNotCourierSansOffice Code ProOffice Code Pro DOxygen MonoPT MonoPanic SansPixelCarnageMonoTTPointfreeProFontWindowsProggyCleanTTProggyCleanTTSZProggySmallTTProggySquareTTProggySquareTTSZProggyTinyTTProggyTinyTTSZRec Mono CasualRec Mono LinearRoboto MonoSV Basic ManualShare Tech MonoShare-TechMonoTrueSmallTypeWritingSource Code ProSudoSymbols Nerd FontSymbols Nerd Font MonoTeX Gyre CursorTerminusUbuntu MonoVerily Serif MonoVictor MonoWhoisagaveiA Writer Mono VmonoOnemonofurmononokisaxMono+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 1, 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 1, 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
+46 / −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 { key = 'm', mods = 'LEADER', action = custom_action( function ( window, pane ) local unix_domain = 'unix' wez.log_info( 'Current pane domain name: ', pane:get_domain_name() ) if pane:get_domain_name() == unix_domain then wez.log_info( 'Detaching from: ', unix_domain ) window:perform_action( wez.action.DetachDomain { DomainName = unix_domain, }, pane ) else wez.log_info( 'Switching to: ', unix_domain ) window:perform_action( wez.action.AttachDomain( unix_domain ), pane ) end end ), },+1 / −0 text lines
+27 / −19 text lines
return function(cfg) cfg.default_cwd = wez.home_dir cfg.inactive_pane_hsb = { saturation = 0.42, brightness = 0.69, } cfg.default_cursor_style = 'SteadyBlock' cfg.check_for_updates = false cfg.audible_bell = 'Disabled' cfg.visual_bell = { fade_in_duration_ms = 69, fade_out_duration_ms = 69, target = 'CursorColor', } cfg.cursor_blink_rate = 0 cfg.front_end = 'WebGpu' cfg.max_fps = 144 cfg.unzoom_on_switch_pane = true cfg.scrollback_lines = 16777216return function ( cfg ) cfg.default_cwd = wez.home_dir cfg.inactive_pane_hsb = { saturation = 0.42, brightness = 0.69, } cfg.default_cursor_style = 'SteadyBlock' cfg.check_for_updates = false cfg.audible_bell = 'Disabled' cfg.visual_bell = { fade_in_duration_ms = 69, fade_out_duration_ms = 69, target = 'CursorColor', } cfg.cursor_blink_rate = 0 cfg.front_end = 'WebGpu' cfg.max_fps = 144 cfg.unzoom_on_switch_pane = true cfg.scrollback_lines = 16777216 cfg.unix_domains = { { name = 'unix', no_serve_automatically = true, -- managed via systemd -- multiplexing = "WezTerm", local_echo_threshold_ms = 10, }, }+14 / −10 text lines
+1 / −2 text lines