Page 1 of 1

Multilingual spell checking in Vim - a partial HowTo.

Posted: 16. Jan 2012, 19:46
by globetrotterdk
1) The first step to implementing multilingual spell checking in Vim, was to download the files I needed from this site ftp://ftp.vim.org/pub/vim/runtime/spell/. I downloaded both the "latin1" and "utf-8" files for each respective language (Danish and Bahasa Indonesia), making sure to get both the files with the extension .spl and .sug

2) I then ran the following command from the directory where the files had been downloaded

Code: Select all

# cp *.* /usr/share/vim/vim73/spell/
3) I then added the following to my ~/.vimrc file

Code: Select all

" ---- set spelling options ----

set spell			"  spell check
set spelllang=en_us		"  languages

" ---- toggle spelling control-E -> en, control-D -> da, control-I -> id ---- 
map     <C-E>    :setlocal spell! spelllang=en<CR>
imap    <C-E>    <ESC>:setlocal spell! spelllang=en<CR>i
map     <C-D>    :setlocal spell! spelllang=da<CR>
imap    <C-D>    <ESC>:setlocal spell! spelllang=da<CR>i
map     <C-I>    :setlocal spell! spelllang=id<CR>
imap    <C-I>    <ESC>:setlocal spell! spelllang=id<CR>i
4) The current problem is that I have to press the relevant key combination twice, before the spelling language (spelllang) is switched. Does anyone have any ideas how to solve this glitch?