From 567a253d538b5170f38d6b0630bbe7d0f3625276 Mon Sep 17 00:00:00 2001 From: Jonas Forsberg Date: Tue, 18 Aug 2020 14:48:40 +0200 Subject: [PATCH] Added spelling function and se add file --- .vim/spell/sv.utf-8.add | 0 .vimrc | 17 ++++++++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 .vim/spell/sv.utf-8.add diff --git a/.vim/spell/sv.utf-8.add b/.vim/spell/sv.utf-8.add new file mode 100644 index 0000000..e69de29 diff --git a/.vimrc b/.vimrc index ac1bf01..b8734da 100644 --- a/.vimrc +++ b/.vimrc @@ -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 :echo "No left for you!" vnoremap :echo "No left for you!" @@ -40,6 +52,10 @@ let mapleader=" " map ss :call FixLastSpellingError() map u1 :call MakeHeading(1) map u2 :call MakeHeading(2) +map ls :call Spelling("sv") +map le :call Spelling("en") +map lo :call Spelling("off") + 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 = {}