Thursday, September 8, 2016

Re: Annoying "smart" indentation

On Thursday, August 25, 2016 at 10:27:15 AM UTC-4, Ben Fritz wrote:
> On Friday, August 19, 2016 at 3:45:16 PM UTC-5, otajuun wrote:
> > As per the documentation, I tried adding "filetype indent off" at the end, to no effect. I can turn off that annoying "feature" on a per-file basis by doing:
> >
> > :set indentexpr=
> >
> > But I have to do it for every single file I open, which is beyond annoying.
> >
>
> That's weird. The "filetype indent off" at the end of your .vimrc should have worked.
>
> When you have a file open which has the unwanted auto-indenting, what is the output of ":verbose set indentexpr?"?
>
> This should tell you which script set the option. If it's not an indent script, that's the problem. If it IS an indent script, then I'm not sure why it's being sourced, since you have turned off filetype indent.

Hello, sorry for the late reply. I performed a clean install, so I still have the stock config in /usr/share/vim

If I try ":verbose set indentexpr?", for a C file I get nothing, it just says:
indentexpr=

But for a Makefile (which also does smart indent), I get:
indentexpr=GetMakeIndent()
Last set from /usr/share/vim/vim74/indent/make.vim


My /etc/vimrc looks like this:
:set nocompatible
:syntax on
:set nu
:set iminsert=0
:set imdisable
:set noswf
:set ts=4
:set shiftwidth=4
:set autoindent
:set bs=2
filetype indent off


And I don't have any .vimrc or other vim config file that I know of.

I suppose I'll once again edit /usr/share/vim/vim74/defaults.vim, changing
filetype plugin indent on
to
filetype plugin on

So that it doesn't auto-load the indentation settings for the filetype.

It completely fixes my issue, but I still find it weird that the behaviour changed all of a sudden.

Thank you,
Jonathan

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments: