From 9a8a14f85f985df2d76b6cc5c4f05050a7d9faf2 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Fri, 24 Feb 2023 10:02:00 +0100 Subject: [PATCH 01/51] nvim: mini indentline fix updated config option Mini changed the configuration for its indentline module to use a table instead of a function for its animation generation configuration. This commit updates the config accordingly. --- nvim/.config/nvim/lua/plug/_mini.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nvim/.config/nvim/lua/plug/_mini.lua b/nvim/.config/nvim/lua/plug/_mini.lua index 1391e19..31dfe4c 100644 --- a/nvim/.config/nvim/lua/plug/_mini.lua +++ b/nvim/.config/nvim/lua/plug/_mini.lua @@ -1,11 +1,11 @@ require('mini.ai').setup() require('mini.comment').setup() -require('mini.cursorword').setup({delay = 500}) +require('mini.cursorword').setup({ delay = 500 }) require('mini.fuzzy').setup() require('mini.indentscope').setup({ symbol = "│", - draw = {animation = require('mini.indentscope').gen_animation('none')}, - options = {indent_at_cursor = false} + draw = { animation = require('mini.indentscope').gen_animation.none() }, + options = { indent_at_cursor = false } }) require('mini.map').setup() -- require('mini.move').setup() -- has not hit stable yet From e87814ebcb07deb3405e35dad54ea7bb2a027b21 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Fri, 24 Feb 2023 10:04:19 +0100 Subject: [PATCH 02/51] nvim: Remove leftover plugin settings We are not making use of vsnip anymore (replaced by luasnip in zero-lsp package) but still had a couple of vsnip mappings that lead to erratic key behavior. --- nvim/.config/nvim/lua/maps.lua | 8 ----- nvim/.config/nvim/lua/plugins.lua | 1 - nvim/.config/nvim/plugin/notational-fzf.vim | 8 ----- nvim/.config/nvim/plugin/vim-pandoc.vim | 34 --------------------- 4 files changed, 51 deletions(-) delete mode 100644 nvim/.config/nvim/plugin/notational-fzf.vim delete mode 100644 nvim/.config/nvim/plugin/vim-pandoc.vim diff --git a/nvim/.config/nvim/lua/maps.lua b/nvim/.config/nvim/lua/maps.lua index 1cb5217..5a3f663 100644 --- a/nvim/.config/nvim/lua/maps.lua +++ b/nvim/.config/nvim/lua/maps.lua @@ -201,14 +201,6 @@ map('x', 'ga', '(EasyAlign)') -- Start interactive EasyAlign for a motion/text object (e.g. gaip) map('n', 'ga', '(EasyAlign)') --- PLUGIN: vnsip --- jump around in snippets -map('i', '', [[vsnip#jumpable(1) ? '(vsnip-jump-next)' : '']], - { expr = true }) -map('i', '', - [[vsnip#jumpable(-1) ? '(vsnip-jump-next)' : '']], - { expr = true }) - -- PLUGIN: symbols-outline.nvim map('n', 'o', 'SymbolsOutline', { silent = true }) diff --git a/nvim/.config/nvim/lua/plugins.lua b/nvim/.config/nvim/lua/plugins.lua index 86a5c16..7068891 100644 --- a/nvim/.config/nvim/lua/plugins.lua +++ b/nvim/.config/nvim/lua/plugins.lua @@ -68,7 +68,6 @@ return { config = function() require('plug._lualine') end }, -- writing { 'vim-pandoc/vim-pandoc-syntax', ft = writing_ft }, - { 'vim-pandoc/vim-pandoc', ft = writing_ft }, { 'vim-pandoc/vim-criticmarkup', ft = writing_ft }, { 'quarto-dev/quarto-nvim', dependencies = { 'jmbuhr/otter.nvim', 'neovim/nvim-lspconfig' }, diff --git a/nvim/.config/nvim/plugin/notational-fzf.vim b/nvim/.config/nvim/plugin/notational-fzf.vim deleted file mode 100644 index 14ea40b..0000000 --- a/nvim/.config/nvim/plugin/notational-fzf.vim +++ /dev/null @@ -1,8 +0,0 @@ -" PLUGIN: notational-fzf-vim -" Configure notational-fzf-vim -if $WIKIROOT ==? "" - let g:nv_search_paths = [ expand('~/documents/notes') ] -else - let g:nv_search_paths = [ $WIKIROOT ] -endif -let g:nv_wrap_preview_text=1 diff --git a/nvim/.config/nvim/plugin/vim-pandoc.vim b/nvim/.config/nvim/plugin/vim-pandoc.vim deleted file mode 100644 index 8387248..0000000 --- a/nvim/.config/nvim/plugin/vim-pandoc.vim +++ /dev/null @@ -1,34 +0,0 @@ -" PLUGIN: vim-pandoc -" handle markdown files with pandoc (and pandoc syntax!) -let g:pandoc#modules#disabled = [ "keyboard", "folding" ] -let g:pandoc#filetypes#pandoc_markdown = 0 -let g:pandoc#filetypes#handled = [ "extra", "latex", "markdown", "pandoc", "rst", "textile"] -" disable all default keymaps -let g:pandoc#keyboard#use_default_mappings=0 -" needs to be set for wrapping and unwrapping of lines to work when doing j/k -" or gj/gk respectively, to allow precise relative cursor jumping -let g:pandoc#keyboard#display_motions=0 -let g:pandoc#hypertext#use_default_mappings=0 -" if there's a pdf and an html or similar, open the pdf -let g:pandoc#command#prefer_pdf=1 -" look for bibtex files w/ same name as edited one, then .bib in current dir, yaml frontmatter, and finally the globally set bibs file -let g:pandoc#biblio#sources="bcyg" -" the globally set bibs file -if $BIBFILE ==? "" - let g:pandoc#biblio#bibs=[expand("~/documents/library/academia/academia.bib")] -else - let g:pandoc#biblio#bibs=[expand($BIBFILE)] -endif -let g:pandoc#biblio#use_bibtool=1 -let g:pandoc#biblio#use_preview=1 -let g:pandoc#completion#bib#mode='citeproc' -let g:pandoc#folding#fold_yaml=1 -let g:pandoc#folding#fastfolds=1 -" let g:pandoc#folding#level=1 -let g:pandoc#spell#default_langs=["en_us", "de_de"] -let g:pandoc#hypertext#ausosave_on_edit_open_link=1 -let g:pandoc#hypertext#create_if_no_alternates_exists=1 - -" PLUGIN: vim-pandoc-syntax -let g:pandoc#syntax#conceal#use = 1 -let g:pandoc#syntax#conceal#urls = 1 From 9a874b1a1b03cf488cfea6ee36be0fdf8d686dd8 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Fri, 24 Feb 2023 21:38:31 +0100 Subject: [PATCH 03/51] nvim: Remap leader groups This commit is a change to some of the foundational mappings I use through my leader key: opening telescope searches and toggling several additional display riders. First of all, all telescope functionality has been subsumed under the f prefix: f (ff, that is) for finding files F for grepping h for finding hidden files o for finding old files b for finding buffers l for searching git log s for searching git status c for finding git commits (for current file) Aside from these (which are pretty massive changes for me), we have a new leader prefix group for the (now freed) s: o toggle symbols outline m toggle minimap s open the (mini.nvim) startup screen --- nvim/.config/nvim/lua/maps.lua | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/nvim/.config/nvim/lua/maps.lua b/nvim/.config/nvim/lua/maps.lua index 5a3f663..ccfd6d2 100644 --- a/nvim/.config/nvim/lua/maps.lua +++ b/nvim/.config/nvim/lua/maps.lua @@ -116,33 +116,33 @@ map('n', 'E', ':Vifm getcwd()', { desc = 'browse project' }) -- PLUGIN: Telescope GLOBAL FUZZY FINDING -- buffers and files in current workdir -map('n', 's', +map('n', 'fb', ":lua require 'telescope.builtin'.buffers(require 'telescope.themes'.get_ivy())", { desc = 'list buffers' }) -- most recently used / MRU, bound to S since it is essentially a larger -- go-back intention than just buffers -map('n', 'S', +map('n', 'fo', ":lua require 'telescope.builtin'.oldfiles(require 'telescope.themes'.get_ivy())", { desc = 'list old files' }) -- fuzzy find files in cwd -map('n', 'f', ":lua require 'telescope.builtin'.find_files()", +map('n', 'ff', ":lua require 'telescope.builtin'.find_files()", { desc = 'find files' }) -- fuzzy find hidden files in cwd -map('n', '', +map('n', 'fh', ":lua require 'telescope.builtin'.find_files({hidden=true})", { desc = 'find hidden files' }) -- general full-text search in cwd with rg -map('n', 'F', ":lua require 'telescope.builtin'.live_grep()", +map('n', 'fF', ":lua require 'telescope.builtin'.live_grep()", { desc = 'grep search' }) -- git status -map('n', 'gs', ":lua require 'telescope.builtin'.git_status()", +map('n', 'fg', ":lua require 'telescope.builtin'.git_status()", { desc = 'git status' }) -- git buffercommits -map('n', 'gb', ":lua require 'telescope.builtin'.git_bcommits()", +map('n', 'fc', ":lua require 'telescope.builtin'.git_bcommits()", { desc = 'git buffer commits' }) -- git commitlog -map('n', 'gl', ":lua require 'telescope.builtin'.git_commits()", +map('n', 'fl', ":lua require 'telescope.builtin'.git_commits()", { desc = 'git commit log' }) -- helptags @@ -193,7 +193,8 @@ map('i', '', 'u[s1z=`]au') map('n', 's', 'ms[s1z=`s', { desc = 'Fix last spell error' }) -- PLUGIN: mini.nvim -map('n', 'm', ':lua MiniMap.toggle()', { silent = true }) +map('n', 'sm', ':lua MiniMap.toggle()', { silent = true, desc = 'toggle minimap' }) +map('n', 'ss', ":lua MiniStarter.open()", { desc = 'show startpage' }) -- PLUGIN: easy-align -- Start interactive EasyAlign in visual mode (e.g. vipga) @@ -202,7 +203,7 @@ map('x', 'ga', '(EasyAlign)') map('n', 'ga', '(EasyAlign)') -- PLUGIN: symbols-outline.nvim -map('n', 'o', 'SymbolsOutline', { silent = true }) +map('n', 'so', 'SymbolsOutline', { silent = true, desc = 'toggle symbol outline' }) -- trim trailing whitespaces with mini.nvim trailspace map("n", "w", function() require("mini.trailspace").trim() end, From ad90cdce305f44476648c5bb4b4d739106bf0af8 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Sat, 25 Feb 2023 16:54:24 +0100 Subject: [PATCH 04/51] qutebrowser: Fix index error on redirects Fixed silly mistake sometimes trying to reach an out of range redirect url. --- qutebrowser/.config/qutebrowser/redirects.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qutebrowser/.config/qutebrowser/redirects.py b/qutebrowser/.config/qutebrowser/redirects.py index 48fccca..701e4ad 100644 --- a/qutebrowser/.config/qutebrowser/redirects.py +++ b/qutebrowser/.config/qutebrowser/redirects.py @@ -197,7 +197,7 @@ def rewrite(request: interceptor.Request): matched=True if matched: - target = service["target"][random.randint(0, len(service["target"]))] + target = service["target"][random.randint(0, len(service["target"])-1)] if target is not None and url.setHost(target) is not False: try: request.redirect(url) From 73ae033139748ea1732c952691da65a682baf15f Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Sat, 25 Feb 2023 16:55:42 +0100 Subject: [PATCH 05/51] vifm: Switch to tidy-viewer for csv preview --- terminal/.config/vifm/vifmrc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/terminal/.config/vifm/vifmrc b/terminal/.config/vifm/vifmrc index 396929e..3080bc6 100644 --- a/terminal/.config/vifm/vifmrc +++ b/terminal/.config/vifm/vifmrc @@ -469,7 +469,8 @@ filextype *.csv \ {Open with visidata} \ vd %f, fileviewer *.csv - \ xsv sample 100 %c | xsv table -c8 -p1 -w1, + \ tidy-viewer + " \ xsv sample 100 %c | xsv table -c8 -p1 -w1, " \ {cat %c | sed -e 's/,,/, ,/g' | column -s, -t | less -#5 -N -S; } " Mindmap From 1e84deff030bb2096402d68e0805f908068becf9 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Sat, 25 Feb 2023 16:58:31 +0100 Subject: [PATCH 06/51] papis: Fix reference for imports, Add personal lib --- writing/.config/papis/config | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/writing/.config/papis/config b/writing/.config/papis/config index 9b7bf01..adbffe8 100644 --- a/writing/.config/papis/config +++ b/writing/.config/papis/config @@ -3,11 +3,11 @@ #picktool = fzf default-library = master file-browser = vifm -ref-format = {doc[author_list][0][surname]}{doc[year]} +ref-format = {doc[author_list][0][family]}{doc[year]} # edit info.yaml as new papers are added add-edit = True -add-folder-name = {doc[ref]}-{doc[title]} +add-folder-name = {doc[author_list][0][family]}-{doc[title]} add-file-name = {doc[author_list][0][family]}{doc[year]} header-format-file = ~/.config/papis/headerformat extra-bibtex-keys = ["tags", "readstatus"] @@ -31,5 +31,8 @@ dir = ~/documents/library [academia] dir = ~/documents/library/academia +[personal] +dir = ~/documents/library/personal + [cs] dir = ~/documents/library/cs From 28825adc5d20b3b3ca0314f3be5f40073d614ffc Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Sat, 25 Feb 2023 17:05:42 +0100 Subject: [PATCH 07/51] kanshi: Fix for black screen Sometimes kanshi will keep docked mode (only external screens) enabled while keeping them turned off and, sometimes even internal screen black. This attempts to fix it. --- desktop/.config/kanshi/config | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/desktop/.config/kanshi/config b/desktop/.config/kanshi/config index ece2f81..111d1a2 100644 --- a/desktop/.config/kanshi/config +++ b/desktop/.config/kanshi/config @@ -1,15 +1,15 @@ profile docked { - output eDP-1 disable output "LG Electronics W2442 0x000075FD" position 1920,0 output "LG Electronics W2442 0x000075E1" position 0,0 - exec notify-send "💻 Display changed" "Applying docked profile" + output eDP-1 disable + exec notify-send "💻 Display changed" "Applying docked LG profile" } profile docked { - output eDP-1 disable output "Goldstar Company Ltd W2442 0x000075FD" position 1920,0 output "Goldstar Company Ltd W2442 0x000075E1" position 0,0 - exec notify-send "💻 Display changed" "Applying docked profile" + output eDP-1 disable + exec notify-send "💻 Display changed" "Applying docked Goldstar profile" } profile portable { From 1ad0c382a9d540c46f57a48038272e5662dc0c83 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Sat, 25 Feb 2023 17:06:55 +0100 Subject: [PATCH 08/51] river: Remove duplicate suspend call --- desktop/.config/river/init | 1 - 1 file changed, 1 deletion(-) diff --git a/desktop/.config/river/init b/desktop/.config/river/init index 7a95637..a3b2bf1 100755 --- a/desktop/.config/river/init +++ b/desktop/.config/river/init @@ -268,7 +268,6 @@ unset loc # start screen idle locking/dimming/sleep tool killall swayidle riverctl spawn "swayidle \ - timeout ${time_to_suspend} \"systemctl suspend-then-hibernate\" \ timeout ${time_to_suspend} \"[ $(cat /sys/class/power_supply/AC/online) -eq 0 ] && systemctl suspend-then-hibernate\" timeout ${time_to_screendim} \"wlopm --off '*'\" \ resume \"wlopm --on '*'\" \ From 89ed4615a7b60725af8757976fcebc705f7a4adb Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Sat, 25 Feb 2023 17:07:19 +0100 Subject: [PATCH 09/51] ncmpcpp: Remap song ffwd and rewind Mapped fast forward to f and song rewind to F to mimick seaerch-ahead and search-behind ability of vim. --- multimedia/.config/ncmpcpp/bindings | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multimedia/.config/ncmpcpp/bindings b/multimedia/.config/ncmpcpp/bindings index 0c8a6ad..1427f85 100644 --- a/multimedia/.config/ncmpcpp/bindings +++ b/multimedia/.config/ncmpcpp/bindings @@ -72,7 +72,7 @@ def_key "P" move_selected_items_to def_key "f" seek_forward -def_key "b" +def_key "F" seek_backward def_key "'" jump_to_playing_song From 5d2542db517f9946d6348737e6be32ec444657d9 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Sat, 25 Feb 2023 17:11:00 +0100 Subject: [PATCH 10/51] sync-mail: Warn user as part of prehook If no hook should be run before syncing (or a user-defined hook) then the warning should fall under that and not be run as part of it. Additionally takes care of multiple decryption requirements in a row. --- office/.local/bin/sync-mail | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/office/.local/bin/sync-mail b/office/.local/bin/sync-mail index 098052b..d52ce92 100755 --- a/office/.local/bin/sync-mail +++ b/office/.local/bin/sync-mail @@ -47,6 +47,7 @@ prehook() { eval "$MBSYNC_PRE" return 0 fi + checkwarnuser imapfilter -c "${XDG_CONFIG_HOME:-$HOME/.config}/imapfilter/config.lua" } @@ -142,7 +143,6 @@ elif [ -n "$1" ]; then fi main() { - checkwarnuser enablegpgagent prehook From f2cb2f5be97ff975fbd8794b8da7576a311c66ca Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Sat, 25 Feb 2023 17:12:27 +0100 Subject: [PATCH 11/51] imapfilter: Switch to use pass command The other office tools use the pass command so we switch this one to use it to unify invocation. --- office/.config/imapfilter/accounts.lua | 8 ++++---- office/.config/imapfilter/filters/rollup-dump.lua | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/office/.config/imapfilter/accounts.lua b/office/.config/imapfilter/accounts.lua index 7589f85..8d48286 100644 --- a/office/.config/imapfilter/accounts.lua +++ b/office/.config/imapfilter/accounts.lua @@ -1,9 +1,9 @@ local accounts = {} -local status, gmailuser = pipe_from( - 'gpg2 --decrypt --no-tty --quiet --no-verbose --for-your-eyes-only --pinentry-mode ask ~/.local/share/pass/misc/aerc-gmail-app-password.gpg | grep username | cut -d: -f2') -local status, gmailpass = pipe_from( - 'gpg2 --decrypt --no-tty --quiet --no-verbose --for-your-eyes-only --pinentry-mode ask ~/.local/share/pass/misc/aerc-gmail-app-password.gpg | head -n1') +local _, gmailuser = pipe_from( + 'pass show misc/gmail-app-password | grep username | cut -d: -f2') +local _, gmailpass = pipe_from( + 'pass show misc/gmail-app-password | head -n1') -- Setup an imap account called gmail accounts.gmail = IMAP { server = "imap.gmail.com", diff --git a/office/.config/imapfilter/filters/rollup-dump.lua b/office/.config/imapfilter/filters/rollup-dump.lua index 7b1ef95..e26f9bb 100644 --- a/office/.config/imapfilter/filters/rollup-dump.lua +++ b/office/.config/imapfilter/filters/rollup-dump.lua @@ -30,11 +30,11 @@ function getSenderList(rollupfile) for line in file:lines() do table.insert(rollupSenders, line) end else print( - "ERROR: rollup did not find rollup.txt file containing mail addresses at " .. - rollupfile or "") + "rollup did not find rollup.txt file containing mail addresses at " .. + rollupfile or ". Skipping.") end return rollupSenders end sendToFolder(accounts.gmail["Inbox"], accounts.gmail["Dump"], - getSenderList(getRollupFile())) + getSenderList(getRollupFile())) From cd9d373dcac8eb2962c8c59dbb9c109c4a46cf1a Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Sat, 25 Feb 2023 17:13:19 +0100 Subject: [PATCH 12/51] taskwarrior: Add today alias Added `tod` alias which looks for tasks due today or overdue. --- office/.config/sh/alias.d/taskwarrior.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/office/.config/sh/alias.d/taskwarrior.sh b/office/.config/sh/alias.d/taskwarrior.sh index 99a8262..4f28098 100644 --- a/office/.config/sh/alias.d/taskwarrior.sh +++ b/office/.config/sh/alias.d/taskwarrior.sh @@ -25,6 +25,7 @@ alias tan="task annotate" alias tn="task next +READY" alias tun="task next urgency \> 4" +alias tod="task +TODAY or +OVERDUE" if exist timew; then alias tra="task active && timew" From fd8b0b290c3e35397ecc779855f46b19955a58ac Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Sat, 25 Feb 2023 17:13:59 +0100 Subject: [PATCH 13/51] taskwarrior: Display scheduled tasks on grey bg Switched scheduled to display on grey background to improve readability on dark color schemes slightly. --- office/.config/task/taskrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/office/.config/task/taskrc b/office/.config/task/taskrc index 65fb40e..f2d2955 100644 --- a/office/.config/task/taskrc +++ b/office/.config/task/taskrc @@ -80,7 +80,7 @@ include task-sync.rc include contexts # try to fix some color weirdness, especially in tmux -# color.scheduled=on grey +color.scheduled=on grey # only ever show one result in the tasksh tasksh.autoclear=1 From 0127a5db075dcf237486f18af260631814142c58 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Sat, 25 Feb 2023 17:16:51 +0100 Subject: [PATCH 14/51] nvim: Switch from neorg to zk-nvim Neorg is fine but not for me right now (especially with its own syntax spec). zk seems to fit my workflow much better, this is the beginning of trying it out. --- nvim/.config/nvim/lua/plug/_neorg.lua | 8 ----- nvim/.config/nvim/lua/plugins.lua | 50 +++++++++++++++------------ 2 files changed, 28 insertions(+), 30 deletions(-) delete mode 100644 nvim/.config/nvim/lua/plug/_neorg.lua diff --git a/nvim/.config/nvim/lua/plug/_neorg.lua b/nvim/.config/nvim/lua/plug/_neorg.lua deleted file mode 100644 index 90cb520..0000000 --- a/nvim/.config/nvim/lua/plug/_neorg.lua +++ /dev/null @@ -1,8 +0,0 @@ -require("neorg").setup { - load = { - ["core.defaults"] = {}, - ["core.norg.concealer"] = {}, - ["core.norg.completion"] = { config = { engine = "nvim-cmp" } }, - ["core.norg.qol.toc"] = {} - } -} diff --git a/nvim/.config/nvim/lua/plugins.lua b/nvim/.config/nvim/lua/plugins.lua index 7068891..f557fba 100644 --- a/nvim/.config/nvim/lua/plugins.lua +++ b/nvim/.config/nvim/lua/plugins.lua @@ -67,10 +67,15 @@ return { requires = { 'kyazdani42/nvim-web-devicons', opt = true }, config = function() require('plug._lualine') end }, -- writing - { 'vim-pandoc/vim-pandoc-syntax', ft = writing_ft }, - { 'vim-pandoc/vim-criticmarkup', ft = writing_ft }, { + { 'vim-pandoc/vim-criticmarkup', ft = writing_ft }, { + 'mickael-menu/zk-nvim', + config = function() require('zk').setup({ picker = "telescope" }) end +}, { 'quarto-dev/quarto-nvim', - dependencies = { 'jmbuhr/otter.nvim', 'neovim/nvim-lspconfig' }, + dependencies = { + 'jmbuhr/otter.nvim', 'neovim/nvim-lspconfig', + 'vim-pandoc/vim-pandoc-syntax' + }, config = function() require 'quarto'.setup { lspFeatures = { @@ -115,14 +120,7 @@ return { { "folke/which-key.nvim", config = function() require("which-key").setup {} end - }, { - "nvim-neorg/neorg", - config = function() require("plug._neorg") end, - dependencies = { "nvim-lua/plenary.nvim" }, - version = "*", - ft = "norg" -}, -- extensive organization plugin mimicking orgmode - -- fuzzy matching + }, -- fuzzy matching { "nvim-telescope/telescope-fzf-native.nvim", build = 'make' }, { "nvim-telescope/telescope.nvim", dependencies = { "nvim-lua/popup.nvim", "nvim-lua/plenary.nvim" }, @@ -180,15 +178,23 @@ return { config = function() require('plug._lsp') end, event = "VeryLazy" }, -- and completion - { - "jghauser/papis.nvim", - after = { "telescope.nvim", "nvim-cmp" }, - dependencies = { - "kkharji/sqlite.lua", "nvim-lua/plenary.nvim", - "MunifTanjim/nui.nvim", "nvim-treesitter/nvim-treesitter" - }, - ft = writing_ft, - rocks = { "lyaml" }, - config = true - } + -- { -- REQUIRES custom `yay -S --asdeps lua51-lyaml invocation` AND is suuper slow + -- "jghauser/papis.nvim", + -- after = { "telescope.nvim", "nvim-cmp" }, + -- dependencies = { + -- "kkharji/sqlite.lua", "nvim-lua/plenary.nvim", + -- "MunifTanjim/nui.nvim", "nvim-treesitter/nvim-treesitter" + -- }, + -- ft = writing_ft, + -- rocks = { "lyaml" }, + -- config = function() + -- require('papis').setup({ + -- papis_python = { + -- dir = "/home/marty/documents/library/academia", + -- info_name = "info.yaml", + -- notes_name = [[notes.qmd]] + -- } + -- }) + -- end + -- } } From e6d7578198e6d464ee558e7a83f79d888ba7f502 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Mon, 27 Feb 2023 08:47:51 +0100 Subject: [PATCH 15/51] nvim: Switch from cmp-pandoc to cmp-pandoc-references cmp-pandoc.nvim did not work sufficiently for my use case so far (sometimes it did, most of the times it did not at all, every now and again it sputtered some references to the list). cmp-pandoc-references seems like a plugin kept relatively 'simple' requiring no setup, a single `bibliography: ` line in the pandoc meta-data header and it works flawlessly from there. I might delve deeper at some point, especially with the papis.nvim integration, but for now this is perfectly adequate. --- nvim/.config/nvim/lua/plug/_cmp.lua | 2 +- nvim/.config/nvim/lua/plugins.lua | 9 +++------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/nvim/.config/nvim/lua/plug/_cmp.lua b/nvim/.config/nvim/lua/plug/_cmp.lua index 086874a..a5e7393 100644 --- a/nvim/.config/nvim/lua/plug/_cmp.lua +++ b/nvim/.config/nvim/lua/plug/_cmp.lua @@ -7,7 +7,7 @@ lsp.nvim_workspace() lsp.setup_nvim_cmp({ sources = { { name = 'path' }, { name = 'nvim_lsp', keyword_length = 2 }, - { name = 'buffer', keyword_length = 3 }, + { name = 'pandoc_references' }, { name = 'buffer', keyword_length = 3 }, { name = 'luasnip', keyword_length = 2 }, { name = 'tmux' }, { name = 'otter' }, { name = 'latex_symbols' }, { name = 'vCard' }, { name = 'nvim_lua' }, { name = 'buffer' }, { name = 'spell' } diff --git a/nvim/.config/nvim/lua/plugins.lua b/nvim/.config/nvim/lua/plugins.lua index f557fba..fc2f9ef 100644 --- a/nvim/.config/nvim/lua/plugins.lua +++ b/nvim/.config/nvim/lua/plugins.lua @@ -164,11 +164,8 @@ return { "rafamadriz/friendly-snippets", "andersevenrud/cmp-tmux", "hrsh7th/cmp-nvim-lsp", "kdheepak/cmp-latex-symbols", "ray-x/cmp-treesitter", "f3fora/cmp-spell", "hrsh7th/cmp-cmdline", - "cbarrete/completion-vcard", { - 'aspeddro/cmp-pandoc.nvim', - dependencies = { 'nvim-lua/plenary.nvim', 'jbyuki/nabla.nvim' }, - event = "InsertEnter" - }, { "lukas-reineke/lsp-format.nvim", config = true } + "cbarrete/completion-vcard", "jc-doyle/cmp-pandoc-references", + { "lukas-reineke/lsp-format.nvim", config = true } }, config = function() require('plug._cmp') end }, { 'simrat39/symbols-outline.nvim', config = true, event = "VeryLazy" }, -- vista-like outline view for code @@ -177,7 +174,7 @@ return { 'ray-x/navigator.lua', config = function() require('plug._lsp') end, event = "VeryLazy" -}, -- and completion +} -- and completion -- { -- REQUIRES custom `yay -S --asdeps lua51-lyaml invocation` AND is suuper slow -- "jghauser/papis.nvim", -- after = { "telescope.nvim", "nvim-cmp" }, From 74bbaf4dafd66c0923a7e0e584d1701fe866cfa6 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Mon, 27 Feb 2023 09:20:18 +0100 Subject: [PATCH 16/51] nvim: Remove cmdline if not used, split buffers belowright --- nvim/.config/nvim/lua/settings.lua | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/nvim/.config/nvim/lua/settings.lua b/nvim/.config/nvim/lua/settings.lua index 2f07e1c..512855e 100644 --- a/nvim/.config/nvim/lua/settings.lua +++ b/nvim/.config/nvim/lua/settings.lua @@ -1,4 +1,4 @@ -local default_builtins_disabled = {"netrw", "netrwPlugin"} +local default_builtins_disabled = { "netrw", "netrwPlugin" } local disable_builtins = function(builtins) for _, plugin in pairs(builtins) do vim.g["loaded_" .. plugin] = 1 end end @@ -12,23 +12,19 @@ local o = { shiftwidth = 4, softtabstop = 4, expandtab = true, - -- make jumplist behave more like browser, when jumping back -- and then adding a new jump discards all the previous -- 'future-jump' tree, making more sense for wiki-like movement jumpoptions = 'stack', - -- set cursor line highlighting, esp useful when using with bracket -- highlighting and you don't know which side of the brace the cursor is on cursorline = true, - -- shows linenumbers relative to the one you are on, for easy movement and -- dNUMBERd deletions number = true, relativenumber = true, -- puts the numbers into the signcolumn so when git/lsp show signs there's no jump signcolumn = 'number', - -- keeps an undofile next to files so that you can even undo if vim is closed -- in between undofile = true, @@ -38,32 +34,30 @@ local o = { -- all lowercased ignorecase = true, smartcase = true, - -- shows previews of what substitute command will do (and a couple others) inccommand = 'split', - -- disables showing us the current mode in the command line since airline takes -- care of it showmode = false, -- turn off modeline, to ensure security observation modeline = false, - -- i feel foldlevel 2 is generally pretty usable, for headlines and similar + -- set to use treesitter in treesitter config foldlevel = 2, conceallevel = 2, - -- enable mouse, doesn't bug me and might come in useful at some point mouse = 'a', - -- pump all clippings into the system clipboard clipboard = 'unnamedplus', - -- turn of automatic resizing of individual splits equalalways = false, - -- make sure there's always *some* context below cursor - scrolloff = 4 - + scrolloff = 4, + -- open new buffers bottomright + splitright = true, + splitbelow = true, + -- remove command line if no command is currently present + cmdheight = 0, } for k, v in pairs(o) do From 693f8ba3f439b9bc858e39117443b63c2a1d8280 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Mon, 27 Feb 2023 09:22:02 +0100 Subject: [PATCH 17/51] nvim: Move autocommands into separate module --- nvim/.config/nvim/init.lua | 29 +---------------------------- nvim/.config/nvim/lua/autocmds.lua | 27 +++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 28 deletions(-) create mode 100644 nvim/.config/nvim/lua/autocmds.lua diff --git a/nvim/.config/nvim/init.lua b/nvim/.config/nvim/init.lua index 397cd86..2af02a3 100644 --- a/nvim/.config/nvim/init.lua +++ b/nvim/.config/nvim/init.lua @@ -2,36 +2,8 @@ -- https://github.com/elianiva/dotfiles/ - with much gratitude local api = vim.api --- Highlight whatever is being yanked -vim.api.nvim_create_autocmd({ "TextYankPost" }, { - command = 'silent! lua require"vim.highlight".on_yank{timeout=500}', - desc = "Highlight yanked text whenevery yanking something", - group = vim.api.nvim_create_augroup('highlightyanks', { clear = true }) -}) - --- Special setting for editing gopass files - make sure nothing leaks outside the directories it is supposed to -vim.api.nvim_create_autocmd({ "BufNewFile", "BufRead" }, { - pattern = { - "/dev/shm/gopass.*", "/dev/shm/pass.?*/?*.txt", - "$TMPDIR/pass.?*/?*.txt", "/tmp/pass.?*/?*.txt" - }, - command = 'setlocal noswapfile nobackup noundofile nowritebackup viminfo=', - desc = "Don't leak any information when editing potential password files", - group = vim.api.nvim_create_augroup('passnoleak', { clear = true }) -}) - api.nvim_exec('runtime abbrev.vim', false) --- fixing neovim opening up at same moment as alacritty (see https://github.com/neovim/neovim/issues/11330) -vim.api.nvim_create_autocmd({ "VimEnter" }, { - callback = function() - local pid, WINCH = vim.fn.getpid(), vim.loop.constants.SIGWINCH - vim.defer_fn(function() vim.loop.kill(pid, WINCH) end, 20) - end, - desc = "Fix neovim sizing issues if opening same time as alacritty", - group = vim.api.nvim_create_augroup('alacritty_fixsize', { clear = true }) -}) - local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" if not vim.loop.fs_stat(lazypath) then vim.fn.system({ @@ -50,6 +22,7 @@ vim.opt.rtp:prepend(lazypath) vim.g.mapleader = " " require('settings') +require('autocmds') require("lazy").setup("plugins") require('look') require('maps') diff --git a/nvim/.config/nvim/lua/autocmds.lua b/nvim/.config/nvim/lua/autocmds.lua new file mode 100644 index 0000000..909817a --- /dev/null +++ b/nvim/.config/nvim/lua/autocmds.lua @@ -0,0 +1,27 @@ +-- Highlight whatever is being yanked +vim.api.nvim_create_autocmd({ "TextYankPost" }, { + command = 'silent! lua require"vim.highlight".on_yank{timeout=500}', + desc = "Highlight yanked text whenevery yanking something", + group = vim.api.nvim_create_augroup('highlightyanks', { clear = true }) +}) + +-- Special setting for editing gopass files - make sure nothing leaks outside the directories it is supposed to +vim.api.nvim_create_autocmd({ "BufNewFile", "BufRead" }, { + pattern = { + "/dev/shm/gopass.*", "/dev/shm/pass.?*/?*.txt", + "$TMPDIR/pass.?*/?*.txt", "/tmp/pass.?*/?*.txt" + }, + command = 'setlocal noswapfile nobackup noundofile nowritebackup viminfo=', + desc = "Don't leak any information when editing potential password files", + group = vim.api.nvim_create_augroup('passnoleak', { clear = true }) +}) + +-- fixing neovim opening up at same moment as alacritty (see https://github.com/neovim/neovim/issues/11330) +vim.api.nvim_create_autocmd({ "VimEnter" }, { + callback = function() + local pid, WINCH = vim.fn.getpid(), vim.loop.constants.SIGWINCH + vim.defer_fn(function() vim.loop.kill(pid, WINCH) end, 20) + end, + desc = "Fix neovim sizing issues if opening same time as alacritty", + group = vim.api.nvim_create_augroup('alacritty_fixsize', { clear = true }) +}) From 70ccf5fa55cbbc05e4b63e6e2e97f0dd45746bd2 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Mon, 27 Feb 2023 09:22:33 +0100 Subject: [PATCH 18/51] nvim: Display gitsigns as highlights on linenums --- nvim/.config/nvim/lua/plugins.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/nvim/.config/nvim/lua/plugins.lua b/nvim/.config/nvim/lua/plugins.lua index fc2f9ef..598dca9 100644 --- a/nvim/.config/nvim/lua/plugins.lua +++ b/nvim/.config/nvim/lua/plugins.lua @@ -11,7 +11,9 @@ return { { 'vifm/vifm.vim' }, -- integrate file manager { 'lewis6991/gitsigns.nvim', -- show vcs changes on left-hand gutter - config = true, + opts = { + numhl = true, signcolumn = false + }, event = "BufRead" }, { 'norcalli/nvim-colorizer.lua', -- color hex, named colors in the correct preview scheme From 1b69f5714619aaca991082379e002c01994b1285 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Tue, 28 Feb 2023 11:21:39 +0100 Subject: [PATCH 19/51] nvim: Remove line number from terminal buffers --- nvim/.config/nvim/lua/autocmds.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/nvim/.config/nvim/lua/autocmds.lua b/nvim/.config/nvim/lua/autocmds.lua index 909817a..ce53e7f 100644 --- a/nvim/.config/nvim/lua/autocmds.lua +++ b/nvim/.config/nvim/lua/autocmds.lua @@ -25,3 +25,9 @@ vim.api.nvim_create_autocmd({ "VimEnter" }, { desc = "Fix neovim sizing issues if opening same time as alacritty", group = vim.api.nvim_create_augroup('alacritty_fixsize', { clear = true }) }) + +-- remove line numbers from terminal buffers +vim.api.nvim_create_autocmd({ "TermOpen" }, { + pattern = '*', + command = 'setlocal nonumber norelativenumber' +}) From 3d4199d74355ddb7b7aea099b9bfb42935364366 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Tue, 28 Feb 2023 11:22:24 +0100 Subject: [PATCH 20/51] bootstrap: Add systemd suspend-then-hibernate configuration --- .../etc/systemd/sleep.conf.d/suspend-then-hibernate.conf | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 bootstrap/system-packages/etc/systemd/sleep.conf.d/suspend-then-hibernate.conf diff --git a/bootstrap/system-packages/etc/systemd/sleep.conf.d/suspend-then-hibernate.conf b/bootstrap/system-packages/etc/systemd/sleep.conf.d/suspend-then-hibernate.conf new file mode 100644 index 0000000..eb52a29 --- /dev/null +++ b/bootstrap/system-packages/etc/systemd/sleep.conf.d/suspend-then-hibernate.conf @@ -0,0 +1,3 @@ +[Sleep] +HibernateDelaySec=120min +SuspendEstimationSec=30min From 8d40fd843e741223ccefe16975319092461a7705 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Tue, 28 Feb 2023 11:26:51 +0100 Subject: [PATCH 21/51] nvim: Rename helpers module to util module --- nvim/.config/nvim/lua/helpers/augroup.lua | 27 ------------------- nvim/.config/nvim/lua/look.lua | 4 +-- .../nvim/lua/{helpers => util}/highlight.lua | 0 3 files changed, 2 insertions(+), 29 deletions(-) delete mode 100644 nvim/.config/nvim/lua/helpers/augroup.lua rename nvim/.config/nvim/lua/{helpers => util}/highlight.lua (100%) diff --git a/nvim/.config/nvim/lua/helpers/augroup.lua b/nvim/.config/nvim/lua/helpers/augroup.lua deleted file mode 100644 index b0ea4cb..0000000 --- a/nvim/.config/nvim/lua/helpers/augroup.lua +++ /dev/null @@ -1,27 +0,0 @@ --- augroup utility function --- --- Let's you create and use autogroups through lua --- which (as of now) is not possible through official nvim api --- --- Cribbed from the very helpful https://icyphox.sh/blog/nvim-lua - Thank you! --- --- Example usage settings.lua --- local cmd = vim.cmd --- local u = require('utils') --- u.create_augroup({ --- { 'BufRead,BufNewFile', '/tmp/nail-*', 'setlocal', 'ft=mail' }, --- { 'BufRead,BufNewFile', '*s-nail-*', 'setlocal', 'ft=mail' }, --- }, 'ftmail') --- cmd('au BufNewFile,BufRead * if &ft == "" | set ft=text | endif') - -local cmd = vim.cmd - - -return function(cmds, groupname) - cmd('augroup ' .. groupname) - cmd('autocmd!') - for _, autocmd in ipairs(cmds) do - cmd('autocmd ' .. table.concat(autocmd, ' ')) - end - cmd('augroup END') -end diff --git a/nvim/.config/nvim/lua/look.lua b/nvim/.config/nvim/lua/look.lua index 5ed11d2..88c94fb 100644 --- a/nvim/.config/nvim/lua/look.lua +++ b/nvim/.config/nvim/lua/look.lua @@ -1,8 +1,8 @@ local b = require('base16') -- italic comments if supported -local set_hl = require("helpers.highlight") -set_hl("Comment", {gui = "italic"}) +local set_hl = require("util.highlight") +set_hl("Comment", { gui = "italic" }) vim.api.nvim_set_var('gruvbox_italic', 1) vim.api.nvim_set_var('one_allow_italics', 1) vim.api.nvim_set_var('pencil_terminal_italics', 1) diff --git a/nvim/.config/nvim/lua/helpers/highlight.lua b/nvim/.config/nvim/lua/util/highlight.lua similarity index 100% rename from nvim/.config/nvim/lua/helpers/highlight.lua rename to nvim/.config/nvim/lua/util/highlight.lua From e1abc2972baa8409403ce2f14c9d1b95b134ecbc Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Wed, 1 Mar 2023 14:27:03 +0100 Subject: [PATCH 22/51] nvim: Add gitcommit ft settings --- nvim/.config/nvim/after/ftplugin/gitcommit.lua | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 nvim/.config/nvim/after/ftplugin/gitcommit.lua diff --git a/nvim/.config/nvim/after/ftplugin/gitcommit.lua b/nvim/.config/nvim/after/ftplugin/gitcommit.lua new file mode 100644 index 0000000..b02d561 --- /dev/null +++ b/nvim/.config/nvim/after/ftplugin/gitcommit.lua @@ -0,0 +1,5 @@ +local ns = vim.api.nvim_create_namespace('gitcommit') +vim.api.nvim_set_hl(ns, 'ColorColumn', { bg = '#a33a3a', blend = 90 }) +vim.api.nvim_win_set_hl_ns(0, ns) +vim.bo.textwidth = 72 +vim.wo.colorcolumn = '+0' From ea7fcd92f5e69e293f019752ecf43fecbfb43656 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Wed, 1 Mar 2023 14:28:42 +0100 Subject: [PATCH 23/51] nvim: Switch to manual lsp mappings --- nvim/.config/nvim/lua/plug/_cmp.lua | 40 ------------- nvim/.config/nvim/lua/plug/_lsp.lua | 90 ++++++++++++++++++++++++++++- 2 files changed, 87 insertions(+), 43 deletions(-) delete mode 100644 nvim/.config/nvim/lua/plug/_cmp.lua diff --git a/nvim/.config/nvim/lua/plug/_cmp.lua b/nvim/.config/nvim/lua/plug/_cmp.lua deleted file mode 100644 index a5e7393..0000000 --- a/nvim/.config/nvim/lua/plug/_cmp.lua +++ /dev/null @@ -1,40 +0,0 @@ -local lsp = require("lsp-zero") -lsp.preset("recommended") -lsp.on_attach(function(client, bufnr) - require("lsp-format").on_attach(client, bufnr) -end) -lsp.nvim_workspace() -lsp.setup_nvim_cmp({ - sources = { - { name = 'path' }, { name = 'nvim_lsp', keyword_length = 2 }, - { name = 'pandoc_references' }, { name = 'buffer', keyword_length = 3 }, - { name = 'luasnip', keyword_length = 2 }, { name = 'tmux' }, - { name = 'otter' }, { name = 'latex_symbols' }, { name = 'vCard' }, - { name = 'nvim_lua' }, { name = 'buffer' }, { name = 'spell' } - }, - documentation = { - max_height = 50, - max_width = 90, - border = 'rounded', - col_offset = 0, - side_padding = 1, - winhighlight = 'Normal:Normal,FloatBorder:Normal,CursorLine:Visual,Search:None', - zindex = 1001 - } -}) -lsp.setup() -vim.diagnostic.config { virtual_text = true } - -local cmp = require 'cmp' --- `/` cmdline setup. -cmp.setup.cmdline('/', { - mapping = cmp.mapping.preset.cmdline(), - sources = { { name = 'buffer' } } -}) --- `:` cmdline setup. -cmp.setup.cmdline(':', { - mapping = cmp.mapping.preset.cmdline(), - sources = cmp.config.sources({ { name = 'path' } }, { - { name = 'cmdline', option = { ignore_cmds = { 'Man', '!' } } } - }) -}) diff --git a/nvim/.config/nvim/lua/plug/_lsp.lua b/nvim/.config/nvim/lua/plug/_lsp.lua index 4bd08b7..8acd3cc 100644 --- a/nvim/.config/nvim/lua/plug/_lsp.lua +++ b/nvim/.config/nvim/lua/plug/_lsp.lua @@ -1,3 +1,87 @@ --- The arch package defaults to the following directory -require'navigator'.setup() -require"lsp_signature".setup() +local lsp = require("lsp-zero") + +vim.diagnostic.config { virtual_text = true } + +lsp.preset({ + name = "recommended", + set_lsp_keymaps = false, + suggest_lsp_servers = true +}) +lsp.on_attach(function(client, bufnr) + require("lsp-format").on_attach(client, bufnr) + local map = vim.keymap.set + map('n', '[d', 'lua vim.diagnostic.goto_prev()', + { buffer = bufnr, desc = 'Previous diagnostic' }) + map('n', ']d', 'lua vim.diagnostic.goto_next()', + { buffer = bufnr, desc = 'Next diagnostic' }) + map('n', '[e', + 'lua vim.diagnostic.goto_prev({severity = vim.diagnostic.severity.ERROR})', + { buffer = bufnr, desc = 'Previous error' }) + map('n', ']e', + 'lua vim.diagnostic.goto_next({severity = vim.diagnostic.severity.ERROR})', + { buffer = bufnr, desc = 'Next error' }) + + 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' }) + if client.server_capabilities.document_formatting then + map('n', 'lf', "lua vim.lsp.buf.formatting()", + { buffer = bufnr, desc = 'Format document' }) + end + + map('n', 'K', 'lua vim.lsp.buf.hover()', + { buffer = bufnr, desc = 'Hover definition' }) + map('n', 'gd', 'lua vim.lsp.buf.definition()', + { buffer = bufnr, desc = 'Definition' }) + 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' }) +end) +lsp.nvim_workspace() +lsp.setup_nvim_cmp({ + sources = { + { name = 'path' }, { name = 'nvim_lsp', keyword_length = 2 }, + { name = 'pandoc_references' }, { name = 'buffer', keyword_length = 3 }, + { name = 'luasnip', keyword_length = 2 }, { name = 'tmux' }, + { name = 'otter' }, { name = 'latex_symbols' }, { name = 'vCard' }, + { name = 'nvim_lua' }, { name = 'buffer' }, { name = 'spell' } + }, + documentation = { + max_height = 50, + max_width = 90, + border = 'rounded', + col_offset = 0, + side_padding = 1, + winhighlight = 'Normal:Normal,FloatBorder:Normal,CursorLine:Visual,Search:None', + zindex = 1001 + } +}) +lsp.setup() + +local cmp = require 'cmp' +-- `/` cmdline setup. +cmp.setup.cmdline('/', { + mapping = cmp.mapping.preset.cmdline(), + sources = { { name = 'buffer' } } +}) +-- `:` cmdline setup. +cmp.setup.cmdline(':', { + mapping = cmp.mapping.preset.cmdline(), + sources = cmp.config.sources({ { name = 'path' } }, { + { name = 'cmdline', option = { ignore_cmds = { 'Man', '!' } } } + }) +}) From e3f123c080123e3c519afbed51d1a0b2b479246a Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Wed, 1 Mar 2023 14:35:04 +0100 Subject: [PATCH 24/51] nvim: Add punctuation-based undo breakpoints --- nvim/.config/nvim/lua/maps.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/nvim/.config/nvim/lua/maps.lua b/nvim/.config/nvim/lua/maps.lua index ccfd6d2..d6258ff 100644 --- a/nvim/.config/nvim/lua/maps.lua +++ b/nvim/.config/nvim/lua/maps.lua @@ -50,6 +50,11 @@ map('n', '', '%') map('i', '', 'gUiw`]a') map('i', '', 'guiw`]a') +-- Add undo break-points at punctuations for plaintext editing +for _, char in pairs({ ",", ".", ";", "?", "!" }) do + map("i", char, string.format("%su", char)) +end + -- yank current filename/filepath to f buffer map('n', 'yp', ':let @p = expand("%")', { desc = 'yank filename' }) map('n', 'yP', ':let @p = expand("%:p")', { desc = 'yank filepath' }) From 56003fcccb193f8b1fe7546b52c4b80c365f5dd7 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Wed, 1 Mar 2023 14:35:41 +0100 Subject: [PATCH 25/51] nvim: Map v for vim-related options --- nvim/.config/nvim/lua/maps.lua | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/nvim/.config/nvim/lua/maps.lua b/nvim/.config/nvim/lua/maps.lua index d6258ff..ee74a10 100644 --- a/nvim/.config/nvim/lua/maps.lua +++ b/nvim/.config/nvim/lua/maps.lua @@ -119,6 +119,22 @@ map('n', 'e', ':Vifm', { desc = 'browse files' }) -- open current file tree with current file directory map('n', 'E', ':Vifm getcwd()', { desc = 'browse project' }) +-- set 'v'im-related options +map('n', 'vc', ':Vifm ' .. vim.fn.stdpath('config') .. '/lua', + { desc = 'open config' }) +map('n', 'vh', ":lua require 'telescope.builtin'.help_tags()", + { desc = 'help tags' }) +map('n', 'vH', ":lua require 'telescope.builtin'.man_pages()", + { desc = 'man pages' }) +map('n', 'vC', + ":lua require 'telescope.builtin'.colorscheme(require 'telescope.themes'.get_ivy())", + { desc = 'colorschemes' }) +map('n', 'vl', ":Lazy", { desc = 'Lazy' }) +map('n', 'vm', ":Mason", { desc = 'Mason' }) +-- Set vim to distraction free prose mode with F11 +map('n', 'vz', ':ZenMode', { silent = true }) + + -- PLUGIN: Telescope GLOBAL FUZZY FINDING -- buffers and files in current workdir map('n', 'fb', @@ -150,18 +166,6 @@ map('n', 'fc', ":lua require 'telescope.builtin'.git_bcommits()", map('n', 'fl', ":lua require 'telescope.builtin'.git_commits()", { desc = 'git commit log' }) --- helptags -map('n', '', ":lua require 'telescope.builtin'.help_tags()", - { desc = 'help tags' }) --- manpages -map('n', '', ":lua require 'telescope.builtin'.man_pages()", - { desc = 'man pages' }) - --- colorschemes -map('n', '', - ":lua require 'telescope.builtin'.colorscheme(require 'telescope.themes'.get_ivy())", - { desc = 'colorschemes' }) - -- spell suggestions map('n', 'z=', ":lua require 'telescope.builtin'.spell_suggest(require 'telescope.themes'.get_ivy())") @@ -181,9 +185,6 @@ map('n', 'mp', 'MarkdownPreviewToggle', map('n', 'f', ':FormatLock') map('n', 'F', ':FormatWriteLock') --- Enter distraction free prose mode with F11 -map('n', '', ':ZenMode', { silent = true }) - -- SPELL CHECKING -- Move to the prev/next spelling error with [S ]S -- Move to the prev/next spelling error or suggestion with [s ]s From e94eade3b3afcffb19d3b6bb32fc71efb29aabfb Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Wed, 1 Mar 2023 14:37:59 +0100 Subject: [PATCH 26/51] nvim: Add descriptions for various prefix groups --- nvim/.config/nvim/lua/maps.lua | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/nvim/.config/nvim/lua/maps.lua b/nvim/.config/nvim/lua/maps.lua index ee74a10..171fee2 100644 --- a/nvim/.config/nvim/lua/maps.lua +++ b/nvim/.config/nvim/lua/maps.lua @@ -1,4 +1,5 @@ local map = vim.keymap.set +local prefix = require('which-key').register -- The general ideas behind these mappings: -- @@ -120,6 +121,7 @@ map('n', 'e', ':Vifm', { desc = 'browse files' }) map('n', 'E', ':Vifm getcwd()', { desc = 'browse project' }) -- set 'v'im-related options +prefix({ ['v'] = { name = "+vim" } }) map('n', 'vc', ':Vifm ' .. vim.fn.stdpath('config') .. '/lua', { desc = 'open config' }) map('n', 'vh', ":lua require 'telescope.builtin'.help_tags()", @@ -137,6 +139,7 @@ map('n', 'vz', ':ZenMode', { silent = true }) -- PLUGIN: Telescope GLOBAL FUZZY FINDING -- buffers and files in current workdir +prefix({ ['f'] = { name = '+find' } }) map('n', 'fb', ":lua require 'telescope.builtin'.buffers(require 'telescope.themes'.get_ivy())", { desc = 'list buffers' }) @@ -188,6 +191,7 @@ map('n', 'F', ':FormatWriteLock') -- SPELL CHECKING -- Move to the prev/next spelling error with [S ]S -- Move to the prev/next spelling error or suggestion with [s ]s +prefix({ ['Z'] = { name = '+Spelling' } }) map('n', 'ZZ', ':setlocal spell! spelllang=en_us,de_de', { desc = 'Toggle spellcheck' }) map('n', 'ZE', ':setlocal spell! spelllang=en_us', @@ -199,18 +203,21 @@ map('i', '', 'u[s1z=`]au') map('n', 's', 'ms[s1z=`s', { desc = 'Fix last spell error' }) -- PLUGIN: mini.nvim -map('n', 'sm', ':lua MiniMap.toggle()', { silent = true, desc = 'toggle minimap' }) +prefix({ ['s'] = { name = '+show' } }) +map('n', 'sm', ':lua MiniMap.toggle()', + { silent = true, desc = 'toggle minimap' }) map('n', 'ss', ":lua MiniStarter.open()", { desc = 'show startpage' }) +-- PLUGIN: symbols-outline.nvim +map('n', 'so', 'SymbolsOutline', + { silent = true, desc = 'toggle symbol outline' }) + -- PLUGIN: easy-align -- Start interactive EasyAlign in visual mode (e.g. vipga) map('x', 'ga', '(EasyAlign)') -- Start interactive EasyAlign for a motion/text object (e.g. gaip) map('n', 'ga', '(EasyAlign)') --- PLUGIN: symbols-outline.nvim -map('n', 'so', 'SymbolsOutline', { silent = true, desc = 'toggle symbol outline' }) - -- trim trailing whitespaces with mini.nvim trailspace map("n", "w", function() require("mini.trailspace").trim() end, { noremap = true }) @@ -226,7 +233,9 @@ map("v", "g", 'g(dial-increment)') -- PLUGIN: zettelkasten.nvim map('n', '', [[:silent lua require 'zettelkasten'.link_follow()]]) map('v', '', [[:lua require 'zettelkasten'.link_follow(true)]]) -map('n', 'ww', [[:lua require 'zettelkasten'.index_open() ]]) +prefix({ ['w'] = { name = '+wiki' } }) +map('n', 'ww', [[:lua require 'zettelkasten'.index_open() ]], + { desc = "open wiki" }) -- PLUGIN: toggleterm.nvim -- create a lazygit window, set up in toggleterm settings From 72e7832dce4cb679bce47f01130b3790e88ed3bf Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Wed, 1 Mar 2023 14:40:36 +0100 Subject: [PATCH 27/51] nvim: Remove navigator.lua --- nvim/.config/nvim/lua/plugins.lua | 48 +++++++++++++++++-------------- 1 file changed, 26 insertions(+), 22 deletions(-) diff --git a/nvim/.config/nvim/lua/plugins.lua b/nvim/.config/nvim/lua/plugins.lua index 598dca9..aa4d323 100644 --- a/nvim/.config/nvim/lua/plugins.lua +++ b/nvim/.config/nvim/lua/plugins.lua @@ -11,9 +11,7 @@ return { { 'vifm/vifm.vim' }, -- integrate file manager { 'lewis6991/gitsigns.nvim', -- show vcs changes on left-hand gutter - opts = { - numhl = true, signcolumn = false - }, + opts = { numhl = true, signcolumn = false }, event = "BufRead" }, { 'norcalli/nvim-colorizer.lua', -- color hex, named colors in the correct preview scheme @@ -88,7 +86,7 @@ return { } } end, - ft = writing_ft + ft = "quarto" }, { 'micarmst/vim-spellsync', event = "VeryLazy" }, -- personal dict improvements for git sync { 'folke/zen-mode.nvim', config = true, event = "VeryLazy" }, -- provide distraction free writing { 'folke/twilight.nvim', event = "VeryLazy" }, -- provide even distraction free-er writing (lowlight paragraphs) @@ -116,8 +114,7 @@ return { config = function() require('plug._mini') end }, { "akinsho/nvim-toggleterm.lua", -- simpler, programmable and multiple terminal toggling for nvim - config = function() require('plug._toggleterm') end, - event = "BufWinEnter" + config = function() require('plug._toggleterm') end }, { "folke/which-key.nvim", @@ -127,6 +124,14 @@ return { "nvim-telescope/telescope.nvim", dependencies = { "nvim-lua/popup.nvim", "nvim-lua/plenary.nvim" }, config = function() require('plug._telescope') end +}, { + "dense-analysis/neural", + dependencies = { "MunifTanjim/nui.nvim", "elpiloto/significant.nvim" }, + config = function() + require('neural').setup({ + source = { openai = { api_key = vim.env.OPENAI_API_KEY } } + }) + end }, -- treesitter { 'nvim-treesitter/nvim-treesitter', @@ -159,24 +164,23 @@ return { "VonHeikemen/lsp-zero.nvim", dependencies = { "neovim/nvim-lspconfig", "williamboman/mason.nvim", - "williamboman/mason-lspconfig.nvim", "hrsh7th/nvim-cmp", - "hrsh7th/cmp-buffer", "hrsh7th/cmp-path", - "saadparwaiz1/cmp_luasnip", "hrsh7th/cmp-nvim-lsp", - "hrsh7th/cmp-nvim-lua", "L3MON4D3/LuaSnip", - "rafamadriz/friendly-snippets", "andersevenrud/cmp-tmux", - "hrsh7th/cmp-nvim-lsp", "kdheepak/cmp-latex-symbols", - "ray-x/cmp-treesitter", "f3fora/cmp-spell", "hrsh7th/cmp-cmdline", - "cbarrete/completion-vcard", "jc-doyle/cmp-pandoc-references", + "williamboman/mason-lspconfig.nvim", { + "hrsh7th/nvim-cmp", + dependencies = { + "hrsh7th/cmp-buffer", "hrsh7th/cmp-path", + "saadparwaiz1/cmp_luasnip", "hrsh7th/cmp-nvim-lsp", + "hrsh7th/cmp-nvim-lua", "andersevenrud/cmp-tmux", + "hrsh7th/cmp-nvim-lsp", "kdheepak/cmp-latex-symbols", + "ray-x/cmp-treesitter", "f3fora/cmp-spell", + "hrsh7th/cmp-cmdline", "cbarrete/completion-vcard", + "jc-doyle/cmp-pandoc-references" + } + }, "L3MON4D3/LuaSnip", "rafamadriz/friendly-snippets", { "lukas-reineke/lsp-format.nvim", config = true } }, - config = function() require('plug._cmp') end - }, { 'simrat39/symbols-outline.nvim', config = true, event = "VeryLazy" }, -- vista-like outline view for code - { 'ray-x/lsp_signature.nvim', event = "VeryLazy" }, - { 'ray-x/guihua.lua', build = 'cd lua/fzy && make', event = "VeryLazy" }, { - 'ray-x/navigator.lua', - config = function() require('plug._lsp') end, - event = "VeryLazy" -} -- and completion + config = function() require('plug._lsp') end + }, { 'simrat39/symbols-outline.nvim', config = true, event = "VeryLazy" }, -- vista-like outline view for code + { 'ray-x/lsp_signature.nvim', config = true } -- { -- REQUIRES custom `yay -S --asdeps lua51-lyaml invocation` AND is suuper slow -- "jghauser/papis.nvim", -- after = { "telescope.nvim", "nvim-cmp" }, From a44cf1d50900e9a97d67f3479bccc8be32eee358 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Wed, 1 Mar 2023 15:56:30 +0100 Subject: [PATCH 28/51] nvim: Add notify, select and input UI theme plugins --- nvim/.config/nvim/lua/plugins.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/nvim/.config/nvim/lua/plugins.lua b/nvim/.config/nvim/lua/plugins.lua index aa4d323..c97931d 100644 --- a/nvim/.config/nvim/lua/plugins.lua +++ b/nvim/.config/nvim/lua/plugins.lua @@ -180,7 +180,11 @@ return { }, config = function() require('plug._lsp') end }, { 'simrat39/symbols-outline.nvim', config = true, event = "VeryLazy" }, -- vista-like outline view for code - { 'ray-x/lsp_signature.nvim', config = true } + { 'ray-x/lsp_signature.nvim', config = true }, -- UI improvements + { 'stevearc/dressing.nvim', config = true }, { + 'rcarriga/nvim-notify', + config = function() vim.notify = require("notify") end +} -- { -- REQUIRES custom `yay -S --asdeps lua51-lyaml invocation` AND is suuper slow -- "jghauser/papis.nvim", -- after = { "telescope.nvim", "nvim-cmp" }, From c75b7636e0156bc6fffc211b7817c6c75a9cccd5 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Wed, 1 Mar 2023 15:57:28 +0100 Subject: [PATCH 29/51] nvim: Determine python venv on lsp start --- nvim/.config/nvim/lua/plug/_lsp.lua | 9 ++++++ nvim/.config/nvim/lua/util/pyenv.lua | 45 ++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+) create mode 100644 nvim/.config/nvim/lua/util/pyenv.lua diff --git a/nvim/.config/nvim/lua/plug/_lsp.lua b/nvim/.config/nvim/lua/plug/_lsp.lua index 8acd3cc..29cdf34 100644 --- a/nvim/.config/nvim/lua/plug/_lsp.lua +++ b/nvim/.config/nvim/lua/plug/_lsp.lua @@ -52,6 +52,15 @@ lsp.on_attach(function(client, bufnr) { buffer = bufnr, desc = 'Type definition' }) end) lsp.nvim_workspace() +-- ensure python virtualenv is determined automatically on lsp start +lsp.configure("pyright", { + on_attach = function(client, _) + local python_path, msg = require('util.pyenv').get_path(client.config + .root_dir) + vim.notify(string.format('%s\n%s', msg, python_path)) + client.config.settings.python.pythonPath = python_path + end +}) lsp.setup_nvim_cmp({ sources = { { name = 'path' }, { name = 'nvim_lsp', keyword_length = 2 }, diff --git a/nvim/.config/nvim/lua/util/pyenv.lua b/nvim/.config/nvim/lua/util/pyenv.lua new file mode 100644 index 0000000..0beb2d2 --- /dev/null +++ b/nvim/.config/nvim/lua/util/pyenv.lua @@ -0,0 +1,45 @@ +local util = require('lspconfig/util') +local path = util.path +local T = {} +local exepath = vim.fn.exepath + +local path_sep = function() + local is_win = vim.loop.os_uname().sysname:find('Windows') + if is_win then + return '\\' + else + return '/' + end +end + +-- from https://github.com/ray-x/navigator.lua/issues/247#issue-1465308677 +T.get_path = function(workspace) + -- Use activated virtualenv. + if vim.env.VIRTUAL_ENV then + return path.join(vim.env.VIRTUAL_ENV, 'bin', 'python'), 'virtual env' + end + + -- Find and use virtualenv in workspace directory. + for _, pattern in ipairs({ '*', '.*' }) do + local match = vim.fn.glob(path.join(workspace, pattern, 'pyvenv.cfg')) + local sep = path_sep() + local py = 'bin' .. sep .. 'python' + if match ~= '' then + match = string.gsub(match, 'pyvenv.cfg', py) + return match, string.format('venv base folder: %s', match) + end + match = vim.fn.glob(path.join(workspace, pattern, 'poetry.lock')) + if match ~= '' then + local venv_base_folder = vim.fn.trim(vim.fn.system( + 'poetry env info -p')) + return path.join(venv_base_folder, 'bin', 'python'), + string.format('venv base folder: %s', venv_base_folder) + end + end + + -- Fallback to system Python. + return exepath('python3') or exepath('python') or 'python', + 'fallback to system python path' +end + +return T From 7128edc57c305cdcd27e364b0270d8f04b9620b8 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Wed, 1 Mar 2023 17:39:03 +0100 Subject: [PATCH 30/51] nvim: Add quarto filetype setup --- nvim/.config/nvim/after/ftplugin/quarto.lua | 94 +++++++++++++++++++++ nvim/.config/nvim/lua/maps.lua | 27 ------ nvim/.config/nvim/lua/plugins.lua | 15 +++- 3 files changed, 108 insertions(+), 28 deletions(-) create mode 100644 nvim/.config/nvim/after/ftplugin/quarto.lua diff --git a/nvim/.config/nvim/after/ftplugin/quarto.lua b/nvim/.config/nvim/after/ftplugin/quarto.lua new file mode 100644 index 0000000..cbe7b57 --- /dev/null +++ b/nvim/.config/nvim/after/ftplugin/quarto.lua @@ -0,0 +1,94 @@ +-- Start quarto session +local startsession = function(file, args) + file = file or "/tmp/jupyter-magma-session.json" + if args then file = args[0] end + vim.fn.jobstart({ "jupyter", "console", "-f", file }, { + on_stdout = function(_) + vim.cmd("MagmaInit " .. file) + vim.cmd("JupyterAttach " .. file) + end, + on_exit = function(_) + vim.notify(string.format("jupyter kernel stopped: %s", file), vim.log.levels.INFO) + end, + stdin = nil + }) +end +vim.api.nvim_create_user_command("JupyterStart", function() startsession() end, + {}) + +local map = vim.keymap.set +-- filetype mappings +-- PLUGIN: magma-nvim +-- Operate jupyter notebooks from within vim +map('n', 'cc', ':MagmaEvaluateLine', { silent = true }) +map('n', 'C', '?^```{jV/```k:MagmaEvaluateVisual', + { silent = true, desc = 'Evaluate current code cell' }) +map('x', 'c', ':MagmaEvaluateVisual', { silent = true }) +map('n', 'c', "nvim_exec('MagmaEvaluateOperator', v:true)", + { expr = true, silent = true, desc = '+code-evaluation' }) +map('n', 'cr', ':MagmaReevaluateCell', { silent = true }) +map('n', 'cu', ':MagmaShowOutput', { silent = true }) +map('n', 'cU', ':noautocmd :MagmaEnterOutput', + { silent = true, desc = 'MagmaEnterOutput' }) +map('n', 'cd', ':MagmaDelete', { silent = true }) +map('n', 'cs', ':MagmaInterrupt') +map('n', 'ci', ':MagmaInit ') +map('n', 'cD', ':MagmaDeinit') +map('n', 'cR', ':MagmaRestart') + +-- jump to beginning of previous/ next cell code +map('n', ']c', '/^```{}:nohl', { desc = 'Next quarto cell' }) +map('n', '[c', '?^```n}:nohl', { desc = 'Previous quarto cell' }) +-- insert cell header above/below +map('n', 'co', 'o```{python}```k', + { desc = 'Insert quarto cell below' }) +map('n', 'cO', 'O```{python}```k', + { desc = 'Insert quarto cell above' }) + +local bufnr = 0 +map('n', '[d', 'lua vim.diagnostic.goto_prev()', + { buffer = bufnr, desc = 'Previous diagnostic' }) +map('n', ']d', 'lua vim.diagnostic.goto_next()', + { buffer = bufnr, desc = 'Next diagnostic' }) +map('n', '[e', + 'lua vim.diagnostic.goto_prev({severity = vim.diagnostic.severity.ERROR})', + { buffer = bufnr, desc = 'Previous error' }) +map('n', ']e', + 'lua vim.diagnostic.goto_next({severity = vim.diagnostic.severity.ERROR})', + { buffer = bufnr, desc = 'Next error' }) + +-- 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' }) +if client and client.server_capabilities.document_formatting then + map('n', 'lf', "lua vim.lsp.buf.formatting()", + { buffer = bufnr, desc = 'Format document' }) +end + +map('n', 'K', 'lua vim.lsp.buf.hover()', + { buffer = bufnr, desc = 'Hover definition' }) +map('n', 'gd', 'lua vim.lsp.buf.definition()', + { buffer = bufnr, desc = 'Definition' }) +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' }) + +if vim.b['sessionfile'] == nil then + vim.b['sessionfile'] = vim.fn.tempname() .. '.json' + startsession(vim.b['sessionfile']) +end diff --git a/nvim/.config/nvim/lua/maps.lua b/nvim/.config/nvim/lua/maps.lua index 171fee2..2980bea 100644 --- a/nvim/.config/nvim/lua/maps.lua +++ b/nvim/.config/nvim/lua/maps.lua @@ -240,30 +240,3 @@ map('n', 'ww', [[:lua require 'zettelkasten'.index_open() ]], -- PLUGIN: toggleterm.nvim -- create a lazygit window, set up in toggleterm settings map('n', 'G', ':Lazygit') - --- PLUGIN: magma-nvim --- Operate jupyter notebooks from within vim -map('n', 'mm', ':MagmaEvaluateLine', { silent = true }) -map('n', 'M', '?^```{jV/```k:MagmaEvaluateVisual', - { silent = true, desc = 'Evaluate current quarto cell' }) -map('x', 'm', ':MagmaEvaluateVisual', { silent = true }) -map('n', 'm', "nvim_exec('MagmaEvaluateOperator', v:true)", - { expr = true, silent = true }) -map('n', 'mr', ':MagmaReevaluateCell', { silent = true }) -map('n', 'ma', ':MagmaShowOutput', { silent = true }) -map('n', 'mq', ':noautocmd :MagmaEnterOutput', - { silent = true, desc = 'MagmaEnterOutput' }) -map('n', 'md', ':MagmaDelete', { silent = true }) -map('n', 'ms', ':MagmaInterrupt') -map('n', 'mI', ':MagmaInit ') -map('n', 'mD', ':MagmaDeinit') -map('n', 'mR', ':MagmaRestart') - --- jump to beginning of previous/ next cell code -map('n', ']c', '/^```{}:nohl', { desc = 'Next quarto cell' }) -map('n', '[c', '?^```n}:nohl', { desc = 'Previous quarto cell' }) --- insert cell header above/below -map('n', 'mo', 'o```{python}```k', - { desc = 'Insert quarto cell below' }) -map('n', 'mO', 'O```{python}```k', - { desc = 'Insert quarto cell above' }) diff --git a/nvim/.config/nvim/lua/plugins.lua b/nvim/.config/nvim/lua/plugins.lua index c97931d..8ea66fe 100644 --- a/nvim/.config/nvim/lua/plugins.lua +++ b/nvim/.config/nvim/lua/plugins.lua @@ -87,6 +87,18 @@ return { } end, ft = "quarto" +}, { + "lkhphuc/jupyter-kernel.nvim", + config = true, + cmd = "JupyterAttach", + build = ":UpdateRemotePlugins", + keys = { + { + "ck", + "JupyterInspect", + desc = "Inspect object in kernel" + } + } }, { 'micarmst/vim-spellsync', event = "VeryLazy" }, -- personal dict improvements for git sync { 'folke/zen-mode.nvim', config = true, event = "VeryLazy" }, -- provide distraction free writing { 'folke/twilight.nvim', event = "VeryLazy" }, -- provide even distraction free-er writing (lowlight paragraphs) @@ -137,7 +149,8 @@ return { 'nvim-treesitter/nvim-treesitter', build = ':TSUpdate', config = function() require('plug._treesitter') end - }, { 'nvim-treesitter/playground', cmd = "TSPlaygroundToggle" }, -- interactively view and query the treesitter tree + }, + { 'nvim-treesitter/playground', cmd = "TSPlaygroundToggle" }, -- interactively view and query the treesitter tree { 'romgrk/nvim-treesitter-context', event = "BufReadPre", config = true }, -- show current cursor context at top of buffer { 'RRethy/nvim-treesitter-textsubjects', -- allows using . and ; to target treesitter branches From 2c4d5c483df17003ddf9eaf1d503f3638692b81f Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Wed, 1 Mar 2023 17:39:23 +0100 Subject: [PATCH 31/51] nvim: Update plugin lockfile --- nvim/.config/nvim/lazy-lock.json | 73 ++++++++++++++++---------------- 1 file changed, 36 insertions(+), 37 deletions(-) diff --git a/nvim/.config/nvim/lazy-lock.json b/nvim/.config/nvim/lazy-lock.json index 22cfec4..dc005d8 100644 --- a/nvim/.config/nvim/lazy-lock.json +++ b/nvim/.config/nvim/lazy-lock.json @@ -1,14 +1,14 @@ { "BetterLua.vim": { "branch": "master", "commit": "d2d6c115575d09258a794a6f20ac60233eee59d5" }, - "LuaSnip": { "branch": "master", "commit": "500981ff6cefc7343e3959ef0f939bd0bfd49ba9" }, + "LuaSnip": { "branch": "master", "commit": "f7c845749aba6096f041a73a26ba64f3817bab99" }, "Navigator.nvim": { "branch": "master", "commit": "91d86506ac2a039504d5205d32a1d4bc7aa57072" }, "bats.vim": { "branch": "master", "commit": "6a5d2ef22b0ede503d867770afd02ebb1f97b709" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, - "cmp-cmdline": { "branch": "main", "commit": "23c51b2a3c00f6abc4e922dbd7c3b9aca6992063" }, + "cmp-cmdline": { "branch": "main", "commit": "8fcc934a52af96120fe26358985c10c035984b53" }, "cmp-latex-symbols": { "branch": "main", "commit": "165fb66afdbd016eaa1570e41672c4c557b57124" }, "cmp-nvim-lsp": { "branch": "main", "commit": "0e6b2ed705ddcff9738ec4ea838141654f12eeef" }, "cmp-nvim-lua": { "branch": "main", "commit": "f3491638d123cfd2c8048aefaf66d246ff250ca6" }, - "cmp-pandoc.nvim": { "branch": "main", "commit": "cb2980263e14fb3c1b776edbd2c7a312b67c65ae" }, + "cmp-pandoc-references": { "branch": "master", "commit": "2c808dff631a783ddd2c554c4c6033907589baf6" }, "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, "cmp-spell": { "branch": "master", "commit": "60584cb75e5e8bba5a0c9e4c3ab0791e0698bffa" }, "cmp-tmux": { "branch": "main", "commit": "984772716f66d8ee88535a6bf3f94c4b4e1301f5" }, @@ -16,58 +16,57 @@ "cmp_luasnip": { "branch": "master", "commit": "18095520391186d634a0045dacaa346291096566" }, "completion-vcard": { "branch": "master", "commit": "2220fd517a985ececed1adcf0e5be8f2815564c7" }, "dial.nvim": { "branch": "master", "commit": "5020da900cc5dfd7067f181ee2ebd872ca7c84e8" }, - "formatter.nvim": { "branch": "master", "commit": "8a4c961330cc4688087f23d18fa7d2f1af9a4902" }, - "friendly-snippets": { "branch": "main", "commit": "a6f7a1609addb4e57daa6bedc300f77f8d225ab7" }, - "gitsigns.nvim": { "branch": "main", "commit": "ec4742a7eebf68bec663041d359b95637242b5c3" }, - "guihua.lua": { "branch": "master", "commit": "d3f6d01639b52e6a83ea98dd6ca244c9aa98b79b" }, - "lazy.nvim": { "branch": "main", "commit": "273081443471cbc52c327bcb99614c32f247998d" }, + "dressing.nvim": { "branch": "master", "commit": "5f44f829481640be0f96759c965ae22a3bcaf7ce" }, + "formatter.nvim": { "branch": "master", "commit": "ed949c13e1a942db29ababa35e8c7864ced90eb6" }, + "friendly-snippets": { "branch": "main", "commit": "02ed98a1d4bc8baac405480935f3353d3bd60359" }, + "gitsigns.nvim": { "branch": "main", "commit": "f965e3bad0be96898dec97dc15bdfe226a176e3a" }, + "jupyter-kernel.nvim": { "branch": "main", "commit": "92eee2a9fcff65aedaba8f0544b87db44981673b" }, + "lazy.nvim": { "branch": "main", "commit": "26d121ea13bee96b079403cee6598f04969d4983" }, "lightspeed.nvim": { "branch": "main", "commit": "299eefa6a9e2d881f1194587c573dad619fdb96f" }, "lsp-format.nvim": { "branch": "master", "commit": "ca0df5c8544e51517209ea7b86ecc522c98d4f0a" }, - "lsp-zero.nvim": { "branch": "main", "commit": "42bc5a1081666098a7154532e6ff5e3edc483b39" }, + "lsp-zero.nvim": { "branch": "main", "commit": "766271e7e4ada413ff44b2cbb54650202ed9eaa4" }, "lsp_signature.nvim": { "branch": "master", "commit": "6f6252f63b0baf0f2224c4caea33819a27f3f550" }, - "lualine.nvim": { "branch": "master", "commit": "0050b308552e45f7128f399886c86afefc3eb988" }, - "magma-nvim-goose": { "branch": "main", "commit": "94370733757d550594fe4a1d65643949d7485989" }, + "lualine.nvim": { "branch": "master", "commit": "e99d733e0213ceb8f548ae6551b04ae32e590c80" }, + "magma-nvim-goose": { "branch": "main", "commit": "d54719dad7771061678a77dace5bef43b4462be8" }, "markdown-preview.nvim": { "branch": "master", "commit": "02cc3874738bc0f86e4b91f09b8a0ac88aef8e96" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "7a97a77eee486ae152d2c559a459eda7c8aa12aa" }, - "mason.nvim": { "branch": "main", "commit": "14ae1ca58440b158a0a35cf90773013caddf788a" }, - "mini.nvim": { "branch": "main", "commit": "dc0ccf1b0499d649a6177d2a406babcfe73b97de" }, - "nabla.nvim": { "branch": "master", "commit": "ddbfc6e244e79db9280c535ee85c81388c5d1b46" }, - "navigator.lua": { "branch": "master", "commit": "66d84151e94052f710b1dfb0d1fce2faaca6dced" }, - "neorg": { "branch": "main", "commit": "36cc15300c0dfc19d483b0a4176cb89e94f4730a" }, - "nui.nvim": { "branch": "main", "commit": "d147222a1300901656f3ebd5b95f91732785a329" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "3f9c0ea157e88b08e2d11ec65002eeb6e421f0da" }, + "mason.nvim": { "branch": "main", "commit": "1c23135467af667c61aef72a7c08b9a032c50a52" }, + "mini.nvim": { "branch": "main", "commit": "427751024313e2270ca723eb16af7b218c83a7fc" }, + "neural": { "branch": "main", "commit": "0166560f213108d61e414a4229a41a34facf35ea" }, + "nui.nvim": { "branch": "main", "commit": "0dc148c6ec06577fcf06cbab3b7dac96d48ba6be" }, "nvim-base16.lua": { "branch": "master", "commit": "b336f40462b3ca1ad16a17c195b83731a2942d9a" }, - "nvim-cmp": { "branch": "main", "commit": "cfafe0a1ca8933f7b7968a287d39904156f2c57d" }, + "nvim-cmp": { "branch": "main", "commit": "01f697a68905f9dcae70960a9eb013695a17f9a2" }, "nvim-colorizer.lua": { "branch": "master", "commit": "36c610a9717cc9ec426a07c8e6bf3b3abcb139d6" }, - "nvim-lspconfig": { "branch": "master", "commit": "aeb76066212b09c7c01a3abb42fe82f0130ef402" }, + "nvim-lspconfig": { "branch": "master", "commit": "95b7a69bc6da2a6a740584ea3c555e5327638b7d" }, + "nvim-notify": { "branch": "master", "commit": "9c987081390753b625e2d94e749e80e9b4a3e082" }, "nvim-surround": { "branch": "main", "commit": "a06dea11e7fdcf338776fa51fa5277163ffb048d" }, - "nvim-toggleterm.lua": { "branch": "main", "commit": "19aad0f41f47affbba1274f05e3c067e6d718e1e" }, - "nvim-treesitter": { "branch": "master", "commit": "f6df07be122de665fb363476cc3680c90f5bdf05" }, - "nvim-treesitter-context": { "branch": "master", "commit": "cacee4828152dd3a83736169ae61bbcd29a3d213" }, - "nvim-treesitter-textsubjects": { "branch": "master", "commit": "bc047b20768845fd54340eb76272b2cf2f6fa3f3" }, + "nvim-toggleterm.lua": { "branch": "main", "commit": "31d38d11390bcd35a568fcc65a79b7d6ec89de62" }, + "nvim-treesitter": { "branch": "master", "commit": "9dd1b9c09707bf1cdd565b999c79ac6461602591" }, + "nvim-treesitter-context": { "branch": "master", "commit": "895ec44f5c89bc67ba5440aef3d1f2efa3d59a41" }, + "nvim-treesitter-textsubjects": { "branch": "master", "commit": "b913508f503527ff540f7fe2dcf1bf1d1f259887" }, "nvim-ts-context-commentstring": { "branch": "main", "commit": "a0f89563ba36b3bacd62cf967b46beb4c2c29e52" }, "nvim-ts-rainbow": { "branch": "master", "commit": "ef95c15a935f97c65a80e48e12fe72d49aacf9b9" }, - "otter.nvim": { "branch": "main", "commit": "e32e432988fddc7fc96f08300e56750a838f0893" }, - "papis.nvim": { "branch": "main", "commit": "4023d30b336c147b12a249ce103561d03fbedef8" }, - "playground": { "branch": "master", "commit": "c481c660fa903a0e295902b1765ecfbd6e76a556" }, - "plenary.nvim": { "branch": "master", "commit": "9a0d3bf7b832818c042aaf30f692b081ddd58bd9" }, + "otter.nvim": { "branch": "main", "commit": "8b46caf113918c26a9247031d6482709078ec907" }, + "playground": { "branch": "master", "commit": "4044b53c4d4fcd7a78eae20b8627f78ce7dc6f56" }, + "plenary.nvim": { "branch": "master", "commit": "253d34830709d690f013daf2853a9d21ad7accab" }, "popup.nvim": { "branch": "master", "commit": "b7404d35d5d3548a82149238289fa71f7f6de4ac" }, - "quarto-nvim": { "branch": "main", "commit": "a30db854054973ab8f140adf3e6b565bf2febf0f" }, + "quarto-nvim": { "branch": "main", "commit": "0f2b3f6f0e1a856378f0fd6551d45d16920089fd" }, + "significant.nvim": { "branch": "main", "commit": "5450e9d5917dc6aa9afb0fcbe32355799b8303fb" }, "spellsitter.nvim": { "branch": "master", "commit": "4af8640d9d706447e78c13150ef7475ea2c16b30" }, - "sqlite.lua": { "branch": "master", "commit": "93ff5824682ecc874200e338fd8ca9ccd08508f8" }, "symbols-outline.nvim": { "branch": "master", "commit": "512791925d57a61c545bc303356e8a8f7869763c" }, "telescope-fzf-native.nvim": { "branch": "main", "commit": "580b6c48651cabb63455e97d7e131ed557b8c7e2" }, - "telescope.nvim": { "branch": "master", "commit": "203bf5609137600d73e8ed82703d6b0e320a5f36" }, + "telescope.nvim": { "branch": "master", "commit": "a3f17d3baf70df58b9d3544ea30abe52a7a832c2" }, "twilight.nvim": { "branch": "main", "commit": "9410252bed96887ca5a86bf16435a3a51a0e6ce5" }, - "vifm.vim": { "branch": "master", "commit": "199af91d6b1b4997450da2098e7e756627c6583b" }, + "vifm.vim": { "branch": "master", "commit": "2982c64e2ec1bd5b451e75526eec590bc6e976b9" }, "vim-criticmarkup": { "branch": "master", "commit": "d15dc134eb177a170c79f6377f81eb02a9d20b02" }, "vim-easy-align": { "branch": "master", "commit": "12dd6316974f71ce333e360c0260b4e1f81169c3" }, "vim-exchange": { "branch": "master", "commit": "784d63083ad7d613aa96f00021cd0dfb126a781a" }, "vim-numbertoggle": { "branch": "main", "commit": "075b7478777e694fbac330ee34a74590dad0fee1" }, - "vim-oscyank": { "branch": "main", "commit": "e6298736a7835bcb365dd45a8e8bfe86d935c1f8" }, - "vim-pandoc": { "branch": "master", "commit": "9f406d964ca70d959b7867f1b5cee3d4884d4d3c" }, + "vim-oscyank": { "branch": "main", "commit": "14685fcc4f487ca42dfe786dd54e4b2913370085" }, "vim-pandoc-syntax": { "branch": "master", "commit": "4268535e1d33117a680a91160d845cd3833dfe28" }, "vim-spellsync": { "branch": "master", "commit": "27e103f2d283a1f6e24cc99dbdcd624713aff277" }, - "which-key.nvim": { "branch": "main", "commit": "684e96c5e8477f1ee9b3f2e9a12d802fd12c5531" }, - "zen-mode.nvim": { "branch": "main", "commit": "3c92f503823088862ca2a7809d1c7edc90fb92fa" }, - "zettelkasten.nvim": { "branch": "main", "commit": "0e77624689b470410f5355b613d45219c9350264" } + "which-key.nvim": { "branch": "main", "commit": "6e190f4732a0f2fc517036f2fcf7727893bc5329" }, + "zen-mode.nvim": { "branch": "main", "commit": "4f2e70d75b7ece1c2a7c852664db492537078996" }, + "zettelkasten.nvim": { "branch": "main", "commit": "0e77624689b470410f5355b613d45219c9350264" }, + "zk-nvim": { "branch": "main", "commit": "0413c52500cd0133b0cd8e7e7d43084855ac1760" } } \ No newline at end of file From 051c0914ad198f7f7a42d37b8d89c3a6940c0c20 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Fri, 3 Mar 2023 12:38:09 +0100 Subject: [PATCH 32/51] nvim: Add wrapping plugin --- nvim/.config/nvim/lazy-lock.json | 1 + nvim/.config/nvim/lua/plugins.lua | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/nvim/.config/nvim/lazy-lock.json b/nvim/.config/nvim/lazy-lock.json index dc005d8..5c14932 100644 --- a/nvim/.config/nvim/lazy-lock.json +++ b/nvim/.config/nvim/lazy-lock.json @@ -66,6 +66,7 @@ "vim-pandoc-syntax": { "branch": "master", "commit": "4268535e1d33117a680a91160d845cd3833dfe28" }, "vim-spellsync": { "branch": "master", "commit": "27e103f2d283a1f6e24cc99dbdcd624713aff277" }, "which-key.nvim": { "branch": "main", "commit": "6e190f4732a0f2fc517036f2fcf7727893bc5329" }, + "wrapping.nvim": { "branch": "master", "commit": "a4013c377e2ffa3be00fb67791d3605ae3115acb" }, "zen-mode.nvim": { "branch": "main", "commit": "4f2e70d75b7ece1c2a7c852664db492537078996" }, "zettelkasten.nvim": { "branch": "main", "commit": "0e77624689b470410f5355b613d45219c9350264" }, "zk-nvim": { "branch": "main", "commit": "0413c52500cd0133b0cd8e7e7d43084855ac1760" } diff --git a/nvim/.config/nvim/lua/plugins.lua b/nvim/.config/nvim/lua/plugins.lua index 8ea66fe..ccaa5ce 100644 --- a/nvim/.config/nvim/lua/plugins.lua +++ b/nvim/.config/nvim/lua/plugins.lua @@ -67,10 +67,10 @@ return { requires = { 'kyazdani42/nvim-web-devicons', opt = true }, config = function() require('plug._lualine') end }, -- writing - { 'vim-pandoc/vim-criticmarkup', ft = writing_ft }, { + { 'vim-pandoc/vim-criticmarkup', ft = writing_ft }, { 'mickael-menu/zk-nvim', config = function() require('zk').setup({ picker = "telescope" }) end -}, { +}, { 'andrewferrier/wrapping.nvim', config = true }, { 'quarto-dev/quarto-nvim', dependencies = { 'jmbuhr/otter.nvim', 'neovim/nvim-lspconfig', From 1c7d0a9835ce54eac863d83adfebad86a7e8916b Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Fri, 3 Mar 2023 12:51:21 +0100 Subject: [PATCH 33/51] nvim: Default to stable versions for plugins Using the lazy option 'version' we default to updating only to the latest stable (semver) version of plugins. This should make it a little more stable in the long run to keep up with plugin updates. Not all plugins support this versioning scheme and for those that do not it just keeps tracking the main branch. Currently from the plugins that support it, only `nvim-lspconfig` needs to be manually kept on the main branch since it is missing the correct lua language server otherwise. This should be a problem of the past with the release of the next version of the plugin. --- nvim/.config/nvim/init.lua | 14 ++++----- nvim/.config/nvim/lazy-lock.json | 52 +++++++++++++++---------------- nvim/.config/nvim/lua/plugins.lua | 2 +- 3 files changed, 34 insertions(+), 34 deletions(-) diff --git a/nvim/.config/nvim/init.lua b/nvim/.config/nvim/init.lua index 2af02a3..6846058 100644 --- a/nvim/.config/nvim/init.lua +++ b/nvim/.config/nvim/init.lua @@ -7,12 +7,9 @@ api.nvim_exec('runtime abbrev.vim', false) local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" if not vim.loop.fs_stat(lazypath) then vim.fn.system({ - "git", - "clone", - "--filter=blob:none", - "https://github.com/folke/lazy.nvim.git", - "--branch=stable", -- latest stable release - lazypath, + "git", "clone", "--filter=blob:none", + "https://github.com/folke/lazy.nvim.git", "--branch=stable", -- latest stable release + lazypath }) end vim.opt.rtp:prepend(lazypath) @@ -23,7 +20,10 @@ vim.g.mapleader = " " require('settings') require('autocmds') -require("lazy").setup("plugins") +require("lazy").setup("plugins", { + defaults = { version = "*" }, + performance = { rtp = { disabled_plugins = { "netrw", "netrwPlugin" } } } +}) require('look') require('maps') diff --git a/nvim/.config/nvim/lazy-lock.json b/nvim/.config/nvim/lazy-lock.json index 5c14932..c9ad12e 100644 --- a/nvim/.config/nvim/lazy-lock.json +++ b/nvim/.config/nvim/lazy-lock.json @@ -1,7 +1,7 @@ { "BetterLua.vim": { "branch": "master", "commit": "d2d6c115575d09258a794a6f20ac60233eee59d5" }, - "LuaSnip": { "branch": "master", "commit": "f7c845749aba6096f041a73a26ba64f3817bab99" }, - "Navigator.nvim": { "branch": "master", "commit": "91d86506ac2a039504d5205d32a1d4bc7aa57072" }, + "LuaSnip": { "branch": "master", "commit": "500981ff6cefc7343e3959ef0f939bd0bfd49ba9" }, + "Navigator.nvim": { "branch": "master", "commit": "52225923679ec866651bb0c2e0691374131ec939" }, "bats.vim": { "branch": "master", "commit": "6a5d2ef22b0ede503d867770afd02ebb1f97b709" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, "cmp-cmdline": { "branch": "main", "commit": "8fcc934a52af96120fe26358985c10c035984b53" }, @@ -15,33 +15,33 @@ "cmp-treesitter": { "branch": "master", "commit": "b40178b780d547bcf131c684bc5fd41af17d05f2" }, "cmp_luasnip": { "branch": "master", "commit": "18095520391186d634a0045dacaa346291096566" }, "completion-vcard": { "branch": "master", "commit": "2220fd517a985ececed1adcf0e5be8f2815564c7" }, - "dial.nvim": { "branch": "master", "commit": "5020da900cc5dfd7067f181ee2ebd872ca7c84e8" }, + "dial.nvim": { "branch": "master", "commit": "54b503f906bc9e5ab85288414840a1b86d40769f" }, "dressing.nvim": { "branch": "master", "commit": "5f44f829481640be0f96759c965ae22a3bcaf7ce" }, "formatter.nvim": { "branch": "master", "commit": "ed949c13e1a942db29ababa35e8c7864ced90eb6" }, - "friendly-snippets": { "branch": "main", "commit": "02ed98a1d4bc8baac405480935f3353d3bd60359" }, - "gitsigns.nvim": { "branch": "main", "commit": "f965e3bad0be96898dec97dc15bdfe226a176e3a" }, + "friendly-snippets": { "branch": "main", "commit": "009887b76f15d16f69ae1341f86a7862f61cf2a1" }, + "gitsigns.nvim": { "branch": "main", "commit": "bb808fc7376ed7bac0fbe8f47b83d4bf01738167" }, "jupyter-kernel.nvim": { "branch": "main", "commit": "92eee2a9fcff65aedaba8f0544b87db44981673b" }, - "lazy.nvim": { "branch": "main", "commit": "26d121ea13bee96b079403cee6598f04969d4983" }, + "lazy.nvim": { "branch": "main", "commit": "8d18ef44e769e98a8dc974ca85275de1d8cc7c04" }, "lightspeed.nvim": { "branch": "main", "commit": "299eefa6a9e2d881f1194587c573dad619fdb96f" }, "lsp-format.nvim": { "branch": "master", "commit": "ca0df5c8544e51517209ea7b86ecc522c98d4f0a" }, - "lsp-zero.nvim": { "branch": "main", "commit": "766271e7e4ada413ff44b2cbb54650202ed9eaa4" }, - "lsp_signature.nvim": { "branch": "master", "commit": "6f6252f63b0baf0f2224c4caea33819a27f3f550" }, + "lsp-zero.nvim": { "branch": "main", "commit": "f9741ad3fff0feb835ac862f938dc795d0e9ba2e" }, + "lsp_signature.nvim": { "branch": "master", "commit": "4665921ff8e30601c7c1328625b3abc1427a6143" }, "lualine.nvim": { "branch": "master", "commit": "e99d733e0213ceb8f548ae6551b04ae32e590c80" }, "magma-nvim-goose": { "branch": "main", "commit": "d54719dad7771061678a77dace5bef43b4462be8" }, - "markdown-preview.nvim": { "branch": "master", "commit": "02cc3874738bc0f86e4b91f09b8a0ac88aef8e96" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "3f9c0ea157e88b08e2d11ec65002eeb6e421f0da" }, - "mason.nvim": { "branch": "main", "commit": "1c23135467af667c61aef72a7c08b9a032c50a52" }, + "markdown-preview.nvim": { "branch": "master", "commit": "9becceee5740b7db6914da87358a183ad11b2049" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "e4badf7984f7a5f0ac7dc10657dbedbd99a82f94" }, + "mason.nvim": { "branch": "main", "commit": "7175340eee0b1b4a86b38794d8c21fdcfa01376b" }, "mini.nvim": { "branch": "main", "commit": "427751024313e2270ca723eb16af7b218c83a7fc" }, - "neural": { "branch": "main", "commit": "0166560f213108d61e414a4229a41a34facf35ea" }, + "neural": { "branch": "main", "commit": "155618730b87a67655bdde373ee27bfce8b07ac9" }, "nui.nvim": { "branch": "main", "commit": "0dc148c6ec06577fcf06cbab3b7dac96d48ba6be" }, "nvim-base16.lua": { "branch": "master", "commit": "b336f40462b3ca1ad16a17c195b83731a2942d9a" }, - "nvim-cmp": { "branch": "main", "commit": "01f697a68905f9dcae70960a9eb013695a17f9a2" }, + "nvim-cmp": { "branch": "main", "commit": "983453e32cb35533a119725883c04436d16c0120" }, "nvim-colorizer.lua": { "branch": "master", "commit": "36c610a9717cc9ec426a07c8e6bf3b3abcb139d6" }, - "nvim-lspconfig": { "branch": "master", "commit": "95b7a69bc6da2a6a740584ea3c555e5327638b7d" }, - "nvim-notify": { "branch": "master", "commit": "9c987081390753b625e2d94e749e80e9b4a3e082" }, + "nvim-lspconfig": { "branch": "master", "commit": "e0926b6abc84578f44fb8917d61cdee22188639e" }, + "nvim-notify": { "branch": "master", "commit": "bdd647f61a05c9b8a57c83b78341a0690e9c29d7" }, "nvim-surround": { "branch": "main", "commit": "a06dea11e7fdcf338776fa51fa5277163ffb048d" }, - "nvim-toggleterm.lua": { "branch": "main", "commit": "31d38d11390bcd35a568fcc65a79b7d6ec89de62" }, - "nvim-treesitter": { "branch": "master", "commit": "9dd1b9c09707bf1cdd565b999c79ac6461602591" }, + "nvim-toggleterm.lua": { "branch": "main", "commit": "a5638b2206c3930a16a24e5c184dddd572f8cd34" }, + "nvim-treesitter": { "branch": "master", "commit": "c38646edf2bdfac157ca619697ecad9ea87fd469" }, "nvim-treesitter-context": { "branch": "master", "commit": "895ec44f5c89bc67ba5440aef3d1f2efa3d59a41" }, "nvim-treesitter-textsubjects": { "branch": "master", "commit": "b913508f503527ff540f7fe2dcf1bf1d1f259887" }, "nvim-ts-context-commentstring": { "branch": "main", "commit": "a0f89563ba36b3bacd62cf967b46beb4c2c29e52" }, @@ -50,24 +50,24 @@ "playground": { "branch": "master", "commit": "4044b53c4d4fcd7a78eae20b8627f78ce7dc6f56" }, "plenary.nvim": { "branch": "master", "commit": "253d34830709d690f013daf2853a9d21ad7accab" }, "popup.nvim": { "branch": "master", "commit": "b7404d35d5d3548a82149238289fa71f7f6de4ac" }, - "quarto-nvim": { "branch": "main", "commit": "0f2b3f6f0e1a856378f0fd6551d45d16920089fd" }, + "quarto-nvim": { "branch": "main", "commit": "b44f8772686241e563c7d0f200748fd71766b64e" }, "significant.nvim": { "branch": "main", "commit": "5450e9d5917dc6aa9afb0fcbe32355799b8303fb" }, "spellsitter.nvim": { "branch": "master", "commit": "4af8640d9d706447e78c13150ef7475ea2c16b30" }, "symbols-outline.nvim": { "branch": "master", "commit": "512791925d57a61c545bc303356e8a8f7869763c" }, "telescope-fzf-native.nvim": { "branch": "main", "commit": "580b6c48651cabb63455e97d7e131ed557b8c7e2" }, - "telescope.nvim": { "branch": "master", "commit": "a3f17d3baf70df58b9d3544ea30abe52a7a832c2" }, - "twilight.nvim": { "branch": "main", "commit": "9410252bed96887ca5a86bf16435a3a51a0e6ce5" }, - "vifm.vim": { "branch": "master", "commit": "2982c64e2ec1bd5b451e75526eec590bc6e976b9" }, + "telescope.nvim": { "branch": "master", "commit": "c1a2af0af69e80e14e6b226d3957a064cd080805" }, + "twilight.nvim": { "branch": "main", "commit": "8bb7fa7b918baab1ca81b977102ddb54afa63512" }, + "vifm.vim": { "branch": "master", "commit": "6898b7fcbc36324c127ba42cabe488ab15c785f4" }, "vim-criticmarkup": { "branch": "master", "commit": "d15dc134eb177a170c79f6377f81eb02a9d20b02" }, - "vim-easy-align": { "branch": "master", "commit": "12dd6316974f71ce333e360c0260b4e1f81169c3" }, + "vim-easy-align": { "branch": "master", "commit": "0db4ea6132110631ec678a99a82aa49a0686ae65" }, "vim-exchange": { "branch": "master", "commit": "784d63083ad7d613aa96f00021cd0dfb126a781a" }, - "vim-numbertoggle": { "branch": "main", "commit": "075b7478777e694fbac330ee34a74590dad0fee1" }, + "vim-numbertoggle": { "branch": "main", "commit": "df9b1fe616507340718716204ba7f434125bdf7a" }, "vim-oscyank": { "branch": "main", "commit": "14685fcc4f487ca42dfe786dd54e4b2913370085" }, "vim-pandoc-syntax": { "branch": "master", "commit": "4268535e1d33117a680a91160d845cd3833dfe28" }, - "vim-spellsync": { "branch": "master", "commit": "27e103f2d283a1f6e24cc99dbdcd624713aff277" }, - "which-key.nvim": { "branch": "main", "commit": "6e190f4732a0f2fc517036f2fcf7727893bc5329" }, + "vim-spellsync": { "branch": "master", "commit": "3d6dd50de9c4d953cc16638112a6ae196df41463" }, + "which-key.nvim": { "branch": "main", "commit": "2a0c2d80c0a60f041afb1b789cfedbd510e2b2b6" }, "wrapping.nvim": { "branch": "master", "commit": "a4013c377e2ffa3be00fb67791d3605ae3115acb" }, - "zen-mode.nvim": { "branch": "main", "commit": "4f2e70d75b7ece1c2a7c852664db492537078996" }, + "zen-mode.nvim": { "branch": "main", "commit": "4bd28fb3a44317c6258cebc7d92243d4b11dfe2c" }, "zettelkasten.nvim": { "branch": "main", "commit": "0e77624689b470410f5355b613d45219c9350264" }, "zk-nvim": { "branch": "main", "commit": "0413c52500cd0133b0cd8e7e7d43084855ac1760" } } \ No newline at end of file diff --git a/nvim/.config/nvim/lua/plugins.lua b/nvim/.config/nvim/lua/plugins.lua index ccaa5ce..9cb3876 100644 --- a/nvim/.config/nvim/lua/plugins.lua +++ b/nvim/.config/nvim/lua/plugins.lua @@ -176,7 +176,7 @@ return { { "VonHeikemen/lsp-zero.nvim", dependencies = { - "neovim/nvim-lspconfig", "williamboman/mason.nvim", + { "neovim/nvim-lspconfig", branch = "master" }, "williamboman/mason.nvim", "williamboman/mason-lspconfig.nvim", { "hrsh7th/nvim-cmp", dependencies = { From c92afad510bcc3097c67723ebe11b01062aaf8a4 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Fri, 3 Mar 2023 12:54:21 +0100 Subject: [PATCH 34/51] qutebrowser: Removed offline server redirect --- qutebrowser/.config/qutebrowser/redirects.py | 1 - 1 file changed, 1 deletion(-) diff --git a/qutebrowser/.config/qutebrowser/redirects.py b/qutebrowser/.config/qutebrowser/redirects.py index 701e4ad..9452bb3 100644 --- a/qutebrowser/.config/qutebrowser/redirects.py +++ b/qutebrowser/.config/qutebrowser/redirects.py @@ -7,7 +7,6 @@ redirects = { "source": ["youtube.com"], "target": [ "yt.oelrichsgarcia.de", - "vid.priv.au", "invidious.weblibre.org", "invidious.dhusch.de", "iv.ggtyler.dev", From 88ab8c10a6d610a6c63d46fa6488c6a08b342d75 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Fri, 3 Mar 2023 12:54:55 +0100 Subject: [PATCH 35/51] sh: Simple pseudo-fix for missing xdg symlink HACK - it does not reconnect the symlink correctly if its target indeed returns to the system. --- sh/.config/sh/xdg | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sh/.config/sh/xdg b/sh/.config/sh/xdg index 72f42ea..fe82615 100644 --- a/sh/.config/sh/xdg +++ b/sh/.config/sh/xdg @@ -25,7 +25,8 @@ test "$XDG_DESKTOP_DIR" || export XDG_DESKTOP_DIR="$HOME/desktop" test "$XDG_DOCUMENTS_DIR" || export XDG_DOCUMENTS_DIR="$HOME/documents" test "$XDG_DOWNLOAD_DIR" || export XDG_DOWNLOAD_DIR="$HOME/downloads" -export XDG_MUSIC_DIR="$HOME/media/audio/music" +export XDG_MEDIA_DIR="$HOME/media" +export XDG_MUSIC_DIR="$XDG_MEDIA_DIR/audio/music" export XDG_PICTURES_DIR="$HOME/pictures" export XDG_VIDEOS_DIR="$HOME/videos" @@ -49,6 +50,11 @@ xdg_makeForUser() { chmod 0700 "$1" } +if [ -h "$XDG_MEDIA_DIR" ] && [ ! -e "$XDG_MEDIA_DIR" ]; then + rm "$XDG_MEDIA_DIR" + xdg_makeForUser "$XDG_MEDIA_DIR" +fi + ## ensure directories exist xdg_isThere "$XDG_BIN_HOME" || xdg_makeForUser "$XDG_BIN_HOME" xdg_isThere "$XDG_CACHE_HOME" || xdg_makeForUser "$XDG_CACHE_HOME" From 356d3ef3e61b3a2c344d7881f4715929368f8eda Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Fri, 3 Mar 2023 12:56:18 +0100 Subject: [PATCH 36/51] writing: Add zk configuration to writing module --- writing/.config/sh/alias.d/zk.sh | 10 ++++++++++ writing/.config/sh/env.d/zk.sh | 4 ++++ 2 files changed, 14 insertions(+) create mode 100644 writing/.config/sh/alias.d/zk.sh create mode 100644 writing/.config/sh/env.d/zk.sh diff --git a/writing/.config/sh/alias.d/zk.sh b/writing/.config/sh/alias.d/zk.sh new file mode 100644 index 0000000..eae9298 --- /dev/null +++ b/writing/.config/sh/alias.d/zk.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env sh +# + +n() { + if [ $# -eq 0 ]; then + zk edit -i + else + zk "${@}" + fi +} diff --git a/writing/.config/sh/env.d/zk.sh b/writing/.config/sh/env.d/zk.sh new file mode 100644 index 0000000..598d9dc --- /dev/null +++ b/writing/.config/sh/env.d/zk.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env sh +# + +export ZK_NOTEBOOK_DIR="${WIKIROOT:-~/documents/notes/}/pinky" From 0447f652cb6a1e2d195d7c2d2a286aac803ae382 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Fri, 3 Mar 2023 18:29:13 +0100 Subject: [PATCH 37/51] waybar: Change colorscheme.css location to xdg state --- desktop/.config/waybar/style.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/desktop/.config/waybar/style.css b/desktop/.config/waybar/style.css index 5a25682..9ec5143 100644 --- a/desktop/.config/waybar/style.css +++ b/desktop/.config/waybar/style.css @@ -149,4 +149,4 @@ window#waybar.hidden { margin: 0; padding: 0; } -@import "/home/marty/.local/share/waybar/colorscheme.css"; +@import "/home/marty/.local/state/waybar/colorscheme.css"; From c13db186cce5f062806b8b9d175db7a3bb70268a Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Fri, 3 Mar 2023 18:29:46 +0100 Subject: [PATCH 38/51] river: Generalize dual-screen wallpaper setup Instead of checking for the specific DP-3 and DP-5 setup that my two screens default to, we just check that two DP- monitors are connected and set up the wallpapers on them. This also circumvents the issue that screens receive different numbering when disconnected and reconnected at any point. --- desktop/.config/river/init | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/desktop/.config/river/init b/desktop/.config/river/init index a3b2bf1..1fea9e0 100755 --- a/desktop/.config/river/init +++ b/desktop/.config/river/init @@ -235,16 +235,17 @@ for pad in $(riverctl list-inputs | grep -i touchscreen); do done setxkbmap -option "compose:menu" + # set a nice wallpaper -if exist wlopm && exist swww; then +if exist swww; then riverctl spawn "swww init" - if [ -e "$HOME/pictures/wall.jpg" ]; then + outputs=$(swww query | cut -d':' -f1) + if [ "$(echo "$outputs" | grep -c -e '^DP')" -eq 2 ] && [ -e "$HOME/pictures/wall_r.jpg" ]; then + swww img -o "$(echo "$outputs" | tail -n1)" "$HOME/pictures/wall_l.jpg" + swww img -o "$(echo "$outputs" | head -n1)" "$HOME/pictures/wall_r.jpg" + elif [ -e "$HOME/pictures/wall.jpg" ]; then swww img "$HOME/pictures/wall.jpg" fi - if wlopm | grep -q DP-5 && wlopm | grep -q DP-3 && [ -e "$HOME/pictures/wall_l.jpg" ] && [ -e "$HOME/pictures/wall_r.jpg" ]; then - swww img -o DP-5 "$HOME/pictures/wall_l.jpg" - swww img -o DP-3 "$HOME/pictures/wall_r.jpg" - fi fi # start status bar From 25d37d17b375585d6ba4de2b388a909bdaf1f96f Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Fri, 3 Mar 2023 18:35:21 +0100 Subject: [PATCH 39/51] nvim: Dynamically source colorscheme from file Neovim will source the `colorscheme.lua` file in its state directory on startup, as well as whenever the file contents are changed. This allows any colorscheme definition to be put into the file and vim will apply it as soon as the file contents change. --- nvim/.config/nvim/lua/look.lua | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/nvim/.config/nvim/lua/look.lua b/nvim/.config/nvim/lua/look.lua index 88c94fb..801980e 100644 --- a/nvim/.config/nvim/lua/look.lua +++ b/nvim/.config/nvim/lua/look.lua @@ -7,10 +7,28 @@ vim.api.nvim_set_var('gruvbox_italic', 1) vim.api.nvim_set_var('one_allow_italics', 1) vim.api.nvim_set_var('pencil_terminal_italics', 1) -function B16theme(theme) - local base16scheme = b.themes[theme] - b(base16scheme, true) +local colorsfile = vim.fn.stdpath('state') .. '/colorscheme.lua' +local function source_colors() + if vim.fn.filereadable(colorsfile) == 1 then + vim.cmd("source " .. colorsfile) + end end --- set the default colorscheme -B16theme('eighties') +-- source colors automatically from colorscheme file on change +local w = vim.loop.new_fs_event() +local function on_change(err, fname, status) + source_colors() + w:stop() + Watch_file(fname) +end +function Watch_file(fname) + local fullpath = vim.api.nvim_call_function('fnamemodify', { fname, ':p' }) + w:start(fullpath, {}, vim.schedule_wrap(function(...) + on_change(...) + end)) +end + +-- set on startup +source_colors() +-- and watch continuously +Watch_file(colorsfile) From 22341e798837bee6bf9018737f15f51fbc2209e9 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Fri, 3 Mar 2023 18:41:06 +0100 Subject: [PATCH 40/51] wezterm: Dynamically load colors from scheme file --- terminal/.config/wezterm/wezterm.lua | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/terminal/.config/wezterm/wezterm.lua b/terminal/.config/wezterm/wezterm.lua index 525036c..cca48f1 100644 --- a/terminal/.config/wezterm/wezterm.lua +++ b/terminal/.config/wezterm/wezterm.lua @@ -6,6 +6,26 @@ local maps = require 'maps' require 'statusbar'.setup() require 'events'.setup() +local function file_exists(name) + local f = io.open(name, "r") + if f ~= nil then + io.close(f) + return true + else + return false + end +end + +-- automatically reload colors file +local colorsfile = (os.getenv('XDG_STATE_HOME') or + (os.getenv('HOME') .. '/.local/state')) .. + '/wezterm/colors.toml' +local colors = {} +if file_exists(colorsfile) == true then + wezterm.add_to_config_reload_watch_list(colorsfile) + colors = wezterm.color.load_scheme(colorsfile) +end + -- wezterm.on("set-up-dotfile-workspace", function(window, pane) -- -- Set a workspace for coding on a current project -- -- Top pane is for the editor, bottom pane is for the build tool @@ -58,20 +78,16 @@ require 'events'.setup() return { enable_wayland = true, - hide_tab_bar_if_only_one_tab = true, use_fancy_tab_bar = false, tab_bar_at_bottom = true, window_padding = { left = 0, right = 0, top = 0, bottom = 0 }, - - color_scheme = "Railscasts (base16)", - + colors = colors, + color_scheme = "Nord (base16)", -- will be overwritten by colors -- default_prog = {"nu"}, scrollback_lines = 10000, - font = wezterm.font('Iosevka Nerd Font'), line_height = 1.0, - leader = { key = 'a', mods = 'CTRL', timeout_milliseconds = 1500 }, keys = maps.keys, key_tables = maps.key_tables From ec20d637c027c1f2de924acf3bea9ceb2bc4722e Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Fri, 3 Mar 2023 18:48:55 +0100 Subject: [PATCH 41/51] qutebrowser: Source colorscheme file from xdg state dir --- qutebrowser/.config/qutebrowser/config.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/qutebrowser/.config/qutebrowser/config.py b/qutebrowser/.config/qutebrowser/config.py index fa11210..be6ae75 100644 --- a/qutebrowser/.config/qutebrowser/config.py +++ b/qutebrowser/.config/qutebrowser/config.py @@ -72,4 +72,7 @@ c.hints.selectors["code"] = [ ] # give the browser nice theme colors -config.source("colorscheme.py") +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) From 09af447747476efe98aa90044cbb1604737b3e66 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Mon, 6 Mar 2023 11:35:13 +0100 Subject: [PATCH 42/51] multimedia: Scrub beets configuration --- multimedia/.config/beets/config.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/multimedia/.config/beets/config.yaml b/multimedia/.config/beets/config.yaml index 8512776..9dee535 100644 --- a/multimedia/.config/beets/config.yaml +++ b/multimedia/.config/beets/config.yaml @@ -48,8 +48,6 @@ item_fields: musicbrainz: extra_tags: [year, catalognum, country, media, label] - user: martyo - pass: u^a<7YKULz\#CKX\-Fm]K%Up0 auto: yes remove: yes From 954ccf5e8955b9173762cfdeeb8c66bb02356c27 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Tue, 7 Mar 2023 10:41:10 +0100 Subject: [PATCH 43/51] nvim: Improve dynamic colorscheme sourcing --- nvim/.config/nvim/lazy-lock.json | 3 ++- nvim/.config/nvim/lua/look.lua | 31 ++++++------------------------- nvim/.config/nvim/lua/plugins.lua | 7 ++++--- 3 files changed, 12 insertions(+), 29 deletions(-) diff --git a/nvim/.config/nvim/lazy-lock.json b/nvim/.config/nvim/lazy-lock.json index c9ad12e..2cadd98 100644 --- a/nvim/.config/nvim/lazy-lock.json +++ b/nvim/.config/nvim/lazy-lock.json @@ -19,6 +19,7 @@ "dressing.nvim": { "branch": "master", "commit": "5f44f829481640be0f96759c965ae22a3bcaf7ce" }, "formatter.nvim": { "branch": "master", "commit": "ed949c13e1a942db29ababa35e8c7864ced90eb6" }, "friendly-snippets": { "branch": "main", "commit": "009887b76f15d16f69ae1341f86a7862f61cf2a1" }, + "fwatch.nvim": { "branch": "main", "commit": "a691f7349dc66285cd75a1a698dd28bca45f2bf8" }, "gitsigns.nvim": { "branch": "main", "commit": "bb808fc7376ed7bac0fbe8f47b83d4bf01738167" }, "jupyter-kernel.nvim": { "branch": "main", "commit": "92eee2a9fcff65aedaba8f0544b87db44981673b" }, "lazy.nvim": { "branch": "main", "commit": "8d18ef44e769e98a8dc974ca85275de1d8cc7c04" }, @@ -34,8 +35,8 @@ "mini.nvim": { "branch": "main", "commit": "427751024313e2270ca723eb16af7b218c83a7fc" }, "neural": { "branch": "main", "commit": "155618730b87a67655bdde373ee27bfce8b07ac9" }, "nui.nvim": { "branch": "main", "commit": "0dc148c6ec06577fcf06cbab3b7dac96d48ba6be" }, - "nvim-base16.lua": { "branch": "master", "commit": "b336f40462b3ca1ad16a17c195b83731a2942d9a" }, "nvim-cmp": { "branch": "main", "commit": "983453e32cb35533a119725883c04436d16c0120" }, + "nvim-base16": { "branch": "master", "commit": "0cab02bac9ca02a70db9e1d07e25fdb630b18a21" }, "nvim-colorizer.lua": { "branch": "master", "commit": "36c610a9717cc9ec426a07c8e6bf3b3abcb139d6" }, "nvim-lspconfig": { "branch": "master", "commit": "e0926b6abc84578f44fb8917d61cdee22188639e" }, "nvim-notify": { "branch": "master", "commit": "bdd647f61a05c9b8a57c83b78341a0690e9c29d7" }, diff --git a/nvim/.config/nvim/lua/look.lua b/nvim/.config/nvim/lua/look.lua index 801980e..05fa4a8 100644 --- a/nvim/.config/nvim/lua/look.lua +++ b/nvim/.config/nvim/lua/look.lua @@ -1,12 +1,3 @@ -local b = require('base16') - --- italic comments if supported -local set_hl = require("util.highlight") -set_hl("Comment", { gui = "italic" }) -vim.api.nvim_set_var('gruvbox_italic', 1) -vim.api.nvim_set_var('one_allow_italics', 1) -vim.api.nvim_set_var('pencil_terminal_italics', 1) - local colorsfile = vim.fn.stdpath('state') .. '/colorscheme.lua' local function source_colors() if vim.fn.filereadable(colorsfile) == 1 then @@ -14,21 +5,11 @@ local function source_colors() end end --- source colors automatically from colorscheme file on change -local w = vim.loop.new_fs_event() -local function on_change(err, fname, status) - source_colors() - w:stop() - Watch_file(fname) -end -function Watch_file(fname) - local fullpath = vim.api.nvim_call_function('fnamemodify', { fname, ':p' }) - w:start(fullpath, {}, vim.schedule_wrap(function(...) - on_change(...) - end)) -end - -- set on startup source_colors() --- and watch continuously -Watch_file(colorsfile) + +-- continuously watch colors file for changes +local fwatch = require('fwatch') +fwatch.watch(colorsfile, { + on_event = vim.schedule_wrap(function() source_colors() end) +}) diff --git a/nvim/.config/nvim/lua/plugins.lua b/nvim/.config/nvim/lua/plugins.lua index 9cb3876..77624be 100644 --- a/nvim/.config/nvim/lua/plugins.lua +++ b/nvim/.config/nvim/lua/plugins.lua @@ -14,6 +14,9 @@ return { opts = { numhl = true, signcolumn = false }, event = "BufRead" }, { + }, + { 'RRethy/nvim-base16', event = "BufWinEnter", + dependencies = { 'rktjmp/fwatch.nvim' } }, { 'norcalli/nvim-colorizer.lua', -- color hex, named colors in the correct preview scheme config = true, event = "VeryLazy" @@ -59,9 +62,7 @@ return { }, { 'junegunn/vim-easy-align', -- Align tables and other alignable things event = "VeryLazy" -}, -- colorschemes - { 'norcalli/nvim-base16.lua' }, -- - -- statusline +}, -- statusline { 'nvim-lualine/lualine.nvim', requires = { 'kyazdani42/nvim-web-devicons', opt = true }, From 72514b2a5ee08f3c7a07946049862e4486e094b2 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Tue, 7 Mar 2023 10:45:43 +0100 Subject: [PATCH 44/51] nvim: Update rainbow brackets to maintained fork --- nvim/.config/nvim/lazy-lock.json | 2 +- nvim/.config/nvim/lua/plug/_treesitter.lua | 16 +++++++++------ nvim/.config/nvim/lua/plugins.lua | 24 ++++++++++++++-------- 3 files changed, 26 insertions(+), 16 deletions(-) diff --git a/nvim/.config/nvim/lazy-lock.json b/nvim/.config/nvim/lazy-lock.json index 2cadd98..045bc33 100644 --- a/nvim/.config/nvim/lazy-lock.json +++ b/nvim/.config/nvim/lazy-lock.json @@ -46,7 +46,7 @@ "nvim-treesitter-context": { "branch": "master", "commit": "895ec44f5c89bc67ba5440aef3d1f2efa3d59a41" }, "nvim-treesitter-textsubjects": { "branch": "master", "commit": "b913508f503527ff540f7fe2dcf1bf1d1f259887" }, "nvim-ts-context-commentstring": { "branch": "main", "commit": "a0f89563ba36b3bacd62cf967b46beb4c2c29e52" }, - "nvim-ts-rainbow": { "branch": "master", "commit": "ef95c15a935f97c65a80e48e12fe72d49aacf9b9" }, + "nvim-ts-rainbow2": { "branch": "master", "commit": "b2d1f4f51b1bd20de419ffb6f5d0876c4f20d9db" }, "otter.nvim": { "branch": "main", "commit": "8b46caf113918c26a9247031d6482709078ec907" }, "playground": { "branch": "master", "commit": "4044b53c4d4fcd7a78eae20b8627f78ce7dc6f56" }, "plenary.nvim": { "branch": "master", "commit": "253d34830709d690f013daf2853a9d21ad7accab" }, diff --git a/nvim/.config/nvim/lua/plug/_treesitter.lua b/nvim/.config/nvim/lua/plug/_treesitter.lua index 22072a3..bb152fb 100644 --- a/nvim/.config/nvim/lua/plug/_treesitter.lua +++ b/nvim/.config/nvim/lua/plug/_treesitter.lua @@ -1,13 +1,17 @@ -require'nvim-treesitter.configs'.setup { +local rainbow = require('ts-rainbow') +require 'nvim-treesitter.configs'.setup { -- one of "all", "maintained" (parsers with maintainers), or a list of languages ensure_installed = "all", - highlight = {enable = true}, - incremental_selection = {enable = true}, - textobjects = {enable = true}, - indent = {enable = true}, + highlight = { enable = true }, + incremental_selection = { enable = true }, + textobjects = { enable = true }, + indent = { enable = true }, -- enable rainbow brackets, needs p00f/nvim-ts-rainbow - rainbow = {enable = true}, + rainbow = { + enable = true, + strategy = { rainbow.strategy.global } + }, -- for improved commentstrings, needs corresponding plugin context_commentstring = {enable = true} diff --git a/nvim/.config/nvim/lua/plugins.lua b/nvim/.config/nvim/lua/plugins.lua index 77624be..ecbef93 100644 --- a/nvim/.config/nvim/lua/plugins.lua +++ b/nvim/.config/nvim/lua/plugins.lua @@ -149,10 +149,18 @@ return { { 'nvim-treesitter/nvim-treesitter', build = ':TSUpdate', - config = function() require('plug._treesitter') end + config = function() require('plug._treesitter') end, + event = "BufReadPre", + -- rainbow brackets using treesitter + -- show current cursor context at top of buffer + -- improves commenting plugin above by using ts + dependencies = { + 'https://gitlab.com/HiPhish/nvim-ts-rainbow2.git', + { 'romgrk/nvim-treesitter-context', config = true }, + 'JoosepAlviste/nvim-ts-context-commentstring' + } }, { 'nvim-treesitter/playground', cmd = "TSPlaygroundToggle" }, -- interactively view and query the treesitter tree - { 'romgrk/nvim-treesitter-context', event = "BufReadPre", config = true }, -- show current cursor context at top of buffer { 'RRethy/nvim-treesitter-textsubjects', -- allows using . and ; to target treesitter branches config = function() @@ -167,13 +175,11 @@ return { } end, event = "BufReadPre" - }, { 'p00f/nvim-ts-rainbow', event = "BufReadPre" }, -- rainbow brackets using treesitter - { 'JoosepAlviste/nvim-ts-context-commentstring', event = "BufReadPre" }, -- improves commenting plugin above by using ts - { - 'lewis6991/spellsitter.nvim', -- uses treesitter to highlight spelling errors - config = function() require('spellsitter').setup() end, - event = "BufReadPre" - }, -- lsp + }, { + 'lewis6991/spellsitter.nvim', -- uses treesitter to highlight spelling errors + config = function() require('spellsitter').setup() end, + event = "BufReadPre" +}, -- lsp { "VonHeikemen/lsp-zero.nvim", dependencies = { From 382bcdba72a99d4ac9bb9a4738864e48947c9989 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Tue, 7 Mar 2023 10:46:25 +0100 Subject: [PATCH 45/51] nvim: Hook treesitter commentstrings into comment maps --- nvim/.config/nvim/lazy-lock.json | 2 +- nvim/.config/nvim/lua/plug/_mini.lua | 8 +++++++- nvim/.config/nvim/lua/plug/_treesitter.lua | 5 ++++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/nvim/.config/nvim/lazy-lock.json b/nvim/.config/nvim/lazy-lock.json index 045bc33..ab5b5be 100644 --- a/nvim/.config/nvim/lazy-lock.json +++ b/nvim/.config/nvim/lazy-lock.json @@ -45,7 +45,7 @@ "nvim-treesitter": { "branch": "master", "commit": "c38646edf2bdfac157ca619697ecad9ea87fd469" }, "nvim-treesitter-context": { "branch": "master", "commit": "895ec44f5c89bc67ba5440aef3d1f2efa3d59a41" }, "nvim-treesitter-textsubjects": { "branch": "master", "commit": "b913508f503527ff540f7fe2dcf1bf1d1f259887" }, - "nvim-ts-context-commentstring": { "branch": "main", "commit": "a0f89563ba36b3bacd62cf967b46beb4c2c29e52" }, + "nvim-ts-context-commentstring": { "branch": "main", "commit": "729d83ecb990dc2b30272833c213cc6d49ed5214" }, "nvim-ts-rainbow2": { "branch": "master", "commit": "b2d1f4f51b1bd20de419ffb6f5d0876c4f20d9db" }, "otter.nvim": { "branch": "main", "commit": "8b46caf113918c26a9247031d6482709078ec907" }, "playground": { "branch": "master", "commit": "4044b53c4d4fcd7a78eae20b8627f78ce7dc6f56" }, diff --git a/nvim/.config/nvim/lua/plug/_mini.lua b/nvim/.config/nvim/lua/plug/_mini.lua index 31dfe4c..83d618a 100644 --- a/nvim/.config/nvim/lua/plug/_mini.lua +++ b/nvim/.config/nvim/lua/plug/_mini.lua @@ -1,5 +1,11 @@ require('mini.ai').setup() -require('mini.comment').setup() +require('mini.comment').setup({ + hooks = { + pre = function() + require('ts_context_commentstring.internal').update_commentstring() + end + } +}) require('mini.cursorword').setup({ delay = 500 }) require('mini.fuzzy').setup() require('mini.indentscope').setup({ diff --git a/nvim/.config/nvim/lua/plug/_treesitter.lua b/nvim/.config/nvim/lua/plug/_treesitter.lua index bb152fb..2a57eff 100644 --- a/nvim/.config/nvim/lua/plug/_treesitter.lua +++ b/nvim/.config/nvim/lua/plug/_treesitter.lua @@ -14,5 +14,8 @@ require 'nvim-treesitter.configs'.setup { }, -- for improved commentstrings, needs corresponding plugin - context_commentstring = {enable = true} + context_commentstring = { + enable = true, + enable_autocmd = false -- since we run it as a hook from the mini.comment plugin + } } From 74fdc4bc8ff641454bd8a4958c24318c29354804 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Tue, 7 Mar 2023 10:49:04 +0100 Subject: [PATCH 46/51] nvim: Update plugins --- nvim/.config/nvim/lazy-lock.json | 14 +++++++------- nvim/.config/nvim/lua/plugins.lua | 10 +++++----- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/nvim/.config/nvim/lazy-lock.json b/nvim/.config/nvim/lazy-lock.json index ab5b5be..4d6a982 100644 --- a/nvim/.config/nvim/lazy-lock.json +++ b/nvim/.config/nvim/lazy-lock.json @@ -22,23 +22,23 @@ "fwatch.nvim": { "branch": "main", "commit": "a691f7349dc66285cd75a1a698dd28bca45f2bf8" }, "gitsigns.nvim": { "branch": "main", "commit": "bb808fc7376ed7bac0fbe8f47b83d4bf01738167" }, "jupyter-kernel.nvim": { "branch": "main", "commit": "92eee2a9fcff65aedaba8f0544b87db44981673b" }, - "lazy.nvim": { "branch": "main", "commit": "8d18ef44e769e98a8dc974ca85275de1d8cc7c04" }, + "lazy.nvim": { "branch": "main", "commit": "14075657131b9a19883a8845c47f1ab65461cd6f" }, "lightspeed.nvim": { "branch": "main", "commit": "299eefa6a9e2d881f1194587c573dad619fdb96f" }, "lsp-format.nvim": { "branch": "master", "commit": "ca0df5c8544e51517209ea7b86ecc522c98d4f0a" }, - "lsp-zero.nvim": { "branch": "main", "commit": "f9741ad3fff0feb835ac862f938dc795d0e9ba2e" }, + "lsp-zero.nvim": { "branch": "main", "commit": "79d2091809a295aba94f9ea72cd622bca198d046" }, "lsp_signature.nvim": { "branch": "master", "commit": "4665921ff8e30601c7c1328625b3abc1427a6143" }, "lualine.nvim": { "branch": "master", "commit": "e99d733e0213ceb8f548ae6551b04ae32e590c80" }, "magma-nvim-goose": { "branch": "main", "commit": "d54719dad7771061678a77dace5bef43b4462be8" }, "markdown-preview.nvim": { "branch": "master", "commit": "9becceee5740b7db6914da87358a183ad11b2049" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "e4badf7984f7a5f0ac7dc10657dbedbd99a82f94" }, - "mason.nvim": { "branch": "main", "commit": "7175340eee0b1b4a86b38794d8c21fdcfa01376b" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "a31e011135a79d63c71254c250c9158e1056a1cb" }, + "mason.nvim": { "branch": "main", "commit": "3ee3174e30e33c9d58fa07b0a73a6e180474b59c" }, "mini.nvim": { "branch": "main", "commit": "427751024313e2270ca723eb16af7b218c83a7fc" }, "neural": { "branch": "main", "commit": "155618730b87a67655bdde373ee27bfce8b07ac9" }, "nui.nvim": { "branch": "main", "commit": "0dc148c6ec06577fcf06cbab3b7dac96d48ba6be" }, - "nvim-cmp": { "branch": "main", "commit": "983453e32cb35533a119725883c04436d16c0120" }, "nvim-base16": { "branch": "master", "commit": "0cab02bac9ca02a70db9e1d07e25fdb630b18a21" }, + "nvim-cmp": { "branch": "main", "commit": "feed47fd1da7a1bad2c7dca456ea19c8a5a9823a" }, "nvim-colorizer.lua": { "branch": "master", "commit": "36c610a9717cc9ec426a07c8e6bf3b3abcb139d6" }, - "nvim-lspconfig": { "branch": "master", "commit": "e0926b6abc84578f44fb8917d61cdee22188639e" }, + "nvim-lspconfig": { "branch": "master", "commit": "1a2d5f5224c65b0709bf5da0ccd9cad29272083a" }, "nvim-notify": { "branch": "master", "commit": "bdd647f61a05c9b8a57c83b78341a0690e9c29d7" }, "nvim-surround": { "branch": "main", "commit": "a06dea11e7fdcf338776fa51fa5277163ffb048d" }, "nvim-toggleterm.lua": { "branch": "main", "commit": "a5638b2206c3930a16a24e5c184dddd572f8cd34" }, @@ -63,7 +63,7 @@ "vim-easy-align": { "branch": "master", "commit": "0db4ea6132110631ec678a99a82aa49a0686ae65" }, "vim-exchange": { "branch": "master", "commit": "784d63083ad7d613aa96f00021cd0dfb126a781a" }, "vim-numbertoggle": { "branch": "main", "commit": "df9b1fe616507340718716204ba7f434125bdf7a" }, - "vim-oscyank": { "branch": "main", "commit": "14685fcc4f487ca42dfe786dd54e4b2913370085" }, + "vim-oscyank": { "branch": "main", "commit": "ffe827a27dae98aa826e2295336c650c9a434da0" }, "vim-pandoc-syntax": { "branch": "master", "commit": "4268535e1d33117a680a91160d845cd3833dfe28" }, "vim-spellsync": { "branch": "master", "commit": "3d6dd50de9c4d953cc16638112a6ae196df41463" }, "which-key.nvim": { "branch": "main", "commit": "2a0c2d80c0a60f041afb1b789cfedbd510e2b2b6" }, diff --git a/nvim/.config/nvim/lua/plugins.lua b/nvim/.config/nvim/lua/plugins.lua index ecbef93..b0fc899 100644 --- a/nvim/.config/nvim/lua/plugins.lua +++ b/nvim/.config/nvim/lua/plugins.lua @@ -13,7 +13,6 @@ return { 'lewis6991/gitsigns.nvim', -- show vcs changes on left-hand gutter opts = { numhl = true, signcolumn = false }, event = "BufRead" - }, { }, { 'RRethy/nvim-base16', event = "BufWinEnter", dependencies = { 'rktjmp/fwatch.nvim' } }, { @@ -25,7 +24,7 @@ return { config = function() require('plug._format') end, event = "VeryLazy" }, -- editing - { 'kylechui/nvim-surround', version = '*', config = true, event = "VeryLazy" }, -- surround things with other things using ys/cs/ds + { 'kylechui/nvim-surround', version = '*', config = true, event = "VeryLazy" }, -- surround things with other things using ys/cs/ds { 'monaqa/dial.nvim', -- extend the ^a / ^x possibilities to dates, hex, alphabets, markdown headers config = function() @@ -183,9 +182,10 @@ return { { "VonHeikemen/lsp-zero.nvim", dependencies = { - { "neovim/nvim-lspconfig", branch = "master" }, "williamboman/mason.nvim", - "williamboman/mason-lspconfig.nvim", { + { "neovim/nvim-lspconfig", branch = "master" }, + "williamboman/mason.nvim", "williamboman/mason-lspconfig.nvim", { "hrsh7th/nvim-cmp", + branch = "main", dependencies = { "hrsh7th/cmp-buffer", "hrsh7th/cmp-path", "saadparwaiz1/cmp_luasnip", "hrsh7th/cmp-nvim-lsp", @@ -193,7 +193,7 @@ return { "hrsh7th/cmp-nvim-lsp", "kdheepak/cmp-latex-symbols", "ray-x/cmp-treesitter", "f3fora/cmp-spell", "hrsh7th/cmp-cmdline", "cbarrete/completion-vcard", - "jc-doyle/cmp-pandoc-references" + "jc-doyle/cmp-pandoc-references", } }, "L3MON4D3/LuaSnip", "rafamadriz/friendly-snippets", { "lukas-reineke/lsp-format.nvim", config = true } From 6f3ac3d31fab80d86feb57a41fa9511b27136290 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Tue, 7 Mar 2023 10:49:51 +0100 Subject: [PATCH 47/51] nvim: Move Navigator to dev version Since Navigator.nvim only implements wezterm compatibility in its main branch as of now, we explicitly switch away from its stable version for now. --- nvim/.config/nvim/lazy-lock.json | 2 +- nvim/.config/nvim/lua/plugins.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/nvim/.config/nvim/lazy-lock.json b/nvim/.config/nvim/lazy-lock.json index 4d6a982..8ed96d8 100644 --- a/nvim/.config/nvim/lazy-lock.json +++ b/nvim/.config/nvim/lazy-lock.json @@ -1,7 +1,7 @@ { "BetterLua.vim": { "branch": "master", "commit": "d2d6c115575d09258a794a6f20ac60233eee59d5" }, "LuaSnip": { "branch": "master", "commit": "500981ff6cefc7343e3959ef0f939bd0bfd49ba9" }, - "Navigator.nvim": { "branch": "master", "commit": "52225923679ec866651bb0c2e0691374131ec939" }, + "Navigator.nvim": { "branch": "master", "commit": "91d86506ac2a039504d5205d32a1d4bc7aa57072" }, "bats.vim": { "branch": "master", "commit": "6a5d2ef22b0ede503d867770afd02ebb1f97b709" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, "cmp-cmdline": { "branch": "main", "commit": "8fcc934a52af96120fe26358985c10c035984b53" }, diff --git a/nvim/.config/nvim/lua/plugins.lua b/nvim/.config/nvim/lua/plugins.lua index b0fc899..6e12ed4 100644 --- a/nvim/.config/nvim/lua/plugins.lua +++ b/nvim/.config/nvim/lua/plugins.lua @@ -3,7 +3,7 @@ local writing_ft = { "quarto", "pandoc", "markdown", "text", "tex" } return { -- vim plugs -- essential - { 'numToStr/Navigator.nvim', config = true }, -- allow seamless navigation between vim buffers and tmux/wezterm splits + { 'numToStr/Navigator.nvim', branch = "master", config = true }, -- allow seamless navigation between vim buffers and tmux/wezterm splits { 'jeffkreeftmeijer/vim-numbertoggle', event = "BufEnter" }, -- toggles numbers to absolute for all buffers but the current which is relative { 'ojroques/vim-oscyank', event = "VeryLazy" }, -- yank from *anywhere* (even ssh session) to clipboard, using :OSCYank { 'ggandor/lightspeed.nvim', event = "VeryLazy" }, -- jump between letters with improved fFtT quicksearch, mimics sneak From 2c0d41f4afb50365125d25da2292d8f2f0afdbf8 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Tue, 7 Mar 2023 10:51:22 +0100 Subject: [PATCH 48/51] nvim: Load zathura colors from xdg state directory --- writing/.config/zathura/zathurarc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/writing/.config/zathura/zathurarc b/writing/.config/zathura/zathurarc index e97241d..da19d35 100644 --- a/writing/.config/zathura/zathurarc +++ b/writing/.config/zathura/zathurarc @@ -1,4 +1,6 @@ +# overwritten by below colors include colorscheme +include /home/marty/.local/state/zathura/zathurarc set recolor "true" set selection-clipboard "clipboard" @@ -7,4 +9,3 @@ set first-page-column 1 map r reload map R rotate map p print - From b800d8f1eb659a19e2870932449c0605e369901a Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Tue, 7 Mar 2023 11:05:15 +0100 Subject: [PATCH 49/51] desktop: Add flavours program to set colors Switching from my custom, brittle, styling implementation `styler` to the wonder `flavours` program which does exactly the same only with more clarity, faster and - I would presume - more stable. --- bootstrap/packages_stable.tsv | 1 + desktop/.config/flavours/config.toml | 84 +++++++++++++++++++ .../templates/nvim/templates/default.mustache | 29 +++++++ .../wezterm/templates/default.mustache | 32 +++++++ desktop/.config/mako/config | 7 -- desktop/.config/river/init | 2 +- 6 files changed, 147 insertions(+), 8 deletions(-) create mode 100644 desktop/.config/flavours/config.toml create mode 100644 desktop/.config/flavours/templates/nvim/templates/default.mustache create mode 100644 desktop/.config/flavours/templates/wezterm/templates/default.mustache diff --git a/bootstrap/packages_stable.tsv b/bootstrap/packages_stable.tsv index b1a2864..e8cf5fe 100644 --- a/bootstrap/packages_stable.tsv +++ b/bootstrap/packages_stable.tsv @@ -68,6 +68,7 @@ fasd Command-line productivity booster, offers quick access to files and directo fd Simple, fast and user-friendly alternative to find R ffmpegthumbnailer Lightweight video thumbnailer that can be used by file managers R firefox Standalone web browser from mozilla.org R +flavours A simple and easy cli to build and use base16 schemes A fonts-cjk Linux 下的免费商用字体包 A freerdp Free implementation of the Remote Desktop Protocol (RDP) R fwupd Simple daemon to allow session software to update firmware R diff --git a/desktop/.config/flavours/config.toml b/desktop/.config/flavours/config.toml new file mode 100644 index 0000000..c971cc1 --- /dev/null +++ b/desktop/.config/flavours/config.toml @@ -0,0 +1,84 @@ +# Configuration for flavours +# https://github.com/Misterio77/flavours +# +# This file should contain a [[items]] section for each application you want themed +# You can also set a shell (outside items) on which to run hooks +# Check flavours repository for more information and examples + + +# Explanation and default values for keys: + +# # Through which shell command hooks will run. The command will be replaced in '{}' +shell = "bash -c '{}'" +# +# [[items]] +# # File to inject to, supports tilde and env var expansion. required +# file = "~/.config/example" +# # Template to use. required +# template = "example" +# +# # Subtemplate to use +# subtemplate = "default" +# # If not rewriting, on which line (usually a comment) to start replacing +# start = "# Start flavours" +# # If not rewriting, on which line (usually a comment) to stop replacing +# end = "# End flavours" +# # Should we rewrite the entire file, instead of using the above delimiters? +# rewrite = false +# # Command to execute after injecting (goes through shell) +# hook = "" +# # Whether this hook should be executed when flavours is ran with lightweight flag +# light = true + +[[items]] +template = "waybar" +file = "~/.local/state/waybar/colorscheme.css" +rewrite = true +light = false +hook = "killall -SIGUSR2 waybar" + +[[items]] +# Uses custom nvim template to work together with +# RRethy base16 neovim plugin +template = "nvim" +file = "~/.local/state/nvim/colorscheme.lua" +rewrite = true + +[[items]] +# For newer wezterm versions (missing cursor= field) +# make use of my custom wezterm template +template = "wezterm" +file = "~/.local/state/wezterm/colors.toml" +rewrite = true + +[[items]] +template = "zathura" +file = "~/.local/state/zathura/zathurarc" +rewrite = true + +[[items]] +template = "qutebrowser" +subtemplate = "minimal" +file = "~/.local/state/qutebrowser/colorscheme.py" +rewrite = true +light = false +hook = "pgrep -x qutebrowser && qutebrowser :config-source" + +# CSS Webpage styling in qutebrowser +[[item]] +file = "~/.config/qutebrowser/stylesheets/stylesheet.css" +template = "styles" +subtemplate = "css-variables" +rewrite = false +start = "/* Start flavours */" +end = "/* End flavours */" + +[[items]] +# MAKO DOES NOT SUPPORT INCLUDES YET +template = "mako" +file = "~/.config/mako/config" +light = false +rewrite = false +start = "# Start flavours" +end = "# End flavours" +hook = "killall mako" diff --git a/desktop/.config/flavours/templates/nvim/templates/default.mustache b/desktop/.config/flavours/templates/nvim/templates/default.mustache new file mode 100644 index 0000000..08baf2c --- /dev/null +++ b/desktop/.config/flavours/templates/nvim/templates/default.mustache @@ -0,0 +1,29 @@ +-- base16-nvim (https://github.com/wincent/base16-nvim) +-- by Greg Hurrell (https://github.com/wincent) +-- based on +-- base16-vim (https://github.com/chriskempson/base16-vim) +-- by Chris Kempson (https://github.com/chriskempson) +-- using nvim-base16 neovim plugin +-- by RRethy (https://github.com/RRethy/nvim-base16) +-- {{scheme-name}} scheme by {{scheme-author}} + +require('base16-colorscheme').setup({ + base00 = '#{{base00-hex}}', + base01 = '#{{base01-hex}}', + base02 = '#{{base02-hex}}', + base03 = '#{{base03-hex}}', + base04 = '#{{base04-hex}}', + base05 = '#{{base05-hex}}', + base06 = '#{{base06-hex}}', + base07 = '#{{base07-hex}}', + base08 = '#{{base08-hex}}', + base09 = '#{{base09-hex}}', + base0A = '#{{base0A-hex}}', + base0B = '#{{base0B-hex}}', + base0C = '#{{base0C-hex}}', + base0D = '#{{base0D-hex}}', + base0E = '#{{base0E-hex}}', + base0F = '#{{base0F-hex}}' +}) + +-- vim: filetype=lua diff --git a/desktop/.config/flavours/templates/wezterm/templates/default.mustache b/desktop/.config/flavours/templates/wezterm/templates/default.mustache new file mode 100644 index 0000000..5f2c202 --- /dev/null +++ b/desktop/.config/flavours/templates/wezterm/templates/default.mustache @@ -0,0 +1,32 @@ +# Base16 {{scheme-name}} - wezterm color config +# Scheme by {{scheme-author}} + +[colors] +foreground = "#{{base05-hex}}" +background = "#{{base00-hex}}" +cursor_bg = "#{{base05-hex}}" +cursor_border = "#{{base05-hex}}" +selection_bg = "#{{base05-hex}}" +selection_fg = "#{{base00-hex}}" + +ansi = [ + "#{{base00-hex}}", + "#{{base08-hex}}", + "#{{base0B-hex}}", + "#{{base0A-hex}}", + "#{{base0D-hex}}", + "#{{base0E-hex}}", + "#{{base0C-hex}}", + "#{{base05-hex}}" +] + +brights = [ + "#{{base03-hex}}", + "#{{base08-hex}}", + "#{{base0B-hex}}", + "#{{base0A-hex}}", + "#{{base0D-hex}}", + "#{{base0E-hex}}", + "#{{base0C-hex}}", + "#{{base07-hex}}" +] diff --git a/desktop/.config/mako/config b/desktop/.config/mako/config index 2a53616..7182376 100644 --- a/desktop/.config/mako/config +++ b/desktop/.config/mako/config @@ -1,25 +1,18 @@ sort=-time layer=overlay -background-color=#2e3440 width=300 height=110 border-size=2 -border-color=#88c0d0 border-radius=15 max-icon-size=64 default-timeout=5000 ignore-timeout=1 font=monospace 14 -[urgency=low] -border-color=#cccccc -[urgency=normal] -border-color=#d08770 [urgency=critical] #on-notify=exec mpv /usr/share/sounds/freedesktop/stereo/message.oga -border-color=#bf616a default-timeout=0 [mode=do-not-disturb] diff --git a/desktop/.config/river/init b/desktop/.config/river/init index 1fea9e0..5e6ce83 100755 --- a/desktop/.config/river/init +++ b/desktop/.config/river/init @@ -71,7 +71,7 @@ riverctl map normal $mod+Shift T spawn "bemenu-translate" # Desktop theming # shellcheck disable=SC2016 -riverctl map normal $mod+Shift S spawn 'styler set $(styler list themes | bemenu)' +riverctl map normal $mod+Shift S spawn 'flavours list -l | bemenu | xargs flavours apply' # Password dropdown frontend riverctl map normal $mod+Shift P spawn "pass-pick" From f1b218da95669ecb85813e0a6eddc4d281428709 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Tue, 7 Mar 2023 11:10:03 +0100 Subject: [PATCH 50/51] bootstrap: Update stable packages --- bootstrap/packages_stable.tsv | 8 +++++--- bootstrap/packages_testing.tsv | 4 ---- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/bootstrap/packages_stable.tsv b/bootstrap/packages_stable.tsv index e8cf5fe..96a08e6 100644 --- a/bootstrap/packages_stable.tsv +++ b/bootstrap/packages_stable.tsv @@ -7,7 +7,7 @@ alsa-utils Advanced Linux Sound Architecture - Utilities R anki Helps you remember facts (like words/phrases in a foreign language) efficiently A ansible Official assortment of Ansible collections R ansible-lint Checks playbooks for practices and behaviour that could potentially be improved. R -arch-wiki-lite The wiki without html. 1/9 as big, easily searched and viewable on console. R +arch-wiki-lite Arch Wiki without HTML. 1/9 as big, easily searched & viewable on console R arduino Arduino prototyping platform SDK R arduino-avr-core Arduino AVR core with upstream avr-gcc and avrdude R arduino-cli Arduino command line interface R @@ -121,6 +121,7 @@ kubo IPFS implementation in Go R lazygit Simple terminal UI for git commands R lib32-gamemode A daemon/lib combo that allows games to request a set of optimisations be temporarily applied to the host OS R libdvdcss Portable abstraction library for DVD decryption R +libfido2 Library functionality for FIDO 2.0, including communication with a device over USB R libqalculate Multi-purpose desktop calculator R libreoffice-fresh LibreOffice branch which contains new features and program enhancements R libva-intel-driver VA-API implementation for Intel G45 and HD Graphics family R @@ -296,7 +297,7 @@ transmission-qt Fast, easy, and free BitTorrent client (Qt GUI) R ttf-brill Brill Typeface by John Hudson for Brill Publishing House A ttf-comic-neue Comic Neue aspires to be the casual script choice for everyone including the typographically savvy. A ttf-heuristica A serif latin & cyrillic font, derived from the "Adobe Utopia" font by Apanov A -ttf-iosevka-nerd Typeface family designed for coding, terminal use and technical documents (Nerd Fonts) R +ttf-iosevka-nerd Patched font Iosevka from nerd fonts library R ttf-signika Sans-serif typeface from Google by Anna Giedryś A tuir Browse Reddit from your terminal A tut A TUI for Mastodon with vim inspired keys A @@ -322,7 +323,7 @@ visidata Terminal spreadsheet multitool for discovering and arranging data R wallabag-client Command line client for the self hosted read-it-later app Wallabag A wavemon Ncurses-based monitoring application for wireless network devices R waybar Highly customizable Wayland bar for Sway and Wlroots based compositors R -waylock-git A simple screenlocker for Wayland compositors A +waylock A simple screenlocker for wayland compositors R wdisplays GUI display configurator for wlroots compositors A wev tool for debugging wayland events, similar to xev A wezterm A GPU-accelerated cross-platform terminal emulator and multiplexer R @@ -337,6 +338,7 @@ xdg-user-dirs Manage user directories like ~/Desktop and ~/Music R xsv A CLI for indexing, slicing, analyzing, splitting and joining CSV files R yaml-language-server YAML Language Server R yarn Fast, reliable, and secure dependency management R +yubikey-manager Python library and command line tool for configuring a YubiKey R yt-dlp A youtube-dl fork with additional features and fixes R ytfzf A POSIX script to find and watch youtube videos from the terminal R zathura-cb Adds comic book support to zathura R diff --git a/bootstrap/packages_testing.tsv b/bootstrap/packages_testing.tsv index f182ca3..b892158 100644 --- a/bootstrap/packages_testing.tsv +++ b/bootstrap/packages_testing.tsv @@ -1,7 +1,6 @@ Name Description Source Target ddrescue GNU data recovery tool R go-mtpfs-git Simple tool for viewing MTP devices as FUSE filesystems A -libfido2 Library functionality for FIDO 2.0, including communication with a device over USB R most A terminal pager similar to 'more' and 'less' R netbird-bin A WireGuard-based mesh network that connects your devices into a single private network A odysseyra1n Bootstraps Procursus and install Sileo/libhooker on devices jailbroken with checkra1n. A @@ -11,6 +10,3 @@ shadow-tech Desktop client for Shadow Tech cloud gaming service. A signal-desktop Signal Private Messenger for Linux R testdisk Checks and undeletes partitions + PhotoRec, signature based recovery tool R texlive-latexextra TeX Live - Large collection of add-on packages for LaTeX R -ttf-iosevka-nerd Patched font Iosevka from nerd fonts library R -vifm A file manager with curses interface, which provides Vi[m]-like environment R -yubikey-manager Python library and command line tool for configuring a YubiKey R From 3827ba15b3be0bf2170874c48574a700d1a35ff4 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Tue, 7 Mar 2023 11:44:14 +0100 Subject: [PATCH 51/51] wezterm: Style tabbar with flavours --- .../wezterm/templates/default.mustache | 12 ++++ terminal/.config/wezterm/wezterm.lua | 57 ++----------------- 2 files changed, 17 insertions(+), 52 deletions(-) diff --git a/desktop/.config/flavours/templates/wezterm/templates/default.mustache b/desktop/.config/flavours/templates/wezterm/templates/default.mustache index 5f2c202..130d0e9 100644 --- a/desktop/.config/flavours/templates/wezterm/templates/default.mustache +++ b/desktop/.config/flavours/templates/wezterm/templates/default.mustache @@ -30,3 +30,15 @@ brights = [ "#{{base0C-hex}}", "#{{base07-hex}}" ] + +[colors.tab_bar] +background = "#{{base00-hex}}" +[colors.tab_bar.inactive_tab] +bg_color = "#{{base05-hex}}" +fg_color = "#{{base00-hex}}" +[colors.tab_bar.active_tab] +bg_color = "#{{base00-hex}}" +fg_color = "#{{base05-hex}}" +[colors.tab_bar.new_tab] +bg_color = "#{{base05-hex}}" +fg_color = "#{{base00-hex}}" diff --git a/terminal/.config/wezterm/wezterm.lua b/terminal/.config/wezterm/wezterm.lua index cca48f1..0b3db1f 100644 --- a/terminal/.config/wezterm/wezterm.lua +++ b/terminal/.config/wezterm/wezterm.lua @@ -1,5 +1,4 @@ local wezterm = require 'wezterm' -local mux = wezterm.mux local maps = require 'maps' @@ -26,56 +25,6 @@ if file_exists(colorsfile) == true then colors = wezterm.color.load_scheme(colorsfile) end --- wezterm.on("set-up-dotfile-workspace", function(window, pane) --- -- Set a workspace for coding on a current project --- -- Top pane is for the editor, bottom pane is for the build tool --- local project_dir = wezterm.home_dir .. '/projects/test/quarto/quarto-test' --- local tab, build_pane, window = mux.spawn_window { --- workspace = 'coding', --- cwd = project_dir, --- args = args --- } --- local editor_pane = build_pane:split{ --- direction = 'Top', --- size = 0.6, --- cwd = project_dir --- } --- build_pane:send_text 'quarto check' --- mux.set_active_workspace 'coding' --- end) --- --- wezterm.on('gui-startup', function(cmd) --- -- allow `wezterm start -- something` to affect what we spawn --- -- in our initial window --- local args = {} --- if cmd then args = cmd.args end --- --- -- Set a workspace for coding on a current project --- -- Top pane is for the editor, bottom pane is for the build tool --- local project_dir = wezterm.home_dir .. '/projects/test/quarto/quarto-test' --- local tab, build_pane, window = mux.spawn_window { --- workspace = 'coding', --- cwd = project_dir, --- args = args --- } --- local editor_pane = build_pane:split { --- direction = 'Top', --- size = 0.6, --- cwd = project_dir --- } --- build_pane:send_text 'quarto check' --- --- -- A workspace for interacting with a local machine that --- -- runs some docker containners for home automation --- local tab, pane, window = mux.spawn_window { --- workspace = 'toppy', --- args = { 'top' } --- } --- --- -- We want to startup in the coding workspace --- mux.set_active_workspace 'coding' --- end) - return { enable_wayland = true, hide_tab_bar_if_only_one_tab = true, @@ -90,5 +39,9 @@ return { line_height = 1.0, leader = { key = 'a', mods = 'CTRL', timeout_milliseconds = 1500 }, keys = maps.keys, - key_tables = maps.key_tables + key_tables = maps.key_tables, + inactive_pane_hsb = { + saturation = 0.9, + brightness = 0.9, + } }