Re: how to avoid deleting the auto-indent in a new empty line when i press Esc

2007-04-17 Thread sun
You may even try (untested) :inoremap CRCR.BS With the mapping above, you don't have to add a character then delete it: you hit the Return key, and Vim (with 'nopaste') maps it to hit Return, hit dot, hit backspace, i.e., the insertion-deletion game is played automatically

Re: how to avoid deleting the auto-indent in a new empty line when i press Esc

2007-04-17 Thread Andy Wokula
Gary Johnson schrieb: On 2007-04-16, fREW [EMAIL PROTECTED] wrote: On 4/16/07, Tom Whittock [EMAIL PROTECTED] wrote: What I need is to always keep the auto-indented spaces. So next time I can start to insert from the spaced cursor. Alternatively use cc to edit the ostensibly blank line.

Re: how to avoid deleting the auto-indent in a new empty line when i press Esc

2007-04-16 Thread sun
Do I need always type a char then BS? Is there a better solution? I wander whether the vim option can do this automatically. A better solution to what problem? If vim automatically indents properly when you add a new line, what difference does it make whether it leaves leading spaces in

Re: how to avoid deleting the auto-indent in a new empty line when i press Esc

2007-04-16 Thread panshizhu
sun [EMAIL PROTECTED] wrote on 2007-04-16 15:57:21: What I need is to always keep the auto-indented spaces. So next time I can start to insert from the spaced cursor. The typing S is a reasonable way although I really want to know how to change indent-deleting behavior for a empty line in

Re: how to avoid deleting the auto-indent in a new empty line when i press Esc

2007-04-16 Thread Tom Whittock
What I need is to always keep the auto-indented spaces. So next time I can start to insert from the spaced cursor. Alternatively use cc to edit the ostensibly blank line. This will open the line using the correct auto indent. Get into this habit and it doesn't matter what state the line was

Re: how to avoid deleting the auto-indent in a new empty line when i press Esc

2007-04-16 Thread fREW
On 4/16/07, Tom Whittock [EMAIL PROTECTED] wrote: What I need is to always keep the auto-indented spaces. So next time I can start to insert from the spaced cursor. Alternatively use cc to edit the ostensibly blank line. This will open the line using the correct auto indent. Get into this

Re: how to avoid deleting the auto-indent in a new empty line when i press Esc

2007-04-16 Thread A.J.Mechelynck
sun wrote: The idea of the comment shown above was to leave something to remind you that you had to come back later, since, as you said, you want to leave the indent there for future use; also, the comment would be sure to stay in place even if the bare indent didn't. But if just adding, let's

how to avoid deleting the auto-indent in a new empty line when i press Esc

2007-04-15 Thread sun
Dear all, The question is: When I insert a line then Esc to edit other place, vim of C filetype delete the auto-indented space. But i want to keep the indent there for the future editing? Then how to make the auto-indent always insert the indent-space regardless whether the line is empty or

Re: how to avoid deleting the auto-indent in a new empty line when i press Esc

2007-04-15 Thread A.J.Mechelynck
sun wrote: Dear all, The question is: When I insert a line then Esc to edit other place, vim of C filetype delete the auto-indented space. But i want to keep the indent there for the future editing? Then how to make the auto-indent always insert the indent-space regardless whether the line is

Re: how to avoid deleting the auto-indent in a new empty line when i press Esc

2007-04-15 Thread sun
If you type an arbitrary character, then delete it immediately, does the extra whitespace stay in place when you move the cursor away? yes, the spaces remain. If it does, you may resort to adding a placeholder comment, like: function MyFunc() { /* TODO: code needed

Re: how to avoid deleting the auto-indent in a new empty line when i press Esc

2007-04-15 Thread A.J.Mechelynck
sun wrote: If you type an arbitrary character, then delete it immediately, does the extra whitespace stay in place when you move the cursor away? yes, the spaces remain. If it does, you may I meant if it doesn't resort to adding a placeholder comment, like: function MyFunc() {

Re: how to avoid deleting the auto-indent in a new empty line when i press Esc

2007-04-15 Thread panshizhu
sun [EMAIL PROTECTED] 写于 2007-04-15 17:27:28: Dear all, The question is: When I insert a line then Esc to edit other place, vim of C filetype delete the auto-indented space. But i want to keep the indent there for the future editing? Then how to make the auto-indent always insert the

Re: how to avoid deleting the auto-indent in a new empty line when i press Esc

2007-04-15 Thread sun
Do I need always type a char then BS? Is there a better solution? I wander whether the vim option can do this automatically. The idea of the comment shown above was to leave something to remind you that you had to come back later, since, as you said, you want to leave the indent there for

Re: how to avoid deleting the auto-indent in a new empty line when i press Esc

2007-04-15 Thread Gary Johnson
On 2007-04-16, sun [EMAIL PROTECTED] wrote: The idea of the comment shown above was to leave something to remind you that you had to come back later, since, as you said, you want to leave the indent there for future use; also, the comment would be sure to stay in place even if