diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2018-07-13 09:02:32 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2018-07-13 09:02:45 +1200 |
commit | 368143a5bdcdc9a8be51c6ecbad6b83f1e3e10a9 (patch) | |
tree | a14583ede11dd09ee8a780dd23e33dba11032d79 /vim | |
parent | Check for 'spell' feature in ftplugins (diff) | |
download | dotfiles-368143a5bdcdc9a8be51c6ecbad6b83f1e3e10a9.tar.gz dotfiles-368143a5bdcdc9a8be51c6ecbad6b83f1e3e10a9.zip |
Disable 'spellcapcheck' for README.md files
This is because such files very often have headings or sentences that
start with filenames.
Diffstat (limited to 'vim')
-rw-r--r-- | vim/after/ftplugin/markdown.vim | 20 |
1 files changed, 16 insertions, 4 deletions
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 |