vim-sensible icon indicating copy to clipboard operation
vim-sensible copied to clipboard

:set smarttab and TeX

Open laurentvees opened this issue 12 years ago • 6 comments

Since I've installed sensible, vim adds an extra indentation after every line starting with \item (on .tex files), which is quite inconvenient. Even stranger:

  • when I started this issue, every new \item had one indentation more than the previous
  • then after switching autoindent, smarttab smartindent off and on I found that smarttab was the guilty option, the extra indent came only to the lines following an \indent but if the line starts with \item the extra indent goes off
  • when I'm opening a new .tex file (without any changes in my .vimrc) there is no added indentation but the option remains in the other .tex file even after closing and reopening it.

laurentvees avatar Dec 29 '13 12:12 laurentvees

Can't reproduce. What are the values of 'shiftwidth' and 'softtabstop'?

tpope avatar Dec 29 '13 15:12 tpope

shiftwidth=4, softtabstop=4.

It's very strange, I can't reproduce this effect in an other file neither.

laurentvees avatar Dec 29 '13 15:12 laurentvees

Might want to check the filetype (tex vs plaintex).

On Sun, Dec 29, 2013 at 10:47 AM, lvaneesbeeck [email protected]:

shiftwidth=4, softtabstop=4.

It's very strange, I can't reproduce this effect in an other file neither.

— Reply to this email directly or view it on GitHubhttps://github.com/tpope/vim-sensible/issues/67#issuecomment-31319206 .

tpope avatar Dec 29 '13 16:12 tpope

Right! The auto indentation is set with filetype=tex, while filetype=plaintex doesn't make it. How can I change the default filetype/where can I find what's done with a particular filetype?

Thanks!

laurentvees avatar Dec 29 '13 16:12 laurentvees

It'll be in $VIMRUNTIME in either ftplugin/tex.vim or indent/tex.vim. You can override with a corresponding file in ~/.vim/after.

I can't reproduce with either filetype, and I'll stress that 'smarttab' is unlikely to be the culprit, as the only thing it changes is what happens when you hit the tab key on your keyboard.

tpope avatar Dec 29 '13 17:12 tpope