Created
July 10, 2014 14:25
-
-
Save echosa/a5fd4b6637718c455e43 to your computer and use it in GitHub Desktop.
Delete trailing spaces in Acme
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Removes trailing spaces from entire window. | |
# Run as `trail` (no | or < necessary) | |
# Inspired by: | |
# http://www.mostlymaths.net/2013/03/extensibility-programming-acme-text-editor.html | |
echo -n "0,$" | 9p write acme/$winid/addr | |
9p read acme/$winid/body | sed 's/ *$//g' | 9p write acme/$winid/data | |
echo -n "0,0" | 9p write acme/$winid/addr | |
echo -n "dot=addr" | 9p write acme/$winid/ctl | |
echo -n "show" | 9p write acme/$winid/ctl |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment