diff options
-rw-r--r-- | vim/after/ftplugin/markdown.vim | 10 | ||||
-rw-r--r-- | vim/after/ftplugin/text.vim | 10 |
2 files changed, 12 insertions, 8 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 diff --git a/vim/after/ftplugin/text.vim b/vim/after/ftplugin/text.vim index cd35231e..06ca464a 100644 --- a/vim/after/ftplugin/text.vim +++ b/vim/after/ftplugin/text.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 |