Skip to content

Instantly share code, notes, and snippets.

declare-option -hidden range-specs fold_regions 0
add-highlighter global/fold-regions replace-ranges fold_regions
# range-specs option format:
# - a timestamp (like %val{timestamp})
# - zero or more "a.b,c.d|string", where:
# - a is the start line
# - b is the start byte in the start line
# - c is the end line
import collections
import dataclasses
import re
import subprocess
import sys
import typing
VERSIONED_DEP_RE = re.compile(r" \([^)]*\)")
MAX_X = 320
MAX_Y = 240
POINT_A = {MAX_X/2, 0 } // top middle
POINT_B = {0, MAX_Y} // bottom left
POINT_C = {MAX_X, MAX_Y} // bottom right
// we greyscale, baby!
COLOR_B = 192
Screwtapello / werder.c
Created June 21, 2020 12:03
Snoof Generator v1.1
* Snoof Generator v1.1
* Dave Olszewski 4/25/1997
* updated 8/12/1998
* A relatively inefficient way
* to make snoof
declare-option completions example
set-option -add global completers option=example
set-option global example 1.1@1 hello||HELLO world||WORLD

Setting Up Games for Gargoyle

So, you've acquired a work of interactive fiction, and you'd like to play it in Gargoyle. Interactive fiction works have been published in many forms over the decades, some easy to use, some less so. The exact steps you need to follow depend on what format it's currently in,

  • Launch Services (does not use a login shell)
    • Finder
    • Kitty
      • bash #1 (login shell)
        • kak -s apple
      • bash #2 (login shell)
        • kak -s apple
          • connects to the Kakoune inside bash #1, and so you see the bash #1 environment (also a login shell)
      • bash #3 (login shell)
  • kitty @ new-window kak -s banana
Screwtapello / tree-custom.kak
Created December 29, 2018 20:50
Mappings for kak-tree
declare-user-mode tree
map -docstring "prev" global tree <left> ": tree-select-prev-node<ret>"
map -docstring "parent" global tree <up> ": tree-select-node<ret>"
map -docstring "next" global tree <right> ": tree-select-next-node<ret>"
map -docstring "children" global tree <down> ": tree-select-children<ret>"
hook global WinSetOption filetype=.* %{
evaluate-commands %sh{
if command -V kak-tree >/dev/null 2>/dev/null &&
declare-option -hidden int last_state_save_history_id 0
declare-option str state_save_path %sh{
echo ${XDG_DATA_HOME:-~/.local/share/}/kak/state-save/
define-command \
-docstring "Save the current selection state for this file" \
state-save \
%{ evaluate-commands %sh{
# Readline has a bunch of special-case bindings just for vi mode, which means we
# can't just add Kakoune-style bindings; instead, we must build Kakoune-style
# bindings from combinations of other (usually emacs-based) commands. BUT
# Readline doesn't support binding a key to a sequence of commands; instead,
# we bind commands to a likely-unused portion of the keymap, and then bind
# our actual keys to sequences of those unusual keys.
"\C-a\C-xm": set-mark
"\C-a\C-xh": backward-char
"\C-a\C-xl": forward-char
"\C-a\C-xw": forward-word