I enabled spell checking in a buffer with set spell spelllang=en which works. If I save the session with mksession! and later source it back with vim -S Session.vim, spellchecking is no longer enabled.

How can I save spell checking an spell language in a Session file (and apply it)?

1 Answer 1


The spell and spelllang options are local options and by default sessions only store global options.

You can change this behavior by updating sessionoptions to also include localoptions:

set sessionoptions+=localoptions

The reason why local options are typically not stored in a session file is that they're normally managed by per-filetype plugins, and those plug-ins will be reloaded when the session is restored. Not storing local options gives the plug-ins the opportunity to set options differently, which might be useful or relevant when restoring a session after upgrading plug-ins.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.