I want to disable autoindent and smartindent for LaTeX so I did
:set noai noci nosi
When I open a brand new mwe.tex
, filetype=plaintex
and there is no auto indent magic.
When I then enter some code, such as \begin{frame}\end{frame}
, save and reopen the file, filetype=tex
, colours have changed, and... there is what to me looks like both auto indent and smart indent going on:
- I start typing
\begin{frame}
at the beginning of the line, so far so good - I press enter, and the cursor is indented by four spaces, despite setting
noai
,noci
, andnosi
. At this point,:set
shows:
--- Options ---
background=dark helplang=en shiftwidth=4 ttyfast
commentstring=%%s nomodeline showmatch ttymouse=xterm
expandtab modified suffixesadd=.tex
filetype=tex ruler syntax=tex
foldmethod=indent scroll=34 tabstop=4
backspace=indent,eol,start
comments=sO:% -,mO:% ,eO:%%,:%
define=\\\([egx]\|char\|mathchar\|count\|dimen\|muskip\|skip\|toks\)\=def\|\\font\|\\\(future\)\
=let\|\\new\(count\|dimen\|skip\|muskip\|box\|toks\|read\|write\|fam\|insert\)\|\\\(re\)\=new\(boo
lean\|command\|counter\|environment\|font\|if\|length\|savebox\|theorem\(style\)\=\)\s*\*\=\s*{\=\
|DeclareMathOperator\s*{\=\s*
fileencoding=utf-8
fileencodings=ucs-bom,utf-8,default,latin1
include=\\input\|\\include{
includeexpr=substitute(v:fname, '^.\{-}{\|}.*', '', 'g')
indentexpr=GetTeXIndent()
indentkeys=0{,0},:,0#,!^F,o,O,e,[,(,{,),},],&,=\bibitem,=\item
- I type
\end{frame
at the indented base. After I add a}
, it gets automatically dedented (with a fraction of a second delay).
From :scriptnames
, I can tell there are scripts loaded at /usr/share/vim/vim80/indent.vim
, /usr/share/vim/vim80/syntax/tex.vim
, /usr/share/vim/vim80/ftplugin/tex.vim
, and /usr/share/vim/vim80/indent/tex.vim
. So it looks like there is a script overriding the standard vim settings. How do I configure the behaviour of this script?