Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Good idea to remap s to $?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  15 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Daan  
View profile  
 More options Aug 4 2012, 7:59 am
From: Daan <bak...@gmail.com>
Date: Sat, 4 Aug 2012 04:59:49 -0700 (PDT)
Local: Sat, Aug 4 2012 7:59 am
Subject: Good idea to remap s to $?

I was thinking about remapping s to $, because:

you would gain:
 sp to append what you yanked to the currently line
 si to start insert 1 character before the end
 [count]s to quickly go down [count]-1 lines and go to the end of that line
 sF[char] to find the last [char] on this line
 sciw to change the last word on the line
 scib to change the last block on line
 s[command][upwards motion] to include this entire line in the motion

and also some arguably faster aliases:
 cs => C
 ds => D
 ys => Y
 sa => A

s currently doesn't seem very deserving of home row, especially considering its equal to xi or dl anyway. so it seems to me like a cool idea to give it another function.

What do you think?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
A. S. Budden  
View profile  
 More options Aug 4 2012, 9:10 am
From: "A. S. Budden" <abud...@gmail.com>
Date: Sat, 4 Aug 2012 14:10:08 +0100
Local: Sat, Aug 4 2012 9:10 am
Subject: Re: Good idea to remap s to $?
On 4 August 2012 12:59, Daan <bak...@gmail.com> wrote:

It's entirely up to you of course!  I use 's' a lot (particular in the
form of e.g. 3s to change three letters).  It has the (significant in
my book) advantage over 3xi that if I then use '.' to repeat, it
repeats the change, not just the insertion.  A common use case for me
is to want to change the prefix on a lot of variables so I do
something like:

    /oldprefix<ENTER>
    9snewprefix<ESC>
    n.n.n.n.n.n.n.n.n. (with possible extra 'n's when I want to skip matches)

Okay, I could do this with :%s/.../gc, but the above sequence often
works better for me.  Therefore, I consider 's' very much deserving of
the home row.  If you find $ hard to get to, you could always map most
of your suggested benefit specifically, e.g.

    nmap <Leader>p $p

or

    nmap ,c C

The great thing about Vim (actually, in the spirit of Cardinal
Ximénez, amongst the great things about Vim) is that you can customise
the keys to work how you want to work and you can easily take your
configuration between different PCs.  So if you want to remap s to $,
that's entirely up to you!

Al


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Daan  
View profile  
 More options Aug 4 2012, 10:43 am
From: Daan <bak...@gmail.com>
Date: Sat, 4 Aug 2012 07:43:30 -0700 (PDT)
Local: Sat, Aug 4 2012 10:43 am
Subject: Re: Good idea to remap s to $?

> It's entirely up to you of course!  I use 's' a lot (particular in the
> form of e.g. 3s to change three letters).  It has the (significant in
> my book) advantage over 3xi that if I then use '.' to repeat, it
> repeats the change, not just the insertion. [...]

s is functionally the same as cl, so you would still be able to perform your command (as 3cl or c3l), albeit at the cost of 1 more keypress than with s.

I understand s is useful, but what I want to find out is whether you advanced vimmers think the benefits of saving the keypress for <shift>4 would outweigh the disadvantages of having to do cl instead of s.

> If you find $ hard to get to, you could always map most
> of your suggested benefit specifically, e.g.

>     nmap <Leader>p $p

That's a good point, although it would only work for $p. Don't you think that all the other things you could more easily do, such as [count]$, si, sF and so on be worth it?

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
A. S. Budden  
View profile  
 More options Aug 4 2012, 11:22 am
From: "A. S. Budden" <abud...@gmail.com>
Date: Sat, 4 Aug 2012 16:22:50 +0100
Local: Sat, Aug 4 2012 11:22 am
Subject: Re: Good idea to remap s to $?

On Aug 4, 2012 3:43 PM, "Daan" <bak...@gmail.com> wrote:

> > It's entirely up to you of course!  I use 's' a lot (particular in the
> > form of e.g. 3s to change three letters).  It has the (significant in
> > my book) advantage over 3xi that if I then use '.' to repeat, it
> > repeats the change, not just the insertion. [...]

> s is functionally the same as cl, so you would still be able to perform

your command (as 3cl or c3l), albeit at the cost of 1 more keypress than
with s.

> I understand s is useful, but what I want to find out is whether you

advanced vimmers think the benefits of saving the keypress for <shift>4
would outweigh the disadvantages of having to do cl instead of s.

> > If you find $ hard to get to, you could always map most
> > of your suggested benefit specifically, e.g.

> >     nmap <Leader>p $p

> That's a good point, although it would only work for $p. Don't you think

that all the other things you could more easily do, such as [count]$, si,
sF and so on be worth it?

Personally, no, but then I use s on a daily basis. To each their own like I
said.

Al


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Gary Johnson  
View profile  
 More options Aug 4 2012, 3:36 pm
From: Gary Johnson <garyj...@spocom.com>
Date: Sat, 4 Aug 2012 12:36:16 -0700
Local: Sat, Aug 4 2012 3:36 pm
Subject: Re: Good idea to remap s to $?

On 2012-08-04, Daan wrote:
> > It's entirely up to you of course!  I use 's' a lot (particular in the
> > form of e.g. 3s to change three letters).  It has the (significant in
> > my book) advantage over 3xi that if I then use '.' to repeat, it
> > repeats the change, not just the insertion. [...]

> s is functionally the same as cl, so you would still be able to
> perform your command (as 3cl or c3l), albeit at the cost of 1 more
> keypress than with s.

> I understand s is useful, but what I want to find out is whether
> you advanced vimmers think the benefits of saving the keypress for
> <shift>4 would outweigh the disadvantages of having to do cl
> instead of s.

Beyond warning you against doing anything stupid or that we think
you might regret, it doesn't really matter what we think.  You're
not suggesting a change to Vim itself but to your environment.
Whether the change is of net benefit to you depends on your habits
and work flow, which may not be the same as ours.

If you don't commonly use s, then there is no loss to you by
remapping it.  I never use , for it's primary function, so I use it
as the first character of most of my mappings.  Other people on this
list frequently use the , function, so my mappings would not work
well for them.

> > If you find $ hard to get to, you could always map most
> > of your suggested benefit specifically, e.g.

> >     nmap <Leader>p $p

> That's a good point, although it would only work for $p. Don't you
> think that all the other things you could more easily do, such as
> [count]$, si, sF and so on be worth it?

There is really only one way to find out:  map it and try it for a
while.

Regards,
Gary


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
John Little  
View profile  
 More options Aug 4 2012, 7:51 pm
From: John Little <John.B.Lit...@gmail.com>
Date: Sat, 4 Aug 2012 16:51:09 -0700 (PDT)
Local: Sat, Aug 4 2012 7:51 pm
Subject: Re: Good idea to remap s to $?

On Saturday, August 4, 2012 11:59:49 PM UTC+12, Daan wrote:
> I was thinking about remapping s to $, because:
...
> What do you think?

I used vi for years, before 'discovering' s.  Then I used it intensively when coding; it saves a keystroke and facilitates using a period to repeat the change.  Only vim's text objects have reduced my use of s.  It appears you haven't
'discovered' s; if you do, you won't think of mapping it, IMO.

Regards, John


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tim Chase  
View profile  
 More options Aug 4 2012, 8:05 pm
From: Tim Chase <v...@tim.thechases.com>
Date: Sat, 04 Aug 2012 19:05:54 -0500
Local: Sat, Aug 4 2012 8:05 pm
Subject: Re: Good idea to remap s to $?
On 08/04/12 18:51, John Little wrote:

> On Saturday, August 4, 2012 11:59:49 PM UTC+12, Daan wrote:
>> I was thinking about remapping s to $, because:
> ...
>> What do you think?

> I used vi for years, before 'discovering' s.  Then I used it
> intensively when coding; it saves a keystroke and facilitates
> using a period to repeat the change.  Only vim's text objects
> have reduced my use of s.  It appears you haven't 'discovered' s;
> if you do, you won't think of mapping it, IMO.

I've had a reply to the OP pending for a while, and John beat me to
actually pushing <send> on the ideas I wanted to convey.  I too
ignored "s" for a long time, but once it became part of my
muscle-memory, I found myself using it on a regular basis.

That said, Vim is a sufficiently malleable editor that, if this is
the way you want it to work, it will bend to your will.  I guess I
just don't find typing "$" all that onerous.  If I had to make some
functionality easier to type, I'd lean towards remapping something
that has functionality duplicated elsewhere like "+" vs. <cr> in
normal mode (they both do the same thing, and outside of VimGolf, I
don't use either in my day-to-day vimming; likewise the underscore
and minus don't see much use if any in my day-to-day).

-tim


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tony Mechelynck  
View profile  
 More options Aug 5 2012, 4:53 am
From: Tony Mechelynck <antoine.mechely...@gmail.com>
Date: Sun, 05 Aug 2012 10:53:35 +0200
Local: Sun, Aug 5 2012 4:53 am
Subject: Re: Good idea to remap s to $?
On 05/08/12 02:05, Tim Chase wrote:

I've "discovered" s several times, by seeing Vim go to Insert mode when
I had absentmindedly typed an :s command without a colon; it's got to
the point when I'm considering mapping Normal-mode s to <Nop> or even to
<Esc> (to give a beep). I find cl easier to remember for the
single-character change (similarly cc rather than S for linewise). This
said, to each is own: some people seem to have difficulty moving their
hands over the keyboard, I don't; I type with all the fingers of my
right hand while leaving the left mostly resting, or maybe holding a
book I'm typing from, and the distance between the Escape key and the
numeric keypad, or even the mouse, doesn't disturb me. YMMV.

Best regards,
Tony.
--
Famous last words:
        (1) "Don't worry, I can handle it."
        (2) "You and what army?"
        (3) "If you were as smart as you think you are, you wouldn't be
             a cop."


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ben Schmidt  
View profile  
 More options Aug 5 2012, 10:49 am
From: Ben Schmidt <mail_ben_schm...@yahoo.com.au>
Date: Mon, 06 Aug 2012 00:49:55 +1000
Local: Sun, Aug 5 2012 10:49 am
Subject: Re: Good idea to remap s to $?

>> ...
>>> What do you think?

>> I used vi for years, before 'discovering' s.  Then I used it
>> intensively when coding; it saves a keystroke and facilitates
>> using a period to repeat the change.  Only vim's text objects
>> have reduced my use of s.  It appears you haven't 'discovered' s;
>> if you do, you won't think of mapping it, IMO.

> I've had a reply to the OP pending for a while, and John beat me to
> actually pushing<send>  on the ideas I wanted to convey.  I too
> ignored "s" for a long time, but once it became part of my
> muscle-memory, I found myself using it on a regular basis.

Me, too.

I often use s to split lines, e.g. I position the cursor on a space,
press s and type enter (possibly followed by some tabs). Then I move to
the next place I need to do it and repeat with dot.

Ben.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Michael Henry  
View profile  
 More options Aug 5 2012, 5:32 pm
From: Michael Henry <v...@drmikehenry.com>
Date: Sun, 05 Aug 2012 17:32:57 -0400
Local: Sun, Aug 5 2012 5:32 pm
Subject: Re: Good idea to remap s to $?
On 08/05/2012 10:49 AM, Ben Schmidt wrote:

> I often use s to split lines, e.g. I position the cursor on a space,
> press s and type enter (possibly followed by some tabs). Then I move to
> the next place I need to do it and repeat with dot.

For that particular use case, I like to press 'r' and <CR>,
since it's a single-character replacement.  That way, I don't
have to press <Esc> afterwards.  It repeats with '.' as well.
But I do use 's' for cases other than replacing a single
character with another character.

Michael Henry


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Aaron Bohannon  
View profile  
 More options Aug 5 2012, 8:56 pm
From: Aaron Bohannon <aaron...@gmail.com>
Date: Sun, 5 Aug 2012 20:56:36 -0400
Local: Sun, Aug 5 2012 8:56 pm
Subject: Re: Good idea to remap s to $?
As everyone else said, it's all personal preference.  However, $ and ^
are probably two of the least optimal built-in keystrokes, given how
often they are needed.  FWIW, I have recently started trying trying
out these mappings, which I think are going to work quite well for me:

map gl  $
map gh  ^

 - Aaron


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Adri Verhoef  
View profile  
 More options Aug 6 2012, 1:24 pm
From: Adri Verhoef <a...@a3.xs4all.nl>
Date: Mon, 6 Aug 2012 19:24:34 +0200
Local: Mon, Aug 6 2012 1:24 pm
Subject: Re: Good idea to remap s to $?

On Mon, Aug 06, 2012 at 00:56:36 +0000, Aaron Bohannon wrote:
> $ and ^
> are probably two of the least optimal built-in keystrokes, given how
> often they are needed.

Since the keys <Home> and <End> are on my keyboard, I try to use those instead
of ^ and $ (and there are no extra mappings required).

- Adri


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Daan  
View profile  
 More options Aug 7 2012, 10:00 am
From: Daan <bak...@gmail.com>
Date: Tue, 7 Aug 2012 07:00:04 -0700 (PDT)
Local: Tues, Aug 7 2012 10:00 am
Subject: Re: Good idea to remap s to $?

> As everyone else said, it's all personal preference.  However, $ and ^
> are probably two of the least optimal built-in keystrokes, given how
> often they are needed.  FWIW, I have recently started trying trying
> out these mappings, which I think are going to work quite well for me:

> map gl  $
> map gh  ^

>  - Aaron

You have a good point, and I might try those mappings as an alternative! Personally I've remapped 0 to ^, because you usually want the first non-blank character anyway.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Matteo Landi  
View profile  
 More options Aug 25 2012, 6:53 am
From: Matteo Landi <landima...@gmail.com>
Date: Sat, 25 Aug 2012 12:53:56 +0200
Local: Sat, Aug 25 2012 6:53 am
Subject: Re: Good idea to remap s to $?

On Aug/06, Adri Verhoef wrote:

> On Mon, Aug 06, 2012 at 00:56:36 +0000, Aaron Bohannon wrote:
> > $ and ^
> > are probably two of the least optimal built-in keystrokes, given how
> > often they are needed.

> Since the keys <Home> and <End> are on my keyboard, I try to use those instead
> of ^ and $ (and there are no extra mappings required).

> - Adri

What about mapping H and L to ^ and $?

I have never had the need to move to the top/bottom of the screen.  On the other
hand, I often need to move the cursor to the beginning/end of the current line
and given that my index is always positioned on the j key, I find it handy to
use H and L for those movements (those bindings are also aligned with the idea
that the h is used to move to the left and l to move to the right).

Cheers,

Matteo

--
http://www.matteolandi.net


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tim Chase  
View profile  
 More options Aug 25 2012, 8:51 am
From: Tim Chase <v...@tim.thechases.com>
Date: Sat, 25 Aug 2012 07:51:46 -0500
Local: Sat, Aug 25 2012 8:51 am
Subject: Re: Good idea to remap s to $?
On 08/25/12 05:53, Matteo Landi wrote:

>> On Mon, Aug 06, 2012 at 00:56:36 +0000, Aaron Bohannon wrote:
>>> $ and ^

> What about mapping H and L to ^ and $?

> I have never had the need to move to the top/bottom of the screen.

This would entirely be a personal thing--that would drive me nuts
since I use H/M/L on a pretty regular basis.

I tend to find that I use "0" more than I use "^"  On left-justified
lines, they're the same, and with leading whitespace, if I want to
correct to the start of the text, I just hit "w".  Neither of which
requires use of <shift> :-)

-tim


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »