aboutsummaryrefslogtreecommitdiff
path: root/vim/after/ftplugin/markdown.vim
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2018-07-02 11:47:26 +1200
committerTom Ryder <tom@sanctum.geek.nz>2018-07-02 11:47:26 +1200
commit080d0352f34f918b5a96d95798011fb57c49a68f (patch)
treef204507450280ae0c8c33907756632c8e0b88c81 /vim/after/ftplugin/markdown.vim
parenta5b8367fd501fa2b28ea25518e8e22d905b2652f (diff)
downloaddotfiles-080d0352f34f918b5a96d95798011fb57c49a68f.tar.gz
dotfiles-080d0352f34f918b5a96d95798011fb57c49a68f.zip
Don't spellcheck &readonly text/markdown
This stops annoying highlighting when I'm just reading something in Vim, rather than editing it (e.g. `view` or an unwriteable file).
Diffstat (limited to 'vim/after/ftplugin/markdown.vim')
-rw-r--r--vim/after/ftplugin/markdown.vim10
1 files changed, 6 insertions, 4 deletions
diff --git a/vim/after/ftplugin/markdown.vim b/vim/after/ftplugin/markdown.vim
index 29d13c71..7ec37c64 100644
--- a/vim/after/ftplugin/markdown.vim
+++ b/vim/after/ftplugin/markdown.vim
@@ -12,7 +12,9 @@ let b:did_ftplugin_after = 1
let b:undo_ftplugin = b:undo_ftplugin
\ . '|unlet b:did_ftplugin_after'
-" Spellcheck documents
-setlocal spell
-let b:undo_ftplugin = b:undo_ftplugin
- \ . '|setlocal spell<'
+" Spellcheck documents we're actually editing (not just viewing)
+if !&readonly
+ setlocal spell
+ let b:undo_ftplugin = b:undo_ftplugin
+ \ . '|setlocal spell<'
+endif