Thursday, June 5, 2014

Re: I realise smart indenting is not working

On 2014-06-06, Philip Rhoades wrote:
> People,
>
> I have been using vim for a long time but finally got bored hitting
> TAB to do indenting on code - I tried to work out why "smart
> indenting" after the usual stuff "for", "class" etc wasn't working
> but couldn't see what the problem was. I found out that Fedora 20 is
> installing Vim 7.4 and all that stuff should "work out of the box" -
> I renamed my .vim dir and .vimrc file and still no difference. I
> logged in as a basic user with no .vim or .vimrc and still no joy . .
>
> Can someone enlighten me? I must be missing something no?

"Smart indenting" isn't all that smart. My understanding is that it
was an attempt to improve Vim's indenting capabilities but it never
acquired enough knowledge of real programming languages to be really
useful.

Use Vim's "automatic indenting" instead. See

:help 30.3
:help :filetype

which boils down to putting this line in your ~/.vimrc:

filetype indent on

Now it should "just work". There can be situations where it
doesn't, though, as when you edit programs written in a language
that Vim doesn't recognize, so if it doesn't work for you, come back
with an example and we'll see what we can do to help.

Regards,
Gary

--
--
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: