Thursday, June 2, 2011

Re: how to auto-indent both Tab and Space indented lines?

On 2011-06-01, A117 wrote:
In my files, some lines are indented with Tab's, while others uses
spaces.
If I set cindent or smartindent, new lines after one set of these
lines cannot be auto-indented correctly.
So I have to set autoindent and add or remove indents manually when
necessary.
Cannot VIM auto discern previous line's indent style to auto indent a
new line?

See if either of these do what you need.

   :help copyindent
   :help preserveindent

Regards,
Gary

You might also wanna look at

:help 'tabstop'
:help 'shiftwidth'
:help 'expandtab'

Cheers,
Daniel

------------------------------------------------------------
Daniel CorrĂȘa
+55 (45) 9938.3993

No comments: