diff --git a/.config/vim/xdg.vim b/.config/vim/xdg.vim index 1db7e4a..46303a8 100644 --- a/.config/vim/xdg.vim +++ b/.config/vim/xdg.vim @@ -46,8 +46,15 @@ endif let &spellfile = $XDG_DATA_HOME . '/vim/spell/' . &spelllang . '.utf-8.add' augroup xdg_spellfile au! + " TODO: This throws `E523: not allowed here` on `:e` as the modeline is + " reread. Suppress or better check for sandbox/modeline before + " executing au OptionSet spelllang let &spellfile = \ $XDG_DATA_HOME . '/vim/spell/' . v:option_new . '.utf-8.add' + " NOTE: Changing &spellfile is not allowed from a modeline, so we need to + " update it manually after the modeline was read + au BufWinEnter * let &spellfile = + \ $XDG_DATA_HOME . '/vim/spell/' . &spelllang . '.utf-8.add' augroup end set runtimepath-=~/.vim runtimepath^=$XDG_CONFIG_HOME/vim