From 9efbcbfa01ab5dd82cf8e39777a3685fa32dbb67 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Fri, 6 Jun 2025 15:47:01 +0200 Subject: [PATCH 01/16] nvim: Replace copilot.vim with copilot.lua Makes the plugin less intrusive (will now only autocomplete on or ap). Can select suggestion with or , and accept with in-text or in-panel. Still automatically started when invoking CodeCompanion chat. --- nvim/.config/nvim/lazy-lock.json | 2 +- nvim/.config/nvim/lua/plugins/llm.lua | 25 ++++++++++++++++++++++++- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/nvim/.config/nvim/lazy-lock.json b/nvim/.config/nvim/lazy-lock.json index 9cea8da..ec6a5bd 100644 --- a/nvim/.config/nvim/lazy-lock.json +++ b/nvim/.config/nvim/lazy-lock.json @@ -10,7 +10,7 @@ "cmp-spell": { "branch": "master", "commit": "694a4e50809d6d645c1ea29015dad0c293f019d6" }, "codecompanion.nvim": { "branch": "main", "commit": "73bac3b52d9b7f52e89ac6698dd7df8962f0454c" }, "conform.nvim": { "branch": "master", "commit": "a6f5bdb78caa305496357d17e962bbc4c0b392e2" }, - "copilot.vim": { "branch": "release", "commit": "7167958954532a0a1b83f2db2f591b43aebff44c" }, + "copilot.lua": { "branch": "master", "commit": "c1bb86abbed1a52a11ab3944ef00c8410520543d" }, "dial.nvim": { "branch": "master", "commit": "2c7e2750372918f072a20f3cf754d845e143d7c9" }, "dressing.nvim": { "branch": "master", "commit": "3a45525bb182730fe462325c99395529308f431e" }, "fidget.nvim": { "branch": "main", "commit": "b61e8af9b8b68ee0ec7da5fb7a8c203aae854f2e" }, diff --git a/nvim/.config/nvim/lua/plugins/llm.lua b/nvim/.config/nvim/lua/plugins/llm.lua index 0307ceb..a4177f3 100644 --- a/nvim/.config/nvim/lua/plugins/llm.lua +++ b/nvim/.config/nvim/lua/plugins/llm.lua @@ -1,11 +1,34 @@ return { + { + -- NOTE: Requires manual auth with ':Copilot auth' or 'GH_COPILOT_TOKEN' set as envvar + "zbirenbaum/copilot.lua", + cmd = "Copilot", + event = "InsertEnter", + opts = { + panel = { layout = { position = "bottom" } }, + suggestion = { keymap = { accept = "" } }, + }, + keys = { + { + "ap", + function() + -- FIXME: If opening before lazy-loaded, errors + require("copilot.panel").open({}) + require("copilot.panel").refresh() + end, + desc = "Refresh Copilot Panel", + silent = true, + mode = { "n" }, + }, + }, + }, -- TODO: Add completion w blink, see https://codecompanion.olimorris.dev/installation.html { "olimorris/codecompanion.nvim", dependencies = { "nvim-lua/plenary.nvim", "nvim-treesitter/nvim-treesitter", - "github/copilot.vim", + "zbirenbaum/copilot.lua", }, init = function(_) if require("core.util").is_available("which-key") then From d3cdd0b30a3c908502196de255a21a837f08ef59 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Fri, 6 Jun 2025 16:43:25 +0200 Subject: [PATCH 02/16] nvim: Fix llm models used by codecompanion --- nvim/.config/nvim/lua/plugins/llm.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nvim/.config/nvim/lua/plugins/llm.lua b/nvim/.config/nvim/lua/plugins/llm.lua index a4177f3..32b464e 100644 --- a/nvim/.config/nvim/lua/plugins/llm.lua +++ b/nvim/.config/nvim/lua/plugins/llm.lua @@ -53,7 +53,8 @@ return { default = "llama-3.1-8b-instant", choices = { "llama-3.3-70b-versatile", - "mixtral-8x7b-32768", + "meta-llama/llama-4-maverick-17b-128e-instruct", + "mistral-saba-24b", }, }, }, From 19f3cd34573edb4b160a69b9a9a39a73b73be82b Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Fri, 6 Jun 2025 16:43:25 +0200 Subject: [PATCH 03/16] nvim: Add copilot status to lualine --- nvim/.config/nvim/lazy-lock.json | 1 + nvim/.config/nvim/lua/plugins/llm.lua | 1 + nvim/.config/nvim/lua/plugins/statusline.lua | 10 ++++++++-- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/nvim/.config/nvim/lazy-lock.json b/nvim/.config/nvim/lazy-lock.json index ec6a5bd..b0c6496 100644 --- a/nvim/.config/nvim/lazy-lock.json +++ b/nvim/.config/nvim/lazy-lock.json @@ -10,6 +10,7 @@ "cmp-spell": { "branch": "master", "commit": "694a4e50809d6d645c1ea29015dad0c293f019d6" }, "codecompanion.nvim": { "branch": "main", "commit": "73bac3b52d9b7f52e89ac6698dd7df8962f0454c" }, "conform.nvim": { "branch": "master", "commit": "a6f5bdb78caa305496357d17e962bbc4c0b392e2" }, + "copilot-lualine": { "branch": "main", "commit": "6bc29ba1fcf8f0f9ba1f0eacec2f178d9be49333" }, "copilot.lua": { "branch": "master", "commit": "c1bb86abbed1a52a11ab3944ef00c8410520543d" }, "dial.nvim": { "branch": "master", "commit": "2c7e2750372918f072a20f3cf754d845e143d7c9" }, "dressing.nvim": { "branch": "master", "commit": "3a45525bb182730fe462325c99395529308f431e" }, diff --git a/nvim/.config/nvim/lua/plugins/llm.lua b/nvim/.config/nvim/lua/plugins/llm.lua index 32b464e..de84f0c 100644 --- a/nvim/.config/nvim/lua/plugins/llm.lua +++ b/nvim/.config/nvim/lua/plugins/llm.lua @@ -2,6 +2,7 @@ return { { -- NOTE: Requires manual auth with ':Copilot auth' or 'GH_COPILOT_TOKEN' set as envvar "zbirenbaum/copilot.lua", + dependencies = { "AndreM222/copilot-lualine" }, cmd = "Copilot", event = "InsertEnter", opts = { diff --git a/nvim/.config/nvim/lua/plugins/statusline.lua b/nvim/.config/nvim/lua/plugins/statusline.lua index 8cc91a1..e6deb2b 100644 --- a/nvim/.config/nvim/lua/plugins/statusline.lua +++ b/nvim/.config/nvim/lua/plugins/statusline.lua @@ -16,7 +16,7 @@ return { return "" elseif has_pynvim == 1 then if molten_ft[vim.bo.filetype] == nil then - return "" + return "" end local status_ok, res = pcall(function() return require("molten.status").kernels() ~= "" @@ -60,7 +60,13 @@ return { lualine_a = { "mode" }, lualine_b = { "branch", "diff", "diagnostics" }, lualine_c = { "filename" }, - lualine_x = { "encoding", "fileformat", "filetype", molten }, + lualine_x = { + "encoding", + { "copilot", symbols = { status = { icons = { unknown = "", enabled = "" } } } }, + "fileformat", + "filetype", + molten, + }, lualine_y = { "progress" }, lualine_z = { selectionCount, "location" }, }, From 1397fee17a083486a462f08a464b27efb15b19f3 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Fri, 6 Jun 2025 23:14:15 +0200 Subject: [PATCH 04/16] nvim: Enable fzf-lua integration for codecompanion Since version 15.5.0 it supports showing selection menus with fzf-lua, so we enable it here. Hardcoded for now. --- nvim/.config/nvim/lazy-lock.json | 2 +- nvim/.config/nvim/lua/plugins/llm.lua | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/nvim/.config/nvim/lazy-lock.json b/nvim/.config/nvim/lazy-lock.json index b0c6496..640834e 100644 --- a/nvim/.config/nvim/lazy-lock.json +++ b/nvim/.config/nvim/lazy-lock.json @@ -8,7 +8,7 @@ "cmp-calc": { "branch": "main", "commit": "5947b412da67306c5b68698a02a846760059be2e" }, "cmp-pandoc.nvim": { "branch": "main", "commit": "30faa4456a7643c4cb02d8fa18438fd484ed7602" }, "cmp-spell": { "branch": "master", "commit": "694a4e50809d6d645c1ea29015dad0c293f019d6" }, - "codecompanion.nvim": { "branch": "main", "commit": "73bac3b52d9b7f52e89ac6698dd7df8962f0454c" }, + "codecompanion.nvim": { "branch": "main", "commit": "ecf07d4a914f44455b5098acd49746b8dc5375f0" }, "conform.nvim": { "branch": "master", "commit": "a6f5bdb78caa305496357d17e962bbc4c0b392e2" }, "copilot-lualine": { "branch": "main", "commit": "6bc29ba1fcf8f0f9ba1f0eacec2f178d9be49333" }, "copilot.lua": { "branch": "master", "commit": "c1bb86abbed1a52a11ab3944ef00c8410520543d" }, diff --git a/nvim/.config/nvim/lua/plugins/llm.lua b/nvim/.config/nvim/lua/plugins/llm.lua index de84f0c..829e8d8 100644 --- a/nvim/.config/nvim/lua/plugins/llm.lua +++ b/nvim/.config/nvim/lua/plugins/llm.lua @@ -30,6 +30,7 @@ return { "nvim-lua/plenary.nvim", "nvim-treesitter/nvim-treesitter", "zbirenbaum/copilot.lua", + { "ibhagwan/fzf-lua", optional = true }, }, init = function(_) if require("core.util").is_available("which-key") then @@ -68,6 +69,11 @@ return { }) end, }, + display = { + action_palette = { + provider = "fzf_lua", + }, + }, }, keys = { { "aa", "CodeCompanionActions", desc = "Actions", silent = true, mode = { "n", "v" } }, From 4e7b64aad04c75ed2ba3421ca06d7782fec5ed0d Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Fri, 6 Jun 2025 23:40:50 +0200 Subject: [PATCH 05/16] nvim: Add gitcommit and history extensions to codecompanion --- nvim/.config/nvim/lazy-lock.json | 2 ++ nvim/.config/nvim/lua/plugins/llm.lua | 22 ++++++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/nvim/.config/nvim/lazy-lock.json b/nvim/.config/nvim/lazy-lock.json index 640834e..1b1884a 100644 --- a/nvim/.config/nvim/lazy-lock.json +++ b/nvim/.config/nvim/lazy-lock.json @@ -8,6 +8,8 @@ "cmp-calc": { "branch": "main", "commit": "5947b412da67306c5b68698a02a846760059be2e" }, "cmp-pandoc.nvim": { "branch": "main", "commit": "30faa4456a7643c4cb02d8fa18438fd484ed7602" }, "cmp-spell": { "branch": "master", "commit": "694a4e50809d6d645c1ea29015dad0c293f019d6" }, + "codecompanion-gitcommit.nvim": { "branch": "main", "commit": "28f05d8e28f1abae4a333f761944119d4080e6ee" }, + "codecompanion-history.nvim": { "branch": "main", "commit": "66943e78bcacaa27f4ac4a398df4016eb5413ecd" }, "codecompanion.nvim": { "branch": "main", "commit": "ecf07d4a914f44455b5098acd49746b8dc5375f0" }, "conform.nvim": { "branch": "master", "commit": "a6f5bdb78caa305496357d17e962bbc4c0b392e2" }, "copilot-lualine": { "branch": "main", "commit": "6bc29ba1fcf8f0f9ba1f0eacec2f178d9be49333" }, diff --git a/nvim/.config/nvim/lua/plugins/llm.lua b/nvim/.config/nvim/lua/plugins/llm.lua index 829e8d8..46c14b5 100644 --- a/nvim/.config/nvim/lua/plugins/llm.lua +++ b/nvim/.config/nvim/lua/plugins/llm.lua @@ -31,6 +31,8 @@ return { "nvim-treesitter/nvim-treesitter", "zbirenbaum/copilot.lua", { "ibhagwan/fzf-lua", optional = true }, + "ravitemer/codecompanion-history.nvim", + "jinzhongjia/codecompanion-gitcommit.nvim", }, init = function(_) if require("core.util").is_available("which-key") then @@ -74,6 +76,26 @@ return { provider = "fzf_lua", }, }, + extensions = { + history = { + enabled = true, + auto_save = false, + expiration_days = 7, + picker = "fzf-lua", + delete_on_clearing_chat = true, + }, + gitcommit = { + enabled = true, + callback = "codecompanion._extensions.gitcommit", + opts = { + add_slash_command = true, + buffer = { + enabled = true, + keymap = "ag", + }, + }, + }, + }, }, keys = { { "aa", "CodeCompanionActions", desc = "Actions", silent = true, mode = { "n", "v" } }, From fad8f65214afa1028557fa9c95efd151c5c1201e Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Sat, 7 Jun 2025 09:23:51 +0200 Subject: [PATCH 06/16] nvim: Improve which-key group rendering Moved most group definition functions into plugin 'init' functions so they run at the beginning and are displayed more reliably. --- nvim/.config/nvim/lua/plugins/lsp.lua | 8 +++++--- nvim/.config/nvim/lua/plugins/prose.lua | 15 +++++++++++++-- nvim/.config/nvim/lua/plugins/testing.lua | 8 +++++--- 3 files changed, 23 insertions(+), 8 deletions(-) diff --git a/nvim/.config/nvim/lua/plugins/lsp.lua b/nvim/.config/nvim/lua/plugins/lsp.lua index a1c56ae..b2478f7 100644 --- a/nvim/.config/nvim/lua/plugins/lsp.lua +++ b/nvim/.config/nvim/lua/plugins/lsp.lua @@ -31,6 +31,11 @@ local lsp = { }, event = { "BufReadPost", "BufNewFile", "BufWritePre" }, opts = { servers = get_all_servers() }, + init = function() + if require("core.util").is_available("which-key") then + require("which-key").add({ "l", group = "language" }) + end + end, config = function(_, lspconfig_opts) -- Display diagnostics as virtual text only if not in insert mode -- /r/neovim/comments/12inp4c/disable_diagnostics_virtual_text_when_in_insert/jqqifwk/ @@ -225,9 +230,6 @@ vim.api.nvim_create_autocmd("LspAttach", { o({ desc = "Next error" }) ) - if require("core.util").is_available("which-key") then - require("which-key").add({ "l", group = "language" }) - end map("n", "ld", "lua vim.diagnostic.open_float()", o({ desc = "Show line diagnostics" })) map("n", "la", "lua vim.lsp.buf.code_action()", o({ desc = "Codeactions" })) map("n", "ln", "lua vim.lsp.buf.rename()", o({ desc = "Rename element" })) diff --git a/nvim/.config/nvim/lua/plugins/prose.lua b/nvim/.config/nvim/lua/plugins/prose.lua index 58480c9..fa1813b 100644 --- a/nvim/.config/nvim/lua/plugins/prose.lua +++ b/nvim/.config/nvim/lua/plugins/prose.lua @@ -97,6 +97,11 @@ local prose_plugs = { }, ft = md_like, cmd = "RenderMarkdown", + init = function() + if require("core.util").is_available("which-key") then + require("which-key").add({ { "p", group = "presentation" } }) + end + end, keys = { { "pm", @@ -160,6 +165,11 @@ local prose_plugs = { }, }, cmd = { "PasteImage" }, + init = function() + if require("core.util").is_available("which-key") then + require("which-key").add({ { "p", group = "presentation" } }) + end + end, keys = { { "pp", "PasteImage", desc = "Paste image from system clipboard" }, }, @@ -169,7 +179,7 @@ local prose_plugs = { -- bring zettelkasten commands { "zk-org/zk-nvim", - config = function() + init = function() if require("core.util").is_available("which-key") then require("which-key").add({ { "n", group = "notes" }, @@ -177,7 +187,8 @@ local prose_plugs = { { "n", group = "note", mode = "v" }, }) end - + end, + config = function() require("zk.commands").add("ZkOrphans", function(opts) opts = vim.tbl_extend("force", { orphan = true }, opts or {}) require("zk").edit(opts, { title = "Zk Orphans" }) diff --git a/nvim/.config/nvim/lua/plugins/testing.lua b/nvim/.config/nvim/lua/plugins/testing.lua index 1062823..ab07007 100644 --- a/nvim/.config/nvim/lua/plugins/testing.lua +++ b/nvim/.config/nvim/lua/plugins/testing.lua @@ -32,6 +32,11 @@ return { "nvim-neotest/neotest-python", }, + init = function() + if require("core.util").is_available("which-key") then + require("which-key").add({ "t", group = "test" }) + end + end, config = function() require("neotest").setup({ adapters = { @@ -41,9 +46,6 @@ return { }), }, }) - if require("core.util").is_available("which-key") then - require("which-key").add({ "t", group = "test" }) - end end, ft = { "python" }, keys = { From d8458ae010c333da1ba147645aa2d04a0b21385d Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Sat, 7 Jun 2025 09:23:51 +0200 Subject: [PATCH 07/16] nvim: Update checkbox markdown states We now have the usual 'undone' ([ ]) and 'done' ([x]) states, but express 3 further ones that are _somewhat_ standardized: - [o] this one is 'doing', in-progress - [-] this one is 'indeterminate', we're not sure - [~] this one is 'deleted', never to be done --- nvim/.config/nvim/lua/plugins/prose.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/nvim/.config/nvim/lua/plugins/prose.lua b/nvim/.config/nvim/lua/plugins/prose.lua index fa1813b..169faa0 100644 --- a/nvim/.config/nvim/lua/plugins/prose.lua +++ b/nvim/.config/nvim/lua/plugins/prose.lua @@ -80,8 +80,9 @@ local prose_plugs = { }, checkbox = { custom = { - todo = { raw = "[-]", rendered = "󰡖 ", highlight = "RenderMarkdownTodo" }, - removed = { raw = "[_]", rendered = "󱋭 ", highlight = "RenderMarkdownTodo" }, + doing = { raw = "[o]", rendered = "󰡖 ", highlight = "RenderMarkdownTodo" }, + indeterminate = { raw = "[-]", rendered = "󰄗 ", highlight = "RenderMarkdownTodo" }, + removed = { raw = "[~]", rendered = "󱋭 ", highlight = "RenderMarkdownTodo" }, }, }, html = { From 6e6f804c08d10d19774870e3076d8d12dbd83347 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Sat, 7 Jun 2025 09:38:37 +0200 Subject: [PATCH 08/16] repo: Format README --- README.md | 70 ++++++++++++++++++++++++++++--------------------------- 1 file changed, 36 insertions(+), 34 deletions(-) diff --git a/README.md b/README.md index 46cca40..588629c 100644 --- a/README.md +++ b/README.md @@ -1,19 +1,19 @@ # `~/🌹` -Note that the below screenshots still show the X configuration from [v0.1](https://gitlab.com/marty-oehme/dotfiles/-/tags/v0.1) which is *very* old by now. +Note that the below screenshots still show the X configuration from [v0.1](https://gitlab.com/marty-oehme/dotfiles/-/tags/v0.1) which is _very_ old by now. The current dotfiles are geared toward wayland for which the setup looks similar but not identical to the previews below. ## What's in these dotfiles -* [x] wayland setup using `riverwm` with quick access to many overlays and picking tools for styles, downloads, browsing history, passwords and more -* [x] vim configuration for simple programming tasks (especially python/bash/lua) and prose (markdown/quarto/latex) -* [x] academic workflow tools, to allow quick citation, pdf compilation, and preview -* [x] simple, efficient waybar with package update notification and mpris integration -* [x] system-wide color management (terminals, vim, qutebrowser, polybar, xresources) through [`flavours`](https://github.com/Misterio77/flavours) application using [base16](http://chriskempson.com/projects/base16/) themes -* [x] quick theme switching by activating `flavours` and fuzzy-searching themes with hot-key (default `=+S`) -* [x] quick directory jumping using `z`, with `fzf` integration -* [x] `fzf`-like integrations for bibtex citation, vim buffer management, most recently used switching, shell command history, and more -* [x] password management with `pass` and picking it with automatic typing into any window +- [x] wayland setup using `riverwm` with quick access to many overlays and picking tools for styles, downloads, browsing history, passwords and more +- [x] vim configuration for simple programming tasks (especially python/bash/lua) and prose (markdown/quarto/latex) +- [x] academic workflow tools, to allow quick citation, pdf compilation, and preview +- [x] simple, efficient waybar with package update notification and mpris integration +- [x] system-wide color management (terminals, vim, qutebrowser, polybar, xresources) through [`flavours`](https://github.com/Misterio77/flavours) application using [base16](http://chriskempson.com/projects/base16/) themes +- [x] quick theme switching by activating `flavours` and fuzzy-searching themes with hot-key (default `=+S`) +- [x] quick directory jumping using `z`, with `fzf` integration +- [x] `fzf`-like integrations for bibtex citation, vim buffer management, most recently used switching, shell command history, and more +- [x] password management with `pass` and picking it with automatic typing into any window [![Styler recoloring demo](https://gitlab.com/marty-oehme/dotfiles/-/wikis/uploads/bde87deda694590a2e08e21552e11309/styler.webp)](https://gitlab.com/marty-oehme/dotfiles/-/wikis/uploads/90894e53eff378db4d7f9f49e7a69fab/styler.mp4) @@ -25,17 +25,18 @@ I would recommend doing an initial `git clone --recursive` for this repository, Of course, you can do it non-recursively and then just pull those modules selectively which you actually want. Once in the repository directory, when you then run `./install.sh` it will install many of the packages I use (though they are probably slightly out-of-date) and link the dotfiles into the home directory. -I would mostly recommend this on fresh machines or a test machine first - it *will* link my personal dotfiles and, if you allow it, *will* install quite a few packages. +I would mostly recommend this on fresh machines or a test machine first - it _will_ link my personal dotfiles and, if you allow it, _will_ install quite a few packages. By default it will ask your consent for some steps -- use `./install.sh -f` to force yes to everything. -The dotfile installation procedure is based on `dotter`, it will generally *not overwrite* anything already in the home directory, but of course be observant when doing ptentially destructive operations. +The dotfile installation procedure is based on `dotter`, it will generally _not overwrite_ anything already in the home directory, but of course be observant when doing ptentially destructive operations. > **NOTE** -> The same non-destructive installation procedure does *not* apply to the package installation and system setting file linking, where it can potentially overwrite or remove existing files. +> The same non-destructive installation procedure does _not_ apply to the package installation and system setting file linking, where it can potentially overwrite or remove existing files. After all files are linked and you open a new shell session, the `dotlink` alias will allow you to re-link all dotfiles from anywhere on the system.[^1] -[^1]: This alias only works when the dotfiles are cloned into `~/.dotfiles`, mirroring my setup. +[^1]: + This alias only works when the dotfiles are cloned into `~/.dotfiles`, mirroring my setup. This is due to a hard-coded cd into this directory. If your dotfiles lie in another directory and you want to use the dotlink alias, simply change the corresponding line in `bootstrap/.config/sh/alias.d/dotlink.sh` @@ -48,29 +49,30 @@ Enjoy! ![Overview - an older image of the dotfile desktop with gaps, showing git logs, styler logs, duckduckgo in a browser, and a vifm view of the dotfiles themselves](https://gitlab.com/marty-oehme/dotfiles/-/wikis/uploads/aaf0319d575dc192ea0f4bd6eaf83c08/gaps.png) -* [`wayland`](https://github.com/wayland-project/wayland) - Containing basics for fully functional tiling wayland setup: - * [`river`](https://github.com/riverwm/river) - Tiling window manager for wayland - * [`waybar`](https://github.com/Alexays/Waybar) - Easily customizable statusbar for wayland - * [`bemenu`](https://github.com/Cloudef/bemenu) - Extended dmenu replacement for wayland, X11 and ncurses - * [`fontconfig`] - System-wide font replacements and styling settings -* [`wezterm`](https://wezfurlong.org/wezterm/) - Terminal emulator and multiplexer (fast, understandable and lua configurable) -* [`nvim`](https://neovim.io/) - Neovim configuration -* [`vifm`](https://github.com/vifm/vifm) - vim-like file-manager -* [`qutebrowser`](https://github.com/qutebrowser/qutebrowser) - vim-key enabled web browser -* [`pass`](pass/README.md) - Password management suite -* [`bibtex`] - LateX/BibteX/pandoc plaintext writing & reference suite (slowly migrating toward [typst](https://typst.app)) -* [`git`](git/README.md) - distributed version control system. -* [`office`](office/README.md) - office/productivity software for writing e-mail and setting appointments +- [`wayland`](https://github.com/wayland-project/wayland) - Containing basics for fully functional tiling wayland setup: + - [`river`](https://github.com/riverwm/river) - Tiling window manager for wayland + - [`waybar`](https://github.com/Alexays/Waybar) - Easily customizable statusbar for wayland + - [`bemenu`](https://github.com/Cloudef/bemenu) - Extended dmenu replacement for wayland, X11 and ncurses + - [`fontconfig`] - System-wide font replacements and styling settings +- [`wezterm`](https://wezfurlong.org/wezterm/) - Terminal emulator and multiplexer (fast, understandable and lua configurable) +- [`nvim`](https://neovim.io/) - Neovim configuration +- [`vifm`](https://github.com/vifm/vifm) - vim-like file-manager +- [`qutebrowser`](https://github.com/qutebrowser/qutebrowser) - vim-key enabled web browser +- [`pass`](pass/README.md) - Password management suite +- [`typst`] - LateX/BibteX/pandoc-like plaintext writing & reference suite +- [`jujutsu`](vcs/README.md) - distributed version control system, together with git. +- [`office`](office/README.md) - office/productivity software for writing e-mail and setting appointments ## Notes -* Generally, most configuration for applications attempts to follow the XDG specifications, keeping configuration in .config directory and supplementary files in .local/share directory. Over time, I am moving more applications to this standard: it keeps the home directory clean, and the separation of configuration, binaries, and data relatively clear. -* The `zsh` directory contains all setup for the z-shell, my daily work environment. It should not be required for working with any other module but will add additional functionality to many (such as command auto-completion and so on). `sh` sets some base functionality for any shell you may wish to work in. It is, for now, the only module that is required for some other modules to work.[^shreq] -* `rofi` contains additional scripts and a simple theming framework for rofi and should probably be reorganized to put the correct files into the correct directories (per xdg) at some point. -* Whereas `sh` module scripts are requirements for other scripts, `.local/bin` in the `scripts` module contains most executable user scripts. Most of these have been migrated to other corresponding modules (e.g. if a script exclusively targets git functionality, it will live there), some useful --- or left-over --- stand-alone scripts remain however. -* `.local/share/pandoc` contains configuration for academic latex writing (pandoc, really) and is of interest if you want to use this functionality. -* `.xinitrc` is used for x initialization and program startup. At some point, some of the consistently running applications may be moved to systemd/runit as supervised services. -* Generally, top-level directories starting with a . are only meaningful for the *repository* not for the functionality of the machine that these dotfiles are deployed on. That means `.gitlab-ci.yml`, `.assets/`, `.gitignore` and similar files and directories will not show up in the final deployment in any home directory. Perhaps they should be called dotdot-files since they're the dotfiles for my dotfiles. 🙂 (Also, '[dotfiles](https://en.wikipedia.org/wiki/Semantic_satiation)'.) +- This are a good sign. +- Generally, most configuration for applications attempts to follow the XDG specifications, keeping configuration in .config directory and supplementary files in .local/share directory. Over time, I am moving more applications to this standard: it keeps the home directory clean, and the separation of configuration, binaries, and data relatively clear. +- The `zsh` directory contains all setup for the z-shell, my daily work environment. It should not be required for working with any other module but will add additional functionality to many (such as command auto-completion and so on). `sh` sets some base functionality for any shell you may wish to work in. It is, for now, the only module that is required for some other modules to work.[^shreq] +- `rofi` contains additional scripts and a simple theming framework for rofi and should probably be reorganized to put the correct files into the correct directories (per xdg) at some point. +- Whereas `sh` module scripts are requirements for other scripts, `.local/bin` in the `scripts` module contains most executable user scripts. Most of these have been migrated to other corresponding modules (e.g. if a script exclusively targets git functionality, it will live there), some useful --- or left-over --- stand-alone scripts remain however. +- `.local/share/pandoc` contains configuration for academic latex writing (pandoc, really) and is of interest if you want to use this functionality. +- `.xinitrc` is used for x initialization and program startup. At some point, some of the consistently running applications may be moved to systemd/runit as supervised services. +- Generally, top-level directories starting with a . are only meaningful for the _repository_ not for the functionality of the machine that these dotfiles are deployed on. That means `.gitlab-ci.yml`, `.assets/`, `.gitignore` and similar files and directories will not show up in the final deployment in any home directory. Perhaps they should be called dotdot-files since they're the dotfiles for my dotfiles. 🙂 (Also, '[dotfiles](https://en.wikipedia.org/wiki/Semantic_satiation)'.) [^shreq]: I may remove this requirement in the future to make modules more self-contained. However, relying on some base utility scripts makes it easier to avoid duplicating such functionality for each individual script in other modules. From 63c6c81f6e19036bd0bd0ed9d88de1a3e2e6a214 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Sat, 7 Jun 2025 09:38:37 +0200 Subject: [PATCH 09/16] nvim: Fix ltex disabled autostart Fixes #1ef7570. We implement our own autostart-aware lsp register function. Any lsp which has the option {autostart=false} set at their config root will be not automatically enabled and can instead be enabled on demand. --- README.md | 2 +- nvim/.config/nvim/lua/plugins/lsp.lua | 40 ++++++++++++++++++--------- sh/README.md | 17 ++++++------ 3 files changed, 36 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index 588629c..a9c852a 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,7 @@ After all files are linked and you open a new shell session, the `dotlink` alias [^1]: This alias only works when the dotfiles are cloned into `~/.dotfiles`, mirroring my setup. This is due to a hard-coded cd into this directory. - If your dotfiles lie in another directory and you want to use the dotlink alias, simply change the corresponding line in `bootstrap/.config/sh/alias.d/dotlink.sh` + If your dotfiles lie in another directory, and you want to use the dotlink alias, simply change the corresponding line in `bootstrap/.config/sh/alias.d/dotlink.sh` Both automatic installation paths are presumably somewhat brittle. In any case, I would suggest to manually look through the files for things you want instead of copying and activating everything. Dotfiles are too personal to be standardized like that. diff --git a/nvim/.config/nvim/lua/plugins/lsp.lua b/nvim/.config/nvim/lua/plugins/lsp.lua index b2478f7..9f31a30 100644 --- a/nvim/.config/nvim/lua/plugins/lsp.lua +++ b/nvim/.config/nvim/lua/plugins/lsp.lua @@ -56,9 +56,14 @@ local lsp = { vim.fn.sign_define("DiagnosticSignInfo", { text = "", texthl = "DiagnosticSignInfo" }) vim.fn.sign_define("DiagnosticSignHint", { text = "", texthl = "DiagnosticSignHint" }) - local function register(server_name, config) + local function register(server_name, config, enabled) if vim.fn.has("nvim-0.11") == 1 then vim.lsp.config(server_name, config) + if enabled == false or vim.lsp.config[server_name]["autostart"] == false then + vim.lsp.enable(server_name, false) + else + vim.lsp.enable(server_name, true) + end else require("lspconfig")[server_name].setup(config) end @@ -186,19 +191,28 @@ local lsp = { vim.api.nvim_create_autocmd("User", { pattern = "SpellEnable", callback = function() - register("ltex", { - on_attach = function(_, _) - if require("core.util").is_available("ltex_extra") then - require("ltex_extra").setup() - end - end, - settings = { - ltex = { - language = vim.o.spelllang, - }, - }, + local mapped = {} + local lang_map = { + en_us = "en-US", + en_gb = "en-GB", + de_de = "de-DE", + } + for _, v in ipairs(vim.opt.spelllang:get()) do + table.insert(mapped, lang_map[v]) + end + vim.lsp.config("ltex", { + settings = { ltex = { language = mapped } }, }) - vim.cmd("LspStart ltex") + -- single-shot setup: Enable for this buffer + -- but instantly disable again globally + vim.lsp.enable("ltex") + vim.lsp.enable("ltex", false) + end, + }) + vim.api.nvim_create_autocmd("User", { + pattern = "SpellDisable", + callback = function() + vim.lsp.enable("ltex", false) end, }) end, diff --git a/sh/README.md b/sh/README.md index 364a6bd..9d6695c 100644 --- a/sh/README.md +++ b/sh/README.md @@ -3,18 +3,17 @@ The bare minimum terminal configuration for a working system. Contains: -* an XDG compliant home directory setup -* several basic environment variables -* simple aliases -* an optional fzf default setup -* X autostart +- an XDG compliant home directory setup +- several basic environment variables +- simple aliases +- an optional fzf default setup +- X autostart -While other modules are largely optional, +While other modules are largely optional, this module is the only one strictly necessary for the system to really work at all. Additionally contains two scripts on which some other modules build: -* a simple script to detect if applications exist +- a simple script to detect if applications exist (and optionally warn the user if they don't) -* and a script to check if internet connectivity exists - +- and a script to check if internet connectivity exists From 3d1f925f78c48fbe79e21a586347259b4057ac52 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Sun, 8 Jun 2025 17:36:09 +0200 Subject: [PATCH 10/16] nvim: Update mason-lspconfig for 2.0 --- nvim/.config/nvim/lua/core/languages.lua | 2 +- nvim/.config/nvim/lua/plugins/lsp.lua | 23 +++++++++++++++-------- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/nvim/.config/nvim/lua/core/languages.lua b/nvim/.config/nvim/lua/core/languages.lua index d604954..2bd28f3 100644 --- a/nvim/.config/nvim/lua/core/languages.lua +++ b/nvim/.config/nvim/lua/core/languages.lua @@ -71,7 +71,7 @@ local languages = { }, latex = { -- TODO: May need to switch to ltex_plus at some point since ltex is unmaintained - lsp = { ltex = { autostart = false }, texlab = {} }, + lsp = { ltex = { disable = true }, texlab = {} }, ts = { "latex" }, }, lua = { diff --git a/nvim/.config/nvim/lua/plugins/lsp.lua b/nvim/.config/nvim/lua/plugins/lsp.lua index 9f31a30..f2e7009 100644 --- a/nvim/.config/nvim/lua/plugins/lsp.lua +++ b/nvim/.config/nvim/lua/plugins/lsp.lua @@ -23,7 +23,21 @@ local lsp = { dependencies = { { "williamboman/mason-lspconfig.nvim", - opts = { automatic_installation = true }, + opts = function() + local to_install = {} + local not_enabled = {} + for k, v in pairs(get_all_servers()) do + table.insert(to_install, k) + if v["disable"] and v["disable"] == true then + table.insert(not_enabled, k) + end + end + local tbl = { + ensure_installed = to_install, + automatic_enable = { exclude = not_enabled }, + } + return tbl + end, dependencies = { "williamboman/mason.nvim" }, cmd = { "LspInstall", "LspUninstall" }, }, @@ -69,13 +83,6 @@ local lsp = { end end - for server_name, config in pairs(lspconfig_opts.servers) do - register(server_name, config) - if vim.fn.has("nvim-0.11") == 0 then - config.capabilities = require("blink.cmp").get_lsp_capabilities(config.capabilities) - end - end - register("marksman", { filetypes = { "markdown", "quarto" }, on_attach = function(client, _) From 7cc7195f9ac9dfa970dda8003ad50e722bdeb76b Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Sun, 8 Jun 2025 17:36:09 +0200 Subject: [PATCH 11/16] nvim: Update nushell lsp installation Nushell lsp is now integrated directly into the 'nu' command. This update stops mason from trying to install a 'nushell' LSP and simply activates the nu-internal LSP if it finds the correct executable instead. --- nvim/.config/nvim/lua/core/languages.lua | 11 +++++++---- nvim/.config/nvim/lua/plugins/lsp.lua | 4 ++++ 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/nvim/.config/nvim/lua/core/languages.lua b/nvim/.config/nvim/lua/core/languages.lua index 2bd28f3..eb142fa 100644 --- a/nvim/.config/nvim/lua/core/languages.lua +++ b/nvim/.config/nvim/lua/core/languages.lua @@ -7,9 +7,12 @@ -- with their respective names used by lspconfig, nvim-treesitter, nvim-lint and conform. -- -local nushell = { lsp = { nushell = {} }, ts = { "nu" } } -if vim.fn.executable("nufmt") == 1 then - nushell.format = { nu = { "nufmt" } } +local nushell = function() + local nushell = { ts = { "nu" } } -- nushell lsp directly built into `nu` cmd + if vim.fn.executable("nufmt") == 1 then + nushell.format = { nu = { "nufmt" } } + end + return nushell end -- FIXME: This does not work for populating LSP config, @@ -96,7 +99,7 @@ local languages = { format = { markdown = { "prettier", "injected" } }, }, nim = { lsp = { nim_langserver = {} }, ts = { "nim", "nim_format_string" }, format = { nim = { "nimpretty" } } }, - nu = nushell, + nu = nushell(), python = { lsp = { basedpyright = {}, ruff = {} }, ts = { "python" }, diff --git a/nvim/.config/nvim/lua/plugins/lsp.lua b/nvim/.config/nvim/lua/plugins/lsp.lua index f2e7009..e85672b 100644 --- a/nvim/.config/nvim/lua/plugins/lsp.lua +++ b/nvim/.config/nvim/lua/plugins/lsp.lua @@ -83,6 +83,10 @@ local lsp = { end end + if vim.fn.executable("nu") == 1 then + register("nushell") + end + register("marksman", { filetypes = { "markdown", "quarto" }, on_attach = function(client, _) From de1591c7a749d529f8b066f2e60654144b8f22c5 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Sun, 8 Jun 2025 17:36:09 +0200 Subject: [PATCH 12/16] nvim: Switch to maintained emmet lsp Called 'emmet_language_server' instead of 'emmet_ls'. --- nvim/.config/nvim/lua/core/languages.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nvim/.config/nvim/lua/core/languages.lua b/nvim/.config/nvim/lua/core/languages.lua index eb142fa..fb32cd4 100644 --- a/nvim/.config/nvim/lua/core/languages.lua +++ b/nvim/.config/nvim/lua/core/languages.lua @@ -55,7 +55,7 @@ local languages = { docker_compose = { lsp = { docker_compose_language_service = {} } }, docker = { lsp = { dockerls = {} }, ts = { "dockerfile" } }, dot = { ts = { "dot" } }, - emmet = { lsp = { emmet_ls = {} } }, + emmet = { lsp = { emmet_language_server = {} } }, javascript = { lsp = { eslint = {} }, ts = { "javascript" }, From 8dd268caf259a0b2d11de7ce055fc8f91b7b6e9b Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Sun, 8 Jun 2025 17:36:09 +0200 Subject: [PATCH 13/16] nvim: Allow registering lsp without providing configuration --- nvim/.config/nvim/lua/plugins/lsp.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nvim/.config/nvim/lua/plugins/lsp.lua b/nvim/.config/nvim/lua/plugins/lsp.lua index e85672b..3f6151b 100644 --- a/nvim/.config/nvim/lua/plugins/lsp.lua +++ b/nvim/.config/nvim/lua/plugins/lsp.lua @@ -72,7 +72,7 @@ local lsp = { local function register(server_name, config, enabled) if vim.fn.has("nvim-0.11") == 1 then - vim.lsp.config(server_name, config) + vim.lsp.config(server_name, config or {}) if enabled == false or vim.lsp.config[server_name]["autostart"] == false then vim.lsp.enable(server_name, false) else From ff7863b0111993922034456a6abd1493055abd14 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Mon, 9 Jun 2025 14:19:57 +0200 Subject: [PATCH 14/16] river: Move hotkey for qute history to H To prepare for output switch hotkey and since '[H]istory' makes more sense, we switch it to `MOD+SHIFT+H`. --- desktop/.config/river/init | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/desktop/.config/river/init b/desktop/.config/river/init index 50233e6..6eba67d 100755 --- a/desktop/.config/river/init +++ b/desktop/.config/river/init @@ -98,7 +98,7 @@ riverctl map normal $mod backspace spawn "powermenu" # Open Bookmark search riverctl map normal None XF86Search spawn "qutedmenu" -riverctl map normal $mod+Shift O spawn "qutedmenu" +riverctl map normal $mod+Shift H spawn "qutedmenu" # Clipboard history riverctl map normal $mod+Shift Space spawn "clipman pick --tool=bemenu" From d91bc46d7583a97a5dd0eb6dcf6b11ee9618bba5 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Mon, 9 Jun 2025 14:19:57 +0200 Subject: [PATCH 15/16] river: Add output quick switch script Invoked by `MOD+SHIFT+O` (for '[O]utput'), it greps the kanshi configuration file for existing profiles and allows you to select one which kanshi tries to apply. Can be a little buggy, though due to kanshi and not the plugin (sometimes failing to re-activate turned off screens etc). --- desktop/.config/kanshi/config | 9 +-------- desktop/.config/river/init | 2 +- desktop/.local/bin/kanshiswitch | 29 +++++++++++++++++++++++++++++ 3 files changed, 31 insertions(+), 9 deletions(-) create mode 100755 desktop/.local/bin/kanshiswitch diff --git a/desktop/.config/kanshi/config b/desktop/.config/kanshi/config index 13648c9..1f5765e 100644 --- a/desktop/.config/kanshi/config +++ b/desktop/.config/kanshi/config @@ -5,13 +5,6 @@ profile docked { exec notify-send "💻 Display changed" "Applying docked LG profile" } -profile docked { - output "Goldstar Company Ltd W2442 0x000574FD" position 1920,0 - output "Goldstar Company Ltd W2442 0x000574E1" position 0,0 - output eDP-1 disable - exec notify-send "💻 Display changed" "Applying docked Goldstar profile" -} - profile dockedall { output "LG Electronics W2442 0x000574FD" position 1920,0 output "LG Electronics W2442 0x000574E1" position 0,0 @@ -19,7 +12,7 @@ profile dockedall { exec notify-send "💻 Display changed" "Applying docked 3-screen profile" } -profile portable { +profile portableforce { output "LG Electronics W2442 0x000574FD" disable output "LG Electronics W2442 0x000574E1" disable output eDP-1 enable position 0,0 diff --git a/desktop/.config/river/init b/desktop/.config/river/init index 6eba67d..df3f22b 100755 --- a/desktop/.config/river/init +++ b/desktop/.config/river/init @@ -176,6 +176,7 @@ riverctl map normal $mod+Shift v toggle-float # shellcheck disable=SC2016 # Make all connected outputs show the desktop and no windows at all riverctl map normal $mod+Shift M spawn 'for i in $(wlopm | wc -l); do riverctl set-focused-tags $((1 << 10)); riverctl focus-output next; done; riverctl set-focused-tags $((1 << 10)); riverctl focus-output next' +riverctl map normal $mod+Shift O spawn "kanshiswitch" riverctl map normal $mod+Shift F10 spawn "riverctl send-layout-cmd $layout_cmd '--tags all --output all view-padding 0'" riverctl map normal $mod F10 spawn "riverctl send-layout-cmd $layout_cmd '--tags all --output all view-padding 6'" @@ -306,7 +307,6 @@ for pad in $(riverctl list-inputs | grep -i touchscreen); do riverctl input "$pad" pointer-accel 0.5 done - # We are not in voidlinux, so no nice turnstile user services will take care of us # have to start everything manually here. if ! cat /etc/*-release | grep -q '^NAME=.*Void'; then diff --git a/desktop/.local/bin/kanshiswitch b/desktop/.local/bin/kanshiswitch new file mode 100755 index 0000000..c4aefb8 --- /dev/null +++ b/desktop/.local/bin/kanshiswitch @@ -0,0 +1,29 @@ +#!/usr/bin/env sh + +if ! exist kanshictl; then + printf "Requires command 'kanshictl' on system." + exit 1 +fi + +picker=dmenu +if exist bemenu; then + picker=bemenu +elif exist wofi; then + picker=wofi +elif exist rofi; then + picker=rofi +fi + +regex='s/profile \+\(.*\) \+{/\1/p' + +list=$(sed -ne "$regex" "${XDG_CONFIG_HOME:-~/.config}/kanshi/config") +profile=$(printf "%s" "$list" | "$picker") +if [ -z "$profile" ]; then + return +else + kanshictl switch "$profile" +fi + +if [ "$1" = '-v' ]; then + notify-send "Kanshi profile set" "Set to: $profile" +fi From de462a270bb82275c083c394112bd35a81b47b5b Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Mon, 9 Jun 2025 14:19:57 +0200 Subject: [PATCH 16/16] papis: Update options for new papis-bbt-formatter version --- writing/papis/config/papis/config | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/writing/papis/config/papis/config b/writing/papis/config/papis/config index 0289ac5..2729f4e 100644 --- a/writing/papis/config/papis/config +++ b/writing/papis/config/papis/config @@ -11,8 +11,8 @@ file-browser = vifm # edit info.yaml as new papers are added add-edit = True # ref-format = {doc[author_list][0][family]}{doc[year]} -ref-format = bbt -add-folder-name = {doc[author_list][0][family]}-{doc[title]} +ref-format = bbt: +add-folder-name = {doc[author_list][0][family]}-{doc[title]} # NOTE: Has issues if no author list add-file-name = {doc[author_list][0][family]}{doc[year]} header-format-file = ~/.config/papis/headerformat extra-bibtex-keys = ["tags", "readstatus", "priority"] @@ -68,7 +68,7 @@ dir = ~/documents/library/academia [plugins.extract] tags = {"red": "important", "green": "extra", "blue": "toread"} -[plugins.bbt-formatter] +[plugins.bbt] full-year = True title-words = 2 title-chars = 20