lfs-uefi: fix efivar-37 FTBFS
[linux_from_scratch_hints.git] / mutt+aspell.txt
blob3771dd2ce32e180a34650a8abfff066a2dfff449
1 AUTHOR: Archaic <archaic at remove-this.indy.rr.com>
3 DATE: 2003-09-13
5 LICENSE: GNU Free Documentation License http://www.gnu.org/licenses/fdl.txt
7 SYNOPSIS: Setting up Mutt and/or Vim to use Aspell.
9 DESCRIPTION: With this hint you can configure Vim to spell check your documents
10 and emails or you can set up Mutt if you use a different editor.
12 PREREQUISITES: None
14 HINT: This hint will be split into two parts. The first part will be
15 configuring Vim to spell check, the other will be for Mutt alone.
17 You do not need to do both, but it won't hurt if you do. You will just have two
18 different ways of spell-checking.
20 ### Setting up Vim to use Aspell ###
22 Install aspell as per the BLFS book:
23 http://beyond.linuxfromscratch.org/view/cvs/general/aspell.html
25 Edit your vimrc to include:
27 map ^T :w!<CR>:!aspell check %<CR>:e! %<CR>
29 NOTE: ^T is <ctrl-t>, but in Vim you have to type <ctrl-v> to type control
30 characters. Thus you need to replace ^T with <ctrl-v><ctrl-t>
32 Once you save your vimrc, any time you are in Vim's command mode, typing
33 <ctrl-t> will cause the screen to split showing the aspell commands at the
34 bottom.
36 If you use Vim as your editor in Mutt, you're all set to spell-check.
38 But wait! There's more!
40 If you are replying to an email and you hit <ctrl-t> aspell will attempt to
41 spell-check the headers, signature, and all the quoted lines in addition to
42 what you actually wrote. There is a nifty little app called newsbody that will
43 allow us to copy just the body of the message to a temporary file, edit it
44 (spell-check it), then put it back into the original message, leaving headers
45 and sigs alone. It also allows us to ignore quoted lines.
47 You can get newsbody in a package called spellutils here:
48 http://home.worldonline.dk/byrial/spellutils/spellutils-0.7.tar.bz2
50 ./configure &&
51 make &&
52 install -m755 newsbody /usr/bin
53 install -m644 newsbody.1 /usr/share/man/man1
55 NOTE: spellutils also builds a file pospell if you're interested in
56 spell-checking .po files.
58 Now that newsbody is installed add the following lines to your vimrc:
59 map ^R \1\2<CR>:e! %<CR>
60 map \1 :w!<CR>
61 map \2 :!newsbody -qs -n % -p aspell check \%f<CR>
63 These lines simply let you run aspell without having to check the sig, headers,
64 or quoted text. Treat ^R the same as ^T above. You can also change the letter
65 to suit your needs.
67 Now you have a way to spell-check regular documents and emails with either
68 <ctrl-t> or <ctrl-r>. You can stop here, or optionally continue on. There is no
69 added functionality below. Just a different way of doing the same thing.
71 ### Setting up Mutt to use Aspell ###
73 NOTE: I use Vim in mutt but the following should work on your editor of choice
74 as these are mutt-specific, not editor-specific.
76 The default command to spell-check in Mutt is "i". There are 2 ways in which to
77 invoke newsbody and aspell in mutt. We can either call a simple script, or we
78 can write a macro. I will discuss both.
80 Script method:
82 cat >/usr/bin/spellcheck <<"EOF"
83 newsbody -hqs -n $2 -p aspell check %f
84 EOF
85 chmod 755 /usr/bin/spellcheck
87 add the following to your muttrc:
89 set ispell="/usr/bin/spellcheck"
91 -or-
93 Macro method:
95 add the following to your muttrc:
97 macro compose i \
98         "<filter-entry>newsbody -hqs -n - -p aspell check %f<enter>" \
99         "run aspell on the selected part"
101 I hope you've found this useful. Please email any suggestions or corrections to
102 the above address. Remove the "remove-this." from my address.
104 CHANGELOG:
105 [2004-05-24]
106  * Created hint
107 [2003-09-13]
108  * Updated to new hints format