Browse Source

Add spellcheck highlight toggle

Andrew Swistak 8 years ago
parent
commit
7bf54c4ce1
1 changed files with 10 additions and 1 deletions
  1. 10 1
      vimrc

+ 10 - 1
vimrc

@@ -4,6 +4,7 @@ Helptags
 filetype plugin indent on
 
 set encoding=utf-8
+set spelllang=en_us
 
 " Search settings
 set incsearch
@@ -62,6 +63,15 @@ let mapleader="\<space>"
 nnoremap j gj
 nnoremap k gk
 
+nnoremap <leader>S :call ToggleSpellCheck()<cr>
+function! ToggleSpellCheck()
+  if &spell ==# "nospell"
+    set spell
+  else
+    set nospell
+  endif
+endfunction
+
 " Set CTRL+S to save becuase I smack that every 10 seconds on whatever application I use
 command! -nargs=0 Save if &modified | confirm write | endif
 nnoremap <silent> <C-s> :Save<CR>
@@ -219,7 +229,6 @@ map <leader><A-/><space> <plug>NERDCommenterComment
 
 let g:tex_flavor = "latex"
 let g:LatexBox_latexmk_options = "-pvc -pdfps"
-au FileType tex setlocal spell spelllang=en_us
 
 """"""""""""""""""""""""""""
 " Rails.vim