summaryrefslogtreecommitdiff
path: root/home
diff options
context:
space:
mode:
Diffstat (limited to 'home')
-rw-r--r--home/neovim/init.vim4
1 files changed, 4 insertions, 0 deletions
diff --git a/home/neovim/init.vim b/home/neovim/init.vim
index 2fa6917..9073f00 100644
--- a/home/neovim/init.vim
+++ b/home/neovim/init.vim
@@ -231,6 +231,10 @@ augroup Sus
" Create some persistent syntax highlighting groups.
au Syntax * call s:AddSyntax()
+ " When 'textwidth' changes, we may need to recalculate.
+ au OptionSet textwidth call s:RemoveSyntax()
+ \ | call s:AddSyntax()
+
" Temporarily remove the groups when in insert mode.
au InsertEnter * call s:RemoveSyntax()
au InsertLeave * call s:AddSyntax()