From: Nicolas Boisselier Date: Mon, 16 Dec 2024 10:14:59 +0000 (+0100) Subject: etc/vim/source/spell.vim X-Git-Url: https://git.nbdom.net/?a=commitdiff_plain;h=5008fe3e2dfde059aec1a3241c46a99024bec0d2;p=nb.git etc/vim/source/spell.vim --- diff --git a/etc/vim/source/spell.vim b/etc/vim/source/spell.vim index 4f452eb1..5d46558e 100644 --- a/etc/vim/source/spell.vim +++ b/etc/vim/source/spell.vim @@ -1,7 +1,13 @@ set spell " Disable spell checking for code +"echo ">>" . &filetype +autocmd BufRead,BufNewFile * if &filetype == "" && expand('%:e') !~ 'mail' | setlocal nospell | endif +" autocmd BufReadPost * if expand('%:e') =~ 'txt\|md\|markdown' | setlocal spell | else | setlocal nospell | endif +"autocmd BufRead,BufNewFile * if &filetype != "" | echo "SPELL" | endif +"autocmd FileType * if &filetype == "" | setlocal nospell | endif autocmd FileType sh,perl,php,vim,python,c,cpp,java,javascript setlocal nospell "autocmd FileType sh syntax match Comment /\v#.*/ contains=@Spell "autocmd FileType sh syntax region Comment start=/^#/ end=/^\S/ contains=@Spell "autocmd FileType sh syntax region Comment start=/^#/ end=/^[^#]/ contains=@Spell "autocmd FileType sh syntax region Comment start=/^#/ end=/[\r\n]$/ contains=@Spell +"autocmd FileType text setlocal spell