Reworked Spell Check Section

Removed the global nospell autocommands:
  The lines `autocmd BufRead,BufNewFile * setlocal nospell` and
  `autocmd BufRead,BufNewFile *.* setlocal nospell` have been removed.
  These were turning off spell checking for all files.
This commit is contained in:
2025-04-15 13:05:56 -04:00
parent d2821c7df6
commit aaf5d31567

27
.vimrc
View File

@@ -294,38 +294,35 @@ imap <C-S-i> <C-R>=strftime("%Y-%m-%d %a")<CR>
imap <F4> <C-R>=strftime("%Y-%m-%d")<CR>
" ---------------------------------------------------------------------------------------------------------------------
" ==> Spellcheck
" ==> Spellcheck
" auto-complete spelling suggestions with <ctrl-p>
" auto-complete spelling suggestions with <ctrl-p>
set complete+=kspell
autocmd FileType markdown setlocal complete+=kspell
autocmd FileType text setlocal complete+=kspell
autocmd FileType gitcommit setlocal complete+=kspell
" Toggle spell check highlights with <F10>
" Toggle spell check highlights with <F10>
nnoremap <F10> :setlocal spell! spelllang=en_us<CR>
" ==> Spellcheck: only certain file types
" https://robots.thoughtbot.com/vim-spell-checking
" 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
" turn on for markdown files
autocmd BufRead,BufNewFile *.md setlocal spell
" turn on for text files
" turn on for text files
autocmd BufRead,BufNewFile *.txt setlocal spell
" turn on for git commits
autocmd FileType gitcommit setlocal spell spelllang=en_us
" ==> Spellcheck Colors
"
" I hate spellcheck's default colors
" (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)
" I hate spellcheck's default colors
" (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 SpellLocal