On 2008-10-06, Anton Sharonov <[EMAIL PROTECTED]> wrote:

> 2008/10/6, pwnb0t <[EMAIL PROTECTED]>:
> >
> > I searched and did not find a valid answer to what I'm trying to do.
> >
> > When I press enter on an indented line (say, line 1), it takes me to
> > line 2 with the proper indentation.  If I press enter again without
> > changing line 2, it takes me to line 3 with the proper indentation on
> > line 3, but the problem is that all tabs are now missing on line 2.
> > How do I get vim to leave the tabs rather than deleting them?

> IIUC, you should use
> 
> :setlocal noexpandtab
> 
> or, if you prefer it in every file you can
> 
> :set noexpandtab
> 
> in your ~/.vimrc
> 
> Please, read this as well:
> 
> :help set
> :help setlocal
> :help expandtab
> 
> Anton.

I don't think that's it.  The "problem" (which I consider a 
feature), can be illustrated like this:

Start vim and set the following:

   :set ai
   :set nu
   :set list

Now type "hello" on the first line, indented by four spaces, and hit 
Enter.  You should see this:

  1     hello$
  2     $
        ^
        cursor is here, in column 5

Now hit Enter again.  You should see this:

  1     hello$
  2 $
  3     $
        ^
        cursor is here, in column 5, but the indentation has been 
        removed from line 2

but the OP wants to see this:

  1     hello$
  2     $
  3     $

with line 2 still containing the indentation even though there is 
nothing else on that line.

That's my understanding of the question, anyway.  I don't know the 
answer, though.

Regards,
Gary


--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to