A video, More Instantly Better Vim (fast forward to 1m00s), inspired me to write a Bash script, starwarsed.sh, which does similar job, but not as good as that Vim plugin. Anyway, I didn’t actually watch the video or try any code, just for that Star Wars video part.

https://cdn.rawgit.com/livibetter/7371102/raw/a79408061da2939584e8708d03c6ec49a444af3e/starwarsed-gray.gif

My Bash script uses fold and nroff. Even I am a first time user of nroff, I am sure not many people have even tried to use it. It took me a while to figure out how to use it for full justified text.

The script also utilizes 256-color, so you can see fading text. Just little fancy stuff. That probably sums up all goods. It’s very primitive, no options, and you have to pipe in:

$ <example.txt ./starwarsed.sh
$ cat example.txt | ./starwarsed.sh

I am a bit of lazy as per my excuse, however, this script does meet my expectation.

While I was learning nroff, almost gave up, because I didn’t realize that \p is needed in order to have full justified text, and I couldn’t even find an example code just for full justification. Probably too simple to make one. I was really considering to code in Python, or just dropped it. Fortunately, I came up the right code.

Anyway, if you want to improve the code, go head to fork.