Friday, October 4, 2013

Re: why is vim autoindenting even if set noautoindent is on?

On 05/10/13 03:46, DwigtArmyOfChampions wrote:
> I type "set noai" to disable auto-indents, but when I have, for example, a piece of code like the following:
>
> int main() {
> }
>
> If I put my cursor on the end of the line on the first curly brace, type "i" to go into Insert mode, and then hit return, it still indents with a tab character. Why is this happening if auto-indent is turned off?
>
Check your vimrc for one or more of the following lines (each of them
also sets indenting for the filetypes which have one filetype-related
indent mode defined):

filetype plugin indent on
filetype indent on
runtime vimrc_example.vim
source $VIMRUNTIME/vimrc_example.vim

If you have one or more of them, then either remove the word "indent"
from (each of) the :filetype command(s), or add

filetype indent off

after sourcing vimrc_example.vim (for the last time, if there are more
than one).


See
:help :filetype
:help 'cindent'
:help 'indentexpr'
:help :verbose


Best regards,
Tony.
--
A pickup with three guys in it pulls into the lumber yard. One of the men
gets out and goes into the office.
"I need some four-by-two's," he says.
"You must mean two-by-four's" replies the clerk.
The man scratches his head. "Wait a minute," he says, "I'll go
check."
Back, after an animated conversation with the other occupants of the
truck, he reassures the clerk, that, yes, in fact, two-by-fours would be
acceptable.
"OK," says the clerk, writing it down, "how long you want 'em?"
The guy gets the blank look again. "Uh... I guess I better go
check," he says.
He goes back out to the truck, and there's another animated
conversation. The guy comes back into the office. "A long time," he says,
"we're building a house".

--
--
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/groups/opt_out.

No comments: