Added spelling function and se add file

This commit is contained in:
Jonas Forsberg 2020-08-18 14:48:40 +02:00
parent ca517707ff
commit 567a253d53
No known key found for this signature in database
GPG Key ID: F2E9818C70350CC9
2 changed files with 16 additions and 1 deletions

0
.vim/spell/sv.utf-8.add Normal file
View File

17
.vimrc
View File

@ -10,6 +10,18 @@ function! MakeHeading(level)
endif
endfunction
function! Spelling(lang)
if a:lang == "en"
setlocal spell spelllang=en_us
setlocal spellfile=~/.vim/spell/en.utf-8.add
elseif a:lang == "sv"
setlocal spell spelllang=sv
setlocal spellfile=~/.vim/spell/sv.utf-8.add
elseif a:lang == "off"
setlocal nospell
endif
endfunction
nnoremap <Left> :echo "No left for you!"<CR>
vnoremap <Left> :<C-u>echo "No left for you!"<CR>
@ -40,6 +52,10 @@ let mapleader=" "
map <Leader>ss :call FixLastSpellingError()<CR>
map <Leader>u1 :call MakeHeading(1)<CR>
map <Leader>u2 :call MakeHeading(2)<CR>
map <Leader>ls :call Spelling("sv")<CR>
map <Leader>le :call Spelling("en")<CR>
map <Leader>lo :call Spelling("off")<CR>
filetype indent plugin on
@ -54,7 +70,6 @@ set relativenumber
execute pathogen#infect()
" Spellcheck
set spellfile=~/.vim/spell/en.utf-8.add
" vimwiki
let wiki_1 = {}