diff --git a/.vimrc b/.vimrc index 8448f2d..15fb4da 100644 --- a/.vimrc +++ b/.vimrc @@ -138,7 +138,7 @@ set statusline+=\ %P " percent through file " => Keymaps: Doing more things at once " turn off search highlight -nnoremap :nohls +nnoremap :nohls " toggle row/column cursor nnoremap c :set cursorline! cursorcolumn! @@ -197,16 +197,32 @@ imap =strftime("%H:%M") " --------------------------------------------------------------------------------------------------------------------- +" --------------------------------------------------------------------------------------------------------------------- +" ==> Spellcheck: only certain file types https://robots.thoughtbot.com/vim-spell-checking + +" turn off for files with no extension +autocmd BufRead,BufNewFile * setlocal nospell +" turn off for files with any extension +autocmd BufRead,BufNewFile *.* setlocal nospell + +" turn on for markdown files +autocmd BufRead,BufNewFile *.md setlocal spell +" turn on for text files +autocmd BufRead,BufNewFile *.txt setlocal spell + " ==> Spellcheck -" Horrible colors! I hate spellchecker's red highlight, so I changed it -" (http://stackoverflow.com/questions/6008921/how-do-i-change-the-highlight-style-in-vim-spellcheck) -" Vim Colors: (http://alvinalexander.com/linux/vi-vim-editor-color-scheme-syntax) + +set spell spelllang=en_us " Toggle spell check with F10 nnoremap :setlocal spell! spelllang=en_us -set spell spelllang=en_us -" Save custom dictionary in nextcloud so it's available on all machines -" set spellfile=/home/chawley/nextcloud-overlook/notes/system/en.utf-8.add + +" auto-complete spelling suggestions with +set complete+=kspell + +" Horrible colors! I hate spellchecker's red highlight, so I changed it +" (http://stackoverflow.com/questions/6008921/how-do-i-change-the-highlight-style-in-vim-spellcheck) +" Vim Colors: (http://alvinalexander.com/linux/vi-vim-editor-color-scheme-syntax) hi clear SpellBad hi clear SpellCap hi clear SpellErrors @@ -215,17 +231,6 @@ hi clear SpellRare hi SpellBad cterm=underline ctermbg=black ctermfg=red hi SpellCap cterm=underline ctermbg=black ctermfg=red -" --------------------------------------------------------------------------------------------------------------------- -" ==> Spellcheck: only certain file types https://robots.thoughtbot.com/vim-spell-checking - -" turn off for files with no extension -autocmd BufRead,BufNewFile * setlocal nospell -" turn off for files with any extension -autocmd BufRead,BufNewFile *.* setlocal nospell -" turn on for markdown files -autocmd BufRead,BufNewFile *.md setlocal spell -" turn on for text files -autocmd BufRead,BufNewFile *.txt setlocal spell " --------------------------------------------------------------------------------------------------------------------- " ==> Snippets