Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

On the subject of Y. #47

Closed
vectorstorm opened this issue May 19, 2013 · 12 comments
Closed

On the subject of Y. #47

vectorstorm opened this issue May 19, 2013 · 12 comments

Comments

@vectorstorm
Copy link

The readme says "I want this to be a plugin nobody objects to installing. Let me know if you have any objections to anything." And so (after being prompted by a few redditors) I'll just mention that the reason why I've never installed this plugin is Y. And, I suppose, to a much lesser extent, I'm uneasy about & on an intellectual level. And I don't really understand the intent of the insert mode C-U mapping (is it really intended to delete to the beginning of the line, going outside the scope of the inserted text? That seems quite odd, so I'm assuming it's unintentional). But chiefly my concern is with Y.

"Yank whole line" is something which I do quite frequently. On the order of a dozen times per day, I would estimate. I can't remember ever having wanted to "yank to end of line". So removing a convenient, default vim command which I use and replacing it with one I don't need doesn't work for me, personally.

Maybe that's just because I'm mostly using vim to edit C-style code, and so an explicit "yank to end of line" usually winds up placing a terminating semicolon into the " register. If I do a naive "yank to end of line", I then have to clean up those extra semicolons everywhere where I use the yanked code. So when I do want to yank to the end of a line of code, I always end up using yt; instead of y$, to exclude the semicolon. Vim-sensible's remapped Y behaviour just isn't useful for me.

Maybe the remapped Y is more useful for folks who program in languages which don't use statement terminators, or to people who write prose? I don't know. Or maybe most folks don't use Y very frequently at all, and so the whole issue reduces to a question of which behaviour is easier for them to remember, for a rarely used operation.

But in my world of C programming, the standard scope of C and D being different from that of Y makes intuitive sense, because each command is using a scope that I frequently want to use for that type of command. I do often want to delete from the cursor to the end of the line. I don't ever want to yank from the cursor to the end of the line, but I do often want to yank a complete line. So the default scopes of D and Y make sense to me, even though they don't match each other, because they do match things which I commonly want to do when deleting and yanking, respectively; they're like "alt-fire" versions of those operations, each of which does something useful, related to their base operation.

Really, I'm doubtful that a plugin which aspires to be "defaults everyone can agree on" should be making key bindings at all. There will always be people who think that the Vi-basic and/or Vim-default way to do things is the right way to do them. You'd have the same complaints from some folks if vim-sensible incorporated the popular nnoremap j gj and nnoremap k gk remappings (I don't use these). Or nop'd the arrow keys (I don't do this, either). Or vnoremap < <gv and vnoremap > >gv so that it's possible to repeatedly shift indenting while maintaining a visual selection (I do use these). Changing any basic commands to work differently is probably never going to be something that everyone will agree on; everybody's got their own commonly encountered situations informing which functions are useful to them (like my "semicolons on the end of lines" issue which makes "yank to end of line" unhelpful for me), and so you're probably not going to find any single remapping that absolutely everyone will agree is better than the default.

Anyhow, sorry for writing a novel in your issue tracker. :) Hope this is of at least a little help, as an alternative point of view.

@drastus
Copy link

drastus commented May 20, 2013

OK, but yanking whole line already has default key binding, yy, which is even faster to type than Y (Shift+y). So is it really a problem? I use Y remapped as y$ quite often and it was always frustrating for me that naked Vim has this illogical vi-compatible binding for Y even if nocompatible is set. Y remapping is maybe the most sensible setting from vim-sensible – it makes an obvious correction while not breaking anything (yy is still there). If it is dropped then I'm afraid most other v-s settings will be gradually removed too, as there always will be someone that doesn't like some particular setting...

@justinmk
Copy link

@drastus , agreed. Probably the change that needs to be made to vim-sensible is to remove the goal of being a "plugin nobody objects to installing". 100% agreement is impossible. 99% is much more feasible.

@vectorstorm
Copy link
Author

yy requires two keypresses by the same finger, executed in sequence. Y requires a single keypress each by two fingers on different hands, executed simultaneously. Any experienced touch-typist will press Y far faster than yy. This is, after all, why vi bothered to map yy to Y in the first place -- because it's faster and easier to type.

Anyhow, my intention wasn't to get vim-sensible to change anything; I was just reporting here that I don't use the plugin because I disagree with the Y remapping (and possibly &, and I still can't figure out the purpose of the insert mode <C-U> mapping, despite tracking down and reading its commit message. Which I guess means that I object to it.) I'm reporting this as an issue here only because the readme asks people to post an issue here if they disagree with anything in the plugin.

@justinmk
Copy link

@vectorstorm , I use vim-sensible even though I override a couple of its settings. I think it is valuable for the vim community to migrate towards "sane defaults" for most users, especially new users, even if veteran users prefer some historical quirks. It also takes some cruft out of my vimrc.

Why not override the 2-3 settings you object to?

@vectorstorm
Copy link
Author

To override settings in vim-sensible, I would have to break my vimrc into two different files in different directories in order to have them load at the correct times. That makes inspection, editing, and deployment of my vimrc on multiple machines rather more complicated, so I would prefer not to have to do it.

I've added a pull request in Issue #48 which contains one method to improve this overriding process.

@tpope
Copy link
Owner

tpope commented Aug 2, 2013

I'm dropping the Y mapping. I think the argument against it is pretty weak, but it's clearly a contentious override, and it's not really worth dividing people over.

Dropping && too, as I was never particularly enthused about that contribution. Leaving <C-U> for now, as it regularly saves my ass by making it undoable.

I'm sticking with the "nobody objects to installing" tagline. I'm quite happy to classify silo-building assholes as nobodies.

@tpope tpope closed this as completed in e48a405 Aug 2, 2013
tpope referenced this issue Aug 2, 2013
See :help Y.  This just makes more sense, man.
@vectorstorm
Copy link
Author

I hope I didn't come across as a "silo-building asshole"; that was not my intent, and I'm very sorry if I did!

@tpope
Copy link
Owner

tpope commented Aug 2, 2013

No, those are a different category. :)

@daGrevis
Copy link

If others are missing the big Y as well, put this you know where...

noremap Y y$

@gaving
Copy link

gaving commented Sep 9, 2013

Arrrrrgh wondering why this was broken now.

/me miserably re-adds the mapping back to vimrc

@ghost
Copy link

ghost commented Sep 10, 2013

I object to installing a vim-sensible that doesn't noremap Y y$.

@trusktr
Copy link

trusktr commented Apr 3, 2014

Is the speed difference between yy and Y really that significant? I'd rather have two different functionalities. An extra command (copy to end of line) is more useful to me than the mostly insignificant amount of time I'd save with default Y.

@tpope
Copy link
Owner

tpope commented Apr 3, 2014

It's asinine, but this issue is closed.

nathanmsmith added a commit to nathanmsmith/.config that referenced this issue May 3, 2020
Ah, Y. Why are you different from C and D?

A fun saga into the remapping
of Y: tpope/vim-sensible#47
nathanmsmith added a commit to nathanmsmith/.config that referenced this issue Aug 14, 2020
Ah, Y. Why are you different from C and D?

A fun saga into the remapping
of Y: tpope/vim-sensible#47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants