From 368143a5bdcdc9a8be51c6ecbad6b83f1e3e10a9 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Fri, 13 Jul 2018 09:02:32 +1200 Subject: Disable 'spellcapcheck' for README.md files This is because such files very often have headings or sentences that start with filenames. --- vim/after/ftplugin/markdown.vim | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'vim/after') diff --git a/vim/after/ftplugin/markdown.vim b/vim/after/ftplugin/markdown.vim index d13bba8f..63f3f062 100644 --- a/vim/after/ftplugin/markdown.vim +++ b/vim/after/ftplugin/markdown.vim @@ -3,8 +3,20 @@ if &filetype !=# 'markdown' || v:version < 700 finish endif -" Spellcheck documents we're actually editing (not just viewing) -if has('spell') && &modifiable && !&readonly - setlocal spell - let b:undo_ftplugin .= '|setlocal spell<' +" Spellchecking features +if has('spell') + + " Spellcheck documents we're actually editing (not just viewing) + if &modifiable && !&readonly + setlocal spell + let b:undo_ftplugin .= '|setlocal spell<' + endif + + " Tolerate leading lowercase letters in README.md files, for things like + " headings being filenames + if expand('%:t') ==# 'README.md' + setlocal spellcapcheck= + let b:undo_ftplugin .= '|setlocal spellcapcheck<' + endif + endif -- cgit v1.2.3