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.
> 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?
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!
> 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?
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.
> --
> You received this message from the "vim_use" maillist.
> Do not top-post! Type your reply below the text you are replying to.
> For more information, visit http://www.vim.org/maillist.php
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.
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.
> 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).
> 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
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."
>> 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.
> 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.
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:
On Sat, Aug 4, 2012 at 7:59 AM, Daan <bak...@gmail.com> wrote:
> 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 received this message from the "vim_use" maillist.
> Do not top-post! Type your reply below the text you are replying to.
> For more information, visit http://www.vim.org/maillist.php
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).
> 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.
> 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).
>> 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> :-)