From 34e3398c4ce7353813b63e4126c9e6adb157f316 Mon Sep 17 00:00:00 2001 From: BertrandSim <46756885+BertrandSim@users.noreply.github.com> Date: Wed, 4 Aug 2021 17:16:25 +0800 Subject: [PATCH] prepend backslashes to `=word`s in 'indentkeys' Currently, inserting tex keywords `item`, `else`, `fi`, and tex delimiters autoindents the current line. However, there are some words that are part of these keywords. (For example, 'fix', 'figure', are part of 'fi'.) In these cases, it would be better _not_ to autoindent the current line. Adding a backslash to these keywords and tex delimiters will reduce the number of unexpected autoindents (autoindent only on `\item`, `\else`, `\fi`, etc.) --- indent/tex.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/indent/tex.vim b/indent/tex.vim index 87804ca5ac..733a30129b 100644 --- a/indent/tex.vim +++ b/indent/tex.vim @@ -20,12 +20,12 @@ set cpoptions&vim setlocal autoindent setlocal indentexpr=VimtexIndentExpr() -setlocal indentkeys=!^F,o,O,(,),],},\&,=item,=else,=fi +setlocal indentkeys=!^F,o,O,(,),],},\&,=\\item,=\\else,=\\fi " Add standard closing math delimiters to indentkeys for s:delim in [ \ 'rangle', 'rbrace', 'rvert', 'rVert', 'rfloor', 'rceil', 'urcorner'] - let &l:indentkeys .= ',=' . s:delim + let &l:indentkeys .= ',=\' . s:delim endfor