*vimchant.txt*          Vimchant - spell-checker plugin             2008-08-31


Description     Vimchant is a simple but efficient spell-checker plugin. It 
                provides fast on-the-fly spell-checking while typing and 
                editing text. Vimchant uses Enchant as its back-end program. 
                Enchant, in turn, is a front-end for several different 
                spell-checkers, including Voikko, Zemberek, Hunspell and 
                Myspell, for example. This plugin does not provide Enchant 
                itself; it's a separate component included in modern GNU/Linux 
                systems.

Author          Teemu Likonen <tlikonen@iki.fi>


==============================================================================
COMMANDS                                              *:VimchantSpellCheckOn*
                                                      *:VimchantSpellCheckOff*

The spell-checker can be turned on and off with the following ex commands:

        :VimchantSpellCheckOn
        :VimchantSpellCheckOff

There are also two keymappings available in normal mode:

        <Leader>ss      Spell-checking on/off
        <Leader>sl      Change the language (prompts for language code)

By default, <Leader> is the backslash key but it can be configured with 
g:mapleader variable. Consult the Vim reference manual for more information on 
<Leader>.

Spell-checker's state as well as the language settings are buffer-specific. 
That is, you can have spell-checker active only in some buffers and you can 
use different languages in different buffers. Settings are preserved while 
navigating through buffers but only the text in active window is actually 
checked for spelling.

==============================================================================
CONFIGURATION                                                *vimchant-config*


Keymaps ~

The default keymaps <Leader>ss and <Leader>sl are available only if they have 
not been taken by some other plugin or already defined by user. You can always 
bind them to other keys or key combinations with Vim's |:map| commands. For 
example, you could put these lines to your ~/.vimrc file:
>
        nmap <F7> <Plug>VimchantSpellCheckSwitch
        nmap <F8> <Plug>VimchantChangeLanguage

This would make <F7> the switching key and <F8> the language selector key.


Update interval ~

When the spell-checker is turned on the check is run every time when user 
stops moving the cursor and editing text. There's a short interval period 
which is determined by 'updatetime' option. It's 4000 milliseconds (i.e., 
4 seconds) by default but you might want to reduce the value a bit so that the 
spell-checker responds faster. For example, you could add the following line 
to your ~/.vimrc file:
>
        set updatetime=1000


Language ~

The LANG environment variable in GNU/Linux systems determines the default 
language used in spell-checking. Apart from changing the LANG variable there 
are two options for configuring languages from Vim. First, you can define 
a global Vim variable and put the preferred language code there:
>
        let g:vimchant_spellcheck_lang = 'fi'

You can also use local-to-buffer variables, for example:
>
        let b:vimchant_spellcheck_lang = 'en_GB'

As the names suggest, the global variable has global effect (all buffers) and 
local variables have local effect (current buffer). Local variables (if set 
and not empty) take preference over other settings; the global variable takes 
preference over the LANG environment variable.

Note: The <Leader>sl keymap actually just changes the local-to-buffer 
variable. It's provided for quick and convenient language switching.


Highlight ~

Misspelled words are highlighted with the same highlight color group which the 
Vim's internal spell-checker uses. The group is called "SpellBad". If you are 
unhappy with the default colors you can change them with |:highlight| command. 
An example:
>
        highlight SpellBad cterm=underline ctermbg=bg ctermfg=Red gui=undercurl guisp=Red


Disabling the plugin ~

The most part of this plugin is loaded into memory when the spell-checker is 
used for the first time. Only the very minimum is loaded automatically when 
Vim is started. To completely prevent Vim from loading this plugin you can put 
the following line to your ~/.vimrc file:
>
        let g:loaded_vimchant = 1


That's pretty much it. Happy typing! :-)

==============================================================================
vim: ft=help tw=78 ts=8 sts=8 et norl fo+=2aw
