My collection of Acme notes and scripts
Acme is a Zen-style text editor.
Using Acme you sacrifice:
What you gain is that instead of spending too much time configuring your editor, you will focus on actual working.
The killer feature of Acme is how it integrates into surrounding system. Acme is not trying to be a complete environment by itself. Acme acts as a glue which links together other programs and tools. With Acme the OS becomes your IDE.
mkdir $HOME/9 && cd $HOME/9
git clone https://github.com/9fans/plan9port/ && cd plan9port
./INSTALL
sudo apt-get install gcc libx11-dev libxt-dev libxext-dev libfontconfig1-dev
git clone https://github.com/9fans/plan9port $HOME/plan9
cd $HOME/plan9/plan9port
./INSTALL -r $HOME/plan9
export PLAN9="/path/to/plan9port"
export PATH="$PATH:$PLAN9/bin"
Run font server:
fontsrv
In case it's not installed:
cd /path/to/plan9port/src/cmd/fontsrv/
9 mk install
Have a look at all available fonts:
9p ls font
Try one of them:
acme -f /mnt/font/'Droid Sans Mono'/13a/font
I spawn Acme by running a
script.
Who is who in bin directory:
a
start Acmeb
create an indented C-like block { ... }
c SYMBOL
/uc SYMBOL
comment/uncomment selectioncommit MESSAGE
commit and push to mastercss
and cssify
transform abbreviations into CSS propertiesf TEXT
find TEXT using The Silver Searcherhd SYMBOL
draw a pretty headinghtm
feed selection to Pug
html
HTML boilerplatei
/ui
indent/unindent selectionlstrip
remove leading whitespacet2s N_SPACES
/s2t N_SPACES
tabs <=> spacesupper
/lower
convert selection to uppercase/lowercasePut these guys in your $PATH.
Edit =
find out the current line number:13
goto 13th line:0
goto file beginning:$
goto file end:1,$
or :,
or Edit 1,$
or Edit ,
select all lines:1,5
or Edit 1,5
select lines 1..5Edit , d
clear windowEdit , < echo hello world
replace window body with some textEdit , < erl -man maps
replace window body with erlang manualEdit , s/text/TEXT/g
or Edit , | sed 's/text/TEXT/g'
global replace$%
or $samfile
current file name$winid
current window idecho some text | 9p write acme/$winid/body
append to the end of current windowctrl-u
delete from cursor to start of linectrl-w
delete word before the cursorctrl-h
delete character before the cursorctrl-a
move cursor to start of the linectrl-e
move cursor to end of the linectrl-i
tabctrl-j
enterctrl-f
filepath autocompletionfn-*left arrow*
go home (macOS)fn-*right arrow*
go end (macOS):+/foobar
, :/foobar
and just foobar
search forward:-/foobar
search backwardsesc
to select the last typed textesc
again to delete any selected textFont
switch between fonts:/^hel
regexp match: lines starting with 'hel':/lo\n/
regexp match: lines ending with 'lo':/^b/,/^e/
regexp match: lines between starting with 'b' and starting with 'e'Dump
write the state of acme to the fileLoad
restore from the dumpEdit , > python
pipe window body through python interpreterEdit +/hello
search 'hello' forwardEdit -/hello
search 'hello' backwardEdit , > wc -l
count lines in fileEdit , | sort
sort linesEdit 3,5p
print lines 3..5 in new windowEdit 3,5 | upper
lines 3..5 upper casedEdit 3,5 s/HE/he/g
replace on 3..5 lines onlyEdit 2 d
delete 2nd lineEdit 2 c/new
change 2nd lineEdit 2 a/new
append text after 2nd lineEdit 2 i/new
insert text before 2nd lineEdit 2 < date
replace 2nd line with the output of dateEdit ,x/^TODAY$/ < date
replace matching lines with the output of dateEdit ,x/Plan9/ |tr a-z A-Z
replace all instances of Plan9 with upper caseEdit 3,5x/^/ a/ /
indent lines 3..5 with 1 tabYou can do amazing things with Sam commands:
Edit ,x/Acme/ {
i/I love
c/Sam
a/ editor!
}
| sed '' > file.txt
> sed '' > file.txt
> awk '{ print(toupper($1)) }' | sort | nl > file.txt
win
start shell in a new windowpage FILE
view graphics filesweb URL
open url in your browserPut in your .bashrc
## If inside Acme...
if [ "$winid" ]; then
## ... then patch the `cd` command
_cd () {
\cd "$@" && awd
}
alias cd=_cd
fi