1
0
mirror of https://github.com/aquatix/dotfiles.git synced 2025-12-06 20:35:11 +01:00

vim spellchecking: toggle/loop with F7 through none/nl/en_gb/en_us

This commit is contained in:
Michiel Scholten
2015-03-06 11:23:15 +01:00
parent 1dcf8541b7
commit 7d9d71fe5d
3 changed files with 26 additions and 0 deletions

BIN
.vim/spell/nl.utf-8.spl Normal file

Binary file not shown.

BIN
.vim/spell/nl.utf-8.sug Normal file

Binary file not shown.

26
.vimrc
View File

@@ -48,6 +48,32 @@ let g:ctrlp_switch_buffer = 0
" == Content convenience ======
" Spell Check (http://vim.wikia.com/wiki/Toggle_spellcheck_with_function_keys)
let b:myLang=0
let g:myLangList=["nospell","nl","en_gb","en_us"]
function! ToggleSpell()
let b:myLang=b:myLang+1
if b:myLang>=len(g:myLangList) | let b:myLang=0 | endif
if b:myLang==0
setlocal nospell
else
execute "setlocal spell spelllang=".get(g:myLangList, b:myLang)
endif
echo "spell checking language:" g:myLangList[b:myLang]
endfunction
nmap <silent> <F7> :call ToggleSpell()<CR>
" In case the spelling language was set by other means than ToggleSpell() (a filetype autocommand say):
if !exists( "b:myLang" )
if &spell
let b:myLang=index(g:myLangList, &spelllang)
else
let b:myLang=0
endif
endif
" Python autocompletion
Plugin 'davidhalter/jedi-vim'
" Code checker. For python, install flake8 or pylint, preferably in the