Blob


1 UNIX is all about files and programs that do one thing and to it well,
2 right? `vi(1)` is one of my favorite text editors. However it lacks
3 some feature: but here's where the *composition* shines.
5 It's stupid and dead-simple actually, but I haven't thought
6 about it until some weeks ago. With a simple
8 map « :w^M:!aspell -c %^M:e!^M^M
10 in your `~/.nexrc` it's simple to do spell checking in `vi`.
12 **Friendly remainder**: the `^M` is literally the *enter* key inserted
13 with `C-v ENTER` or `C-v C-m`.
15 I've also the following binding in my `~/.nexrc` to spell check
16 Italian text:
18 map » :w^M:!aspell --lang=it -c %^M:e!^M^M
21 ### What's that gibberish?
23 OK, it may be non-obvious what that that mapping does, so let's split
24 it into pieces:
26 - `map «` starts a mapping on the `«` key
27 - `:w^M` writes the current file (the return is necessary to *enter* the command)
28 - `:!aspell -c %^M` run aspell over the file (`%` is replaced with the current file name)
29 - `:e!^M` force vi to re-read the file
30 - `^M` Tell vi to render the editor. After a command execution vi doesn't render its interface. Rather, it wait (a bit like `ex`) for a command.
32 ### Why the `«` and `»` characters?
34 Those keys aren't bind to anything and are simple to type with my keyboard layout.