From f4b83f2b5adc947528dd3b3e63b0279f3c2f8f19 Mon Sep 17 00:00:00 2001
From: Daniel Fichtinger
Date: Tue, 3 Jun 2025 19:03:18 -0400
Subject: [PATCH 01/71] AutoYADM commit: 2025-06-03 19:03:18
---
.config/fish/config.fish | 34 +++++++++++++++++-----------------
1 file changed, 17 insertions(+), 17 deletions(-)
diff --git a/.config/fish/config.fish b/.config/fish/config.fish
index 458feeae..c09fcb70 100644
--- a/.config/fish/config.fish
+++ b/.config/fish/config.fish
@@ -8,21 +8,21 @@ if status is-login
"
end
- if status is-interactive
-
- # source ~/.config/fish/custom_cd.fish
-
- starship init fish | source
- direnv hook fish | source
- zoxide init fish | source
- thefuck --alias | source
- fzf --fish | source && fzf_configure_bindings
- if test "$SSH_TTY"
- set -gx COLORTERM truecolor
- set -gx TERM xterm-256color
- end
- end
- set -gx EDITOR kak
-
- set -e __sourced_profile
end
+if status is-interactive
+
+ # source ~/.config/fish/custom_cd.fish
+
+ starship init fish | source
+ direnv hook fish | source
+ zoxide init fish | source
+ thefuck --alias | source
+ fzf --fish | source && fzf_configure_bindings
+ if test "$SSH_TTY"
+ set -gx COLORTERM truecolor
+ set -gx TERM xterm-256color
+ end
+end
+set -gx EDITOR kak
+
+set -e __sourced_profile
From d962ff6dc2b43e2fba034181337c0925c1e24fdd Mon Sep 17 00:00:00 2001
From: Daniel Fichtinger
Date: Tue, 3 Jun 2025 19:50:18 -0400
Subject: [PATCH 02/71] AutoYADM commit: 2025-06-03 19:50:18
---
.config/qutebrowser/config.py | 12 +++--
.config/qutebrowser/userscripts/getbib | 68 ++++++++++++++++++++++++++
2 files changed, 75 insertions(+), 5 deletions(-)
create mode 100644 .config/qutebrowser/userscripts/getbib
diff --git a/.config/qutebrowser/config.py b/.config/qutebrowser/config.py
index 0771ed53..2f27d134 100644
--- a/.config/qutebrowser/config.py
+++ b/.config/qutebrowser/config.py
@@ -36,14 +36,15 @@ c.colors.webpage.preferred_color_scheme = "dark"
# searches
c.url.searchengines["DEFAULT"] = "https://www.startpage.com/sp/search?query={}"
-c.url.searchengines["!d"] = "https://duckduckgo.com/?q={}"
-c.url.searchengines["!aw"] = "https://wiki.archlinux.org/?search={}"
-c.url.searchengines["!g"] = (
+c.url.searchengines["d"] = "https://duckduckgo.com/?q={}"
+c.url.searchengines["aw"] = "https://wiki.archlinux.org/?search={}"
+c.url.searchengines["g"] = (
"http://www.google.com/search?hl=en&source=hp&ie=ISO-8859-l&q={}"
)
c.url.searchengines["ap"] = "https://www.archlinux.org/packages/?sort=&q={}"
-# with config.pattern("chatgpt.com") as p:
-# p.bindings.commands["normal"][""] = "click-element css main"
+c.url.searchengines["w"] = (
+ "https://en.wikipedia.org/w/index.php?title=Special:Search&search={}"
+)
config.bind(
"",
"mode-leave ;; jseval -q document.activeElement.blur()",
@@ -58,6 +59,7 @@ config.bind(
sets = {
"normal": [
+ ["\\", "mode-enter passthrough"],
["m", "scroll left"],
["n", "scroll down"],
["e", "scroll up"],
diff --git a/.config/qutebrowser/userscripts/getbib b/.config/qutebrowser/userscripts/getbib
new file mode 100644
index 00000000..0ab0ba54
--- /dev/null
+++ b/.config/qutebrowser/userscripts/getbib
@@ -0,0 +1,68 @@
+#!/usr/bin/env python3
+"""Qutebrowser userscript scraping the current web page for DOIs and downloading
+corresponding bibtex information.
+
+Set the environment variable 'QUTE_BIB_FILEPATH' to indicate the path to
+download to. Otherwise, bibtex information is downloaded to '/tmp' and hence
+deleted at reboot.
+
+Installation: see qute://help/userscripts.html
+
+Inspired by
+https://ocefpaf.github.io/python4oceanographers/blog/2014/05/19/doi2bibtex/
+"""
+
+import os
+import sys
+import re
+from collections import Counter
+from urllib import parse as url_parse
+from urllib import request as url_request
+
+
+FIFO_PATH = os.getenv("QUTE_FIFO")
+
+def message_fifo(message, level="warning"):
+ """Send message to qutebrowser FIFO. The level must be one of 'info',
+ 'warning' (default) or 'error'."""
+ with open(FIFO_PATH, "w") as fifo:
+ fifo.write("message-{} '{}'".format(level, message))
+
+
+source = os.getenv("QUTE_TEXT")
+with open(source) as f:
+ text = f.read()
+
+# find DOIs on page using regex
+dval = re.compile(r'(10\.(\d)+/([^(\s\>\"\<)])+)')
+# https://stackoverflow.com/a/10324802/3865876, too strict
+# dval = re.compile(r'\b(10[.][0-9]{4,}(?:[.][0-9]+)*/(?:(?!["&\'<>])\S)+)\b')
+dois = dval.findall(text)
+dois = Counter(e[0] for e in dois)
+try:
+ doi = dois.most_common(1)[0][0]
+except IndexError:
+ message_fifo("No DOIs found on page")
+ sys.exit()
+message_fifo("Found {} DOIs on page, selecting {}".format(len(dois), doi),
+ level="info")
+
+# get bibtex data corresponding to DOI
+url = "https://dx.doi.org/" + url_parse.quote(doi)
+headers = dict(Accept='text/bibliography; style=bibtex')
+request = url_request.Request(url, headers=headers)
+response = url_request.urlopen(request)
+status_code = response.getcode()
+if status_code >= 400:
+ message_fifo("Request returned {}".format(status_code))
+ sys.exit()
+
+# obtain content and format it
+bibtex = response.read().decode("utf-8").strip()
+bibtex = bibtex.replace(" ", "\n ", 1).\
+ replace("}, ", "},\n ").replace("}}", "}\n}")
+
+# append to file
+bib_filepath = os.getenv("QUTE_BIB_FILEPATH", "/tmp/qute.bib")
+with open(bib_filepath, "a") as f:
+ f.write(bibtex + "\n\n")
From e889b84eca22c9f435c822246711b57121971823 Mon Sep 17 00:00:00 2001
From: Daniel Fichtinger
Date: Tue, 3 Jun 2025 20:05:22 -0400
Subject: [PATCH 03/71] AutoYADM commit: 2025-06-03 20:05:22
---
.config/qutebrowser/config.py | 7 +-
.../qutebrowser/userscripts/code_select.py | 64 ++++
.config/qutebrowser/userscripts/localhost | 9 +
.../qutebrowser/userscripts/qute-bitwarden | 308 ++++++++++++++++++
.config/qutebrowser/userscripts/readability | 66 ++++
.config/qutebrowser/userscripts/view_in_mpv | 142 ++++++++
6 files changed, 595 insertions(+), 1 deletion(-)
create mode 100644 .config/qutebrowser/userscripts/code_select.py
create mode 100644 .config/qutebrowser/userscripts/localhost
create mode 100644 .config/qutebrowser/userscripts/qute-bitwarden
create mode 100644 .config/qutebrowser/userscripts/readability
create mode 100644 .config/qutebrowser/userscripts/view_in_mpv
diff --git a/.config/qutebrowser/config.py b/.config/qutebrowser/config.py
index 2f27d134..cfaa9d6e 100644
--- a/.config/qutebrowser/config.py
+++ b/.config/qutebrowser/config.py
@@ -74,7 +74,12 @@ sets = {
["k", "quickmark-save"],
["J", "search-prev"],
["j", "search-next"],
- ["", "hint links spawn --detach mpv {hint-url}"],
+ [
+ "",
+ "hint links spawn --detach mpv --force-window --quiet --keep-open=yes --ytdl",
+ ],
+ ["", "spawn --userscript view_in_mpv"],
+ # ["", "hint links spawn --userscript view_in_mpv"],
["gm", "tab-focus 1"],
["gi", "tab-focus -1"],
["gN", "tab-move +"],
diff --git a/.config/qutebrowser/userscripts/code_select.py b/.config/qutebrowser/userscripts/code_select.py
new file mode 100644
index 00000000..8f7fc312
--- /dev/null
+++ b/.config/qutebrowser/userscripts/code_select.py
@@ -0,0 +1,64 @@
+#!/usr/bin/env python3
+
+import os
+import html
+import re
+import sys
+import xml.etree.ElementTree as ET
+try:
+ import pyperclip
+except ImportError:
+ try:
+ import pyclip as pyperclip
+ except ImportError:
+ PYPERCLIP = False
+ else:
+ PYPERCLIP = True
+else:
+ PYPERCLIP = True
+
+
+def parse_text_content(element):
+ # https://stackoverflow.com/a/35591507/15245191
+ magic = '''
+ ]>'''
+ root = ET.fromstring(magic + element)
+ text = ET.tostring(root, encoding="unicode", method="text")
+ text = html.unescape(text)
+ return text
+
+
+def send_command_to_qute(command):
+ with open(os.environ.get("QUTE_FIFO"), "w") as f:
+ f.write(command)
+
+
+def main():
+ delimiter = sys.argv[1] if len(sys.argv) > 1 else ";"
+ # For info on qute environment vairables, see
+ # https://github.com/qutebrowser/qutebrowser/blob/master/doc/userscripts.asciidoc
+ element = os.environ.get("QUTE_SELECTED_HTML")
+ code_text = parse_text_content(element)
+ re_remove_dollars = re.compile(r"^(\$ )", re.MULTILINE)
+ code_text = re.sub(re_remove_dollars, '', code_text)
+ if PYPERCLIP:
+ pyperclip.copy(code_text)
+ send_command_to_qute(
+ "message-info 'copied to clipboard: {info}{suffix}'".format(
+ info=code_text.splitlines()[0].replace("'", "\""),
+ suffix="..." if len(code_text.splitlines()) > 1 else ""
+ )
+ )
+ else:
+ # Qute's yank command won't copy accross multiple lines so we
+ # compromise by placing lines on a single line seperated by the
+ # specified delimiter
+ code_text = re.sub("(\n)+", delimiter, code_text)
+ code_text = code_text.replace("'", "\"")
+ send_command_to_qute("yank inline '{code}'\n".format(code=code_text))
+
+
+if __name__ == "__main__":
+ main()
diff --git a/.config/qutebrowser/userscripts/localhost b/.config/qutebrowser/userscripts/localhost
new file mode 100644
index 00000000..1715c10a
--- /dev/null
+++ b/.config/qutebrowser/userscripts/localhost
@@ -0,0 +1,9 @@
+#!/usr/bin/env bash
+
+if [[ $1 -eq 'list' ]] && [[ -z $QUTE_COUNT ]];
+then
+ PORTS="$(ss -nltp | tail -n +2 | awk '{print $4}' | awk -F: '{print $2}')"
+ QUTE_COUNT=$(echo "$PORTS" | dmenu )
+fi
+
+echo open -t localhost:${QUTE_COUNT:-8080} > $QUTE_FIFO
diff --git a/.config/qutebrowser/userscripts/qute-bitwarden b/.config/qutebrowser/userscripts/qute-bitwarden
new file mode 100644
index 00000000..4e755772
--- /dev/null
+++ b/.config/qutebrowser/userscripts/qute-bitwarden
@@ -0,0 +1,308 @@
+#!/usr/bin/env python3
+
+# SPDX-FileCopyrightText: Chris Braun (cryzed)
+#
+# SPDX-License-Identifier: GPL-3.0-or-later
+
+"""
+Insert login information using Bitwarden CLI and a dmenu-compatible application
+(e.g. dmenu, rofi -dmenu, ...).
+"""
+
+USAGE = """The domain of the site has to be in the name of the Bitwarden entry, for example: "github.com/cryzed" or
+"websites/github.com". The login information is inserted by emulating key events using qutebrowser's fake-key command in this manner:
+[USERNAME][PASSWORD], which is compatible with almost all login forms.
+
+If enabled, with the `--totp` flag, it will also move the TOTP code to the
+clipboard, much like the Firefox add-on.
+
+You must log into Bitwarden CLI using `bw login` prior to use of this script.
+The session key will be stored using keyctl for the number of seconds passed to
+the --auto-lock option.
+
+To use in qutebrowser, run: `spawn --userscript qute-bitwarden`
+"""
+
+EPILOG = """Dependencies: tldextract (Python 3 module), pyperclip (optional
+Python module, used for TOTP codes), Bitwarden CLI (1.7.4 is known to work
+but older versions may well also work)
+
+WARNING: The login details are viewable as plaintext in qutebrowser's debug log
+(qute://log) and might be shared if you decide to submit a crash report!"""
+
+import argparse
+import enum
+import functools
+import os
+import shlex
+import subprocess
+import sys
+import json
+import tldextract
+
+argument_parser = argparse.ArgumentParser(
+ description=__doc__,
+ usage=USAGE,
+ epilog=EPILOG,
+)
+argument_parser.add_argument('url', nargs='?', default=os.getenv('QUTE_URL'))
+argument_parser.add_argument('--dmenu-invocation', '-d', default='rofi -dmenu -i -p Bitwarden',
+ help='Invocation used to execute a dmenu-provider')
+argument_parser.add_argument('--password-prompt-invocation', '-p', default='rofi -dmenu -p "Master Password" -password -lines 0',
+ help='Invocation used to prompt the user for their Bitwarden password')
+argument_parser.add_argument('--no-insert-mode', '-n', dest='insert_mode', action='store_false',
+ help="Don't automatically enter insert mode")
+argument_parser.add_argument('--totp', '-t', action='store_true',
+ help="Copy TOTP key to clipboard")
+argument_parser.add_argument('--io-encoding', '-i', default='UTF-8',
+ help='Encoding used to communicate with subprocesses')
+argument_parser.add_argument('--merge-candidates', '-m', action='store_true',
+ help='Merge pass candidates for fully-qualified and registered domain name')
+argument_parser.add_argument('--auto-lock', type=int, default=900,
+ help='Automatically lock the vault after this many seconds')
+group = argument_parser.add_mutually_exclusive_group()
+group.add_argument('--username-only', '-e',
+ action='store_true', help='Only insert username')
+group.add_argument('--password-only', '-w',
+ action='store_true', help='Only insert password')
+group.add_argument('--totp-only', '-T',
+ action='store_true', help='Only insert totp code')
+
+stderr = functools.partial(print, file=sys.stderr)
+
+
+class ExitCodes(enum.IntEnum):
+ SUCCESS = 0
+ FAILURE = 1
+ # 1 is automatically used if Python throws an exception
+ NO_PASS_CANDIDATES = 2
+ COULD_NOT_MATCH_USERNAME = 3
+ COULD_NOT_MATCH_PASSWORD = 4
+
+
+def qute_command(command):
+ with open(os.environ['QUTE_FIFO'], 'w') as fifo:
+ fifo.write(command + '\n')
+ fifo.flush()
+
+
+def ask_password(password_prompt_invocation):
+ process = subprocess.run(
+ shlex.split(password_prompt_invocation),
+ text=True,
+ stdout=subprocess.PIPE,
+ )
+ if process.returncode > 0:
+ raise Exception('Could not unlock vault')
+ master_pass = process.stdout.strip()
+ return subprocess.check_output(
+ ['bw', 'unlock', '--raw', '--passwordenv', 'BW_MASTERPASS'],
+ env={**os.environ, 'BW_MASTERPASS': master_pass},
+ text=True,
+ ).strip()
+
+
+def get_session_key(auto_lock, password_prompt_invocation):
+ if auto_lock == 0:
+ subprocess.call(['keyctl', 'purge', 'user', 'bw_session'])
+ return ask_password(password_prompt_invocation)
+ else:
+ process = subprocess.run(
+ ['keyctl', 'request', 'user', 'bw_session'],
+ text=True,
+ stdout=subprocess.PIPE,
+ )
+ key_id = process.stdout.strip()
+ if process.returncode > 0:
+ session = ask_password(password_prompt_invocation)
+ if not session:
+ raise Exception('Could not unlock vault')
+ key_id = subprocess.check_output(
+ ['keyctl', 'add', 'user', 'bw_session', session, '@u'],
+ text=True,
+ ).strip()
+
+ if auto_lock > 0:
+ subprocess.call(['keyctl', 'timeout', str(key_id), str(auto_lock)])
+ return subprocess.check_output(
+ ['keyctl', 'pipe', str(key_id)],
+ text=True,
+ ).strip()
+
+
+def pass_(domain, encoding, auto_lock, password_prompt_invocation):
+ session_key = get_session_key(auto_lock, password_prompt_invocation)
+ process = subprocess.run(
+ ['bw', 'list', 'items', '--nointeraction', '--session', session_key, '--url', domain],
+ capture_output=True,
+ )
+
+ err = process.stderr.decode(encoding).strip()
+ if err:
+ msg = 'Bitwarden CLI returned for {:s} - {:s}'.format(domain, err)
+ stderr(msg)
+
+ if "Vault is locked" in err:
+ stderr("Bitwarden Vault got locked, trying again with clean session")
+ return pass_(domain, encoding, 0, password_prompt_invocation)
+
+ if process.returncode:
+ return '[]'
+
+ out = process.stdout.decode(encoding).strip()
+
+ return out
+
+
+def get_totp_code(selection_id, domain_name, encoding, auto_lock, password_prompt_invocation):
+ session_key = get_session_key(auto_lock, password_prompt_invocation)
+ process = subprocess.run(
+ ['bw', 'get', 'totp', '--nointeraction', '--session', session_key, selection_id],
+ capture_output=True,
+ )
+
+ err = process.stderr.decode(encoding).strip()
+ if err:
+ # domain_name instead of selection_id to make it more user-friendly
+ msg = 'Bitwarden CLI returned for {:s} - {:s}'.format(domain_name, err)
+ stderr(msg)
+
+ if "Vault is locked" in err:
+ stderr("Bitwarden Vault got locked, trying again with clean session")
+ return get_totp_code(selection_id, domain_name, encoding, 0, password_prompt_invocation)
+
+ if process.returncode:
+ return '[]'
+
+ out = process.stdout.decode(encoding).strip()
+
+ return out
+
+
+def dmenu(items, invocation, encoding):
+ command = shlex.split(invocation)
+ process = subprocess.run(command, input='\n'.join(
+ items).encode(encoding), stdout=subprocess.PIPE)
+ return process.stdout.decode(encoding).strip()
+
+
+def fake_key_raw(text):
+ for character in text:
+ # Escape all characters by default, space requires special handling
+ sequence = '" "' if character == ' ' else r'\{}'.format(character)
+ qute_command('fake-key {}'.format(sequence))
+
+
+def main(arguments):
+ if not arguments.url:
+ argument_parser.print_help()
+ return ExitCodes.FAILURE
+
+ extract_result = tldextract.extract(arguments.url)
+
+ # Try to find candidates using targets in the following order: fully-qualified domain name (includes subdomains),
+ # the registered domain name and finally: the IPv4 address if that's what
+ # the URL represents
+ candidates = []
+ for target in filter(
+ None,
+ [
+ extract_result.fqdn,
+ (
+ extract_result.top_domain_under_public_suffix
+ if hasattr(extract_result, "top_domain_under_public_suffix")
+ else extract_result.registered_domain
+ ),
+ extract_result.subdomain + "." + extract_result.domain,
+ extract_result.domain,
+ extract_result.ipv4,
+ ],
+ ):
+ target_candidates = json.loads(
+ pass_(
+ target,
+ arguments.io_encoding,
+ arguments.auto_lock,
+ arguments.password_prompt_invocation,
+ )
+ )
+ if not target_candidates:
+ continue
+
+ candidates = candidates + target_candidates
+ if not arguments.merge_candidates:
+ break
+ else:
+ if not candidates:
+ stderr('No pass candidates for URL {!r} found!'.format(
+ arguments.url))
+ return ExitCodes.NO_PASS_CANDIDATES
+
+ if len(candidates) == 1:
+ selection = candidates.pop()
+ else:
+ choices = ['{:s} | {:s}'.format(c['name'], c['login']['username']) for c in candidates]
+ choice = dmenu(choices, arguments.dmenu_invocation, arguments.io_encoding)
+ choice_tokens = choice.split('|')
+ choice_name = choice_tokens[0].strip()
+ choice_username = choice_tokens[1].strip()
+ selection = next((c for (i, c) in enumerate(candidates)
+ if c['name'] == choice_name
+ and c['login']['username'] == choice_username),
+ None)
+
+ # Nothing was selected, simply return
+ if not selection:
+ return ExitCodes.SUCCESS
+
+ username = selection['login']['username']
+ password = selection['login']['password']
+ totp = selection['login']['totp']
+
+ if arguments.username_only:
+ fake_key_raw(username)
+ elif arguments.password_only:
+ fake_key_raw(password)
+ elif arguments.totp_only:
+ # No point in moving it to the clipboard in this case
+ fake_key_raw(
+ get_totp_code(
+ selection['id'],
+ selection['name'],
+ arguments.io_encoding,
+ arguments.auto_lock,
+ arguments.password_prompt_invocation,
+ )
+ )
+ else:
+ # Enter username and password using fake-key and (which seems to work almost universally), then switch
+ # back into insert-mode, so the form can be directly submitted by
+ # hitting enter afterwards
+ fake_key_raw(username)
+ qute_command('fake-key ')
+ fake_key_raw(password)
+
+ if arguments.insert_mode:
+ qute_command('mode-enter insert')
+
+ # If it finds a TOTP code, it copies it to the clipboard,
+ # which is the same behavior as the Firefox add-on.
+ if not arguments.totp_only and totp and arguments.totp:
+ # The import is done here, to make pyperclip an optional dependency
+ import pyperclip
+ pyperclip.copy(
+ get_totp_code(
+ selection['id'],
+ selection['name'],
+ arguments.io_encoding,
+ arguments.auto_lock,
+ arguments.password_prompt_invocation,
+ )
+ )
+
+ return ExitCodes.SUCCESS
+
+
+if __name__ == '__main__':
+ arguments = argument_parser.parse_args()
+ sys.exit(main(arguments))
diff --git a/.config/qutebrowser/userscripts/readability b/.config/qutebrowser/userscripts/readability
new file mode 100644
index 00000000..07095a5b
--- /dev/null
+++ b/.config/qutebrowser/userscripts/readability
@@ -0,0 +1,66 @@
+#!/usr/bin/env python3
+#
+# Executes python-readability on current page and opens the summary as new tab.
+#
+# Depends on the python-readability package, or its fork:
+#
+# - https://github.com/buriy/python-readability
+# - https://github.com/bookieio/breadability
+#
+# Usage:
+# :spawn --userscript readability
+#
+import codecs, os
+
+tmpfile = os.path.join(
+ os.environ.get('QUTE_DATA_DIR',
+ os.path.expanduser('~/.local/share/qutebrowser')),
+ 'userscripts/readability.html')
+
+if not os.path.exists(os.path.dirname(tmpfile)):
+ os.makedirs(os.path.dirname(tmpfile))
+
+# Styling for dynamic window margin scaling and line height
+HEADER = """
+
+
+
+
+ %s
+
+
+
+"""
+
+with codecs.open(os.environ['QUTE_HTML'], 'r', 'utf-8') as source:
+ data = source.read()
+
+ try:
+ from breadability.readable import Article as reader
+ doc = reader(data, os.environ['QUTE_URL'])
+ title = doc._original_document.title
+ content = HEADER % title + doc.readable + ""
+ except ImportError:
+ from readability import Document
+ doc = Document(data)
+ title = doc.title()
+ content = doc.summary().replace('', HEADER % title)
+
+ # add a class to make styling the page easier
+ content = content.replace('', '')
+
+ with codecs.open(tmpfile, 'w', 'utf-8') as target:
+ target.write(content.lstrip())
+
+ with open(os.environ['QUTE_FIFO'], 'w') as fifo:
+ fifo.write('open -t %s' % tmpfile)
diff --git a/.config/qutebrowser/userscripts/view_in_mpv b/.config/qutebrowser/userscripts/view_in_mpv
new file mode 100644
index 00000000..4f371c6b
--- /dev/null
+++ b/.config/qutebrowser/userscripts/view_in_mpv
@@ -0,0 +1,142 @@
+#!/usr/bin/env bash
+#
+# Behavior:
+# Userscript for qutebrowser which views the current web page in mpv using
+# sensible mpv-flags. While viewing the page in MPV, all
+
+ In order to restore this particular video
+ click here.
+
+ ";
+ replacement.style.position = "relative";
+ replacement.style.zIndex = "100003000000";
+ replacement.style.fontSize = "1rem";
+ replacement.style.textAlign = "center";
+ replacement.style.verticalAlign = "middle";
+ replacement.style.height = "100%";
+ replacement.style.background = "#101010";
+ replacement.style.color = "white";
+ replacement.style.border = "4px dashed #545454";
+ replacement.style.padding = "2em";
+ replacement.style.margin = "auto";
+ App.all_replacements[i] = replacement;
+ App.backup_videos[i] = video;
+ video.parentNode.replaceChild(replacement, video);
+ }
+
+ function restore_video(obj, index) {
+ obj = App.all_replacements[index];
+ video = App.backup_videos[index];
+ obj.parentNode.replaceChild(video, obj);
+ }
+
+ /** force repainting the video, thanks to:
+ * http://web.archive.org/web/20151029064649/https://martinwolf.org/2014/06/10/force-repaint-of-an-element-with-javascript/
+ */
+ var siteHeader = document.getElementById('header');
+ siteHeader.style.display='none';
+ siteHeader.offsetHeight; // no need to store this anywhere, the reference is enough
+ siteHeader.style.display='block';
+
+EOF
+}
+
+printjs() {
+ js | sed 's,//.*$,,' | tr '\n' ' '
+}
+echo "jseval -q -w main $(printjs)" >> "$QUTE_FIFO"
+
+msg info "Opening $QUTE_URL with mpv"
+"${video_command[@]}" "$@" "$QUTE_URL"
From c63c8bc5d8b2172e6b77219b5b2ba44e0971122c Mon Sep 17 00:00:00 2001
From: Daniel Fichtinger
Date: Tue, 3 Jun 2025 20:21:18 -0400
Subject: [PATCH 04/71] AutoYADM commit: 2025-06-03 20:21:18
---
.config/qutebrowser/autoconfig.yml | 4 ++++
.config/qutebrowser/config.py | 16 ++++++++++++----
2 files changed, 16 insertions(+), 4 deletions(-)
diff --git a/.config/qutebrowser/autoconfig.yml b/.config/qutebrowser/autoconfig.yml
index da8df7b7..4a216103 100644
--- a/.config/qutebrowser/autoconfig.yml
+++ b/.config/qutebrowser/autoconfig.yml
@@ -8,3 +8,7 @@ config_version: 2
settings:
content.javascript.clipboard:
https://github.com: access-paste
+ statusbar.show:
+ global: always
+ tabs.position:
+ global: top
diff --git a/.config/qutebrowser/config.py b/.config/qutebrowser/config.py
index cfaa9d6e..1b337b5d 100644
--- a/.config/qutebrowser/config.py
+++ b/.config/qutebrowser/config.py
@@ -22,8 +22,6 @@ c.completion.open_categories = [
"filesystem",
]
-# c.hints.chars = "tnserigm"
-# c.hints.chars = "tnseripldh"
c.hints.chars = "tnserigmao"
# dark mode
@@ -59,6 +57,8 @@ config.bind(
sets = {
"normal": [
+ ["tT", "config-cycle tabs.position top left"],
+ ["sH", "config-cycle statusbar.show always never"],
["\\", "mode-enter passthrough"],
["m", "scroll left"],
["n", "scroll down"],
@@ -75,8 +75,8 @@ sets = {
["J", "search-prev"],
["j", "search-next"],
[
- "",
- "hint links spawn --detach mpv --force-window --quiet --keep-open=yes --ytdl",
+ ";/",
+ "hint links spawn --detach mpv --force-window --quiet --keep-open=yes --ytdl {hint-url}",
],
["", "spawn --userscript view_in_mpv"],
# ["", "hint links spawn --userscript view_in_mpv"],
@@ -147,6 +147,14 @@ ashen = {
"g_12": "#151515",
}
+c.tabs.padding = {"top": 5, "bottom": 5, "left": 9, "right": 9}
+
+# c.colors.statusbar.normal.bg = "#00000000"
+# c.colors.statusbar.command.bg = "#00000000"
+# c.colors.tabs.even.bg = "#00000000" # transparent tabs!!
+# c.colors.tabs.odd.bg = "#00000000"
+# c.colors.tabs.bar.bg = "#00000000"
+
# # colors
# c.colors.completion.fg = ashen["text"]
# c.colors.completion.category.fg = "#F2F2F2"
From 10d636fd7d37b8ab5144fcf31069d3b0ad8b2aae Mon Sep 17 00:00:00 2001
From: Daniel Fichtinger
Date: Wed, 4 Jun 2025 19:07:31 -0400
Subject: [PATCH 05/71] AutoYADM commit: 2025-06-04 19:07:31
---
.config/fish/config.fish | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/.config/fish/config.fish b/.config/fish/config.fish
index c09fcb70..4527086a 100644
--- a/.config/fish/config.fish
+++ b/.config/fish/config.fish
@@ -1,14 +1,14 @@
-if status is-login
- if not set -q __sourced_profile
- set -x __sourced_profile 1
- exec bash -c "\
- test -e /etc/profile && source /etc/profile
- test -e $HOME/.bash_profile && source $HOME/.bash_profile
- exec fish --login
- "
- end
+# if status is-login
+# if not set -q __sourced_profile
+# set -x __sourced_profile 1
+# exec bash -c "\
+# test -e /etc/profile && source /etc/profile
+# test -e $HOME/.bash_profile && source $HOME/.bash_profile
+# exec fish --login
+# "
+# end
-end
+# end
if status is-interactive
# source ~/.config/fish/custom_cd.fish
@@ -25,4 +25,4 @@ if status is-interactive
end
set -gx EDITOR kak
-set -e __sourced_profile
+# set -e __sourced_profile
From e360171387a6ea6db73b1f61a64c49fe1281746b Mon Sep 17 00:00:00 2001
From: Daniel Fichtinger
Date: Wed, 4 Jun 2025 19:22:53 -0400
Subject: [PATCH 06/71] AutoYADM commit: 2025-06-04 19:22:53
---
.config/kak/kakrc | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/.config/kak/kakrc b/.config/kak/kakrc
index 68dcb779..261b2e78 100644
--- a/.config/kak/kakrc
+++ b/.config/kak/kakrc
@@ -169,3 +169,10 @@ map -docstring 'save to jumplist' global normal
# selection saving
map -docstring 'add selection' global normal Y a
+
+define-command -docstring 'open popup shell' popup-shell %{
+ popup fish
+}
+alias global pp popup-shell
+
+map -docstring 'popup shell' global user . ': popup-shell'
From b656d363f9f08094dc9de741dcc5fd7f9fae2f47 Mon Sep 17 00:00:00 2001
From: Daniel Fichtinger
Date: Wed, 4 Jun 2025 19:53:18 -0400
Subject: [PATCH 07/71] AutoYADM commit: 2025-06-04 19:53:18
---
.config/kak/kakrc | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/.config/kak/kakrc b/.config/kak/kakrc
index 261b2e78..6c3f3cdc 100644
--- a/.config/kak/kakrc
+++ b/.config/kak/kakrc
@@ -156,12 +156,21 @@ define-command -override -hidden consume %{
}
}
+define-command terminal-consume %{
+ terminal dash -c 'niri msg action consume-or-expel-window-left; exec fish'
+}
+
+alias global tc terminal-consume
+
define-command -docstring %{
Create a new client in vertial split
-} newv %{
+} new-consume %{
new consume
}
+alias global nc new-consume
+alias global n new
+
# jumplist
map -docstring 'jump forward' global normal
From bde22b04ae86a6df95435761298b53e94b7d77bf Mon Sep 17 00:00:00 2001
From: Daniel Fichtinger
Date: Wed, 4 Jun 2025 20:23:37 -0400
Subject: [PATCH 08/71] AutoYADM commit: 2025-06-04 20:23:37
---
.config/kak/autoload/lsp.kak | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.config/kak/autoload/lsp.kak b/.config/kak/autoload/lsp.kak
index fd17d343..ee7318c4 100644
--- a/.config/kak/autoload/lsp.kak
+++ b/.config/kak/autoload/lsp.kak
@@ -24,7 +24,7 @@ define-command -hidden -override lsp-hide-code-actions %{
set-option global lsp_debug false
# list of filetypes for which LSP will be activated in the window scope
-declare-option str-list lsp_filetypes python go rust bash fish c cpp typst markdown yaml json jsonc bash sh
+declare-option str-list lsp_filetypes python go rust bash fish c cpp typst markdown yaml json jsonc bash sh typescript javascript
declare-option -hidden bool inlay_enabled false
From ad0b6a912dea10ae007d0a341ba8eba9783e1ac1 Mon Sep 17 00:00:00 2001
From: Daniel Fichtinger
Date: Wed, 4 Jun 2025 20:38:42 -0400
Subject: [PATCH 09/71] AutoYADM commit: 2025-06-04 20:38:42
---
.config/kak/autoload/lsp.kak | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/.config/kak/autoload/lsp.kak b/.config/kak/autoload/lsp.kak
index ee7318c4..90e174d2 100644
--- a/.config/kak/autoload/lsp.kak
+++ b/.config/kak/autoload/lsp.kak
@@ -106,6 +106,20 @@ hook -group lsp-filetype-python global BufSetOption filetype=python %{
}
}
+remove-hooks global lsp-filetype-javascript
+hook -group lsp-filetype-javascript global BufSetOption filetype=(?:javascript|typescript) %{
+ set-option buffer lsp_servers %{
+ [typescript-language-server]
+ root_globs = ["package.json", "tsconfig.json", "jsconfig.json", ".git", ".hg"]
+ args = ["--stdio"]
+ settings_section = "_"
+ [typescript-language-server.settings._]
+ # quotePreference = "double"
+ # typescript.format.semicolons = "insert"
+
+ }
+}
+
# use our custom fish-lsp wrapper because it sets env vars
hook -group lsp-filetype-fish global BufSetOption filetype=fish %{
set-option buffer lsp_servers %{
From 6a227a3dbec64eadc02e9b9ac2de5668f070144d Mon Sep 17 00:00:00 2001
From: Daniel Fichtinger
Date: Wed, 4 Jun 2025 21:24:15 -0400
Subject: [PATCH 10/71] AutoYADM commit: 2025-06-04 21:24:15
---
.config/kak-tree-sitter/config.toml | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)
diff --git a/.config/kak-tree-sitter/config.toml b/.config/kak-tree-sitter/config.toml
index c6283d9f..d38444fa 100644
--- a/.config/kak-tree-sitter/config.toml
+++ b/.config/kak-tree-sitter/config.toml
@@ -96,3 +96,26 @@ pin = "7275b7f85014aad7e15d4987ec4f2249572eecfb"
[language.ini.queries]
path = "runtime/queries/ini"
+[language.just]
+aliases = ["just", "justfile"]
+
+[language.just.grammar.source.git]
+url = "https://github.com/poliorcetics/tree-sitter-just"
+pin = "8d03cfdd7ab89ff76d935827de1b93450fa0ec0a"
+
+[language.just.grammar]
+path = "src"
+compile = "cc"
+compile_args = ["-c", "-fpic", "../parser.c", "-I", ".."]
+compile_flags = ["-O3"]
+link = "cc"
+link_args = ["-shared", "-fpic", "parser.o", "-o", "just.so"]
+link_flags = ["-O3"]
+
+[language.just.queries.source.git]
+url = "https://github.com/helix-editor/helix"
+pin = "f6878f62f74430cff188e7978d06c5ed143179e9"
+
+[language.just.queries]
+path = "runtime/queries/just"
+
From 494b5694539ba7eceaf137d31cb75b87b3010baf Mon Sep 17 00:00:00 2001
From: Daniel Fichtinger
Date: Fri, 6 Jun 2025 14:53:19 -0400
Subject: [PATCH 11/71] AutoYADM commit: 2025-06-06 14:53:18
---
.config/kak/autoload/lsp.kak | 19 ++++++++++++++++++-
1 file changed, 18 insertions(+), 1 deletion(-)
diff --git a/.config/kak/autoload/lsp.kak b/.config/kak/autoload/lsp.kak
index 90e174d2..1a2d205b 100644
--- a/.config/kak/autoload/lsp.kak
+++ b/.config/kak/autoload/lsp.kak
@@ -102,7 +102,6 @@ hook -group lsp-filetype-python global BufSetOption filetype=python %{
[basedpyright-langserver.settings.basedpyright.analysis]
typeCheckingMode = "standard"
inlayHints.genericTypes = true
-
}
}
@@ -129,3 +128,21 @@ hook -group lsp-filetype-fish global BufSetOption filetype=fish %{
command = "/home/fic/.config/kak/scripts/fish-lsp.fish"
}
}
+
+remove-hooks global lsp-filetype-markdown
+hook -group lsp-filetype-markdown global BufSetOption filetype=markdown %{
+ set-option buffer lsp_servers %{
+ [marksman]
+ root_globs = [".marksman.toml", ".git"]
+ args = ["server"]
+
+ [harper-ls]
+ root_globs = ["*"]
+ args = ["--stdio"]
+ command = "harper-ls"
+ [harper-ls.settings.harper-ls.linters]
+ LongSentences = false
+ }
+}
+
+
From 97227fd7615435b2ac8a735332e46c2bc795ce0f Mon Sep 17 00:00:00 2001
From: Daniel Fichtinger
Date: Fri, 6 Jun 2025 15:09:17 -0400
Subject: [PATCH 12/71] AutoYADM commit: 2025-06-06 15:09:17
---
.config/kak/autoload/lsp.kak | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/.config/kak/autoload/lsp.kak b/.config/kak/autoload/lsp.kak
index 1a2d205b..5191e174 100644
--- a/.config/kak/autoload/lsp.kak
+++ b/.config/kak/autoload/lsp.kak
@@ -145,4 +145,13 @@ hook -group lsp-filetype-markdown global BufSetOption filetype=markdown %{
}
}
+# can override this to customize what's rendered in the menu
+define-command -override -hidden lsp-perform-code-action -params 1.. -docstring "Called on :lsp-code-actions" %{
+ nop %sh{
+ if printf '%s' "$kak_opt_lsp_servers" | grep -q 'harper-ls'; then
+ notify-send "harper time"
+ fi
+ }
+ lsp-menu %arg{@}
+}
From d8bbe8da60f5420e9756e93ce606ee5fe7b29492 Mon Sep 17 00:00:00 2001
From: Daniel Fichtinger
Date: Fri, 6 Jun 2025 15:24:41 -0400
Subject: [PATCH 13/71] AutoYADM commit: 2025-06-06 15:24:41
---
.config/kak/autoload/lsp.kak | 33 ++++++++++++++++++++++++---------
1 file changed, 24 insertions(+), 9 deletions(-)
diff --git a/.config/kak/autoload/lsp.kak b/.config/kak/autoload/lsp.kak
index 5191e174..e6fdb8e4 100644
--- a/.config/kak/autoload/lsp.kak
+++ b/.config/kak/autoload/lsp.kak
@@ -145,13 +145,28 @@ hook -group lsp-filetype-markdown global BufSetOption filetype=markdown %{
}
}
-# can override this to customize what's rendered in the menu
-define-command -override -hidden lsp-perform-code-action -params 1.. -docstring "Called on :lsp-code-actions" %{
- nop %sh{
- if printf '%s' "$kak_opt_lsp_servers" | grep -q 'harper-ls'; then
- notify-send "harper time"
- fi
- }
- lsp-menu %arg{@}
-}
+# # can be empty, global, or file
+# declare-option -hidden str harper_add ""
+# define-command -hidden harper-add -params 1 %{
+# set-option window harper_add %arg{1}
+# lsp-code-actions -auto-single
+# }
+
+# # can override this to customize what's rendered in the menu
+# # Each code action is two args: its name, and the corresponding command
+# define-command -override -hidden lsp-perform-code-action -params 1.. -docstring "Called on :lsp-code-actions" %{
+# evaluate-commands %sh{
+# # harper specific filtering
+# if printf '%s' "$kak_opt_lsp_servers" | grep -q 'harper-ls'; then
+# if [ "$kak_opt_harper_add" = "global" ]; then
+# # filter and keep only
+# echo "echo -debug 'harper adding global'"
+# fi
+# fi
+# echo "echo -debug dumping $# code actions args:"
+# echo "echo -debug %arg{@}"
+
+# }
+# lsp-menu %arg{@}
+# }
From b0d59bbcb9b499a34847dabeacf6da712b431fc9 Mon Sep 17 00:00:00 2001
From: Daniel Fichtinger
Date: Fri, 6 Jun 2025 15:40:01 -0400
Subject: [PATCH 14/71] AutoYADM commit: 2025-06-06 15:40:01
---
.config/fish/functions/kak-session.fish | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/.config/fish/functions/kak-session.fish b/.config/fish/functions/kak-session.fish
index 6354a948..424307a5 100644
--- a/.config/fish/functions/kak-session.fish
+++ b/.config/fish/functions/kak-session.fish
@@ -86,7 +86,9 @@ function kak-session -w kak --description "kakoune where sessions are derived fr
cat $fifo >/dev/null
command rm -r "$fifo_dir"
- command kak -c "$session_id" -e 'try %{ delete-buffer *scratch*; bar-buflist; echo }' $flags $files
+ echo "hook -once global BufCreate ^(?!.*\\*scratch\\*).* %{ delete-buffer *scratch* }" | kak -p "$session_id"
+ command kak -c "$session_id" -e 'delete-buffer *scratch*; bar-buflist; echo' $flags $files
+ # command kak -c "$session_id" -e 'try %{ delete-buffer *scratch*; bar-buflist; echo } catch %{ nop %sh{notify-send "error"} }' $flags $files
else
command kak -s "$session_id" -e "cd %[$kakroot]" $flags $files
end
@@ -116,7 +118,9 @@ function kak-session -w kak --description "kakoune where sessions are derived fr
setsid kak -d -s "$session_id" -E "cd %[$git_dir]; echo -to-file $fifo ready" &
cat $fifo >/dev/null
command rm -r "$fifo_dir"
- command kak -c "$session_id" -e 'try %{ delete-buffer *scratch*; bar-buflist; echo }' $flags $files
+ echo "hook -once global BufCreate [*]scratch[*] %{ delete-buffer *scratch* }" | kak -p "$session_id"
+ command kak -c "$session_id" -e 'delete-buffer *scratch*; bar-buflist; echo' $flags $files
+ # command kak -c "$session_id" -e 'try %{ delete-buffer *scratch*; bar-buflist; echo } catch %{ nop %sh{notify-send "error"} }' $flags $files
else
command kak -s "$session_id" -e "cd %[$git_dir]" $flags $files
end
From 9c2bf2b56692f03662f492a01bba7522807c9711 Mon Sep 17 00:00:00 2001
From: Daniel Fichtinger
Date: Fri, 6 Jun 2025 15:55:04 -0400
Subject: [PATCH 15/71] AutoYADM commit: 2025-06-06 15:55:04
---
.config/fish/functions/kak-session.fish | 12 ++++++------
.config/kak/kakrc | 15 +++++++++++++++
2 files changed, 21 insertions(+), 6 deletions(-)
diff --git a/.config/fish/functions/kak-session.fish b/.config/fish/functions/kak-session.fish
index 424307a5..4fb20338 100644
--- a/.config/fish/functions/kak-session.fish
+++ b/.config/fish/functions/kak-session.fish
@@ -86,9 +86,9 @@ function kak-session -w kak --description "kakoune where sessions are derived fr
cat $fifo >/dev/null
command rm -r "$fifo_dir"
- echo "hook -once global BufCreate ^(?!.*\\*scratch\\*).* %{ delete-buffer *scratch* }" | kak -p "$session_id"
- command kak -c "$session_id" -e 'delete-buffer *scratch*; bar-buflist; echo' $flags $files
- # command kak -c "$session_id" -e 'try %{ delete-buffer *scratch*; bar-buflist; echo } catch %{ nop %sh{notify-send "error"} }' $flags $files
+ # echo "hook -once global BufCreate ^(?!.*\\*scratch\\*).* %{ delete-buffer *scratch* }" | kak -p "$session_id"
+ # command kak -c "$session_id" -e 'delete-buffer! *scratch*' $flags $files
+ command kak -c "$session_id" -e 'try %{ delete-buffer *scratch*; bar-buflist; echo }' $flags $files
else
command kak -s "$session_id" -e "cd %[$kakroot]" $flags $files
end
@@ -118,9 +118,9 @@ function kak-session -w kak --description "kakoune where sessions are derived fr
setsid kak -d -s "$session_id" -E "cd %[$git_dir]; echo -to-file $fifo ready" &
cat $fifo >/dev/null
command rm -r "$fifo_dir"
- echo "hook -once global BufCreate [*]scratch[*] %{ delete-buffer *scratch* }" | kak -p "$session_id"
- command kak -c "$session_id" -e 'delete-buffer *scratch*; bar-buflist; echo' $flags $files
- # command kak -c "$session_id" -e 'try %{ delete-buffer *scratch*; bar-buflist; echo } catch %{ nop %sh{notify-send "error"} }' $flags $files
+ # echo "hook -once global BufCreate [*]scratch[*] %{ delete-buffer *scratch* }" | kak -p "$session_id"
+ # command kak -c "$session_id" -e 'delete-buffer! *scratch*' $flags $files
+ command kak -c "$session_id" -e 'try %{ delete-buffer *scratch*; bar-buflist; echo }' $flags $files
else
command kak -s "$session_id" -e "cd %[$git_dir]" $flags $files
end
diff --git a/.config/kak/kakrc b/.config/kak/kakrc
index 6c3f3cdc..6c927c07 100644
--- a/.config/kak/kakrc
+++ b/.config/kak/kakrc
@@ -185,3 +185,18 @@ define-command -docstring 'open popup shell' popup-shell %{
alias global pp popup-shell
map -docstring 'popup shell' global user . ': popup-shell'
+
+# hook -once global ClientCreate .* %{
+# evaluate-commands %sh{
+# if [ "$kak_buflist" != "*debug* *scratch*" ]; then
+# echo "delete-buffer *scratch*"
+# else
+# echo "echo -debug dumping buffers"
+# echo "echo -debug %val{buflist}"
+# fi
+# }
+# }
+
+hook -once global BufCreate ^(?!(\*scratch\*|\*debug\*)) %{
+ delete-buffer *scratch*
+}
From 53b8fc9ac60764bb34950745aa3bac941a222242 Mon Sep 17 00:00:00 2001
From: Daniel Fichtinger
Date: Fri, 6 Jun 2025 16:10:06 -0400
Subject: [PATCH 16/71] AutoYADM commit: 2025-06-06 16:10:06
---
.config/kak/autoload/filetype.kak | 21 +++++++++++----------
.config/kak/autoload/filetype/typst.kak | 2 ++
.config/kak/kakrc | 25 +++++++++++--------------
3 files changed, 24 insertions(+), 24 deletions(-)
diff --git a/.config/kak/autoload/filetype.kak b/.config/kak/autoload/filetype.kak
index b1d3093c..35eda053 100644
--- a/.config/kak/autoload/filetype.kak
+++ b/.config/kak/autoload/filetype.kak
@@ -21,19 +21,20 @@ hook global WinSetOption filetype=kak %{
hook global WinSetOption filetype=typst %{
set-option buffer formatcmd "typstyle --wrap-text"
hook -group typst-auto-format window BufWritePre .* format
- hook -once -always WinSetOption filetype=.* %{
+ hook -once -always window WinSetOption filetype=.* %{
unset-option window formatcmd
remove-hooks window typst-auto-format
}
- define-command -docstring %{
- Spawns a Zathura pdf preview and Typst watcher for the currently open Typst file
- } typst %{
- nop %sh{
- {
- "$kak_config/scripts/kak-typ-zathura.fish" -k -w "$kak_buffile" "$kak_client_pid"
- } > /dev/null 2>&1 < /dev/null &
- }
- }
+ define-command -docstring %{
+ Spawns a Zathura pdf preview and Typst watcher for the currently open Typst file
+ } typst %{
+ nop %sh{
+ {
+ "$kak_config/scripts/kak-typ-zathura.fish" -k -w "$kak_buffile" "$kak_client_pid"
+ } > /dev/null 2>&1 < /dev/null &
+ }
+ }
+ nop %sh{ notify-send "4" }
}
hook global WinSetOption filetype=fish %{
diff --git a/.config/kak/autoload/filetype/typst.kak b/.config/kak/autoload/filetype/typst.kak
index 63deab0f..16935786 100644
--- a/.config/kak/autoload/filetype/typst.kak
+++ b/.config/kak/autoload/filetype/typst.kak
@@ -21,11 +21,13 @@ hook global WinSetOption filetype=typst %(
hook window InsertChar \n -group typst-indent typst-indent-on-new-line
hook -once -always window WinSetOption filetype=.* %{ remove-hooks window typst-.+ }
+ nop %sh{ notify-send "2" }
)
hook -group typst-highlight global WinSetOption filetype=typst %{
add-highlighter window/typst ref typst
hook -once -always window WinSetOption filetype=.* %{ remove-highlighter window/typst }
+ nop %sh{ notify-send "3" }
}
provide-module typst %~
diff --git a/.config/kak/kakrc b/.config/kak/kakrc
index 6c927c07..bb3ebd75 100644
--- a/.config/kak/kakrc
+++ b/.config/kak/kakrc
@@ -95,17 +95,17 @@ map -docstring 'Extend to file end' global user n "gjl"
# Zathura pdf preview only for Typst files
-hook global WinSetOption filetype=typst %{
- define-command -docstring %{
- Spawns a Zathura pdf preview and Typst watcher for the currently open Typst file
- } typst %{
- nop %sh{
- {
- "$kak_config/scripts/kak-typ-zathura.fish" -k -w "$kak_buffile" "$kak_client_pid"
- } > /dev/null 2>&1 < /dev/null &
- }
- }
-}
+# hook global WinSetOption filetype=typst %{
+# define-command -docstring %{
+# Spawns a Zathura pdf preview and Typst watcher for the currently open Typst file
+# } typst %{
+# nop %sh{
+# {
+# "$kak_config/scripts/kak-typ-zathura.fish" -k -w "$kak_buffile" "$kak_client_pid"
+# } > /dev/null 2>&1 < /dev/null &
+# }
+# }
+# }
define-command -docstring "Create a scratch buffer" scratch %{
edit -scratch
@@ -197,6 +197,3 @@ map -docstring 'popup shell' global user . ': popup-shell'
# }
# }
-hook -once global BufCreate ^(?!(\*scratch\*|\*debug\*)) %{
- delete-buffer *scratch*
-}
From e8bcd30a97615b04bae30b41663a97288b40b5a2 Mon Sep 17 00:00:00 2001
From: Daniel Fichtinger
Date: Fri, 6 Jun 2025 16:25:18 -0400
Subject: [PATCH 17/71] AutoYADM commit: 2025-06-06 16:25:18
---
.config/kak/autoload/filetype.kak | 1 -
.config/kak/autoload/filetype/typst.kak | 2 --
2 files changed, 3 deletions(-)
diff --git a/.config/kak/autoload/filetype.kak b/.config/kak/autoload/filetype.kak
index 35eda053..f177f806 100644
--- a/.config/kak/autoload/filetype.kak
+++ b/.config/kak/autoload/filetype.kak
@@ -34,7 +34,6 @@ hook global WinSetOption filetype=typst %{
} > /dev/null 2>&1 < /dev/null &
}
}
- nop %sh{ notify-send "4" }
}
hook global WinSetOption filetype=fish %{
diff --git a/.config/kak/autoload/filetype/typst.kak b/.config/kak/autoload/filetype/typst.kak
index 16935786..63deab0f 100644
--- a/.config/kak/autoload/filetype/typst.kak
+++ b/.config/kak/autoload/filetype/typst.kak
@@ -21,13 +21,11 @@ hook global WinSetOption filetype=typst %(
hook window InsertChar \n -group typst-indent typst-indent-on-new-line
hook -once -always window WinSetOption filetype=.* %{ remove-hooks window typst-.+ }
- nop %sh{ notify-send "2" }
)
hook -group typst-highlight global WinSetOption filetype=typst %{
add-highlighter window/typst ref typst
hook -once -always window WinSetOption filetype=.* %{ remove-highlighter window/typst }
- nop %sh{ notify-send "3" }
}
provide-module typst %~
From 54f574c70354a965514a614767d5b487183de47c Mon Sep 17 00:00:00 2001
From: Daniel Fichtinger
Date: Fri, 6 Jun 2025 19:49:29 -0400
Subject: [PATCH 18/71] AutoYADM commit: 2025-06-06 19:49:29
---
.config/kak-tree-sitter/config.toml | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/.config/kak-tree-sitter/config.toml b/.config/kak-tree-sitter/config.toml
index d38444fa..b5894a3c 100644
--- a/.config/kak-tree-sitter/config.toml
+++ b/.config/kak-tree-sitter/config.toml
@@ -119,3 +119,23 @@ pin = "f6878f62f74430cff188e7978d06c5ed143179e9"
[language.just.queries]
path = "runtime/queries/just"
+# typescript
+[language.typescript.grammar.source.git]
+url = "https://github.com/tree-sitter/tree-sitter-typescript"
+pin = "75b3874edb2dc714fb1fd77a32013d0f8699989f"
+
+[language.typescript.grammar]
+path = "typescript/src"
+compile = "cc"
+compile_args = ["-c", "-fpic", "../scanner.c", "../parser.c", "-I", ".."]
+compile_flags = ["-O3"]
+link = "cc"
+link_args = ["-shared", "-fpic", "scanner.o", "parser.o", "-o", "typescript.so"]
+link_flags = ["-O3"]
+
+[language.typescript.queries.source.git]
+url = "https://github.com/helix-editor/helix"
+pin = "f4b488e380e28aa36a06ad400d6656fa864ba5b7"
+
+[language.typescript.queries]
+path = "runtime/queries/typescript"
From bb119ab06afc822040c4af215d0aa143ecee3b16 Mon Sep 17 00:00:00 2001
From: Daniel Fichtinger
Date: Fri, 6 Jun 2025 20:05:37 -0400
Subject: [PATCH 19/71] AutoYADM commit: 2025-06-06 20:05:37
---
.config/kak-tree-sitter/config.toml | 34 ++++++++++++++---------------
1 file changed, 17 insertions(+), 17 deletions(-)
diff --git a/.config/kak-tree-sitter/config.toml b/.config/kak-tree-sitter/config.toml
index b5894a3c..0715fcf1 100644
--- a/.config/kak-tree-sitter/config.toml
+++ b/.config/kak-tree-sitter/config.toml
@@ -119,23 +119,23 @@ pin = "f6878f62f74430cff188e7978d06c5ed143179e9"
[language.just.queries]
path = "runtime/queries/just"
-# typescript
-[language.typescript.grammar.source.git]
-url = "https://github.com/tree-sitter/tree-sitter-typescript"
-pin = "75b3874edb2dc714fb1fd77a32013d0f8699989f"
+# # typescript
+# [language.typescript.grammar.source.git]
+# url = "https://github.com/tree-sitter/tree-sitter-typescript"
+# pin = "75b3874edb2dc714fb1fd77a32013d0f8699989f"
-[language.typescript.grammar]
-path = "typescript/src"
-compile = "cc"
-compile_args = ["-c", "-fpic", "../scanner.c", "../parser.c", "-I", ".."]
-compile_flags = ["-O3"]
-link = "cc"
-link_args = ["-shared", "-fpic", "scanner.o", "parser.o", "-o", "typescript.so"]
-link_flags = ["-O3"]
+# [language.typescript.grammar]
+# path = "typescript/src"
+# compile = "cc"
+# compile_args = ["-c", "-fpic", "../scanner.c", "../parser.c", "-I", ".."]
+# compile_flags = ["-O3"]
+# link = "cc"
+# link_args = ["-shared", "-fpic", "scanner.o", "parser.o", "-o", "typescript.so"]
+# link_flags = ["-O3"]
-[language.typescript.queries.source.git]
-url = "https://github.com/helix-editor/helix"
-pin = "f4b488e380e28aa36a06ad400d6656fa864ba5b7"
+# [language.typescript.queries.source.git]
+# url = "https://git.sr.ht/~hadronized/kak-tree-sitter"
+# pin = "6b984af1ff754b64bebc1b85c8a3c2062af9e5b7"
-[language.typescript.queries]
-path = "runtime/queries/typescript"
+# [language.typescript.queries]
+# path = "runtime/queries/typescript"
From 5e33efec7cc177fe282ae482203c3134b772de43 Mon Sep 17 00:00:00 2001
From: Daniel Fichtinger
Date: Fri, 6 Jun 2025 21:08:25 -0400
Subject: [PATCH 20/71] AutoYADM commit: 2025-06-06 21:08:25
---
.config/kak-tree-sitter/config.toml | 34 ++++++++++++++---------------
1 file changed, 17 insertions(+), 17 deletions(-)
diff --git a/.config/kak-tree-sitter/config.toml b/.config/kak-tree-sitter/config.toml
index 0715fcf1..1290b4ac 100644
--- a/.config/kak-tree-sitter/config.toml
+++ b/.config/kak-tree-sitter/config.toml
@@ -118,24 +118,24 @@ pin = "f6878f62f74430cff188e7978d06c5ed143179e9"
[language.just.queries]
path = "runtime/queries/just"
+# typescript
+[language.typescript.grammar.source.git]
+url = "https://github.com/tree-sitter/tree-sitter-typescript"
+pin = "b1bf4825d9eaa0f3bdeb1e52f099533328acfbdf"
-# # typescript
-# [language.typescript.grammar.source.git]
-# url = "https://github.com/tree-sitter/tree-sitter-typescript"
-# pin = "75b3874edb2dc714fb1fd77a32013d0f8699989f"
+[language.typescript.grammar]
+path = "typescript/src"
+compile = "cc"
+compile_args = ["-c", "-fpic", "../scanner.c", "../parser.c", "-I", ".."]
+compile_flags = ["-O3"]
+link = "cc"
+link_args = ["-shared", "-fpic", "scanner.o", "parser.o", "-o", "typescript.so"]
+link_flags = ["-O3"]
-# [language.typescript.grammar]
-# path = "typescript/src"
-# compile = "cc"
-# compile_args = ["-c", "-fpic", "../scanner.c", "../parser.c", "-I", ".."]
-# compile_flags = ["-O3"]
-# link = "cc"
-# link_args = ["-shared", "-fpic", "scanner.o", "parser.o", "-o", "typescript.so"]
-# link_flags = ["-O3"]
+[language.typescript.queries.source.git]
+url = "https://git.sr.ht/~ficd/kak-tree-sitter"
+pin = "d8afa2ddcf2f97d29f495eccc08ad9ccff8d9199"
-# [language.typescript.queries.source.git]
-# url = "https://git.sr.ht/~hadronized/kak-tree-sitter"
-# pin = "6b984af1ff754b64bebc1b85c8a3c2062af9e5b7"
+[language.typescript.queries]
+path = "runtime/queries/typescript"
-# [language.typescript.queries]
-# path = "runtime/queries/typescript"
From 10106eaac8cd0ca59be03672f41e48e8c458a07d Mon Sep 17 00:00:00 2001
From: Daniel Fichtinger
Date: Fri, 6 Jun 2025 21:23:37 -0400
Subject: [PATCH 21/71] AutoYADM commit: 2025-06-06 21:23:37
---
.config/kak-tree-sitter/config.toml | 1 +
1 file changed, 1 insertion(+)
diff --git a/.config/kak-tree-sitter/config.toml b/.config/kak-tree-sitter/config.toml
index 1290b4ac..b26390c6 100644
--- a/.config/kak-tree-sitter/config.toml
+++ b/.config/kak-tree-sitter/config.toml
@@ -118,6 +118,7 @@ pin = "f6878f62f74430cff188e7978d06c5ed143179e9"
[language.just.queries]
path = "runtime/queries/just"
+
# typescript
[language.typescript.grammar.source.git]
url = "https://github.com/tree-sitter/tree-sitter-typescript"
From b44ed6c49b467852f4316f01b87d336ec574458b Mon Sep 17 00:00:00 2001
From: Daniel Fichtinger
Date: Fri, 6 Jun 2025 21:54:08 -0400
Subject: [PATCH 22/71] AutoYADM commit: 2025-06-06 21:54:08
---
.config/fish/fish_variables | 1 +
1 file changed, 1 insertion(+)
diff --git a/.config/fish/fish_variables b/.config/fish/fish_variables
index 56c36ec5..5190f07b 100644
--- a/.config/fish/fish_variables
+++ b/.config/fish/fish_variables
@@ -2,6 +2,7 @@
# VERSION: 3.0
SETUVAR --export AUTOYADMPUSH:1
SETUVAR --export EDITOR:kak
+SETUVAR --export IGREP_CUSTOM_EDITOR:kak\x20\x2b\x7bline_number\x7d\x20\x7bfile_name\x7d
SETUVAR --export KAKOUNE_POSIX_SHELL:/usr/bin/dash
SETUVAR --export XDG_CONFIG_HOME:/home/fic/\x2econfig
SETUVAR Z_DATA_DIR:/home/fic/\x2elocal/share/z
From a6ff49a2409f302d6ca820a5a2595970c732de2e Mon Sep 17 00:00:00 2001
From: Daniel Fichtinger
Date: Sat, 7 Jun 2025 14:54:07 -0400
Subject: [PATCH 23/71] AutoYADM commit: 2025-06-07 14:54:07
---
.config/nvchecker/new_ver.json | 6 +++---
.config/nvchecker/old_ver.json | 6 +++---
.config/nvchecker/old_ver.json~ | 6 +++---
3 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/.config/nvchecker/new_ver.json b/.config/nvchecker/new_ver.json
index 4998ee2f..95f09db9 100644
--- a/.config/nvchecker/new_ver.json
+++ b/.config/nvchecker/new_ver.json
@@ -7,9 +7,9 @@
"url": "https://github.com/blopker/codebook/releases/tag/v0.3.0"
},
"iwe": {
- "version": "iwe-v0.0.32",
- "gitref": "refs/tags/iwe-v0.0.32",
- "url": "https://github.com/iwe-org/iwe/releases/tag/iwe-v0.0.32"
+ "version": "iwe-v0.0.33",
+ "gitref": "refs/tags/iwe-v0.0.33",
+ "url": "https://github.com/iwe-org/iwe/releases/tag/iwe-v0.0.33"
},
"kak-tree-sitter": {
"version": "2.0.0",
diff --git a/.config/nvchecker/old_ver.json b/.config/nvchecker/old_ver.json
index 4998ee2f..95f09db9 100644
--- a/.config/nvchecker/old_ver.json
+++ b/.config/nvchecker/old_ver.json
@@ -7,9 +7,9 @@
"url": "https://github.com/blopker/codebook/releases/tag/v0.3.0"
},
"iwe": {
- "version": "iwe-v0.0.32",
- "gitref": "refs/tags/iwe-v0.0.32",
- "url": "https://github.com/iwe-org/iwe/releases/tag/iwe-v0.0.32"
+ "version": "iwe-v0.0.33",
+ "gitref": "refs/tags/iwe-v0.0.33",
+ "url": "https://github.com/iwe-org/iwe/releases/tag/iwe-v0.0.33"
},
"kak-tree-sitter": {
"version": "2.0.0",
diff --git a/.config/nvchecker/old_ver.json~ b/.config/nvchecker/old_ver.json~
index 9b029329..4998ee2f 100644
--- a/.config/nvchecker/old_ver.json~
+++ b/.config/nvchecker/old_ver.json~
@@ -7,9 +7,9 @@
"url": "https://github.com/blopker/codebook/releases/tag/v0.3.0"
},
"iwe": {
- "version": "iwe-v0.0.31",
- "gitref": "refs/tags/iwe-v0.0.31",
- "url": "https://github.com/iwe-org/iwe/releases/tag/iwe-v0.0.31"
+ "version": "iwe-v0.0.32",
+ "gitref": "refs/tags/iwe-v0.0.32",
+ "url": "https://github.com/iwe-org/iwe/releases/tag/iwe-v0.0.32"
},
"kak-tree-sitter": {
"version": "2.0.0",
From 6710c2e94b688b51567073c64f968630019d3663 Mon Sep 17 00:00:00 2001
From: Daniel Fichtinger
Date: Sat, 7 Jun 2025 15:24:37 -0400
Subject: [PATCH 24/71] AutoYADM commit: 2025-06-07 15:24:37
---
.config/kak/autoload/hop.kak | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/.config/kak/autoload/hop.kak b/.config/kak/autoload/hop.kak
index 0489d7b1..9099db45 100644
--- a/.config/kak/autoload/hop.kak
+++ b/.config/kak/autoload/hop.kak
@@ -1,5 +1,9 @@
# https://git.sr.ht/~hadronized/hop.kak
-evaluate-commands %sh{ hop-kak --init }
+# evaluate-commands %sh{ hop-kak --init }
+declare-option range-specs hop_ranges
+
+set-face global hop_label_head black,green+F
+set-face global hop_label_tail black,blue+F
declare-option str hop_kak_keyset 'tnserigmaodhcxplfuwyqz'
From 05e35ad2348209106da4bdcac509e085c5a4d04f Mon Sep 17 00:00:00 2001
From: Daniel Fichtinger
Date: Sat, 7 Jun 2025 15:40:08 -0400
Subject: [PATCH 25/71] AutoYADM commit: 2025-06-07 15:40:08
---
.config/kak/autoload/hop.kak | 6 ++++--
.config/kak/kakrc | 1 +
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/.config/kak/autoload/hop.kak b/.config/kak/autoload/hop.kak
index 9099db45..e74aef0a 100644
--- a/.config/kak/autoload/hop.kak
+++ b/.config/kak/autoload/hop.kak
@@ -1,9 +1,10 @@
# https://git.sr.ht/~hadronized/hop.kak
# evaluate-commands %sh{ hop-kak --init }
+provide-module hop-kak %~
declare-option range-specs hop_ranges
-set-face global hop_label_head black,green+F
-set-face global hop_label_tail black,blue+F
+set-face global hop_label_head %exp{%opt{orange_golden}+Fbugfa}
+set-face global hop_label_tail %exp{%opt{orange_golden}+Fbugfa}
declare-option str hop_kak_keyset 'tnserigmaodhcxplfuwyqz'
@@ -41,3 +42,4 @@ map -docstring %{
map -docstring %{
Hop mode
} global normal ': enter-user-mode hop'
+~
diff --git a/.config/kak/kakrc b/.config/kak/kakrc
index bb3ebd75..acde4b55 100644
--- a/.config/kak/kakrc
+++ b/.config/kak/kakrc
@@ -1,6 +1,7 @@
evaluate-commands %sh{ kak-tree-sitter -dks --init $kak_session }
evaluate-commands %sh{kak-popup init}
colorscheme ashen
+require-module hop-kak
require-module fishr
require-module surround
require-module ficgrep
From c84e52bb573fc9306133be9b70d7cdcc794fb35e Mon Sep 17 00:00:00 2001
From: Daniel Fichtinger
Date: Sat, 7 Jun 2025 15:55:27 -0400
Subject: [PATCH 26/71] AutoYADM commit: 2025-06-07 15:55:27
---
.config/kak/autoload/hop.kak | 38 ++++++++++++++++++++++++++++++++++--
1 file changed, 36 insertions(+), 2 deletions(-)
diff --git a/.config/kak/autoload/hop.kak b/.config/kak/autoload/hop.kak
index e74aef0a..24554455 100644
--- a/.config/kak/autoload/hop.kak
+++ b/.config/kak/autoload/hop.kak
@@ -3,8 +3,40 @@
provide-module hop-kak %~
declare-option range-specs hop_ranges
-set-face global hop_label_head %exp{%opt{orange_golden}+Fbugfa}
-set-face global hop_label_tail %exp{%opt{orange_golden}+Fbugfa}
+set-face global hop_label_head %exp{%opt{background},%opt{orange_golden}+Fbua}
+set-face global hop_label_tail %exp{%opt{background},%opt{orange_golden}+Fbua}
+
+# needed so the cursor face doesn't override what hop sets
+# but only temporary because otherwise we want cursor face to
+# override others
+define-command -hidden hop-set-cursor %{
+ set-face window PrimaryCursorNormal "%opt{background},%opt{orange_blaze}+b"
+ set-face window SecondaryCursorNormal "%opt{background},%opt{orange_muted}"
+ set-face window PrimaryCursorInsert "%opt{background},%opt{g_3}+b"
+ set-face window SecondaryCursorInsert "%opt{background},%opt{g_7}"
+ set-face window PrimaryCursorNormalEol "%opt{background},%opt{orange_smolder}+b"
+ set-face window SecondaryCursorNormalEol "%opt{background},%opt{golden_muted}"
+ set-face window PrimaryCursorInsertEol "%opt{background},%opt{g_1}+b"
+ set-face window SecondaryCursorInsertEol "%opt{background},%opt{g_5}"
+ set-face window PrimarySelection ",%opt{brown_dark}"
+ set-face window SecondarySelection ",%opt{brown_darker}"
+
+}
+
+define-command -hidden hop-clear-cursor %{
+ set-face window PrimaryCursorNormal "%opt{background},%opt{orange_blaze}+gfb"
+ set-face window SecondaryCursorNormal "%opt{background},%opt{orange_muted}+gf"
+ set-face window PrimaryCursorInsert "%opt{background},%opt{g_3}+gfb"
+ set-face window SecondaryCursorInsert "%opt{background},%opt{g_7}+gf"
+ set-face window PrimaryCursorNormalEol "%opt{background},%opt{orange_smolder}+gfb"
+ set-face window SecondaryCursorNormalEol "%opt{background},%opt{golden_muted}+gf"
+ set-face window PrimaryCursorInsertEol "%opt{background},%opt{g_1}+gfb"
+ set-face window SecondaryCursorInsertEol "%opt{background},%opt{g_5}+gf"
+ set-face window PrimarySelection ",%opt{brown_dark}+g"
+ set-face window SecondarySelection ",%opt{brown_darker}+g"
+
+}
+
declare-option str hop_kak_keyset 'tnserigmaodhcxplfuwyqz'
@@ -12,6 +44,7 @@ declare-option str hop_kak_keyset 'tnserigmaodhcxplfuwyqz'
map global normal ':execute-keys gtGbx'
define-command hop-kak %{
+ hop-set-cursor
evaluate-commands -no-hooks -- %sh{
hop-kak --keyset "$kak_opt_hop_kak_keyset" --sels "$kak_selections_desc"
}
@@ -24,6 +57,7 @@ define-command -override hop-kak-words %{
map window normal ': trigger-user-hook donehop'
map window normal , ': trigger-user-hook donehop,'
hook -once window User donehop %{
+ hop-clear-cursor
eval "ui-scrolloff-enable"
try %{ ui-wrap-enable }
unmap window normal
From 51d453e03cc6c2e1e5b23171ef48668363912a86 Mon Sep 17 00:00:00 2001
From: Daniel Fichtinger
Date: Sat, 7 Jun 2025 16:10:37 -0400
Subject: [PATCH 27/71] AutoYADM commit: 2025-06-07 16:10:37
---
.config/kak/autoload/hop.kak | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.config/kak/autoload/hop.kak b/.config/kak/autoload/hop.kak
index 24554455..fe6198fa 100644
--- a/.config/kak/autoload/hop.kak
+++ b/.config/kak/autoload/hop.kak
@@ -44,7 +44,6 @@ declare-option str hop_kak_keyset 'tnserigmaodhcxplfuwyqz'
map global normal ':execute-keys gtGbx'
define-command hop-kak %{
- hop-set-cursor
evaluate-commands -no-hooks -- %sh{
hop-kak --keyset "$kak_opt_hop_kak_keyset" --sels "$kak_selections_desc"
}
@@ -52,6 +51,7 @@ define-command hop-kak %{
define-command -override hop-kak-words %{
+ hop-set-cursor
eval "ui-scrolloff-disable"
try %{ ui-wrap-disable }
map window normal ': trigger-user-hook donehop'
From 8796bb6b970018d52dd45e94d207b3d6e7fbf62a Mon Sep 17 00:00:00 2001
From: Daniel Fichtinger
Date: Sun, 8 Jun 2025 15:01:42 -0400
Subject: [PATCH 28/71] AutoYADM commit: 2025-06-08 15:01:42
---
.config/kak/autoload/lsp.kak | 37 +++++++++++++++++++++++++++---------
1 file changed, 28 insertions(+), 9 deletions(-)
diff --git a/.config/kak/autoload/lsp.kak b/.config/kak/autoload/lsp.kak
index e6fdb8e4..e8b010f3 100644
--- a/.config/kak/autoload/lsp.kak
+++ b/.config/kak/autoload/lsp.kak
@@ -48,21 +48,40 @@ define-command -hidden inlay-toggle %{
}
}
-declare-option -hidden bool diagnostics_enabled false
-define-command -hidden diagnostics-on %{
+declare-option -hidden bool inlay_diagnostics_enabled false
+define-command -hidden inlay_diagnostics-on %{
lsp-inlay-diagnostics-enable window
- set-option window diagnostics_enabled true
+ set-option window inlay-diagnostics_enabled true
}
-define-command -hidden diagnostics-off %{
+define-command -hidden inlay-diagnostics-off %{
lsp-inlay-diagnostics-disable window
- set-option window diagnostics_enabled false
+ set-option window inlay_diagnostics_enabled false
}
-define-command -hidden diagnostics-toggle %{
+define-command -hidden inlay-diagnostics-toggle %{
evaluate-commands %sh{
- if [ "$kak_opt_diagnostics_enabled" = "true" ]; then
- echo "diagnostics-off"
+ if [ "$kak_opt_inlay_diagnostics_enabled" = "true" ]; then
+ echo "inlay-diagnostics-off"
else
- echo "diagnostics-on"
+ echo "inlay-diagnostics-on"
+ fi
+ }
+}
+
+declare-option -hidden bool inline_diagnostics_enabled true
+define-command -hidden inline-diagnostics-on %{
+ lsp-inline-diagnostics-enable window
+ set-option window inline-diagnostics_enabled true
+}
+define-command -hidden inline-diagnostics-off %{
+ lsp-inline-diagnostics-disable window
+ set-option window inline_diagnostics_enabled false
+}
+define-command inline-diagnostics-toggle %{
+ evaluate-commands %sh{
+ if [ "$kak_opt_inline_diagnostics_enabled" = "true" ]; then
+ echo "inline-diagnostics-off"
+ else
+ echo "inline-diagnostics-on"
fi
}
}
From a51cd136f646b2891682999e176935f89aa72021 Mon Sep 17 00:00:00 2001
From: Daniel Fichtinger
Date: Sun, 8 Jun 2025 15:16:42 -0400
Subject: [PATCH 29/71] AutoYADM commit: 2025-06-08 15:16:42
---
.config/kak/autoload/lsp.kak | 18 +++++++-----------
1 file changed, 7 insertions(+), 11 deletions(-)
diff --git a/.config/kak/autoload/lsp.kak b/.config/kak/autoload/lsp.kak
index e8b010f3..4649cfe8 100644
--- a/.config/kak/autoload/lsp.kak
+++ b/.config/kak/autoload/lsp.kak
@@ -49,9 +49,9 @@ define-command -hidden inlay-toggle %{
}
declare-option -hidden bool inlay_diagnostics_enabled false
-define-command -hidden inlay_diagnostics-on %{
+define-command -hidden inlay-diagnostics-on %{
lsp-inlay-diagnostics-enable window
- set-option window inlay-diagnostics_enabled true
+ set-option window inlay_diagnostics_enabled true
}
define-command -hidden inlay-diagnostics-off %{
lsp-inlay-diagnostics-disable window
@@ -70,7 +70,7 @@ define-command -hidden inlay-diagnostics-toggle %{
declare-option -hidden bool inline_diagnostics_enabled true
define-command -hidden inline-diagnostics-on %{
lsp-inline-diagnostics-enable window
- set-option window inline-diagnostics_enabled true
+ set-option window inline_diagnostics_enabled true
}
define-command -hidden inline-diagnostics-off %{
lsp-inline-diagnostics-disable window
@@ -95,14 +95,10 @@ define-command -hidden lsp-filetype-hooks-update %{
# commands to execute for lsp window settings
lsp-enable-window
inlay-on
- try %{
- # only map to UI mode if that module is available
- map -docstring 'toggle inlay hints' window ui h ': inlay-toggle'
- map -docstring 'toggle inlay diagnostics' window ui d ': diagnostics-toggle'
- } catch %{
- map -docstring 'toggle inlay hints' window lsp ': inlay-toggle'
- map -docstring 'toggle inlay diagnostics' window lsp ': diagnostics-toggle'
- }
+ # only map to UI mode if that module is available
+ map -docstring 'toggle inlay hints' window ui h ': inlay-toggle'
+ map -docstring 'toggle inlay diagnostics' window ui d ': inlay-diagnostics-toggle'
+ map -docstring 'toggle inline diagnostics' window ui e ': inline-diagnostics-toggle'
}
}
lsp-filetype-hooks-update
From 9a0344b51b3147a9c9da24133dfc5b8172b53bf6 Mon Sep 17 00:00:00 2001
From: Daniel Fichtinger
Date: Sun, 8 Jun 2025 21:18:57 -0400
Subject: [PATCH 30/71] AutoYADM commit: 2025-06-08 21:18:57
---
.config/kak/autoload/clipboard.kak | 2 ++
1 file changed, 2 insertions(+)
diff --git a/.config/kak/autoload/clipboard.kak b/.config/kak/autoload/clipboard.kak
index c3a3cf1d..81607e0d 100644
--- a/.config/kak/autoload/clipboard.kak
+++ b/.config/kak/autoload/clipboard.kak
@@ -1,3 +1,5 @@
+# Goal: better multi-selection behavior
+# If we copy multiple selections, it should be copied s.t. each selection is on its own line
map -docstring "yank the selection into the clipboard" global user y " wl-copy"
map -docstring "paste the clipboard" global user p " wl-paste -n"
From 4b980f2e952763b6113d51a9855101a881b154a1 Mon Sep 17 00:00:00 2001
From: Daniel Fichtinger
Date: Sun, 8 Jun 2025 21:34:00 -0400
Subject: [PATCH 31/71] AutoYADM commit: 2025-06-08 21:34:00
---
.config/kak/autoload/clipboard.kak | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/.config/kak/autoload/clipboard.kak b/.config/kak/autoload/clipboard.kak
index 81607e0d..e9cd1c74 100644
--- a/.config/kak/autoload/clipboard.kak
+++ b/.config/kak/autoload/clipboard.kak
@@ -1,5 +1,27 @@
# Goal: better multi-selection behavior
# If we copy multiple selections, it should be copied s.t. each selection is on its own line
+
+define-command clip-copy-split %{
+ evaluate-commands -save-regs 'a' %{
+ # copy all selections
+ execute-keys '"ay'
+ # create a scratch buffer
+ edit -scratch
+ # paste all selections, separate lines, delete last newline
+ # select all, copy to clipboard
+ execute-keys '"aagjd%wl-copy'
+ delete-buffer
+ }
+}
+
+define-command clip-copy %{
+ evaluate-commands -save-regs 'a' %{
+ execute-keys '"ay'
+ edit -scratch
+ execute-keys '"agjd%wl-copy'
+ }
+}
+
map -docstring "yank the selection into the clipboard" global user y " wl-copy"
map -docstring "paste the clipboard" global user p " wl-paste -n"
From ad5ca55b5a17ae30112d1e665a05eaa856da18cb Mon Sep 17 00:00:00 2001
From: Daniel Fichtinger
Date: Sun, 8 Jun 2025 21:49:00 -0400
Subject: [PATCH 32/71] AutoYADM commit: 2025-06-08 21:49:00
---
.config/kak/autoload/clipboard.kak | 17 +++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)
diff --git a/.config/kak/autoload/clipboard.kak b/.config/kak/autoload/clipboard.kak
index e9cd1c74..16d6d758 100644
--- a/.config/kak/autoload/clipboard.kak
+++ b/.config/kak/autoload/clipboard.kak
@@ -1,24 +1,29 @@
# Goal: better multi-selection behavior
# If we copy multiple selections, it should be copied s.t. each selection is on its own line
-define-command clip-copy-split %{
+declare-option -docstring %{
+ Command for copying to system clipboard
+} str clipboard_copy_cmd 'wl-copy'
+
+define-command -docstring %{
+ Copies selections to system clipboard, splitting each selection onto new lines.
+} clip-copy-split %{
evaluate-commands -save-regs 'a' %{
- # copy all selections
execute-keys '"ay'
- # create a scratch buffer
edit -scratch
- # paste all selections, separate lines, delete last newline
- # select all, copy to clipboard
execute-keys '"aagjd%wl-copy'
delete-buffer
}
}
-define-command clip-copy %{
+define-command -docstring %{
+ Copies selections to system clipboard, does not split selections onto new lines.
+} clip-copy-verbatim %{
evaluate-commands -save-regs 'a' %{
execute-keys '"ay'
edit -scratch
execute-keys '"agjd%wl-copy'
+ delete-buffer
}
}
From 2e8efd58afa8d44419c83d48110df686a6dd9813 Mon Sep 17 00:00:00 2001
From: Daniel Fichtinger
Date: Sun, 8 Jun 2025 22:04:24 -0400
Subject: [PATCH 33/71] AutoYADM commit: 2025-06-08 22:04:24
---
.config/kak/autoload/clipboard.kak | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/.config/kak/autoload/clipboard.kak b/.config/kak/autoload/clipboard.kak
index 16d6d758..fa2fa740 100644
--- a/.config/kak/autoload/clipboard.kak
+++ b/.config/kak/autoload/clipboard.kak
@@ -5,13 +5,23 @@ declare-option -docstring %{
Command for copying to system clipboard
} str clipboard_copy_cmd 'wl-copy'
+define-command -params 0..1 clip-copy %{
+ evaluate-commands %sh{
+ if [ ${#} = 1 ] && [ ${1} = split ]; then
+ echo "clip-copy-split"
+ else
+ echo "clip-copy-verbatim"
+ fi
+ }
+}
+
define-command -docstring %{
Copies selections to system clipboard, splitting each selection onto new lines.
} clip-copy-split %{
evaluate-commands -save-regs 'a' %{
execute-keys '"ay'
edit -scratch
- execute-keys '"aagjd%wl-copy'
+ execute-keys '"aagjd%%opt{clipboard_copy_cmd}'
delete-buffer
}
}
@@ -22,7 +32,7 @@ define-command -docstring %{
evaluate-commands -save-regs 'a' %{
execute-keys '"ay'
edit -scratch
- execute-keys '"agjd%wl-copy'
+ execute-keys '"a%%opt{clipboard_copy_cmd}'
delete-buffer
}
}
From a2516ffcc0b6806cd9dc082b61fadb4613fb6d60 Mon Sep 17 00:00:00 2001
From: Daniel Fichtinger
Date: Sun, 8 Jun 2025 22:19:37 -0400
Subject: [PATCH 34/71] AutoYADM commit: 2025-06-08 22:19:37
---
.config/kak/autoload/clipboard.kak | 42 +++++++++++++++++++-----------
1 file changed, 27 insertions(+), 15 deletions(-)
diff --git a/.config/kak/autoload/clipboard.kak b/.config/kak/autoload/clipboard.kak
index fa2fa740..7143bfce 100644
--- a/.config/kak/autoload/clipboard.kak
+++ b/.config/kak/autoload/clipboard.kak
@@ -1,27 +1,38 @@
-# Goal: better multi-selection behavior
-# If we copy multiple selections, it should be copied s.t. each selection is on its own line
-
+# TODO: Make it so that each selection is split by only a single newline,
+# ie if the selection already has a newline at the end then don't add another one
declare-option -docstring %{
- Command for copying to system clipboard
+ Command for copying to system clipboard.
} str clipboard_copy_cmd 'wl-copy'
-define-command -params 0..1 clip-copy %{
- evaluate-commands %sh{
- if [ ${#} = 1 ] && [ ${1} = split ]; then
- echo "clip-copy-split"
- else
- echo "clip-copy-verbatim"
- fi
+define-command -docstring %{
+ clip-copy [-split]: copy selections to system clipboard
+ Set the clipboard_copy_cmd option to change the command
+ Switches:
+ -split separate each selection with a newline
+} -params 0..1 clip-copy %{
+ evaluate-commands -save-regs 'a|' %{
+ execute-keys '"ay'
+ edit -scratch
+ set-register | %opt{clipboard_copy_cmd}
+ execute-keys %sh{
+ if [ ${#} = 1 ] && [ ${1} = '-split' ]; then
+ echo '"aagjd%'
+ else
+ echo '"a%'
+ fi
+ }
+ delete-buffer
}
}
define-command -docstring %{
Copies selections to system clipboard, splitting each selection onto new lines.
} clip-copy-split %{
- evaluate-commands -save-regs 'a' %{
+ evaluate-commands -save-regs 'a|' %{
execute-keys '"ay'
edit -scratch
- execute-keys '"aagjd%%opt{clipboard_copy_cmd}'
+ set-register | %opt{clipboard_copy_cmd}
+ execute-keys '"aagjd%'
delete-buffer
}
}
@@ -29,10 +40,11 @@ define-command -docstring %{
define-command -docstring %{
Copies selections to system clipboard, does not split selections onto new lines.
} clip-copy-verbatim %{
- evaluate-commands -save-regs 'a' %{
+ evaluate-commands -save-regs 'a|' %{
execute-keys '"ay'
edit -scratch
- execute-keys '"a%%opt{clipboard_copy_cmd}'
+ set-register | %opt{clipboard_copy_cmd}
+ execute-keys '"a%'
delete-buffer
}
}
From ee9af11e5e5d241a72da51996bce01f56bbbbd6e Mon Sep 17 00:00:00 2001
From: Daniel Fichtinger
Date: Sun, 8 Jun 2025 22:34:46 -0400
Subject: [PATCH 35/71] AutoYADM commit: 2025-06-08 22:34:46
---
.config/kak/autoload/clipboard.kak | 47 +++++++++++-------------------
1 file changed, 17 insertions(+), 30 deletions(-)
diff --git a/.config/kak/autoload/clipboard.kak b/.config/kak/autoload/clipboard.kak
index 7143bfce..ab4d788b 100644
--- a/.config/kak/autoload/clipboard.kak
+++ b/.config/kak/autoload/clipboard.kak
@@ -1,5 +1,3 @@
-# TODO: Make it so that each selection is split by only a single newline,
-# ie if the selection already has a newline at the end then don't add another one
declare-option -docstring %{
Command for copying to system clipboard.
} str clipboard_copy_cmd 'wl-copy'
@@ -8,48 +6,37 @@ define-command -docstring %{
clip-copy [-split]: copy selections to system clipboard
Set the clipboard_copy_cmd option to change the command
Switches:
- -split separate each selection with a newline
-} -params 0..1 clip-copy %{
+ -split ensure each selection separated by newline
+} -params 0..1 clipboard-copy %{
+ # preserve registers
evaluate-commands -save-regs 'a|' %{
+ # copy selections
execute-keys '"ay'
+ # disposable buffer
edit -scratch
+ # set shell register to copy command
set-register | %opt{clipboard_copy_cmd}
+ # branch based on switch
execute-keys %sh{
if [ ${#} = 1 ] && [ ${1} = '-split' ]; then
- echo '"aagjd%'
+ # paste all
+ # reduce selections to those without newline
+ # append a newline
+ # delete trailing newline
+ # select all, pipe to copy cmd
+ echo '"a\nagjd%'
else
+ # paste all, select all, pipe to copy cmd
echo '"a%'
fi
}
+ # clean up
delete-buffer
}
}
-define-command -docstring %{
- Copies selections to system clipboard, splitting each selection onto new lines.
-} clip-copy-split %{
- evaluate-commands -save-regs 'a|' %{
- execute-keys '"ay'
- edit -scratch
- set-register | %opt{clipboard_copy_cmd}
- execute-keys '"aagjd%'
- delete-buffer
- }
-}
-
-define-command -docstring %{
- Copies selections to system clipboard, does not split selections onto new lines.
-} clip-copy-verbatim %{
- evaluate-commands -save-regs 'a|' %{
- execute-keys '"ay'
- edit -scratch
- set-register | %opt{clipboard_copy_cmd}
- execute-keys '"a%'
- delete-buffer
- }
-}
-
-map -docstring "yank the selection into the clipboard" global user y " wl-copy"
+map -docstring "yank the selections into the clipboard" global user y ": clipboard-copy"
+map -docstring "yank the split selections into the clipboard" global user Y ": clipboard-copy -split"
map -docstring "paste the clipboard" global user p " wl-paste -n"
map -docstring "paste the clipboard before" global user P "! wl-paste -n"
From 9c499a221b306bc133eca0072034234146d4e1ac Mon Sep 17 00:00:00 2001
From: Daniel Fichtinger
Date: Sun, 8 Jun 2025 22:49:47 -0400
Subject: [PATCH 36/71] AutoYADM commit: 2025-06-08 22:49:47
---
.config/kak/autoload/clipboard.kak | 26 +++++++++++++++++---------
1 file changed, 17 insertions(+), 9 deletions(-)
diff --git a/.config/kak/autoload/clipboard.kak b/.config/kak/autoload/clipboard.kak
index ab4d788b..7bd91ca8 100644
--- a/.config/kak/autoload/clipboard.kak
+++ b/.config/kak/autoload/clipboard.kak
@@ -2,6 +2,8 @@ declare-option -docstring %{
Command for copying to system clipboard.
} str clipboard_copy_cmd 'wl-copy'
+declare-option int clip_selcount 0
+
define-command -docstring %{
clip-copy [-split]: copy selections to system clipboard
Set the clipboard_copy_cmd option to change the command
@@ -10,6 +12,7 @@ define-command -docstring %{
} -params 0..1 clipboard-copy %{
# preserve registers
evaluate-commands -save-regs 'a|' %{
+ set-option local clip_selcount %val{selection_count}
# copy selections
execute-keys '"ay'
# disposable buffer
@@ -18,16 +21,21 @@ define-command -docstring %{
set-register | %opt{clipboard_copy_cmd}
# branch based on switch
execute-keys %sh{
- if [ ${#} = 1 ] && [ ${1} = '-split' ]; then
- # paste all
- # reduce selections to those without newline
- # append a newline
- # delete trailing newline
- # select all, pipe to copy cmd
- echo '"a\nagjd%'
+ if [ "$kak_opt_clip_selcount" -gt 1 ]; then
+ if [ ${#} = 1 ] && [ ${1} = '-split' ]; then
+ # paste all
+ # reduce selections to those without newline
+ # append a newline
+ # delete extra newlines
+ # select all, pipe to copy cmd
+ echo '"a\nagjd%'
+ printf 'gj:try %%{ exec \\n }'
+ else
+ # paste all, select all, pipe to copy cmd
+ echo '"a%'
+ fi
else
- # paste all, select all, pipe to copy cmd
- echo '"a%'
+ echo ''
fi
}
# clean up
From 13998f3066c211591a84df90c96bd1b872986fc9 Mon Sep 17 00:00:00 2001
From: Daniel Fichtinger
Date: Sun, 8 Jun 2025 23:04:49 -0400
Subject: [PATCH 37/71] AutoYADM commit: 2025-06-08 23:04:49
---
.config/kak/autoload/clipboard.kak | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/.config/kak/autoload/clipboard.kak b/.config/kak/autoload/clipboard.kak
index 7bd91ca8..85d297dd 100644
--- a/.config/kak/autoload/clipboard.kak
+++ b/.config/kak/autoload/clipboard.kak
@@ -4,6 +4,13 @@ declare-option -docstring %{
declare-option int clip_selcount 0
+define-command -hidden clip-trim %{
+ try %{
+ execute-keys \n
+ execute-keys bjGjd
+ }
+}
+
define-command -docstring %{
clip-copy [-split]: copy selections to system clipboard
Set the clipboard_copy_cmd option to change the command
@@ -28,8 +35,9 @@ define-command -docstring %{
# append a newline
# delete extra newlines
# select all, pipe to copy cmd
- echo '"a\nagjd%'
- printf 'gj:try %%{ exec \\n }'
+ echo '"a\na'
+ echo 'gj: clip-trim'
+ echo '%'
else
# paste all, select all, pipe to copy cmd
echo '"a%'
@@ -39,7 +47,7 @@ define-command -docstring %{
fi
}
# clean up
- delete-buffer
+ # delete-buffer
}
}
From 654ea26909a530ec0e8361f1d00cd96f7a5a872c Mon Sep 17 00:00:00 2001
From: Daniel Fichtinger
Date: Mon, 9 Jun 2025 14:13:22 -0400
Subject: [PATCH 38/71] AutoYADM commit: 2025-06-09 14:13:22
---
.config/kak/autoload/clipboard.kak | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/.config/kak/autoload/clipboard.kak b/.config/kak/autoload/clipboard.kak
index 85d297dd..9c735a44 100644
--- a/.config/kak/autoload/clipboard.kak
+++ b/.config/kak/autoload/clipboard.kak
@@ -22,13 +22,12 @@ define-command -docstring %{
set-option local clip_selcount %val{selection_count}
# copy selections
execute-keys '"ay'
- # disposable buffer
- edit -scratch
# set shell register to copy command
set-register | %opt{clipboard_copy_cmd}
# branch based on switch
execute-keys %sh{
if [ "$kak_opt_clip_selcount" -gt 1 ]; then
+ echo ': edit -scratch'
if [ ${#} = 1 ] && [ ${1} = '-split' ]; then
# paste all
# reduce selections to those without newline
@@ -42,12 +41,11 @@ define-command -docstring %{
# paste all, select all, pipe to copy cmd
echo '"a%'
fi
+ echo ": delete-buffer"
else
echo ''
fi
}
- # clean up
- # delete-buffer
}
}
From 30a89c5619939ce569d5f2bfbd1950dbb17a5053 Mon Sep 17 00:00:00 2001
From: Daniel Fichtinger
Date: Mon, 9 Jun 2025 14:28:38 -0400
Subject: [PATCH 39/71] AutoYADM commit: 2025-06-09 14:28:38
---
.config/kak/kakrc | 14 --------------
1 file changed, 14 deletions(-)
diff --git a/.config/kak/kakrc b/.config/kak/kakrc
index acde4b55..f45dd876 100644
--- a/.config/kak/kakrc
+++ b/.config/kak/kakrc
@@ -94,20 +94,6 @@ map -docstring 'case insensitive backward extend-search' global user '' L"
map -docstring 'Extend to file end' global user n "gjl"
-# Zathura pdf preview only for Typst files
-
-# hook global WinSetOption filetype=typst %{
-# define-command -docstring %{
-# Spawns a Zathura pdf preview and Typst watcher for the currently open Typst file
-# } typst %{
-# nop %sh{
-# {
-# "$kak_config/scripts/kak-typ-zathura.fish" -k -w "$kak_buffile" "$kak_client_pid"
-# } > /dev/null 2>&1 < /dev/null &
-# }
-# }
-# }
-
define-command -docstring "Create a scratch buffer" scratch %{
edit -scratch
}
From 1f9b5fceea352d97151a74aa427a2c813c17a5a6 Mon Sep 17 00:00:00 2001
From: Daniel Fichtinger
Date: Mon, 9 Jun 2025 17:07:29 -0400
Subject: [PATCH 40/71] AutoYADM commit: 2025-06-09 17:07:29
---
.config/kak/autoload/lsp.kak | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/.config/kak/autoload/lsp.kak b/.config/kak/autoload/lsp.kak
index 4649cfe8..721388c6 100644
--- a/.config/kak/autoload/lsp.kak
+++ b/.config/kak/autoload/lsp.kak
@@ -160,6 +160,30 @@ hook -group lsp-filetype-markdown global BufSetOption filetype=markdown %{
}
}
+remove-hooks global lsp-filetype-typst
+hook -group lsp-filetype-typst global BufSetOption filetype=typst %{
+ set-option buffer lsp_servers %{
+ [tinymist]
+ root_globs = [".git", ".hg"]
+ args = ["lsp"]
+ settings_section = "_"
+ [tinymist.settings._]
+ # See https://myriad-dreamin.github.io/tinymist/configurations.html
+ exportPdf = "never"
+ # exportPdf = "onDocumentHasTitle"
+ formatterMode = "typstyle"
+ previewFeature = "disable"
+
+ [harper-ls]
+ root_globs = ["*"]
+ args = ["--stdio"]
+ command = "harper-ls"
+ [harper-ls.settings.harper-ls.linters]
+ LongSentences = false
+ }
+ set-option -add buffer lsp_servers "formatterPrintWidth = %opt{autowrap_column}"
+}
+
# # can be empty, global, or file
# declare-option -hidden str harper_add ""
# define-command -hidden harper-add -params 1 %{
From aa7cbf8a129b2eb60a525321cce13143dfd641ae Mon Sep 17 00:00:00 2001
From: Daniel Fichtinger
Date: Mon, 9 Jun 2025 17:37:39 -0400
Subject: [PATCH 41/71] AutoYADM commit: 2025-06-09 17:37:38
---
.config/kak/autoload/lsp.kak | 4 ++++
.config/kak/scripts/lsp-diags.py | 10 ++++++++++
2 files changed, 14 insertions(+)
create mode 100755 .config/kak/scripts/lsp-diags.py
diff --git a/.config/kak/autoload/lsp.kak b/.config/kak/autoload/lsp.kak
index 721388c6..9c470c29 100644
--- a/.config/kak/autoload/lsp.kak
+++ b/.config/kak/autoload/lsp.kak
@@ -209,3 +209,7 @@ hook -group lsp-filetype-typst global BufSetOption filetype=typst %{
# lsp-menu %arg{@}
# }
+# enable inline-diagnostics if the cursor is on a diagnostic
+define-command lsp-check-inline-diagnostic %{
+ # we write a python script for this
+}
diff --git a/.config/kak/scripts/lsp-diags.py b/.config/kak/scripts/lsp-diags.py
new file mode 100755
index 00000000..9d811a22
--- /dev/null
+++ b/.config/kak/scripts/lsp-diags.py
@@ -0,0 +1,10 @@
+#!/usr/bin/env python
+
+
+def parse_specs(data: str):
+ diagnostics = []
+ for entry in data.strip().split():
+ if not entry or len(entry) < 9:
+ continue
+ range_part, _ = entry.split("|", 1)
+ start_str, end_str = range_part.split(",")
From 523aafb569ce9efc53e473e58d5b7f1f52dccb72 Mon Sep 17 00:00:00 2001
From: Daniel Fichtinger
Date: Mon, 9 Jun 2025 17:53:37 -0400
Subject: [PATCH 42/71] AutoYADM commit: 2025-06-09 17:53:37
---
.config/kak/scripts/lsp-diags.py | 31 ++++++++++++++++++++++++++++++-
1 file changed, 30 insertions(+), 1 deletion(-)
diff --git a/.config/kak/scripts/lsp-diags.py b/.config/kak/scripts/lsp-diags.py
index 9d811a22..77a628dd 100755
--- a/.config/kak/scripts/lsp-diags.py
+++ b/.config/kak/scripts/lsp-diags.py
@@ -1,10 +1,39 @@
#!/usr/bin/env python
+Position = tuple[int, int]
+SpecList = list[tuple[Position, Position]]
+
def parse_specs(data: str):
- diagnostics = []
+ diagnostics: SpecList = []
for entry in data.strip().split():
if not entry or len(entry) < 9:
continue
range_part, _ = entry.split("|", 1)
start_str, end_str = range_part.split(",")
+ sl, sc = map(int, start_str.split("."))
+ el, ec = map(int, end_str.split("."))
+ diagnostics.append(((sl, sc), (el, ec)))
+ return diagnostics
+
+
+def is_cursor_in_any(cursor: Position, diagnostics: SpecList) -> bool:
+ cl, cc = cursor
+ for (sl, sc), (el, ec) in diagnostics:
+ if sl == el == cl and sc <= cc <= ec:
+ return True
+ elif sl < cl < el:
+ return True
+ elif cl == sl and cc >= sc:
+ return True
+ elif cl == el and cc <= sc:
+ return True
+ return False
+
+
+if __name__ == "__main__":
+ test_data = "1 10.21,10.30|DiagnosticHint 33.43,33.47|DiagnosticHint 34.7,34.10|DiagnosticHint 57.8,57.17|DiagnosticHint 68.9,68.18|DiagnosticHint 69.14,69.23|DiagnosticHint 72.7,72.11|DiagnosticHint 73.70,73.79|DiagnosticHint 75.7,75.11|DiagnosticHint 77.47,77.56|DiagnosticHint 79.27,79.28|DiagnosticHint 81.61,81.70|DiagnosticHint 84.66,84.75|DiagnosticHint 96.4,96.13|DiagnosticHint 97.3,97.12|DiagnosticHint 101.8,101.20|DiagnosticHint 145.28,145.43|DiagnosticHint 153.13,153.21|DiagnosticHint 155.13,155.21|DiagnosticHint 158.5,158.14|DiagnosticHint 164.56,164.61|DiagnosticHint 203.21,203.21|DiagnosticHint 204.28,204.28|DiagnosticHint 206.16,206.16|DiagnosticHint 209.5,209.5|DiagnosticHint 210.5,210.5|DiagnosticHint 216.25,216.25|DiagnosticHint 219.21,219.21|DiagnosticHint 225.27,225.27|DiagnosticHint 234.59,234.59|DiagnosticHint 263.37,263.39|DiagnosticHint 268.55,268.57|DiagnosticHint 287.46,287.47|DiagnosticHint 326.16,326.25|DiagnosticHint 337.34,337.36|DiagnosticHint 339.33,339.35|DiagnosticHint 364.63,364.71|DiagnosticHint 366.46,366.54|DiagnosticHint"
+ out = parse_specs(test_data)
+ print(out)
+ test_cursor = (10, 24)
+ print(is_cursor_in_any(test_cursor, out))
From c6f9a5c0683686e48db3bac40c54da1e3e8005ca Mon Sep 17 00:00:00 2001
From: Daniel Fichtinger
Date: Mon, 9 Jun 2025 18:08:55 -0400
Subject: [PATCH 43/71] AutoYADM commit: 2025-06-09 18:08:55
---
.config/kak/scripts/lsp-diags.py | 39 ++++++++++++++++++++++++++++----
1 file changed, 35 insertions(+), 4 deletions(-)
diff --git a/.config/kak/scripts/lsp-diags.py b/.config/kak/scripts/lsp-diags.py
index 77a628dd..5f8a2032 100755
--- a/.config/kak/scripts/lsp-diags.py
+++ b/.config/kak/scripts/lsp-diags.py
@@ -1,11 +1,16 @@
#!/usr/bin/env python
+import sys
+import os
+
Position = tuple[int, int]
SpecList = list[tuple[Position, Position]]
+diagnostics: SpecList = []
+
def parse_specs(data: str):
- diagnostics: SpecList = []
+ parsed: SpecList = []
for entry in data.strip().split():
if not entry or len(entry) < 9:
continue
@@ -13,8 +18,8 @@ def parse_specs(data: str):
start_str, end_str = range_part.split(",")
sl, sc = map(int, start_str.split("."))
el, ec = map(int, end_str.split("."))
- diagnostics.append(((sl, sc), (el, ec)))
- return diagnostics
+ parsed.append(((sl, sc), (el, ec)))
+ return parsed
def is_cursor_in_any(cursor: Position, diagnostics: SpecList) -> bool:
@@ -31,9 +36,35 @@ def is_cursor_in_any(cursor: Position, diagnostics: SpecList) -> bool:
return False
-if __name__ == "__main__":
+def test():
test_data = "1 10.21,10.30|DiagnosticHint 33.43,33.47|DiagnosticHint 34.7,34.10|DiagnosticHint 57.8,57.17|DiagnosticHint 68.9,68.18|DiagnosticHint 69.14,69.23|DiagnosticHint 72.7,72.11|DiagnosticHint 73.70,73.79|DiagnosticHint 75.7,75.11|DiagnosticHint 77.47,77.56|DiagnosticHint 79.27,79.28|DiagnosticHint 81.61,81.70|DiagnosticHint 84.66,84.75|DiagnosticHint 96.4,96.13|DiagnosticHint 97.3,97.12|DiagnosticHint 101.8,101.20|DiagnosticHint 145.28,145.43|DiagnosticHint 153.13,153.21|DiagnosticHint 155.13,155.21|DiagnosticHint 158.5,158.14|DiagnosticHint 164.56,164.61|DiagnosticHint 203.21,203.21|DiagnosticHint 204.28,204.28|DiagnosticHint 206.16,206.16|DiagnosticHint 209.5,209.5|DiagnosticHint 210.5,210.5|DiagnosticHint 216.25,216.25|DiagnosticHint 219.21,219.21|DiagnosticHint 225.27,225.27|DiagnosticHint 234.59,234.59|DiagnosticHint 263.37,263.39|DiagnosticHint 268.55,268.57|DiagnosticHint 287.46,287.47|DiagnosticHint 326.16,326.25|DiagnosticHint 337.34,337.36|DiagnosticHint 339.33,339.35|DiagnosticHint 364.63,364.71|DiagnosticHint 366.46,366.54|DiagnosticHint"
out = parse_specs(test_data)
print(out)
test_cursor = (10, 24)
print(is_cursor_in_any(test_cursor, out))
+
+
+def main():
+ in_path = "/tmp/diag-in"
+ out_path = "/tmp/diag-out"
+
+ with open(in_path, "r") as infile, open(out_path, "w") as outfile:
+ diagnostics = []
+ while True:
+ line = infile.readline()
+ if not line:
+ continue
+ assert isinstance(line, str)
+ if line.startswith("set "):
+ _, payload = line.split(" ", 1)
+ diagnostics = parse_specs(payload)
+ _ = outfile.write("ok\n")
+ outfile.flush()
+ elif line.startswith("query "):
+ _, pos = line.split(" ", 1)
+ l, c = map(int, pos.strip().split())
+ result = is_cursor_in_any((l, c), diagnostics)
+ _ = outfile.write("true\n" if result else "false\n")
+ outfile.flush()
+ elif line == "exit":
+ break
From eafc2ae303ca0f6790ed91fb1262bdc247202b02 Mon Sep 17 00:00:00 2001
From: Daniel Fichtinger
Date: Mon, 9 Jun 2025 18:24:37 -0400
Subject: [PATCH 44/71] AutoYADM commit: 2025-06-09 18:24:37
---
.config/kak/scripts/lsp-diags.py | 23 +++++++++++++++++------
1 file changed, 17 insertions(+), 6 deletions(-)
diff --git a/.config/kak/scripts/lsp-diags.py b/.config/kak/scripts/lsp-diags.py
index 5f8a2032..3ff98a40 100755
--- a/.config/kak/scripts/lsp-diags.py
+++ b/.config/kak/scripts/lsp-diags.py
@@ -25,14 +25,19 @@ def parse_specs(data: str):
def is_cursor_in_any(cursor: Position, diagnostics: SpecList) -> bool:
cl, cc = cursor
for (sl, sc), (el, ec) in diagnostics:
- if sl == el == cl and sc <= cc <= ec:
- return True
+ if cl < sl or cl > el:
+ continue
+ if sl == el:
+ if cl == sl and sc <= cc <= ec:
+ return True
+ elif cl == sl:
+ if cc >= sc:
+ return True
+ elif cl == el:
+ if cc <= ec:
+ return True
elif sl < cl < el:
return True
- elif cl == sl and cc >= sc:
- return True
- elif cl == el and cc <= sc:
- return True
return False
@@ -60,11 +65,17 @@ def main():
diagnostics = parse_specs(payload)
_ = outfile.write("ok\n")
outfile.flush()
+ print("ok", flush=True)
elif line.startswith("query "):
_, pos = line.split(" ", 1)
l, c = map(int, pos.strip().split())
result = is_cursor_in_any((l, c), diagnostics)
_ = outfile.write("true\n" if result else "false\n")
outfile.flush()
+ print("ok", flush=True)
elif line == "exit":
break
+
+
+if __name__ == "__main__":
+ main()
From 0a173e7323545a49370fd8544189d354f504aa85 Mon Sep 17 00:00:00 2001
From: Daniel Fichtinger
Date: Mon, 9 Jun 2025 18:39:42 -0400
Subject: [PATCH 45/71] AutoYADM commit: 2025-06-09 18:39:42
---
.config/kak/autoload/lsp.kak | 24 ++++++++++++++++++++++++
.config/kak/scripts/lsp-diags.py | 2 --
2 files changed, 24 insertions(+), 2 deletions(-)
diff --git a/.config/kak/autoload/lsp.kak b/.config/kak/autoload/lsp.kak
index 9c470c29..adaed0bd 100644
--- a/.config/kak/autoload/lsp.kak
+++ b/.config/kak/autoload/lsp.kak
@@ -213,3 +213,27 @@ hook -group lsp-filetype-typst global BufSetOption filetype=typst %{
define-command lsp-check-inline-diagnostic %{
# we write a python script for this
}
+
+define-command lsp-diag-set %{
+ evaluate-commands %sh{
+ printf 'set %s\n' "$kak_opt_lsp_inline_diagnostics" >/tmp/diag-in
+ read result < /tmp/diag-out
+ if [ "$result" != "ok" ]; then
+ echo "info 'failed'"
+ else
+ echo "nop"
+ fi
+ }
+}
+
+define-command -params 2 lsp-diag-query %{
+ evaluate-commands %sh{
+ printf 'query %s %s\n' "$1" "$2" >/tmp/diag-in
+ read result < /tmp/diag-out
+ if [ "$result" = "true" ]; then
+ echo "info 'true'"
+ else
+ echo "info 'false'"
+ fi
+ }
+}
diff --git a/.config/kak/scripts/lsp-diags.py b/.config/kak/scripts/lsp-diags.py
index 3ff98a40..88a34444 100755
--- a/.config/kak/scripts/lsp-diags.py
+++ b/.config/kak/scripts/lsp-diags.py
@@ -65,14 +65,12 @@ def main():
diagnostics = parse_specs(payload)
_ = outfile.write("ok\n")
outfile.flush()
- print("ok", flush=True)
elif line.startswith("query "):
_, pos = line.split(" ", 1)
l, c = map(int, pos.strip().split())
result = is_cursor_in_any((l, c), diagnostics)
_ = outfile.write("true\n" if result else "false\n")
outfile.flush()
- print("ok", flush=True)
elif line == "exit":
break
From f25709871cf62bbd110bc5676b9b930a4ea136c9 Mon Sep 17 00:00:00 2001
From: Daniel Fichtinger
Date: Mon, 9 Jun 2025 18:55:37 -0400
Subject: [PATCH 46/71] AutoYADM commit: 2025-06-09 18:55:37
---
.config/kak/autoload/lsp.kak | 8 ++++----
.config/kak/scripts/lsp-diags.py | 30 ++++++++++++++++++++++++++++--
2 files changed, 32 insertions(+), 6 deletions(-)
diff --git a/.config/kak/autoload/lsp.kak b/.config/kak/autoload/lsp.kak
index adaed0bd..1cff64bb 100644
--- a/.config/kak/autoload/lsp.kak
+++ b/.config/kak/autoload/lsp.kak
@@ -216,8 +216,8 @@ define-command lsp-check-inline-diagnostic %{
define-command lsp-diag-set %{
evaluate-commands %sh{
- printf 'set %s\n' "$kak_opt_lsp_inline_diagnostics" >/tmp/diag-in
- read result < /tmp/diag-out
+ printf 'set %s\n' "$kak_opt_lsp_inline_diagnostics" >"$kak_opt_diagpipe_in"
+ read result < "$kak_opt_diagpipe_out"
if [ "$result" != "ok" ]; then
echo "info 'failed'"
else
@@ -228,8 +228,8 @@ define-command lsp-diag-set %{
define-command -params 2 lsp-diag-query %{
evaluate-commands %sh{
- printf 'query %s %s\n' "$1" "$2" >/tmp/diag-in
- read result < /tmp/diag-out
+ printf 'query %s %s\n' "$1" "$2" >"$kak_opt_diagpipe_in"
+ read result < "$kak_opt_diagpipe_out"
if [ "$result" = "true" ]; then
echo "info 'true'"
else
diff --git a/.config/kak/scripts/lsp-diags.py b/.config/kak/scripts/lsp-diags.py
index 88a34444..bf9ee83b 100755
--- a/.config/kak/scripts/lsp-diags.py
+++ b/.config/kak/scripts/lsp-diags.py
@@ -2,6 +2,8 @@
import sys
import os
+import tempfile
+import atexit
Position = tuple[int, int]
SpecList = list[tuple[Position, Position]]
@@ -49,9 +51,33 @@ def test():
print(is_cursor_in_any(test_cursor, out))
+def cleanup(inp: str, outp: str, dir: str):
+ try:
+ os.remove(inp)
+ os.remove(outp)
+ os.rmdir(dir)
+ except FileNotFoundError:
+ pass
+
+
+def gen_kakoune_output(inp: str, outp: str) -> str:
+ return f"declare_option -hidden str diagpipe_in {inp}\ndeclare_option -hidden str diagpipe_out {outp}"
+
+
def main():
- in_path = "/tmp/diag-in"
- out_path = "/tmp/diag-out"
+ # create unique directory and names
+ fifo_dir = tempfile.mkdtemp(prefix="diagpipe-")
+ in_path = os.path.join(fifo_dir, "in")
+ out_path = os.path.join(fifo_dir, "out")
+
+ # create fifos
+ os.mkfifo(in_path)
+ os.mkfifo(out_path)
+
+ _ = atexit.register(lambda: cleanup(in_path, out_path, fifo_dir))
+
+ print(in_path, flush=True)
+ print(out_path, flush=True)
with open(in_path, "r") as infile, open(out_path, "w") as outfile:
diagnostics = []
From d0893f3708a62c572064e5191e86d84722f8ad9a Mon Sep 17 00:00:00 2001
From: Daniel Fichtinger
Date: Mon, 9 Jun 2025 19:11:37 -0400
Subject: [PATCH 47/71] AutoYADM commit: 2025-06-09 19:11:37
---
.config/kak/scripts/lsp-diags.py | 29 +++++++++++++++++++++++++++--
1 file changed, 27 insertions(+), 2 deletions(-)
diff --git a/.config/kak/scripts/lsp-diags.py b/.config/kak/scripts/lsp-diags.py
index bf9ee83b..0b0a1e38 100755
--- a/.config/kak/scripts/lsp-diags.py
+++ b/.config/kak/scripts/lsp-diags.py
@@ -1,5 +1,7 @@
#!/usr/bin/env python
+# pyright: strict, reportUnusedCallResult=false
+
import sys
import os
import tempfile
@@ -64,6 +66,27 @@ def gen_kakoune_output(inp: str, outp: str) -> str:
return f"declare_option -hidden str diagpipe_in {inp}\ndeclare_option -hidden str diagpipe_out {outp}"
+def daemonize():
+ # exit parent
+ if os.fork() > 0:
+ sys.exit(0)
+ # new session
+ os.setsid()
+ if os.fork() > 0:
+ # exit first child
+ sys.exit(0)
+ _ = sys.stdin.close()
+ _ = sys.stdout.flush()
+ _ = sys.stderr.flush()
+
+ # redirect IO to /dev/null
+ with open("/dev/null", "rb", 0) as dn:
+ os.dup2(dn.fileno(), sys.stdin.fileno())
+ with open("/dev/null", "ab", 0) as dn:
+ os.dup2(dn.fileno(), sys.stdout.fileno())
+ os.dup2(dn.fileno(), sys.stderr.fileno())
+
+
def main():
# create unique directory and names
fifo_dir = tempfile.mkdtemp(prefix="diagpipe-")
@@ -76,8 +99,10 @@ def main():
_ = atexit.register(lambda: cleanup(in_path, out_path, fifo_dir))
- print(in_path, flush=True)
- print(out_path, flush=True)
+ output = gen_kakoune_output(in_path, out_path)
+ print(output)
+ sys.stdout.flush()
+ daemonize()
with open(in_path, "r") as infile, open(out_path, "w") as outfile:
diagnostics = []
From ac51e3f41ee9f11d5200bb97ea8f0f2ffbe1a264 Mon Sep 17 00:00:00 2001
From: Daniel Fichtinger
Date: Mon, 9 Jun 2025 23:23:54 -0400
Subject: [PATCH 48/71] AutoYADM commit: 2025-06-09 23:23:54
---
.config/kak/scripts/lsp-diags.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/.config/kak/scripts/lsp-diags.py b/.config/kak/scripts/lsp-diags.py
index 0b0a1e38..9b5f060e 100755
--- a/.config/kak/scripts/lsp-diags.py
+++ b/.config/kak/scripts/lsp-diags.py
@@ -7,6 +7,7 @@ import os
import tempfile
import atexit
+
Position = tuple[int, int]
SpecList = list[tuple[Position, Position]]
@@ -67,7 +68,7 @@ def gen_kakoune_output(inp: str, outp: str) -> str:
def daemonize():
- # exit parent
+ # fork and exit parent
if os.fork() > 0:
sys.exit(0)
# new session
From ad6b9f48b1c80f102a030e80ff13a2e70c149b7e Mon Sep 17 00:00:00 2001
From: Daniel Fichtinger
Date: Mon, 9 Jun 2025 23:39:01 -0400
Subject: [PATCH 49/71] AutoYADM commit: 2025-06-09 23:39:01
---
.config/kak/autoload/lsp.kak | 2 ++
.config/kak/scripts/lsp-diags.py | 27 +++++++++++++++++----------
2 files changed, 19 insertions(+), 10 deletions(-)
diff --git a/.config/kak/autoload/lsp.kak b/.config/kak/autoload/lsp.kak
index 1cff64bb..cfe24390 100644
--- a/.config/kak/autoload/lsp.kak
+++ b/.config/kak/autoload/lsp.kak
@@ -214,6 +214,8 @@ define-command lsp-check-inline-diagnostic %{
# we write a python script for this
}
+evaluate-commands %sh{ ${kak_config}/scripts/lsp-diags.py }
+
define-command lsp-diag-set %{
evaluate-commands %sh{
printf 'set %s\n' "$kak_opt_lsp_inline_diagnostics" >"$kak_opt_diagpipe_in"
diff --git a/.config/kak/scripts/lsp-diags.py b/.config/kak/scripts/lsp-diags.py
index 9b5f060e..afc65958 100755
--- a/.config/kak/scripts/lsp-diags.py
+++ b/.config/kak/scripts/lsp-diags.py
@@ -2,11 +2,13 @@
# pyright: strict, reportUnusedCallResult=false
+import atexit
+import subprocess
import sys
import os
import tempfile
-import atexit
-
+import signal
+from typing import Any
Position = tuple[int, int]
SpecList = list[tuple[Position, Position]]
@@ -55,6 +57,7 @@ def test():
def cleanup(inp: str, outp: str, dir: str):
+ subprocess.run(["notify-send", "cleanup runs"])
try:
os.remove(inp)
os.remove(outp)
@@ -64,10 +67,10 @@ def cleanup(inp: str, outp: str, dir: str):
def gen_kakoune_output(inp: str, outp: str) -> str:
- return f"declare_option -hidden str diagpipe_in {inp}\ndeclare_option -hidden str diagpipe_out {outp}"
+ return f"declare-option -hidden str diagpipe_in {inp}\ndeclare-option -hidden str diagpipe_out {outp}"
-def daemonize():
+def daemonize(inp: str, outp: str, dir: str):
# fork and exit parent
if os.fork() > 0:
sys.exit(0)
@@ -76,9 +79,6 @@ def daemonize():
if os.fork() > 0:
# exit first child
sys.exit(0)
- _ = sys.stdin.close()
- _ = sys.stdout.flush()
- _ = sys.stderr.flush()
# redirect IO to /dev/null
with open("/dev/null", "rb", 0) as dn:
@@ -86,9 +86,18 @@ def daemonize():
with open("/dev/null", "ab", 0) as dn:
os.dup2(dn.fileno(), sys.stdout.fileno())
os.dup2(dn.fileno(), sys.stderr.fileno())
+ _ = atexit.register(lambda: cleanup(inp, outp, dir))
+
+ def on_exit(signum: Any, frame: Any):
+ cleanup(inp, outp, dir)
+ sys.exit(0)
+
+ signal.signal(signal.SIGTERM, on_exit)
+ signal.signal(signal.SIGINT, on_exit)
def main():
+ subprocess.run(["notify-send", "begin loop"])
# create unique directory and names
fifo_dir = tempfile.mkdtemp(prefix="diagpipe-")
in_path = os.path.join(fifo_dir, "in")
@@ -98,12 +107,10 @@ def main():
os.mkfifo(in_path)
os.mkfifo(out_path)
- _ = atexit.register(lambda: cleanup(in_path, out_path, fifo_dir))
-
output = gen_kakoune_output(in_path, out_path)
print(output)
sys.stdout.flush()
- daemonize()
+ daemonize(in_path, out_path, fifo_dir)
with open(in_path, "r") as infile, open(out_path, "w") as outfile:
diagnostics = []
From 66ed93369c911742370dfd4cfca7c52080eb1172 Mon Sep 17 00:00:00 2001
From: Daniel Fichtinger
Date: Mon, 9 Jun 2025 23:54:02 -0400
Subject: [PATCH 50/71] AutoYADM commit: 2025-06-09 23:54:02
---
.config/kak/autoload/lsp.kak | 8 ++++++++
.config/kak/scripts/lsp-diags.py | 16 +++++++++-------
2 files changed, 17 insertions(+), 7 deletions(-)
diff --git a/.config/kak/autoload/lsp.kak b/.config/kak/autoload/lsp.kak
index cfe24390..bb8c8296 100644
--- a/.config/kak/autoload/lsp.kak
+++ b/.config/kak/autoload/lsp.kak
@@ -239,3 +239,11 @@ define-command -params 2 lsp-diag-query %{
fi
}
}
+
+hook global KakEnd .* %{
+ nop %sh{
+ printf 'exit\n' >"$kak_opt_diagpipe_in"
+ read result < "$kak_opt_diagpipe_out"
+ notify-send "killing"
+ }
+}
diff --git a/.config/kak/scripts/lsp-diags.py b/.config/kak/scripts/lsp-diags.py
index afc65958..80cfc642 100755
--- a/.config/kak/scripts/lsp-diags.py
+++ b/.config/kak/scripts/lsp-diags.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
-# pyright: strict, reportUnusedCallResult=false
+# pyright: basic, reportUnusedCallResult=false
import atexit
import subprocess
@@ -8,7 +8,7 @@ import sys
import os
import tempfile
import signal
-from typing import Any
+import types
Position = tuple[int, int]
SpecList = list[tuple[Position, Position]]
@@ -88,8 +88,8 @@ def daemonize(inp: str, outp: str, dir: str):
os.dup2(dn.fileno(), sys.stderr.fileno())
_ = atexit.register(lambda: cleanup(inp, outp, dir))
- def on_exit(signum: Any, frame: Any):
- cleanup(inp, outp, dir)
+ def on_exit(*_):
+ # cleanup(inp, outp, dir)
sys.exit(0)
signal.signal(signal.SIGTERM, on_exit)
@@ -113,12 +113,13 @@ def main():
daemonize(in_path, out_path, fifo_dir)
with open(in_path, "r") as infile, open(out_path, "w") as outfile:
- diagnostics = []
+ diagnostics: SpecList = []
while True:
line = infile.readline()
if not line:
continue
assert isinstance(line, str)
+ subprocess.run(["notify-send", f"Received command: {line}"])
if line.startswith("set "):
_, payload = line.split(" ", 1)
diagnostics = parse_specs(payload)
@@ -130,8 +131,9 @@ def main():
result = is_cursor_in_any((l, c), diagnostics)
_ = outfile.write("true\n" if result else "false\n")
outfile.flush()
- elif line == "exit":
- break
+ elif line.startswith("exit"):
+ subprocess.run(["notify-send", "exit received"])
+ sys.exit(0)
if __name__ == "__main__":
From e011abfe4e7d2589e47f30b532b085fd762016cf Mon Sep 17 00:00:00 2001
From: Daniel Fichtinger
Date: Tue, 10 Jun 2025 00:09:05 -0400
Subject: [PATCH 51/71] AutoYADM commit: 2025-06-10 00:09:05
---
.config/kak/autoload/lsp.kak | 25 ++++++++++++++++++++-----
.config/kak/scripts/lsp-diags.py | 9 +++++----
2 files changed, 25 insertions(+), 9 deletions(-)
diff --git a/.config/kak/autoload/lsp.kak b/.config/kak/autoload/lsp.kak
index bb8c8296..f860134b 100644
--- a/.config/kak/autoload/lsp.kak
+++ b/.config/kak/autoload/lsp.kak
@@ -221,7 +221,7 @@ define-command lsp-diag-set %{
printf 'set %s\n' "$kak_opt_lsp_inline_diagnostics" >"$kak_opt_diagpipe_in"
read result < "$kak_opt_diagpipe_out"
if [ "$result" != "ok" ]; then
- echo "info 'failed'"
+ echo "info 'lsp-diag failed to set'"
else
echo "nop"
fi
@@ -233,9 +233,9 @@ define-command -params 2 lsp-diag-query %{
printf 'query %s %s\n' "$1" "$2" >"$kak_opt_diagpipe_in"
read result < "$kak_opt_diagpipe_out"
if [ "$result" = "true" ]; then
- echo "info 'true'"
+ echo "trigger-user-hook lsp-diag-hover-true"
else
- echo "info 'false'"
+ echo "trigger-user-hook lsp-diag-hover-false"
fi
}
}
@@ -244,6 +244,21 @@ hook global KakEnd .* %{
nop %sh{
printf 'exit\n' >"$kak_opt_diagpipe_in"
read result < "$kak_opt_diagpipe_out"
- notify-send "killing"
}
-}
+}
+
+hook global User lsp-diag-hover-false %{
+ info 'false detected'
+}
+
+hook global User lsp-diag-hover-true %{
+ info 'true detected'
+}
+
+hook global NormalIdle .* %{
+ lsp-diag-query %val{cursor_line} %val{cursor_column}
+}
+
+hook global WinSetOption lsp_inline_diagnostics=.* %{
+ lsp-diag-set
+}
diff --git a/.config/kak/scripts/lsp-diags.py b/.config/kak/scripts/lsp-diags.py
index 80cfc642..2980e5a8 100755
--- a/.config/kak/scripts/lsp-diags.py
+++ b/.config/kak/scripts/lsp-diags.py
@@ -57,7 +57,7 @@ def test():
def cleanup(inp: str, outp: str, dir: str):
- subprocess.run(["notify-send", "cleanup runs"])
+ # subprocess.run(["notify-send", "cleanup runs"])
try:
os.remove(inp)
os.remove(outp)
@@ -97,7 +97,7 @@ def daemonize(inp: str, outp: str, dir: str):
def main():
- subprocess.run(["notify-send", "begin loop"])
+ # subprocess.run(["notify-send", "begin loop"])
# create unique directory and names
fifo_dir = tempfile.mkdtemp(prefix="diagpipe-")
in_path = os.path.join(fifo_dir, "in")
@@ -119,8 +119,9 @@ def main():
if not line:
continue
assert isinstance(line, str)
- subprocess.run(["notify-send", f"Received command: {line}"])
+ # # subprocess.run(["notify-send", f"Received command: {line}"])
if line.startswith("set "):
+ # subprocess.run(["notify-send", f"Received set: {line}"])
_, payload = line.split(" ", 1)
diagnostics = parse_specs(payload)
_ = outfile.write("ok\n")
@@ -132,7 +133,7 @@ def main():
_ = outfile.write("true\n" if result else "false\n")
outfile.flush()
elif line.startswith("exit"):
- subprocess.run(["notify-send", "exit received"])
+ # subprocess.run(["notify-send", "exit received"])
sys.exit(0)
From 038dc3b6ef889f06d2baba13a13d48811c9e76a5 Mon Sep 17 00:00:00 2001
From: Daniel Fichtinger
Date: Tue, 10 Jun 2025 00:24:17 -0400
Subject: [PATCH 52/71] AutoYADM commit: 2025-06-10 00:24:17
---
.config/kak/autoload/lsp.kak | 25 ++++++++++++++-----------
.config/kak/scripts/lsp-diags.py | 8 --------
2 files changed, 14 insertions(+), 19 deletions(-)
diff --git a/.config/kak/autoload/lsp.kak b/.config/kak/autoload/lsp.kak
index f860134b..e09dfee8 100644
--- a/.config/kak/autoload/lsp.kak
+++ b/.config/kak/autoload/lsp.kak
@@ -99,6 +99,7 @@ define-command -hidden lsp-filetype-hooks-update %{
map -docstring 'toggle inlay hints' window ui h ': inlay-toggle'
map -docstring 'toggle inlay diagnostics' window ui d ': inlay-diagnostics-toggle'
map -docstring 'toggle inline diagnostics' window ui e ': inline-diagnostics-toggle'
+ trigger-user-hook lsp-enabled
}
}
lsp-filetype-hooks-update
@@ -247,18 +248,20 @@ hook global KakEnd .* %{
}
}
-hook global User lsp-diag-hover-false %{
- info 'false detected'
-}
-hook global User lsp-diag-hover-true %{
- info 'true detected'
-}
+hook global User lsp-enabled %{
+ hook window User lsp-diag-hover-false %{
+ try inlay-diagnostics-off
+ }
-hook global NormalIdle .* %{
- lsp-diag-query %val{cursor_line} %val{cursor_column}
-}
+ hook window User lsp-diag-hover-true %{
+ try inlay-diagnostics-on
+ }
-hook global WinSetOption lsp_inline_diagnostics=.* %{
- lsp-diag-set
+ hook window NormalIdle .* %{
+ lsp-diag-query %val{cursor_line} %val{cursor_column}
+ }
+ hook window WinSetOption lsp_inline_diagnostics=.* %{
+ lsp-diag-set
+ }
}
diff --git a/.config/kak/scripts/lsp-diags.py b/.config/kak/scripts/lsp-diags.py
index 2980e5a8..2bd6a30a 100755
--- a/.config/kak/scripts/lsp-diags.py
+++ b/.config/kak/scripts/lsp-diags.py
@@ -48,14 +48,6 @@ def is_cursor_in_any(cursor: Position, diagnostics: SpecList) -> bool:
return False
-def test():
- test_data = "1 10.21,10.30|DiagnosticHint 33.43,33.47|DiagnosticHint 34.7,34.10|DiagnosticHint 57.8,57.17|DiagnosticHint 68.9,68.18|DiagnosticHint 69.14,69.23|DiagnosticHint 72.7,72.11|DiagnosticHint 73.70,73.79|DiagnosticHint 75.7,75.11|DiagnosticHint 77.47,77.56|DiagnosticHint 79.27,79.28|DiagnosticHint 81.61,81.70|DiagnosticHint 84.66,84.75|DiagnosticHint 96.4,96.13|DiagnosticHint 97.3,97.12|DiagnosticHint 101.8,101.20|DiagnosticHint 145.28,145.43|DiagnosticHint 153.13,153.21|DiagnosticHint 155.13,155.21|DiagnosticHint 158.5,158.14|DiagnosticHint 164.56,164.61|DiagnosticHint 203.21,203.21|DiagnosticHint 204.28,204.28|DiagnosticHint 206.16,206.16|DiagnosticHint 209.5,209.5|DiagnosticHint 210.5,210.5|DiagnosticHint 216.25,216.25|DiagnosticHint 219.21,219.21|DiagnosticHint 225.27,225.27|DiagnosticHint 234.59,234.59|DiagnosticHint 263.37,263.39|DiagnosticHint 268.55,268.57|DiagnosticHint 287.46,287.47|DiagnosticHint 326.16,326.25|DiagnosticHint 337.34,337.36|DiagnosticHint 339.33,339.35|DiagnosticHint 364.63,364.71|DiagnosticHint 366.46,366.54|DiagnosticHint"
- out = parse_specs(test_data)
- print(out)
- test_cursor = (10, 24)
- print(is_cursor_in_any(test_cursor, out))
-
-
def cleanup(inp: str, outp: str, dir: str):
# subprocess.run(["notify-send", "cleanup runs"])
try:
From efd43b534e517de2b214413699cdc37047affe08 Mon Sep 17 00:00:00 2001
From: Daniel Fichtinger
Date: Tue, 10 Jun 2025 00:55:38 -0400
Subject: [PATCH 53/71] AutoYADM commit: 2025-06-10 00:55:38
---
.config/kak/autoload/lsp.kak | 5 -----
1 file changed, 5 deletions(-)
diff --git a/.config/kak/autoload/lsp.kak b/.config/kak/autoload/lsp.kak
index e09dfee8..cbaa801f 100644
--- a/.config/kak/autoload/lsp.kak
+++ b/.config/kak/autoload/lsp.kak
@@ -210,11 +210,6 @@ hook -group lsp-filetype-typst global BufSetOption filetype=typst %{
# lsp-menu %arg{@}
# }
-# enable inline-diagnostics if the cursor is on a diagnostic
-define-command lsp-check-inline-diagnostic %{
- # we write a python script for this
-}
-
evaluate-commands %sh{ ${kak_config}/scripts/lsp-diags.py }
define-command lsp-diag-set %{
From 13d2fef362252a40b3c564e9b6224e042a0cec47 Mon Sep 17 00:00:00 2001
From: Daniel Fichtinger
Date: Tue, 10 Jun 2025 12:52:38 -0400
Subject: [PATCH 54/71] AutoYADM commit: 2025-06-10 12:52:38
---
.config/kak/autoload/lsp.kak | 2 ++
1 file changed, 2 insertions(+)
diff --git a/.config/kak/autoload/lsp.kak b/.config/kak/autoload/lsp.kak
index cbaa801f..87b922e2 100644
--- a/.config/kak/autoload/lsp.kak
+++ b/.config/kak/autoload/lsp.kak
@@ -210,6 +210,7 @@ hook -group lsp-filetype-typst global BufSetOption filetype=typst %{
# lsp-menu %arg{@}
# }
+provide-module lsp-diag %~
evaluate-commands %sh{ ${kak_config}/scripts/lsp-diags.py }
define-command lsp-diag-set %{
@@ -260,3 +261,4 @@ hook global User lsp-enabled %{
lsp-diag-set
}
}
+~
From b654a2f5724a04f5ad4bb2b0a2488cec8e649c82 Mon Sep 17 00:00:00 2001
From: Daniel Fichtinger
Date: Tue, 10 Jun 2025 15:13:33 -0400
Subject: [PATCH 55/71] AutoYADM commit: 2025-06-10 15:13:33
---
.config/kak/autoload/lsp.kak | 21 ++++++++++++---------
1 file changed, 12 insertions(+), 9 deletions(-)
diff --git a/.config/kak/autoload/lsp.kak b/.config/kak/autoload/lsp.kak
index 87b922e2..5e389c57 100644
--- a/.config/kak/autoload/lsp.kak
+++ b/.config/kak/autoload/lsp.kak
@@ -237,15 +237,7 @@ define-command -params 2 lsp-diag-query %{
}
}
-hook global KakEnd .* %{
- nop %sh{
- printf 'exit\n' >"$kak_opt_diagpipe_in"
- read result < "$kak_opt_diagpipe_out"
- }
-}
-
-
-hook global User lsp-enabled %{
+define-command lsp-diag-hover-enable %{
hook window User lsp-diag-hover-false %{
try inlay-diagnostics-off
}
@@ -260,5 +252,16 @@ hook global User lsp-enabled %{
hook window WinSetOption lsp_inline_diagnostics=.* %{
lsp-diag-set
}
+ hook global KakEnd .* %{
+ nop %sh{
+ printf 'exit\n' >"$kak_opt_diagpipe_in"
+ read result < "$kak_opt_diagpipe_out"
+ }
+ }
+
+}
+
+hook global User lsp-enabled %{
+ lsp-diag-hover-enable
}
~
From f096e44679de13816c2983baa393f1dd0f1f6bd8 Mon Sep 17 00:00:00 2001
From: Daniel Fichtinger
Date: Tue, 10 Jun 2025 15:28:37 -0400
Subject: [PATCH 56/71] AutoYADM commit: 2025-06-10 15:28:37
---
.config/kak/autoload/lsp.kak | 14 +++++++-------
.config/kak/scripts/lsp-diags.py | 18 ++++++++++++++----
2 files changed, 21 insertions(+), 11 deletions(-)
diff --git a/.config/kak/autoload/lsp.kak b/.config/kak/autoload/lsp.kak
index 5e389c57..a9ca4889 100644
--- a/.config/kak/autoload/lsp.kak
+++ b/.config/kak/autoload/lsp.kak
@@ -237,6 +237,13 @@ define-command -params 2 lsp-diag-query %{
}
}
+hook global KakEnd .* %{
+ nop %sh{
+ printf 'exit\n' >"$kak_opt_diagpipe_in"
+ read result < "$kak_opt_diagpipe_out"
+ }
+}
+
define-command lsp-diag-hover-enable %{
hook window User lsp-diag-hover-false %{
try inlay-diagnostics-off
@@ -252,13 +259,6 @@ define-command lsp-diag-hover-enable %{
hook window WinSetOption lsp_inline_diagnostics=.* %{
lsp-diag-set
}
- hook global KakEnd .* %{
- nop %sh{
- printf 'exit\n' >"$kak_opt_diagpipe_in"
- read result < "$kak_opt_diagpipe_out"
- }
- }
-
}
hook global User lsp-enabled %{
diff --git a/.config/kak/scripts/lsp-diags.py b/.config/kak/scripts/lsp-diags.py
index 2bd6a30a..e9b30345 100755
--- a/.config/kak/scripts/lsp-diags.py
+++ b/.config/kak/scripts/lsp-diags.py
@@ -9,6 +9,7 @@ import os
import tempfile
import signal
import types
+import selectors
Position = tuple[int, int]
SpecList = list[tuple[Position, Position]]
@@ -104,12 +105,21 @@ def main():
sys.stdout.flush()
daemonize(in_path, out_path, fifo_dir)
- with open(in_path, "r") as infile, open(out_path, "w") as outfile:
- diagnostics: SpecList = []
- while True:
- line = infile.readline()
+ sel = selectors.DefaultSelector()
+ infile = open(in_path, "r", buffering=1)
+ outfile = open(out_path, "w", buffering=1)
+ sel.register(infile.fileno(), selectors.EVENT_READ, data=infile)
+
+ # with open(in_path, "r") as infile, open(out_path, "w") as outfile:
+ diagnostics: SpecList = []
+ while True:
+ for key, _ in sel.select(timeout=None):
+ infile_obj = key.data
+ line = infile_obj.readline()
+ # line = infile.readline()
if not line:
continue
+ line = line.strip()
assert isinstance(line, str)
# # subprocess.run(["notify-send", f"Received command: {line}"])
if line.startswith("set "):
From 5a1ce73215698d54db8cd1bd9883998d5fd4011e Mon Sep 17 00:00:00 2001
From: Daniel Fichtinger
Date: Tue, 10 Jun 2025 15:43:48 -0400
Subject: [PATCH 57/71] AutoYADM commit: 2025-06-10 15:43:47
---
.config/kak/scripts/lsp-diags.py | 144 +-----------------------------
.config/kak/scripts/lsp-diags_.py | 132 +++++++++++++++++++++++++++
2 files changed, 133 insertions(+), 143 deletions(-)
mode change 100755 => 120000 .config/kak/scripts/lsp-diags.py
create mode 100755 .config/kak/scripts/lsp-diags_.py
diff --git a/.config/kak/scripts/lsp-diags.py b/.config/kak/scripts/lsp-diags.py
deleted file mode 100755
index e9b30345..00000000
--- a/.config/kak/scripts/lsp-diags.py
+++ /dev/null
@@ -1,143 +0,0 @@
-#!/usr/bin/env python
-
-# pyright: basic, reportUnusedCallResult=false
-
-import atexit
-import subprocess
-import sys
-import os
-import tempfile
-import signal
-import types
-import selectors
-
-Position = tuple[int, int]
-SpecList = list[tuple[Position, Position]]
-
-diagnostics: SpecList = []
-
-
-def parse_specs(data: str):
- parsed: SpecList = []
- for entry in data.strip().split():
- if not entry or len(entry) < 9:
- continue
- range_part, _ = entry.split("|", 1)
- start_str, end_str = range_part.split(",")
- sl, sc = map(int, start_str.split("."))
- el, ec = map(int, end_str.split("."))
- parsed.append(((sl, sc), (el, ec)))
- return parsed
-
-
-def is_cursor_in_any(cursor: Position, diagnostics: SpecList) -> bool:
- cl, cc = cursor
- for (sl, sc), (el, ec) in diagnostics:
- if cl < sl or cl > el:
- continue
- if sl == el:
- if cl == sl and sc <= cc <= ec:
- return True
- elif cl == sl:
- if cc >= sc:
- return True
- elif cl == el:
- if cc <= ec:
- return True
- elif sl < cl < el:
- return True
- return False
-
-
-def cleanup(inp: str, outp: str, dir: str):
- # subprocess.run(["notify-send", "cleanup runs"])
- try:
- os.remove(inp)
- os.remove(outp)
- os.rmdir(dir)
- except FileNotFoundError:
- pass
-
-
-def gen_kakoune_output(inp: str, outp: str) -> str:
- return f"declare-option -hidden str diagpipe_in {inp}\ndeclare-option -hidden str diagpipe_out {outp}"
-
-
-def daemonize(inp: str, outp: str, dir: str):
- # fork and exit parent
- if os.fork() > 0:
- sys.exit(0)
- # new session
- os.setsid()
- if os.fork() > 0:
- # exit first child
- sys.exit(0)
-
- # redirect IO to /dev/null
- with open("/dev/null", "rb", 0) as dn:
- os.dup2(dn.fileno(), sys.stdin.fileno())
- with open("/dev/null", "ab", 0) as dn:
- os.dup2(dn.fileno(), sys.stdout.fileno())
- os.dup2(dn.fileno(), sys.stderr.fileno())
- _ = atexit.register(lambda: cleanup(inp, outp, dir))
-
- def on_exit(*_):
- # cleanup(inp, outp, dir)
- sys.exit(0)
-
- signal.signal(signal.SIGTERM, on_exit)
- signal.signal(signal.SIGINT, on_exit)
-
-
-def main():
- # subprocess.run(["notify-send", "begin loop"])
- # create unique directory and names
- fifo_dir = tempfile.mkdtemp(prefix="diagpipe-")
- in_path = os.path.join(fifo_dir, "in")
- out_path = os.path.join(fifo_dir, "out")
-
- # create fifos
- os.mkfifo(in_path)
- os.mkfifo(out_path)
-
- output = gen_kakoune_output(in_path, out_path)
- print(output)
- sys.stdout.flush()
- daemonize(in_path, out_path, fifo_dir)
-
- sel = selectors.DefaultSelector()
- infile = open(in_path, "r", buffering=1)
- outfile = open(out_path, "w", buffering=1)
- sel.register(infile.fileno(), selectors.EVENT_READ, data=infile)
-
- # with open(in_path, "r") as infile, open(out_path, "w") as outfile:
- diagnostics: SpecList = []
- while True:
- for key, _ in sel.select(timeout=None):
- infile_obj = key.data
- line = infile_obj.readline()
- # line = infile.readline()
- if not line:
- continue
- line = line.strip()
- assert isinstance(line, str)
- # # subprocess.run(["notify-send", f"Received command: {line}"])
- if line.startswith("set "):
- # subprocess.run(["notify-send", f"Received set: {line}"])
- _, payload = line.split(" ", 1)
- diagnostics = parse_specs(payload)
- _ = outfile.write("ok\n")
- outfile.flush()
- elif line.startswith("query "):
- _, pos = line.split(" ", 1)
- l, c = map(int, pos.strip().split())
- result = is_cursor_in_any((l, c), diagnostics)
- _ = outfile.write("true\n" if result else "false\n")
- outfile.flush()
- elif line.startswith("exit"):
- # subprocess.run(["notify-send", "exit received"])
- sys.exit(0)
-
-
-if __name__ == "__main__":
- main()
diff --git a/.config/kak/scripts/lsp-diags.py b/.config/kak/scripts/lsp-diags.py
new file mode 120000
index 00000000..732dc5e5
--- /dev/null
+++ b/.config/kak/scripts/lsp-diags.py
@@ -0,0 +1 @@
+/home/fic/dev/kak-lsp-diags/lsp-diags.py
\ No newline at end of file
diff --git a/.config/kak/scripts/lsp-diags_.py b/.config/kak/scripts/lsp-diags_.py
new file mode 100755
index 00000000..dd548ed2
--- /dev/null
+++ b/.config/kak/scripts/lsp-diags_.py
@@ -0,0 +1,132 @@
+#!/usr/bin/env python
+
+# pyright: basic, reportUnusedCallResult=false
+
+import atexit
+import sys
+import os
+import tempfile
+import signal
+
+Position = tuple[int, int]
+SpecList = list[tuple[Position, Position]]
+
+diagnostics: SpecList = []
+
+
+def parse_specs(data: str):
+ parsed: SpecList = []
+ for entry in data.strip().split():
+ if not entry or len(entry) < 9:
+ continue
+ range_part, _ = entry.split("|", 1)
+ start_str, end_str = range_part.split(",")
+ sl, sc = map(int, start_str.split("."))
+ el, ec = map(int, end_str.split("."))
+ parsed.append(((sl, sc), (el, ec)))
+ return parsed
+
+
+def is_cursor_in_any(cursor: Position, diagnostics: SpecList) -> bool:
+ cl, cc = cursor
+ for (sl, sc), (el, ec) in diagnostics:
+ if cl < sl or cl > el:
+ continue
+ if sl == el:
+ if cl == sl and sc <= cc <= ec:
+ return True
+ elif cl == sl:
+ if cc >= sc:
+ return True
+ elif cl == el:
+ if cc <= ec:
+ return True
+ elif sl < cl < el:
+ return True
+ return False
+
+
+def cleanup(inp: str, outp: str, dir: str):
+ # subprocess.run(["notify-send", "cleanup runs"])
+ try:
+ os.remove(inp)
+ os.remove(outp)
+ os.rmdir(dir)
+ except FileNotFoundError:
+ pass
+
+
+def gen_kakoune_output(inp: str, outp: str) -> str:
+ return f"declare-option -hidden str diagpipe_in {inp}\ndeclare-option -hidden str diagpipe_out {outp}"
+
+
+def daemonize(inp: str, outp: str, dir: str):
+ # fork and exit parent
+ if os.fork() > 0:
+ sys.exit(0)
+ # new session
+ os.setsid()
+ if os.fork() > 0:
+ # exit first child
+ sys.exit(0)
+
+ # redirect IO to /dev/null
+ with open("/dev/null", "rb", 0) as dn:
+ os.dup2(dn.fileno(), sys.stdin.fileno())
+ with open("/dev/null", "ab", 0) as dn:
+ os.dup2(dn.fileno(), sys.stdout.fileno())
+ os.dup2(dn.fileno(), sys.stderr.fileno())
+ _ = atexit.register(lambda: cleanup(inp, outp, dir))
+
+ def on_exit(*_):
+ # cleanup(inp, outp, dir)
+ sys.exit(0)
+
+ signal.signal(signal.SIGTERM, on_exit)
+ signal.signal(signal.SIGINT, on_exit)
+
+
+def main():
+ # subprocess.run(["notify-send", "begin loop"])
+ # create unique directory and names
+ fifo_dir = tempfile.mkdtemp(prefix="diagpipe-")
+ in_path = os.path.join(fifo_dir, "in")
+ out_path = os.path.join(fifo_dir, "out")
+
+ # create fifos
+ os.mkfifo(in_path)
+ os.mkfifo(out_path)
+
+ output = gen_kakoune_output(in_path, out_path)
+ print(output)
+ sys.stdout.flush()
+ daemonize(in_path, out_path, fifo_dir)
+
+ with open(in_path, "r") as infile, open(out_path, "w") as outfile:
+ diagnostics: SpecList = []
+ while True:
+ line = infile.readline()
+ if not line:
+ continue
+ line = line.strip()
+ assert isinstance(line, str)
+ # # subprocess.run(["notify-send", f"Received command: {line}"])
+ if line.startswith("set "):
+ # subprocess.run(["notify-send", f"Received set: {line}"])
+ _, payload = line.split(" ", 1)
+ diagnostics = parse_specs(payload)
+ _ = outfile.write("ok\n")
+ outfile.flush()
+ elif line.startswith("query "):
+ _, pos = line.split(" ", 1)
+ l, c = map(int, pos.strip().split())
+ result = is_cursor_in_any((l, c), diagnostics)
+ _ = outfile.write("true\n" if result else "false\n")
+ outfile.flush()
+ elif line.startswith("exit"):
+ # subprocess.run(["notify-send", "exit received"])
+ sys.exit(0)
+
+
+if __name__ == "__main__":
+ main()
From 8cfd745ef9a8e3ffd15a3b42611df05963ed2327 Mon Sep 17 00:00:00 2001
From: Daniel Fichtinger
Date: Tue, 10 Jun 2025 19:10:39 -0400
Subject: [PATCH 58/71] AutoYADM commit: 2025-06-10 19:10:39
---
.config/nvchecker/new_ver.json | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/.config/nvchecker/new_ver.json b/.config/nvchecker/new_ver.json
index 95f09db9..7d4ca670 100644
--- a/.config/nvchecker/new_ver.json
+++ b/.config/nvchecker/new_ver.json
@@ -2,9 +2,9 @@
"version": 2,
"data": {
"codebook": {
- "version": "0.3.0",
- "gitref": "refs/tags/v0.3.0",
- "url": "https://github.com/blopker/codebook/releases/tag/v0.3.0"
+ "version": "0.3.2",
+ "gitref": "refs/tags/v0.3.2",
+ "url": "https://github.com/blopker/codebook/releases/tag/v0.3.2"
},
"iwe": {
"version": "iwe-v0.0.33",
From d4d2836c97ec932b30914dfc34512a114c49bd18 Mon Sep 17 00:00:00 2001
From: Daniel Fichtinger
Date: Tue, 10 Jun 2025 19:41:37 -0400
Subject: [PATCH 59/71] AutoYADM commit: 2025-06-10 19:41:37
---
.config/nvchecker/old_ver.json | 6 +++---
.config/nvchecker/old_ver.json~ | 6 +++---
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/.config/nvchecker/old_ver.json b/.config/nvchecker/old_ver.json
index 95f09db9..7d4ca670 100644
--- a/.config/nvchecker/old_ver.json
+++ b/.config/nvchecker/old_ver.json
@@ -2,9 +2,9 @@
"version": 2,
"data": {
"codebook": {
- "version": "0.3.0",
- "gitref": "refs/tags/v0.3.0",
- "url": "https://github.com/blopker/codebook/releases/tag/v0.3.0"
+ "version": "0.3.2",
+ "gitref": "refs/tags/v0.3.2",
+ "url": "https://github.com/blopker/codebook/releases/tag/v0.3.2"
},
"iwe": {
"version": "iwe-v0.0.33",
diff --git a/.config/nvchecker/old_ver.json~ b/.config/nvchecker/old_ver.json~
index 4998ee2f..95f09db9 100644
--- a/.config/nvchecker/old_ver.json~
+++ b/.config/nvchecker/old_ver.json~
@@ -7,9 +7,9 @@
"url": "https://github.com/blopker/codebook/releases/tag/v0.3.0"
},
"iwe": {
- "version": "iwe-v0.0.32",
- "gitref": "refs/tags/iwe-v0.0.32",
- "url": "https://github.com/iwe-org/iwe/releases/tag/iwe-v0.0.32"
+ "version": "iwe-v0.0.33",
+ "gitref": "refs/tags/iwe-v0.0.33",
+ "url": "https://github.com/iwe-org/iwe/releases/tag/iwe-v0.0.33"
},
"kak-tree-sitter": {
"version": "2.0.0",
From a8d8881de4fca0e9b40d59dbf06f49c2d5fc8574 Mon Sep 17 00:00:00 2001
From: Daniel Fichtinger
Date: Tue, 10 Jun 2025 22:48:37 -0400
Subject: [PATCH 60/71] AutoYADM commit: 2025-06-10 22:48:37
---
.config/kak/autoload/lsp.kak | 55 ------------------------------------
1 file changed, 55 deletions(-)
diff --git a/.config/kak/autoload/lsp.kak b/.config/kak/autoload/lsp.kak
index a9ca4889..a989a712 100644
--- a/.config/kak/autoload/lsp.kak
+++ b/.config/kak/autoload/lsp.kak
@@ -210,58 +210,3 @@ hook -group lsp-filetype-typst global BufSetOption filetype=typst %{
# lsp-menu %arg{@}
# }
-provide-module lsp-diag %~
-evaluate-commands %sh{ ${kak_config}/scripts/lsp-diags.py }
-
-define-command lsp-diag-set %{
- evaluate-commands %sh{
- printf 'set %s\n' "$kak_opt_lsp_inline_diagnostics" >"$kak_opt_diagpipe_in"
- read result < "$kak_opt_diagpipe_out"
- if [ "$result" != "ok" ]; then
- echo "info 'lsp-diag failed to set'"
- else
- echo "nop"
- fi
- }
-}
-
-define-command -params 2 lsp-diag-query %{
- evaluate-commands %sh{
- printf 'query %s %s\n' "$1" "$2" >"$kak_opt_diagpipe_in"
- read result < "$kak_opt_diagpipe_out"
- if [ "$result" = "true" ]; then
- echo "trigger-user-hook lsp-diag-hover-true"
- else
- echo "trigger-user-hook lsp-diag-hover-false"
- fi
- }
-}
-
-hook global KakEnd .* %{
- nop %sh{
- printf 'exit\n' >"$kak_opt_diagpipe_in"
- read result < "$kak_opt_diagpipe_out"
- }
-}
-
-define-command lsp-diag-hover-enable %{
- hook window User lsp-diag-hover-false %{
- try inlay-diagnostics-off
- }
-
- hook window User lsp-diag-hover-true %{
- try inlay-diagnostics-on
- }
-
- hook window NormalIdle .* %{
- lsp-diag-query %val{cursor_line} %val{cursor_column}
- }
- hook window WinSetOption lsp_inline_diagnostics=.* %{
- lsp-diag-set
- }
-}
-
-hook global User lsp-enabled %{
- lsp-diag-hover-enable
-}
-~
From 1060fe681b9c4d30008f4b907bdbc30b15358add Mon Sep 17 00:00:00 2001
From: Daniel Fichtinger
Date: Wed, 11 Jun 2025 00:35:24 -0400
Subject: [PATCH 61/71] AutoYADM commit: 2025-06-11 00:35:24
---
.config/kak/autoload/lsp.kak | 1 +
1 file changed, 1 insertion(+)
diff --git a/.config/kak/autoload/lsp.kak b/.config/kak/autoload/lsp.kak
index a989a712..28c1e6d7 100644
--- a/.config/kak/autoload/lsp.kak
+++ b/.config/kak/autoload/lsp.kak
@@ -1,5 +1,6 @@
# load plugin
eval %sh{kak-lsp}
+# eval %sh{kak-lsp-diags}
# mappings
map global user l ': enter-user-mode lsp' -docstring 'LSP mode'
From 3a559394d6eb83189ec65b0bc24f20e02bfa5de9 Mon Sep 17 00:00:00 2001
From: Daniel Fichtinger
Date: Wed, 11 Jun 2025 15:56:37 -0400
Subject: [PATCH 62/71] AutoYADM commit: 2025-06-11 15:56:37
---
.config/kak/autoload/notes.kak | 287 +++++++++++++++++++++++++++++++++
.config/kak/kakrc | 1 +
2 files changed, 288 insertions(+)
create mode 100644 .config/kak/autoload/notes.kak
diff --git a/.config/kak/autoload/notes.kak b/.config/kak/autoload/notes.kak
new file mode 100644
index 00000000..42c5d2c8
--- /dev/null
+++ b/.config/kak/autoload/notes.kak
@@ -0,0 +1,287 @@
+provide-module notes %~
+# Global directory for notes.
+declare-option str notes_root_dir "%sh{ echo $HOME/notes/kak }"
+
+# Active directory.
+#
+# Global directory (`notes_root_dir`) or a local override.
+declare-option str notes_active_dir "%opt{notes_root_dir}"
+
+declare-option str notes_sym_todo 'TODO'
+declare-option str notes_sym_wip 'WIP'
+declare-option str notes_sym_done 'DONE'
+declare-option str notes_sym_wontdo 'WONTDO'
+declare-option str notes_sym_idea 'IDEA'
+declare-option str notes_sym_question 'QUESTION'
+declare-option str notes_sym_hold 'HOLD'
+declare-option str notes_sym_review 'REVIEW'
+declare-option str notes_find 'fd -t file .md'
+declare-option -hidden str notes_tasks_list_current_line
+declare-option -hidden str notes_journal_now
+
+# Main notes mode.
+declare-user-mode notes
+
+# Mode to edit tasks.
+declare-user-mode notes-tasks
+
+# Mode to list tasks.
+declare-user-mode notes-tasks-list
+
+# Mode to navigate journal.
+declare-user-mode notes-journal-nav
+
+# Mode to navigate journal (last journals).
+declare-user-mode notes-journal-nav-last
+
+set-face global notes_todo green
+set-face global notes_wip blue
+set-face global notes_done black
+set-face global notes_wontdo black
+set-face global notes_idea green
+set-face global notes_question cyan
+set-face global notes_hold red
+set-face global notes_review yellow
+
+set-face global notes_issue cyan+u
+set-face global notes_subtask_uncheck green
+set-face global notes_subtask_check black
+set-face global notes_tag blue+i
+
+# Open the daily journal.
+define-command notes-journal-open -docstring 'open daily journal' %{
+ nop %sh{
+ mkdir -p "$kak_opt_notes_active_dir/journal/$(date +%Y/%b)"
+ }
+
+ evaluate-commands %{
+ edit "%opt{notes_active_dir}/journal/%sh{ date '+%Y/%b/%a %d' }.md"
+ set-option buffer notes_journal_now %sh{ date }
+ }
+}
+
+# Open a journal relative to today.
+define-command -hidden notes-journal-open-rel -params -1 %{
+ nop %sh{
+ mkdir -p "$kak_opt_notes_active_dir/journal/$(date -d ""$kak_opt_notes_journal_now $1"" +%Y/%b)"
+ }
+
+ evaluate-commands %{
+ edit -existing "%opt{notes_active_dir}/journal/%sh{ date -d ""$kak_opt_notes_journal_now $1"" ""+%Y/%b/%a %d"" }.md"
+ set-option buffer notes_journal_now %sh{ date -d """$kak_opt_notes_journal_now $1""" }
+ }
+}
+
+# Open a note by prompting the user with a menu.
+define-command notes-open -docstring 'open note' %{
+ prompt -menu -shell-script-candidates "$kak_opt_notes_find $kak_opt_notes_active_dir/notes" 'open note:' %{
+ edit %sh{
+ echo "${kak_text%.md}.md"
+ }
+ }
+}
+
+# Create a new note by prompting the user for its text.
+define-command notes-new-note -docstring 'new note' %{
+ prompt note: %{
+ edit %sh{
+ echo "$kak_opt_notes_active_dir/notes/${kak_text%.md}.md"
+ }
+ }
+}
+
+# Archive a note by prompting the user for which note to operate on.
+define-command notes-archive-note -docstring 'archive note' %{
+ prompt -menu -shell-script-candidates "$kak_opt_notes_find $kak_opt_notes_active_dir/notes" archive: %{
+ nop %sh{
+ mkdir -p "$kak_opt_notes_active_dir/archives"
+ mv "$kak_text" "$kak_opt_notes_active_dir/archives/"
+ }
+ }
+}
+
+# Prompt the user to pick and open an archived note.
+define-command notes-archive-open -docstring 'open archive' %{
+ prompt -menu -shell-script-candidates "$kak_opt_notes_find $kak_opt_notes_active_dir/archives" 'open archive:' %{
+ edit %sh{
+ echo "${kak_text%.md}.md"
+ }
+ }
+}
+
+# Capture a new note.
+define-command notes-capture -docstring 'capture' %{
+ prompt capture: %{
+ nop %sh{
+ echo -e "> $(date '+%a %b %d %Y, %H:%M:%S')\n$kak_text\n" >> "$kak_opt_notes_active_dir/capture.md"
+ }
+ }
+}
+
+# Open the capture file.
+define-command notes-open-capture -docstring 'open capture' %{
+ edit "%opt{notes_active_dir}/capture.md"
+}
+
+# Switch the status of a note to the input parameter.
+define-command notes-task-switch-status -params 1 -docstring 'switch task' %{
+ execute-keys -draft "gife_c%arg{1}"
+}
+
+# Open a GitHub issue. This requires a specific formatting of the file.
+define-command notes-task-gh-open-issue -docstring 'open GitHub issue' %{
+ evaluate-commands -save-regs 'il' %{
+ try %{
+ execute-keys -draft 'w"iy'
+ execute-keys -draft '%sgithub_project: ;_"ly'
+ nop %sh{
+ open "https://github.com/$kak_reg_l/issues/$kak_reg_i"
+ }
+ }
+ }
+}
+
+define-command -hidden notes-tasks-list-by-regex -params 1 -docstring 'list tasks by status' %{
+ edit -scratch *notes-tasks-list*
+ unset-option buffer notes_tasks_list_current_line
+ execute-keys "%%d|rg -n --column -e '%arg{1}' '%opt{notes_active_dir}/notes' '%opt{notes_active_dir}/journal' '%opt{notes_active_dir}/capture.md'|sortgg"
+}
+
+# List all tasks.
+define-command notes-tasks-list-all -docstring 'list all tasks' %{
+ notes-tasks-list-by-regex "%opt{notes_sym_todo}\|%opt{notes_sym_wip}\|%opt{notes_sym_done}\|%opt{notes_sym_wontdo}\|%opt{notes_sym_idea}\|%opt{notes_sym_question}\|opt{notes_sym_hold}"
+}
+
+# Command executed when pressing