Tuesday, February 3, 2015

Re: Vim Indent

On Tuesday, February 3, 2015 at 12:15:17 AM UTC-6, Harisha Navilarekallu wrote:
> On Tuesday, 3 February 2015 11:09:11 UTC+5:30, Ben Fritz wrote:
> > On Monday, February 2, 2015 at 9:21:39 PM UTC-6, Harisha Navilarekallu wrote:
> > > On my new laptop, I have installed gvim7.4 on Win-7.
> > > With this auto-indent is some how not working. I am not sure if any thing needs to be enabled / disabled.
> > > I use only C/C++:
> > >
> > > Few of the problems I am facing are:
> > >
> > > if ( cond )
> > > cond--; // Indent not working.
> > >
> > > The same code with Curly braces works fine:
> > >
> > > if ( cond ) {
> > > cond--; // <----- Indentation working here!!!!
> > > }
> > >
> > >
> > > int foo( ARG1,
> > > ARG2) // No indentation here!!!
> > > {
> > > }
> > >
> > > Note that the above is not corrected even if I force auto indent whole file using gg=G.
> > >
> > > I am not sure what is causing this problem.
> > > Earlier version which I was using with old laptop is working fine.
> > >
> > > I have installed few plugins like : MultiSearch, Tab-Auto completion, which I think should not affect the Auto-indent by any way.
> > >
> > > Any idea how to resolve this?
> > >
> >
> > Have you enabled filetype detection and indentation rules?
> >
> > I.e. does your .vimrc contain one of the following?
> >
> > filetype plugin indent on
> > filetype indent on
>
>
> I have added again - Nothing changes.
>
> I think its some thing to do with File type? The reason is when I try same thing in one of my older file, it perfectly works. I am not able to find the diff in file type.
> When I checked the file type using file command in Unix, it says:
> "test.cpp: ASCII C++ program text, with CRLF line terminators"
>
> When I try the old working file it says:
> "./test.cpp: ASCII English text"
>
> I tried changing the dos format to unix without success.

Vim *probably* handles Dos format just fine.

What does Vim think this file is?

Find out, with this command:

:set filetype? fileformat?

filetype should be cpp if your detection is enabled properly.

If fileformat isn't DOS, then you'll want to check your 'fileformats' setting (note the 's' on the end of this one).

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