Inserting new lines in normal mode without changing mode. (without ending insert mode)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Inserting new lines in normal mode without changing mode. (without ending insert mode)

Talha Oktay
Hi,

I have a very simple question.

I want to be able to insert new empty lines without
ending in insert mode. I know I can use, o, O etc. but
they all change the mode and make me endup in insert
mode.

Sometimes I want to be able insert just new lines etc.
to spl?t code segments and paragraphs without entering
any more characters. I do not want to push ESC or Ctrl
[ to go back to normal mode.

I know that I can define a macro for this. On the
other hand, I suppose there must be a built in support
for this. To the best of my knowledge, I have not been
able find such a command, I could not find an info in
the mail archieves.

Any help is very much appreciated.

Thanks




               
__________________________________
Discover Yahoo!
Use Yahoo! to plan a weekend, have fun online and more. Check it out!
http://discover.yahoo.com/
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Inserting new lines in normal mode without changing mode. (without ending insert mode)

Alan G Isaac
On Thu, 2 Jun 2005, Talha Oktay apparently wrote:
> I want to be able to insert new empty lines without ending
> in insert mode. I know I can use, o, O etc. but they all
> change the mode and make me endup in insert mode.

:put=''

hth,
Alan Isaac




Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Inserting new lines in normal mode without changing mode. (without ending insert mode)

A.J.Mechelynck
In reply to this post by Talha Oktay
Talha Oktay wrote:

> Hi,
>
> I have a very simple question.
>
> I want to be able to insert new empty lines without
> ending in insert mode. I know I can use, o, O etc. but
> they all change the mode and make me endup in insert
> mode.
>
> Sometimes I want to be able insert just new lines etc.
> to spl?t code segments and paragraphs without entering
> any more characters. I do not want to push ESC or Ctrl
> [ to go back to normal mode.
>
> I know that I can define a macro for this. On the
> other hand, I suppose there must be a built in support
> for this. To the best of my knowledge, I have not been
> able find such a command, I could not find an info in
> the mail archieves.
>
> Any help is very much appreciated.
>
> Thanks

[advertisement snipped]

AFAIK, there is no builtin command to insert a line and end up in Normal
mode; but you might use

        :map <F4> o<Esc>
        :map <C-F4> O<Esc>
or
        :map <F4> "=""<CR>p
        :map <C-F4> "=""<CR>P
or
        :map <F4> :put =\"\"<CR>
        :map <C-F4> :put! =\"\"<CR>

All these are untested, and maybe there are others yet... Take your pick
(and replace <F4> and <C-F4> by whatever keys suit you).


Best regards,
Tony.

Loading...