Re: inserting newlines

2007-03-20 Thread Greg Matheson
On Tue, 20 Mar 2007, Tim Chase wrote:

> >>>one issue that both of us have is that we create newlines with o or O
> >>>and then go back to normal mode immediately afterwards.

> >>I have this mapping
> >>   noremap  i
> >>in my vimrc, so I *do* do it with one keystroke
> >>(the Enter in normal mode).

> >That's an idea!

> >I use  a lot in normal mode to move down a line, but I could
> >map the other key which does the same thing, '+'. It is also
> >easy to remember, as meaning, add a line.

> I think you may be the first person I've met who uses the  
> key for that purpose on a regular basis :)  [ed: as I typed this, 
> a second email came in from another person who uses  ]

> But yes, , "+" and "-" are keys that mostly duplicate the 
> behavior of "j"/"k" keys, so I find them good candidates for 
> remapping.

I use j and k a lot, of course. I like to use - and  because
they go to the first non-blank character on the line.

There's also underscore, which I have never used.

_   [count] - 1 lines downward, on the first non-blank
character |linewise|.

Perhaps I should try mapping that one.

> I have "+" and "-" remapped to "O" and "o" 
> respectively followed by  for adding lines above/below the 
> current line.

That's intuitive too.

-- 
Greg MathesonManagement is doing things right; 
 Leadership is doing the right things.
 --Peter Drucker

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.



Re: inserting newlines

2007-03-20 Thread Tim Chase

one issue that both of us have is that we create newlines with o or O
and then go back to normal mode immediately afterwards.



I have this mapping
   noremap  i
in my vimrc, so I *do* do it with one keystroke
(the Enter in normal mode).


That's an idea!

I use  a lot in normal mode to move down a line, but I could
map the other key which does the same thing, '+'. It is also
easy to remember, as meaning, add a line.


I think you may be the first person I've met who uses the  
key for that purpose on a regular basis :)  [ed: as I typed this, 
a second email came in from another person who uses  ]


But yes, , "+" and "-" are keys that mostly duplicate the 
behavior of "j"/"k" keys, so I find them good candidates for 
remapping.  I have "+" and "-" remapped to "O" and "o" 
respectively followed by  for adding lines above/below the 
current line.  But any mix of those keys would be usable for such 
purposes.


-tim





Re: inserting newlines

2007-03-20 Thread Mr. Shawn H. Corey

Greg Matheson wrote:

On Tue, 20 Mar 2007, Yakov Lerner wrote:


On 3/19/07, fREW <[EMAIL PROTECTED]> wrote:



one issue that both of us have is that we create newlines with o or O
and then go back to normal mode immediately afterwards.



I have this mapping
   noremap  i
in my vimrc, so I *do* do it with one keystroke
(the Enter in normal mode).


That's an idea!

I use  a lot in normal mode to move down a line, but I could
map the other key which does the same thing, '+'. It is also
easy to remember, as meaning, add a line.



I also use  to move down a line. How about?

:map  o
:map  O


--
Just my 0.0002 million dollars worth,
   Shawn

"For the things we have to learn before we can do them, we learn by 
doing them."

  Aristotle


Re: inserting newlines

2007-03-20 Thread Greg Matheson
On Tue, 20 Mar 2007, Yakov Lerner wrote:

> On 3/19/07, fREW <[EMAIL PROTECTED]> wrote:

> >one issue that both of us have is that we create newlines with o or O
> >and then go back to normal mode immediately afterwards.

> I have this mapping
>noremap  i
> in my vimrc, so I *do* do it with one keystroke
> (the Enter in normal mode).

That's an idea!

I use  a lot in normal mode to move down a line, but I could
map the other key which does the same thing, '+'. It is also
easy to remember, as meaning, add a line.

-- 
Greg MathesonIf you have no teeth,
 use your gums.
 --Korean army saying.

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.



Re: inserting newlines

2007-03-20 Thread Yakov Lerner

On 3/19/07, fREW <[EMAIL PROTECTED]> wrote:

Hi all,
I was recently discussing some features of vim that I use a lot with a
friend and asking if he knew of ways to do certain things better, and
one issue that both of us have is that we create newlines with o or O
and then go back to normal mode immediately afterwards.

So I often end up doing:
o
or
O
where it would be nice to have a single key that would do this.  Is
there already such a feature, or should I just do something like

nnoremap zj o
nnoremap zk O

I realize that zk and zj are still two keystrokes, but they are easier
to type as it is.


I have this mapping
   noremap  i
in my vimrc, so I *do* do it with one keystroke
(the Enter in normal mode).

Yakov "one man's bug is another man's feature" Lerner


Re: inserting newlines

2007-03-19 Thread A.J.Mechelynck

fREW wrote:

Hi all,
I was recently discussing some features of vim that I use a lot with a
friend and asking if he knew of ways to do certain things better, and
one issue that both of us have is that we create newlines with o or O
and then go back to normal mode immediately afterwards.

So I often end up doing:
o
or
O
where it would be nice to have a single key that would do this.  Is
there already such a feature, or should I just do something like

nnoremap zj o
nnoremap zk O

I realize that zk and zj are still two keystrokes, but they are easier
to type as it is.

Thanks!


open empty line after: any one of the three below
:put =""
o
:normal o

open empty line before: any one of the three below
:.-1put =""
O
:normal O

To do it with a single keystroke: use all four below:
:map  o
:map  O
:imap  
:imap  

Replace  and/or  by any other keystroke that you would prefer to use 
instead.



Best regards,
Tony.
--
Enzymes are things invented by biologists that explain things which
otherwise require harder thinking.
-- Jerome Lettvin


inserting newlines

2007-03-19 Thread fREW

Hi all,
I was recently discussing some features of vim that I use a lot with a
friend and asking if he knew of ways to do certain things better, and
one issue that both of us have is that we create newlines with o or O
and then go back to normal mode immediately afterwards.

So I often end up doing:
o
or
O
where it would be nice to have a single key that would do this.  Is
there already such a feature, or should I just do something like

nnoremap zj o
nnoremap zk O

I realize that zk and zj are still two keystrokes, but they are easier
to type as it is.

Thanks!
--
-fREW