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