mirror of
https://codeberg.org/diginaut/dotfiles.git
synced 2026-05-06 20:24:10 +02:00
vim spellchecking: toggle/loop with F7 through none/nl/en_gb/en_us
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -48,6 +48,32 @@ let g:ctrlp_switch_buffer = 0
|
|||||||
|
|
||||||
" == Content convenience ======
|
" == 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
|
" Python autocompletion
|
||||||
Plugin 'davidhalter/jedi-vim'
|
Plugin 'davidhalter/jedi-vim'
|
||||||
" Code checker. For python, install flake8 or pylint, preferably in the
|
" Code checker. For python, install flake8 or pylint, preferably in the
|
||||||
|
|||||||
Reference in New Issue
Block a user