diff --git a/bootstrap/packages_stable.tsv b/bootstrap/packages_stable.tsv index b1a2864..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 @@ -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 @@ -120,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 @@ -295,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 @@ -321,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 @@ -336,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 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 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..130d0e9 --- /dev/null +++ b/desktop/.config/flavours/templates/wezterm/templates/default.mustache @@ -0,0 +1,44 @@ +# 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}}" +] + +[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/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 { 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 7a95637..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" @@ -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 @@ -268,7 +269,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 '*'\" \ 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"; 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 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 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' 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/init.lua b/nvim/.config/nvim/init.lua index 397cd86..6846058 100644 --- a/nvim/.config/nvim/init.lua +++ b/nvim/.config/nvim/init.lua @@ -2,45 +2,14 @@ -- 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({ - "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) @@ -50,7 +19,11 @@ vim.opt.rtp:prepend(lazypath) vim.g.mapleader = " " require('settings') -require("lazy").setup("plugins") +require('autocmds') +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 22cfec4..8ed96d8 100644 --- a/nvim/.config/nvim/lazy-lock.json +++ b/nvim/.config/nvim/lazy-lock.json @@ -4,70 +4,71 @@ "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" }, "cmp-treesitter": { "branch": "master", "commit": "b40178b780d547bcf131c684bc5fd41af17d05f2" }, "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" }, + "dial.nvim": { "branch": "master", "commit": "54b503f906bc9e5ab85288414840a1b86d40769f" }, + "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": "14075657131b9a19883a8845c47f1ab65461cd6f" }, "lightspeed.nvim": { "branch": "main", "commit": "299eefa6a9e2d881f1194587c573dad619fdb96f" }, "lsp-format.nvim": { "branch": "master", "commit": "ca0df5c8544e51517209ea7b86ecc522c98d4f0a" }, - "lsp-zero.nvim": { "branch": "main", "commit": "42bc5a1081666098a7154532e6ff5e3edc483b39" }, - "lsp_signature.nvim": { "branch": "master", "commit": "6f6252f63b0baf0f2224c4caea33819a27f3f550" }, - "lualine.nvim": { "branch": "master", "commit": "0050b308552e45f7128f399886c86afefc3eb988" }, - "magma-nvim-goose": { "branch": "main", "commit": "94370733757d550594fe4a1d65643949d7485989" }, - "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" }, - "nvim-base16.lua": { "branch": "master", "commit": "b336f40462b3ca1ad16a17c195b83731a2942d9a" }, - "nvim-cmp": { "branch": "main", "commit": "cfafe0a1ca8933f7b7968a287d39904156f2c57d" }, + "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": "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-base16": { "branch": "master", "commit": "0cab02bac9ca02a70db9e1d07e25fdb630b18a21" }, + "nvim-cmp": { "branch": "main", "commit": "feed47fd1da7a1bad2c7dca456ea19c8a5a9823a" }, "nvim-colorizer.lua": { "branch": "master", "commit": "36c610a9717cc9ec426a07c8e6bf3b3abcb139d6" }, - "nvim-lspconfig": { "branch": "master", "commit": "aeb76066212b09c7c01a3abb42fe82f0130ef402" }, + "nvim-lspconfig": { "branch": "master", "commit": "1a2d5f5224c65b0709bf5da0ccd9cad29272083a" }, + "nvim-notify": { "branch": "master", "commit": "bdd647f61a05c9b8a57c83b78341a0690e9c29d7" }, "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-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" }, + "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": "729d83ecb990dc2b30272833c213cc6d49ed5214" }, + "nvim-ts-rainbow2": { "branch": "master", "commit": "b2d1f4f51b1bd20de419ffb6f5d0876c4f20d9db" }, + "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": "b44f8772686241e563c7d0f200748fd71766b64e" }, + "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" }, - "twilight.nvim": { "branch": "main", "commit": "9410252bed96887ca5a86bf16435a3a51a0e6ce5" }, - "vifm.vim": { "branch": "master", "commit": "199af91d6b1b4997450da2098e7e756627c6583b" }, + "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-oscyank": { "branch": "main", "commit": "e6298736a7835bcb365dd45a8e8bfe86d935c1f8" }, - "vim-pandoc": { "branch": "master", "commit": "9f406d964ca70d959b7867f1b5cee3d4884d4d3c" }, + "vim-numbertoggle": { "branch": "main", "commit": "df9b1fe616507340718716204ba7f434125bdf7a" }, + "vim-oscyank": { "branch": "main", "commit": "ffe827a27dae98aa826e2295336c650c9a434da0" }, "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" } + "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": "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/autocmds.lua b/nvim/.config/nvim/lua/autocmds.lua new file mode 100644 index 0000000..ce53e7f --- /dev/null +++ b/nvim/.config/nvim/lua/autocmds.lua @@ -0,0 +1,33 @@ +-- 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 }) +}) + +-- remove line numbers from terminal buffers +vim.api.nvim_create_autocmd({ "TermOpen" }, { + pattern = '*', + command = 'setlocal nonumber norelativenumber' +}) 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..05fa4a8 100644 --- a/nvim/.config/nvim/lua/look.lua +++ b/nvim/.config/nvim/lua/look.lua @@ -1,16 +1,15 @@ -local b = require('base16') - --- italic comments if supported -local set_hl = require("helpers.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) - -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') +-- set on startup +source_colors() + +-- 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/maps.lua b/nvim/.config/nvim/lua/maps.lua index 1cb5217..2980bea 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: -- @@ -50,6 +51,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' }) @@ -114,49 +120,55 @@ 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 +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()", + { 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', 's', +prefix({ ['f'] = { name = '+find' } }) +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 -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())") @@ -176,12 +188,10 @@ 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 +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', @@ -193,7 +203,14 @@ 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 }) +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) @@ -201,17 +218,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 }) - -- trim trailing whitespaces with mini.nvim trailspace map("n", "w", function() require("mini.trailspace").trim() end, { noremap = true }) @@ -227,35 +233,10 @@ 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 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/plug/_cmp.lua b/nvim/.config/nvim/lua/plug/_cmp.lua deleted file mode 100644 index 086874a..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 = '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..29cdf34 100644 --- a/nvim/.config/nvim/lua/plug/_lsp.lua +++ b/nvim/.config/nvim/lua/plug/_lsp.lua @@ -1,3 +1,96 @@ --- 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() +-- 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 }, + { 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', '!' } } } + }) +}) diff --git a/nvim/.config/nvim/lua/plug/_mini.lua b/nvim/.config/nvim/lua/plug/_mini.lua index 1391e19..83d618a 100644 --- a/nvim/.config/nvim/lua/plug/_mini.lua +++ b/nvim/.config/nvim/lua/plug/_mini.lua @@ -1,11 +1,17 @@ require('mini.ai').setup() -require('mini.comment').setup() -require('mini.cursorword').setup({delay = 500}) +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({ 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 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/plug/_treesitter.lua b/nvim/.config/nvim/lua/plug/_treesitter.lua index 22072a3..2a57eff 100644 --- a/nvim/.config/nvim/lua/plug/_treesitter.lua +++ b/nvim/.config/nvim/lua/plug/_treesitter.lua @@ -1,14 +1,21 @@ -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} + context_commentstring = { + enable = true, + enable_autocmd = false -- since we run it as a hook from the mini.comment plugin + } } diff --git a/nvim/.config/nvim/lua/plugins.lua b/nvim/.config/nvim/lua/plugins.lua index 86a5c16..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 @@ -11,9 +11,11 @@ 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" - }, { + }, + { '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" @@ -22,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() @@ -59,19 +61,21 @@ 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 }, 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 }, { + { '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' }, + dependencies = { + 'jmbuhr/otter.nvim', 'neovim/nvim-lspconfig', + 'vim-pandoc/vim-pandoc-syntax' + }, config = function() require 'quarto'.setup { lspFeatures = { @@ -82,7 +86,19 @@ return { } } end, - ft = writing_ft + 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) @@ -110,31 +126,40 @@ 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", 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" }, 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', build = ':TSUpdate', - config = function() require('plug._treesitter') end - }, { '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 + 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 { 'RRethy/nvim-treesitter-textsubjects', -- allows using . and ; to target treesitter branches config = function() @@ -149,47 +174,54 @@ 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 = { - "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", { - 'aspeddro/cmp-pandoc.nvim', - dependencies = { 'nvim-lua/plenary.nvim', 'jbyuki/nabla.nvim' }, - event = "InsertEnter" - }, { "lukas-reineke/lsp-format.nvim", config = true } + { "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", + "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 - { - "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 - } + 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 }, -- 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" }, + -- 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 + -- } } 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 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 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 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 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())) 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" 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 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 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) diff --git a/qutebrowser/.config/qutebrowser/redirects.py b/qutebrowser/.config/qutebrowser/redirects.py index 48fccca..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", @@ -197,7 +196,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) 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" 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 diff --git a/terminal/.config/wezterm/wezterm.lua b/terminal/.config/wezterm/wezterm.lua index 525036c..0b3db1f 100644 --- a/terminal/.config/wezterm/wezterm.lua +++ b/terminal/.config/wezterm/wezterm.lua @@ -1,78 +1,47 @@ local wezterm = require 'wezterm' -local mux = wezterm.mux local maps = require 'maps' require 'statusbar'.setup() require 'events'.setup() --- 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) +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 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 + key_tables = maps.key_tables, + inactive_pane_hsb = { + saturation = 0.9, + brightness = 0.9, + } } 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 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" 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 -