A short description of my Acme setup

This is a short description of my Acme setup, mostly so that I don’t forget the details.

And Acme from plan9port.

LSP

I use gopls as the language server for Go development, clangd for C/C++, and rls for Rust.

Hardware

I mostly use Acme with an Evoluent VerticalMouse 4, because that makes things like the 2-1 chord easier to perform and a vertical mouse is easier on the wrist than a regular flat mouse.

If I’m not at my desk, using Acme with just the touchpad and Ctrl/Alt (on Linux) or Command/Option (on MacOS) works nicely as well.

Scripts

This is the script I use to start Acme:

 1#!/usr/bin/env -S 9 rc -x
 2
 3# Starts all the stuff required for Acme to work nicely
 4
 59 plumber
 6
 7if (~ `{pgrep fontsrv} '') {
 8	9 fontsrv &
 9}
10
11if (~ `{pgrep autokey} '') {
12	autokey &
13}
14
15if (~ $fontsz '') {
16	fontsz=13
17}
18
19monospace=DejaVuSansMono
20proportional=DejaVuSans
21
22acmebin=$home^/plan9port/bin/acme
23
24$acmebin -a \
25	-l /home/gbe/acme.dump \
26	-F '/mnt/font/'^$monospace^'/'^$fontsz^'a/font' \
27	-f '/mnt/font/'^$proportional^'/'^$fontsz^'a/font' &
28
29sleep 1
30acmefocused &
31acme-lsp &
32Adefaults &
33

Adefaults is the following script. It adds default options to the tag line of various Acme windows, depending on the file name:

 1#!/bin/bash
 2
 39p read acme/log | while read line; do
 4	winid=$(echo "$line" | cut -d' ' -f1)
 5	action=$(echo "$line" | cut -d' ' -f2)
 6	fname=$(echo "$line" | cut -d' ' -f3-)
 7
 8	if [[ "$action" != "new" ]]; then
 9		continue
10	fi
11
12	if [[ -d "$fname" ]]; then
13		(
14			if [[ -e "$fname"/go.mod ]]; then
15				printf "Lws+ "
16			fi
17		) | 9p write acme/$winid/tag
18	else
19		# Regular file
20		(
21			printf " |I- |I+ "
22
23			case "$fname" in
24				*.beancount)
25					printf '[fava $%%] :$ '
26					;;
27				*.md|*/guide)
28					printf "|fmt |Check"
29					;;
30				*.go|*.cpp|*.h|*.rs|*.ml|*.mli)
31					printf "Lfmt Ldef Lrefs Lhov "
32					;;
33				*.py)
34					printf "[Edit ,x/	/c/    /] "
35					;;
36				*/COMMIT_EDITMSG|*.jjdescription)
37					printf "|fmt "
38					;;
39			esac
40		) | 9p write acme/$winid/tag
41	fi
42done