diff --git a/desktop/.config/waybar/config b/desktop/.config/waybar/config index 81d4e74..e0d7ca1 100644 --- a/desktop/.config/waybar/config +++ b/desktop/.config/waybar/config @@ -49,12 +49,16 @@ "on-click-right": "$TERMINAL start --class float glances" }, "custom/events": { - "format": "{}", - "interval": 300, - "exec": "~/.config/waybar/modules/khal.py 2>/dev/null", "exec-if": "command -v khal >/dev/null 2>&1", + "exec": "~/.config/waybar/modules/khal.py 2>/dev/null", "return-type": "json", - "on-click": "$TERMINAL start --class float ikhal" + "interval": 300, + "on-click": "$TERMINAL start --class float ikhal", + "format": "{icon}{}", + "format-icons": { + "event": " ", + "no-event": "", + }, }, "memory": { "interval": 30, @@ -138,7 +142,7 @@ "tag-labels": [ "", "", "", "", "", "", "", "", "", "" ] }, "river/mode": { - "format": "{} 󱐁", + "format": "{} ", }, "river/window": { "format": " {}", @@ -172,10 +176,10 @@ "interval": 60, }, "custom/vidl": { - "format": "{} {icon}", + "format": "{icon}{}", "format-alt-click": "right", "format-icons": { - "default": "" + "default": " " }, "exec": "wc -l ~/.local/share/vidl/vidl_queue | cut -d' ' -f1", "exec-if": "[ -f ~/.local/share/vidl/vidl_queue ]", diff --git a/desktop/.config/waybar/modules/khal.py b/desktop/.config/waybar/modules/khal.py index ba96199..6dc3971 100755 --- a/desktop/.config/waybar/modules/khal.py +++ b/desktop/.config/waybar/modules/khal.py @@ -1,10 +1,14 @@ #!/usr/bin/env python # from https://gist.github.com/bjesus/178a9bd3453470d74803945dbbf9ed40 # List upcoming khal events in simple json container fit for waybar +# +# Hovering over the item displays all upcoming +# The icon changes if there are events today, and displays the +# closest upcoming one. -import subprocess import datetime import json +import subprocess from html import escape data = {} @@ -17,19 +21,19 @@ output = subprocess.check_output("khal list now " + next_week, shell=True) output = output.decode("utf-8") lines = output.split("\n") -new_lines = [] +new_lines: list[str] = [] for line in lines: clean_line = escape(line).split(" ::")[0] - if len(clean_line) and not clean_line[0] in ["0", "1", "2"]: + if len(clean_line) and clean_line[0] not in ["0", "1", "2"]: clean_line = "\n" + clean_line + "" new_lines.append(clean_line) output = "\n".join(new_lines).strip() -if today in output: - data["text"] = " " + output.split("\n")[1] -else: - data["text"] = " " - +data["alt"] = "no-event" data["tooltip"] = output +if today in output: + data["text"] = output.split("\n")[1] + data["alt"] = "event" + print(json.dumps(data)) diff --git a/nvim/.config/nvim/after/ftplugin/markdown.lua b/nvim/.config/nvim/after/ftplugin/markdown.lua index 84ad5c0..d7f2888 100644 --- a/nvim/.config/nvim/after/ftplugin/markdown.lua +++ b/nvim/.config/nvim/after/ftplugin/markdown.lua @@ -1,8 +1,10 @@ local map = vim.keymap.set if require("core.util").is_available("which-key") then - require("which-key").register({ ["c"] = { name = "+codecells" } }) - require("which-key").register({ ["e"] = { name = "+criticmarkup" } }) + require("which-key").add({ + { "c", group = "codecells" }, + { "e", group = "criticmarkup" }, + }) end if require("core.util").is_available("zk") and require("zk.util").notebook_root(vim.fn.expand("%:p")) ~= nil then @@ -23,7 +25,7 @@ map("n", "co", "o```python```k", { desc = "Insert quar map("n", "cO", "O```python```k", { desc = "Insert quarto cell above" }) if require("core.util").is_available("which-key") then - require("which-key").register({ ["p"] = { name = "+prose" } }) + require("which-key").add({ "p", group = "prose" }) end -- show nice md preview in browser (auto-syncs scrolling) if require("core.util").is_available("peek") then diff --git a/nvim/.config/nvim/after/ftplugin/quarto.lua b/nvim/.config/nvim/after/ftplugin/quarto.lua index 39fecf5..565bf04 100644 --- a/nvim/.config/nvim/after/ftplugin/quarto.lua +++ b/nvim/.config/nvim/after/ftplugin/quarto.lua @@ -1,3 +1,4 @@ + local default_buffer_session = function() local buffer_path = vim.api.nvim_buf_get_name(0) or vim.fn.tempname() local temp_path = vim.fn.stdpath("run") .. "/molten-sessions" .. buffer_path .. ".json" @@ -15,7 +16,7 @@ local startsession = function(file, args) local path = require("core.util").get_python_venv_bin() if not path then - return + return end vim.g["python3_host_prog"] = path @@ -41,30 +42,17 @@ local startsession = function(file, args) }) end vim.api.nvim_create_user_command("JupyterStart", function() - startsession() + startsession(vim.b["sessionfile"] or default_buffer_session()) end, {}) -vim.api.nvim_create_autocmd({"InsertEnter", "BufEnter"}, { - callback = function() - if vim.b["sessionfile"] == nil then - local path = default_buffer_session() - vim.b["sessionfile"] = path - vim.schedule_wrap(startsession(path)) - end - end, -}) --- -- -- TODO find better way to enable lsp key mappings for quarto buffers --- -- local prefix = require("which-key").register --- -- prefix({ ["l"] = { name = "+lsp" } }) --- -- map("n", "li", "LspInfo", { buffer = bufnr, desc = "Lsp Info" }) --- -- map("n", "ld", "lua vim.diagnostic.open_float()", { buffer = bufnr, desc = "Line diagnostics" }) --- -- map("n", "la", "lua vim.lsp.buf.code_action()", { buffer = bufnr, desc = "Codeactions" }) --- -- map("n", "ln", "lua vim.lsp.buf.rename()", { buffer = bufnr, desc = "Rename element" }) --- -- map("n", "lr", "lua vim.lsp.buf.references()", { buffer = bufnr, desc = "References" }) --- -- --- -- map("n", "gD", "lua vim.lsp.buf.declaration()", { buffer = bufnr, desc = "Declaration" }) --- -- map("n", "gs", "lua vim.lsp.buf.signature_help()", { buffer = bufnr, desc = "Signature help" }) --- -- map("n", "gI", "lua vim.lsp.buf.implementation()", { buffer = bufnr, desc = "Implementation" }) --- -- map("n", "gt", "lua vim.lsp.buf.type_definition()", { buffer = bufnr, desc = "Type definition" }) - --- vim.g["python3_host_prog"] = vim.fn.expand(require("core.util").get_python_venv()) +if vim.g.quarto_auto_init_molten_session then + vim.api.nvim_create_autocmd({ "InsertEnter", "BufEnter" }, { + callback = function() + if vim.b["sessionfile"] == nil then + local path = default_buffer_session() + vim.b["sessionfile"] = path + vim.schedule_wrap(startsession(path)) + end + end, + }) +end diff --git a/nvim/.config/nvim/lazy-lock.json b/nvim/.config/nvim/lazy-lock.json index fe88133..90e03e5 100644 --- a/nvim/.config/nvim/lazy-lock.json +++ b/nvim/.config/nvim/lazy-lock.json @@ -4,9 +4,9 @@ "FixCursorHold.nvim": { "branch": "master", "commit": "1900f89dc17c603eec29960f57c00bd9ae696495" }, "LuaSnip": { "branch": "master", "commit": "03c8e67eb7293c404845b3982db895d59c0d1538" }, "Navigator.nvim": { "branch": "master", "commit": "91d86506ac2a039504d5205d32a1d4bc7aa57072" }, - "aerial.nvim": { "branch": "master", "commit": "4d10acbcb760802ea74381ac3ed98cbb6e5f7805" }, + "aerial.nvim": { "branch": "master", "commit": "7e2615991cf110f6688112abcb45cf338248d1f6" }, "bats.vim": { "branch": "master", "commit": "6a5d2ef22b0ede503d867770afd02ebb1f97b709" }, - "cmp-beancount": { "branch": "main", "commit": "c8a2533828b84546ae279d60137aec92bd52dc72" }, + "cmp-beancount": { "branch": "main", "commit": "29e23297c06b9d69771e4b14e0fb3b9d583a150e" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, "cmp-calc": { "branch": "main", "commit": "5947b412da67306c5b68698a02a846760059be2e" }, "cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" }, @@ -23,12 +23,12 @@ "cmp-treesitter": { "branch": "master", "commit": "958fcfa0d8ce46d215e19cc3992c542f576c4123" }, "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, "completion-vcard": { "branch": "master", "commit": "2220fd517a985ececed1adcf0e5be8f2815564c7" }, - "conform.nvim": { "branch": "master", "commit": "60e6fbddbdf37d7790de07dc7420beefaf650e5e" }, + "conform.nvim": { "branch": "master", "commit": "ae213f5169d5d0c6abbe76e1438d932772fc1657" }, "dial.nvim": { "branch": "master", "commit": "54b503f906bc9e5ab85288414840a1b86d40769f" }, "dressing.nvim": { "branch": "master", "commit": "71349f24c6e07b39f33600985843c289ca735308" }, "fidget.nvim": { "branch": "main", "commit": "ef99df04a1c53a453602421bc0f756997edc8289" }, - "flash.nvim": { "branch": "main", "commit": "7bb4a9c75d1e20cd24185afedeaa11681829ba23" }, - "friendly-snippets": { "branch": "main", "commit": "682157939e57bd6a2c86277dfd4d6fbfce63dbac" }, + "flash.nvim": { "branch": "main", "commit": "ec0bf2842189f65f60fd40bf3557cac1029cc932" }, + "friendly-snippets": { "branch": "main", "commit": "00ebcaa159e817150bd83bfe2d51fa3b3377d5c4" }, "fwatch.nvim": { "branch": "main", "commit": "a691f7349dc66285cd75a1a698dd28bca45f2bf8" }, "git-conflict.nvim": { "branch": "main", "commit": "bfd9fe6fba9a161fc199771d85996236a0d0faad" }, "gitsigns.nvim": { "branch": "main", "commit": "0b04035bb7b3c83e999b9676e2fb46fd0aa9f910" }, @@ -37,40 +37,40 @@ "image.nvim": { "branch": "master", "commit": "da64ce69598875c9af028afe129f916b02ccc42e" }, "img-clip.nvim": { "branch": "main", "commit": "fc30500c35663aa1762697f5aba31d43b86028f0" }, "jupytext.nvim": { "branch": "main", "commit": "c8baf3ad344c59b3abd461ecc17fc16ec44d0f7b" }, - "lazy.nvim": { "branch": "main", "commit": "c882227f1fdc4580d14212df8f814a0772951e3d" }, + "lazy.nvim": { "branch": "main", "commit": "839f9e78e78dc935b1188fb16583365991739c51" }, "lsp-setup.nvim": { "branch": "main", "commit": "6e4e977512ce426d8b52c27f3b6e6aefc73e1452" }, "ltex_extra.nvim": { "branch": "dev", "commit": "57192d7ae5ba8cef3c10e90f2cd62d4a7cdaab69" }, - "lualine.nvim": { "branch": "master", "commit": "0a5a66803c7407767b799067986b4dc3036e1983" }, + "lualine.nvim": { "branch": "master", "commit": "544dd1583f9bb27b393f598475c89809c4d5e86b" }, "luarocks.nvim": { "branch": "main", "commit": "1db9093915eb16ba2473cfb8d343ace5ee04130a" }, "markmap.nvim": { "branch": "main", "commit": "5fb6755cf5434511cc23a4936c9eb76b9142fba5" }, "mason-conform.nvim": { "branch": "main", "commit": "abce2be529f3b4b336c56d0ba6336a9144e0fee6" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "9ae570e206360e47d30b4c35a4550c165f4ea7b7" }, - "mason-nvim-lint": { "branch": "main", "commit": "637a5b8f1b454753ec70289c4996d88a50808642" }, + "mason-nvim-lint": { "branch": "main", "commit": "b579a00ee39dcd590b1023028dc8fb3d203a67b0" }, "mason.nvim": { "branch": "main", "commit": "c43eeb5614a09dc17c03a7fb49de2e05de203924" }, "mdeval.nvim": { "branch": "master", "commit": "2c32e2f3e7d8f222e7a4724989f218d036e1081d" }, "mini.nvim": { "branch": "main", "commit": "19e1584124cda35388d4fdb911eab7124014e541" }, - "molten-nvim": { "branch": "main", "commit": "df5ccef3b6fda3582f7746e45327ee031f668826" }, + "molten-nvim": { "branch": "main", "commit": "eb6d0fe33e14989b0f1fbe25d9732889ee57bd1a" }, "neogen": { "branch": "main", "commit": "0daffcec249bf42275e322361fe55b89a05ff278" }, - "neotest": { "branch": "master", "commit": "f30bab1faef13d47f3905e065215c96a42d075ad" }, + "neotest": { "branch": "master", "commit": "32ff2ac21135a372a42b38ae131e531e64833bd3" }, "neotest-python": { "branch": "master", "commit": "81d2265efac717bb567bc15cc652ae10801286b3" }, "nvim-FeMaco.lua": { "branch": "main", "commit": "96bbf843595dbe865838b3f2484b73557f34700c" }, - "nvim-cmp": { "branch": "main", "commit": "a110e12d0b58eefcf5b771f533fc2cf3050680ac" }, - "nvim-colorizer.lua": { "branch": "master", "commit": "85855b38011114929f4058efc97af1059ab3e41d" }, + "nvim-cmp": { "branch": "main", "commit": "d818fd0624205b34e14888358037fb6f5dc51234" }, + "nvim-colorizer.lua": { "branch": "master", "commit": "08bd34bf0ed79723f62764c7f9ca70516d461d0d" }, "nvim-coverage": { "branch": "main", "commit": "aa4b4400588e2259e87e372b1e4e90ae13cf5a39" }, "nvim-lint": { "branch": "master", "commit": "efc6fc83f0772283e064c53a8f9fb5645bde0bc0" }, - "nvim-lspconfig": { "branch": "master", "commit": "53a3c6444ec5006b567071614c83edc8ad651f6d" }, - "nvim-nio": { "branch": "master", "commit": "7969e0a8ffabdf210edd7978ec954a47a737bbcc" }, + "nvim-lspconfig": { "branch": "master", "commit": "fa6c2a64100c6f692bbec29bbbc8ec2663c9e869" }, + "nvim-nio": { "branch": "master", "commit": "a428f309119086dc78dd4b19306d2d67be884eee" }, "nvim-surround": { "branch": "main", "commit": "ec2dc7671067e0086cdf29c2f5df2dd909d5f71f" }, - "nvim-toggleterm.lua": { "branch": "main", "commit": "066cccf48a43553a80a210eb3be89a15d789d6e6" }, - "nvim-tree.lua": { "branch": "master", "commit": "2086e564c4d23fea714e8a6d63b881e551af2f41" }, + "nvim-toggleterm.lua": { "branch": "main", "commit": "48be57eaba817f038d61bbf64d2c597f578c0827" }, + "nvim-tree.lua": { "branch": "master", "commit": "f9ff00bc06d7cb70548a3847d7a2a05e928bc988" }, "nvim-treesitter": { "branch": "master", "commit": "f197a15b0d1e8d555263af20add51450e5aaa1f0" }, "nvim-treesitter-context": { "branch": "master", "commit": "5efba33af0f39942e426340da7bc15d7dec16474" }, "nvim-treesitter-endwise": { "branch": "master", "commit": "8b34305ffc28bd75a22f5a0a9928ee726a85c9a6" }, "nvim-treesitter-textsubjects": { "branch": "master", "commit": "a8d2844bba925d9450ef7ab215f3b054028288ca" }, - "nvim-ts-autotag": { "branch": "main", "commit": "ddfccbf0df1b9349c2b9e9b17f4afa8f9b6c1ed1" }, - "nvim-ts-context-commentstring": { "branch": "main", "commit": "cb064386e667def1d241317deed9fd1b38f0dc2e" }, + "nvim-ts-autotag": { "branch": "main", "commit": "1624866a1379fc1861797f0ed05899a9c1d2ff61" }, + "nvim-ts-context-commentstring": { "branch": "main", "commit": "6b5f95aa4d24f2c629a74f2c935c702b08dbde62" }, "nvim-web-devicons": { "branch": "master", "commit": "5b9067899ee6a2538891573500e8fd6ff008440f" }, - "otter.nvim": { "branch": "main", "commit": "45db1799625eacda838c196c728974058d922d80" }, + "otter.nvim": { "branch": "main", "commit": "837f258040d0174ff8495584088046f98499b1ac" }, "peek.nvim": { "branch": "master", "commit": "5820d937d5414baea5f586dc2a3d912a74636e5b" }, "plenary.nvim": { "branch": "master", "commit": "50012918b2fc8357b87cff2a7f7f0446e47da174" }, "popup.nvim": { "branch": "master", "commit": "b7404d35d5d3548a82149238289fa71f7f6de4ac" }, @@ -78,11 +78,11 @@ "rainbow-delimiters.nvim": { "branch": "master", "commit": "12b1a1e095d968887a17ef791c2edb78d7595d46" }, "smartcolumn.nvim": { "branch": "main", "commit": "d01b99355c7fab13233f48d0f28dc097e68a03f7" }, "stickybuf.nvim": { "branch": "master", "commit": "2160fcd536d81f5fa43f7167dba6634e814e3154" }, - "telescope-fzf-native.nvim": { "branch": "main", "commit": "935bedf39c440de2f97ce58dbbb44a40402057c1" }, + "telescope-fzf-native.nvim": { "branch": "main", "commit": "cf48d4dfce44e0b9a2e19a008d6ec6ea6f01a83b" }, "telescope-luasnip.nvim": { "branch": "master", "commit": "11668478677de360dea45cf2b090d34f21b8ae07" }, "telescope.nvim": { "branch": "master", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" }, "texpresso.vim": { "branch": "main", "commit": "1cc949fde8ed3220968039b6b1b6ccdd9f475087" }, - "trouble.nvim": { "branch": "main", "commit": "57761ba7148164f0315ed203e714ac242329abd4" }, + "trouble.nvim": { "branch": "main", "commit": "40c5317a6e90fe3393f07b0fee580d9e93a216b4" }, "twilight.nvim": { "branch": "main", "commit": "8bb7fa7b918baab1ca81b977102ddb54afa63512" }, "undotree": { "branch": "main", "commit": "eab459ab87dd249617b5f7187bb69e614a083047" }, "vifm.vim": { "branch": "master", "commit": "a8130c37d144b51d84bee19f0532abcd3583383f" }, @@ -91,8 +91,8 @@ "vim-pandoc-syntax": { "branch": "master", "commit": "16939cda184ff555938cc895cc62477c172997f9" }, "vim-spellsync": { "branch": "master", "commit": "3d6dd50de9c4d953cc16638112a6ae196df41463" }, "wezterm.nvim": { "branch": "main", "commit": "f73bba23ab4becd146fa2d0a3a16a84b987eeaca" }, - "which-key.nvim": { "branch": "main", "commit": "0539da005b98b02cf730c1d9da82b8e8edb1c2d2" }, + "which-key.nvim": { "branch": "main", "commit": "48cdaaab93a4c85cac8eb271bb48307ed337787f" }, "wrapping.nvim": { "branch": "master", "commit": "3a823200c297885b70515fa8d974e1763c578e26" }, - "zen-mode.nvim": { "branch": "main", "commit": "cb73b8bd0ef9d765b942db09dc762c603a89ae44" }, + "zen-mode.nvim": { "branch": "main", "commit": "04b52674b8c800f8b7d4609e8bd8d0212e3ffa79" }, "zk-nvim": { "branch": "main", "commit": "66b9b490e930fb77f93a2a0c64e0da9a5144fd0a" } } \ No newline at end of file diff --git a/nvim/.config/nvim/lua/core/mappings.lua b/nvim/.config/nvim/lua/core/mappings.lua index 5f61ba8..4384247 100644 --- a/nvim/.config/nvim/lua/core/mappings.lua +++ b/nvim/.config/nvim/lua/core/mappings.lua @@ -2,11 +2,13 @@ local map = vim.keymap.set local is_available = require("core.util").is_available if is_available("which-key") then - local prefix = require("which-key").register - prefix({ ["v"] = { name = "+vim" } }) - prefix({ ["s"] = { name = "+show" } }) - prefix({ ["s"] = { name = "+set" } }) - prefix({ ["Z"] = { name = "+spelling" } }) + local prefix = require("which-key").add + prefix({ + { "v", group = "vim" }, + { "s", group = "show" }, + { "s", group = "set" }, + { "Z", group = "spelling" }, + }) end -- The general ideas behind these mappings: diff --git a/nvim/.config/nvim/lua/core/settings.lua b/nvim/.config/nvim/lua/core/settings.lua index 7ad8774..c7d2fb1 100644 --- a/nvim/.config/nvim/lua/core/settings.lua +++ b/nvim/.config/nvim/lua/core/settings.lua @@ -1,3 +1,9 @@ +-- Change (personal) plugin options +-- mainly intended for things I have not packaged as plugin but may +-- require options to be set. +vim.g.quarto_auto_init_molten_session = false + +-- Change (Neo)Vim default options local default_builtins_disabled = { "netrw", "netrwPlugin" } local disable_builtins = function(builtins) for _, plugin in pairs(builtins) do diff --git a/nvim/.config/nvim/lua/plugins/config/lsp.lua b/nvim/.config/nvim/lua/plugins/config/lsp.lua index 7054d1d..94dee61 100644 --- a/nvim/.config/nvim/lua/plugins/config/lsp.lua +++ b/nvim/.config/nvim/lua/plugins/config/lsp.lua @@ -20,6 +20,7 @@ local servers = { eslint = {}, gopls = {}, julials = {}, + jsonls = {}, ltex = { autostart = false }, lua_ls = { settings = { @@ -63,7 +64,7 @@ local function on_attach(_, bufnr) ) if require("core.util").is_available("which-key") then - require("which-key").register({ ["l"] = { name = "+language" } }) + require("which-key").add({ "l", group = "language" }) end map( "n", @@ -126,7 +127,7 @@ local function on_attach(_, bufnr) else vim.diagnostic.disable(0) end - end, { buffer = bufnr, desc = "Disable buffer diagnostics" }) + end, { buffer = bufnr, desc = "Toggle Diagnostics" }) end -- Display diagnostics as virtual text only if not in insert mode @@ -159,9 +160,9 @@ lspconfig.marksman.setup({ on_attach = function(client, bufnr) -- TODO: for some reason this stays true even after rootdir switch? if client.config.in_zk_notebook then - vim.defer_fn(function() - vim.lsp.buf_detach_client(bufnr, client.id) - end, 1000) + vim.defer_fn(function() + vim.lsp.buf_detach_client(bufnr, client.id) + end, 1000) end on_attach(client, bufnr) end, diff --git a/nvim/.config/nvim/lua/plugins/core.lua b/nvim/.config/nvim/lua/plugins/core.lua index 878f302..d267be6 100644 --- a/nvim/.config/nvim/lua/plugins/core.lua +++ b/nvim/.config/nvim/lua/plugins/core.lua @@ -86,8 +86,8 @@ return { { "micarmst/vim-spellsync", event = "VeryLazy" }, { "folke/which-key.nvim", - config = true, event = "CursorHold", + opts = { icons = { mappings = false } }, }, -- collection of plugins { diff --git a/nvim/.config/nvim/lua/plugins/data_analysis.lua b/nvim/.config/nvim/lua/plugins/data_analysis.lua index 3fbc520..5088b87 100644 --- a/nvim/.config/nvim/lua/plugins/data_analysis.lua +++ b/nvim/.config/nvim/lua/plugins/data_analysis.lua @@ -46,6 +46,10 @@ return { map("n", "[c", "?^```n}:nohl", { desc = "Codecell last" }) map("n", "co", "o```{python}```k", { desc = "Insert quarto cell below" }) map("n", "cO", "O```{python}```k", { desc = "Insert quarto cell above" }) + + if require("core.util").is_available("which-key") then + require("which-key").add({ "c", group = "codecells" }) + end end, ft = { "quarto" }, }, @@ -114,7 +118,7 @@ return { callback = function() local map = vim.keymap.set if require("core.util").is_available("which-key") then - require("which-key").register({ ["c"] = { name = "+codecells" } }) + require("which-key").add({ "c", group = "codecells" }) end -- Operate jupyter notebooks from within vim map( diff --git a/nvim/.config/nvim/lua/plugins/git.lua b/nvim/.config/nvim/lua/plugins/git.lua index cc24131..e227f6a 100644 --- a/nvim/.config/nvim/lua/plugins/git.lua +++ b/nvim/.config/nvim/lua/plugins/git.lua @@ -1,18 +1,22 @@ return { { "akinsho/git-conflict.nvim", - event = "VeryLazy", + event = { "InsertEnter", "CursorHold" }, config = function() require("git-conflict").setup({ default_mappings = false, disable_diagnostics = true, }) - vim.keymap.set("n", "ho", "(git-conflict-ours)", { desc = "Conflict use ours" }) - vim.keymap.set("n", "hO", "(git-conflict-theirs)", { desc = "Conflict use theirs" }) - vim.keymap.set("n", "hm", "(git-conflict-both)", { desc = "Conflict use both" }) - vim.keymap.set("n", "hM", "(git-conflict-none)", { desc = "Conflict use none" }) - vim.keymap.set("n", "[H", "(git-conflict-prev-conflict)", { desc = "Prev git conflict" }) - vim.keymap.set("n", "]H", "(git-conflict-next-conflict)", { desc = "Next git conflict" }) + if require("core.util").is_available("which-key") then + require("which-key").add({ "h", group = "git" }) + end + local map = vim.keymap.set + map("n", "ho", "(git-conflict-ours)", { desc = "Conflict use ours" }) + map("n", "hO", "(git-conflict-theirs)", { desc = "Conflict use theirs" }) + map("n", "hm", "(git-conflict-both)", { desc = "Conflict use both" }) + map("n", "hM", "(git-conflict-none)", { desc = "Conflict use none" }) + map("n", "[H", "(git-conflict-prev-conflict)", { desc = "Prev git conflict" }) + map("n", "]H", "(git-conflict-next-conflict)", { desc = "Next git conflict" }) end, lazy = false, -- TODO needs to be force refreshed in lazy loaded mode unfortunately }, @@ -56,7 +60,7 @@ return { -- Actions if require("core.util").is_available("which-key") then - require("which-key").register({ ["h"] = { name = "+git" } }) + require("which-key").add({ "h", group = "git" }) end map({ "n", "v" }, "hs", ":Gitsigns stage_hunk", { desc = "stage hunk" }) map({ "n", "v" }, "hr", ":Gitsigns reset_hunk", { desc = "reset hunk" }) diff --git a/nvim/.config/nvim/lua/plugins/ide.lua b/nvim/.config/nvim/lua/plugins/ide.lua index 679c25d..40bb8f1 100644 --- a/nvim/.config/nvim/lua/plugins/ide.lua +++ b/nvim/.config/nvim/lua/plugins/ide.lua @@ -141,7 +141,9 @@ return { "stevearc/conform.nvim", config = function() require("conform").setup({ + lsp_format = "fallback", + format_after_save = function(bufnr) if vim.g.disable_autoformat or vim.b[bufnr].disable_autoformat then return @@ -152,10 +154,10 @@ return { }) vim.api.nvim_create_user_command("FormatDisable", function(args) if args.bang then - -- FormatDisable! will disable formatting just for this buffer - vim.b.disable_autoformat = true - else vim.g.disable_autoformat = true + else + -- FormatDisable! will disable formatting globally + vim.b.disable_autoformat = true end end, { desc = "Disable formatting on save", @@ -262,7 +264,7 @@ return { }, }) if require("core.util").is_available("which-key") then - require("which-key").register({ ["t"] = { name = "+test" } }) + require("which-key").add({ "t", group = "test" }) end end, ft = { "python" }, diff --git a/nvim/.config/nvim/lua/plugins/prose.lua b/nvim/.config/nvim/lua/plugins/prose.lua index 502fc34..8be45c7 100644 --- a/nvim/.config/nvim/lua/plugins/prose.lua +++ b/nvim/.config/nvim/lua/plugins/prose.lua @@ -94,10 +94,11 @@ local prose_plugs = { "mickael-menu/zk-nvim", config = function() if require("core.util").is_available("which-key") then - local prefix = require("which-key").register - prefix({ ["n"] = { name = "+notes" } }) - prefix({ ["n"] = { name = "+note" } }) - prefix({ ["n"] = { name = "+note", mode = "v" } }) + require("which-key").add({ + { "n", group = "notes" }, + { "n", group = "note" }, + { "n", group = "note", mode = "v" }, + }) require("zk.commands").add("ZkOrphans", function(opts) opts = vim.tbl_extend("force", { orphan = true }, opts or {}) diff --git a/nvim/.config/nvim/lua/plugins/telescope.lua b/nvim/.config/nvim/lua/plugins/telescope.lua index a32bf82..67d3e4e 100644 --- a/nvim/.config/nvim/lua/plugins/telescope.lua +++ b/nvim/.config/nvim/lua/plugins/telescope.lua @@ -10,7 +10,7 @@ return { cmd = "Telescope", config = function() if require("core.util").is_available("which-key") then - require("which-key").register({ ["f"] = { name = "+find" } }) + require("which-key").add({ "f", group = "find" }) end -- Setup up telescope fuzzy finding settings -- @@ -37,10 +37,10 @@ return { selection_caret = "󰳟 ", color_devicons = true, mappings = { - -- FIXME Find way to only invoke this *IF* trouble plugin is found - i = { [""] = require("trouble.sources.telescope").open }, - n = { [""] = require("trouble.sources.telescope").open }, - } + -- FIXME Find way to only invoke this *IF* trouble plugin is found + i = { [""] = require("trouble.sources.telescope").open }, + n = { [""] = require("trouble.sources.telescope").open }, + }, }, pickers = { buffers = { theme = "ivy" }, @@ -82,7 +82,7 @@ return { function() require("telescope.builtin").colorscheme(require("telescope.themes").get_ivy()) end, - desc = "colorschemes" , + desc = "colorschemes", }, { diff --git a/nvim/.config/nvim/snippets/quarto.snippets b/nvim/.config/nvim/snippets/quarto.snippets index 47e9533..0f0786d 100644 --- a/nvim/.config/nvim/snippets/quarto.snippets +++ b/nvim/.config/nvim/snippets/quarto.snippets @@ -65,11 +65,6 @@ snippet eref Equation crossref snippet cite Citation [@${1:bib-key}] -snippet fn Footnote - [^${1:id}] - - [^${1}]: ${2:text} - snippet shortcode Shortcode {{< $0 >}} diff --git a/nvim/.config/sh/alias.d/neovim.sh b/nvim/.config/sh/alias.d/neovim.sh index 5616a34..bd4999f 100644 --- a/nvim/.config/sh/alias.d/neovim.sh +++ b/nvim/.config/sh/alias.d/neovim.sh @@ -8,4 +8,5 @@ if exist nvim; then # open notes with my vim zettelkasten plugin # TODO better implementation conditional on zk & zettelkasten existing alias vn='nvim +"lua require \"zk.commands\".get(\"ZkCd\")()" +"edit ~/documents/notes/index.md"' + alias vs='nvim +"lua require \"personal.scratchpad\".create()"' fi diff --git a/qutebrowser/config/config.py b/qutebrowser/config/config.py index d7c7953..8a559a4 100644 --- a/qutebrowser/config/config.py +++ b/qutebrowser/config/config.py @@ -77,3 +77,5 @@ state_dir=os.environ.get('XDG_STATE_HOME', f"{os.environ['HOME']}/.local/state") colorscheme=f"{state_dir}/qutebrowser/colorscheme.py" if os.path.isfile(colorscheme): config.source(colorscheme) + +c.url.start_pages = "https://start.duckduckgo.com/html" diff --git a/social/.config/newsboat/config b/social/.config/newsboat/config index fecfbee..a79e612 100644 --- a/social/.config/newsboat/config +++ b/social/.config/newsboat/config @@ -74,19 +74,33 @@ bind-key h quit searchresultslist bind-key g home bind-key G end bind-key ^F pagedown -bind-key ^U pageup -bind-key ^B halfpageup +bind-key ^B pageup bind-key ^D halfpagedown +bind-key ^U halfpageup bind-key n next-unread bind-key N prev-unread bind-key ^n next-unread-feed articlelist bind-key ^p prev-unread-feed articlelist +unbind-key R +unbind-key r +bind-key O reload-all +bind-key o reload + +unbind-key A +bind-key M mark-all-feeds-read feedlist +bind-key m mark-feed-read feedlist +bind-key m toggle-article-read articlelist +bind-key m toggle-article-read article +bind-key m toggle-article-read article +bind-key m toggle-article-read tagselection +bind-key m toggle-article-read filterselection +bind-key m toggle-article-read searchresultslist + bind-key s sort bind-key S rev-sort bind-key U show-urls -bind-key a toggle-article-read bind-key f goto-url bind-key z toggle-show-read-feeds diff --git a/terminal/.config/vifm/vifmrc b/terminal/.config/vifm/vifmrc index 30973e9..fcec9ae 100644 --- a/terminal/.config/vifm/vifmrc +++ b/terminal/.config/vifm/vifmrc @@ -322,6 +322,9 @@ noremap ,pc :!pdftk %f cat output output.pdf nnoremap ,t :!vifm-thumbnailer -t %u %c nnoremap ,T :!vifm-thumbnailer -r -t %u %c +" batch rename or delete files in current dir +nnoremap ,r :!vidir + " allows preview to work for normal view and single pane view noremap w : if layoutis('only') \| if &lines + 50 < &columns | vsplit | else | split | endif diff --git a/writing/.config/sioyek/prefs_user.config b/writing/.config/sioyek/prefs_user.config index 1daf52d..39e57a5 100644 --- a/writing/.config/sioyek/prefs_user.config +++ b/writing/.config/sioyek/prefs_user.config @@ -8,6 +8,7 @@ should_launch_new_instance 1 # seems to not be working? should_launch_new_window 1 should_load_tutorial_when_no_other_file 0 check_for_updates_on_startup 0 +should_highlight_unselected_search 1 startup_commands toggle_custom_color