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

Bind L not I to expandLineSelection by default #59003

Closed
ma11hew28 opened this issue Sep 20, 2018 · 7 comments
Closed

Bind L not I to expandLineSelection by default #59003

ma11hew28 opened this issue Sep 20, 2018 · 7 comments
Assignees
Milestone

Comments

@ma11hew28
Copy link

ma11hew28 commented Sep 20, 2018

Summary

I think the default keybinding to select the current line should be Ctrl+L, not Ctrl+I.

History

Looking at the history, I've deduced that I (instead of L) was bound to expandLineSelection by mistake. (That's why I chose the type "bug report" and not "feature request" for this issue.)

In issue #950, @benkaiser requested that Ctrl+L be used to select the current line. However, in the body of his issue, he used the letter l (a lowercase L), which in this font is practically indistinguishable from the letter I (an uppercase I). (If you look really closely, you can see the difference. A lowercase L is a little bit taller than an uppercase I. Can you tell? How about if I put them side-by-side, respectively: lI?)

I imagine that's why @Agetorp and his "buddy," who I think is @MattiasPernhult, used I (instead of L) when implementing @benkaiser's request. And so, naturally, their pull request (#961) doesn't include an explanation as to why they chose to use I instead of L, because in their minds, they were just following @benkaiser's spec.

After @alexandrudima merged the pull request, @jack-guy & @le717 each commented on issue #950 asking why I was used instead of L. Their question was never answered.

In issue #1357, @benkaiser later requested that this keybinding default be changed to what he had initially asked it to be in his original issue (#950), but @alexandrudima didn't address that part of his request.

Note: @mohsen1 also wrote in his issue #1159 (a duplicate of #950) that he wanted L, not I.

Discussion

Although changing the default keybinding for expandLineSelection from Ctrl+I to Ctrl+L may hinder current users of VS Code who have already gotten used to using Ctrl+I to select the current line, I think they'd eventually get used to the new default keyboard shortcut of Ctrl+L, or they could always just override the new default and map it back to Ctrl+I, if they so preferred.

So, while the dust would likely eventually settle for current users, not changing the default keyboard shortcut would likely continue to frustrate new users indefinitely. New users will likely continue to migrate to VS Code for the foreseeable future, many likely coming, as I have, from other popular editors, such as Atom, Sublime, and TextMate, all of which use L, not I, in their default keyboard shortcuts for selecting the current line. And, for those VS Code users, such as me, @benkaiser, @jack-guy, @le717, @mohsen1, etc, and likely a growing myriad of others, who expect Ctrl+L to select the current line, making that the default keyboard shortcut follows the principle of least astonishment. Moreover, new users are less likely than current users to know how to search for commands and override default keyboard shortcuts in VS Code. Also, as the saying goes, "First impressions are everything," yet another reason in this case to cater to the wishes of new users over those of current users.

Another reason associating L with the command for selecting the current line makes sense is that the first letter of the word "line" is an L, not an I.

Also, Ctrl+L isn't currently bound to any command by default, so that makes this change easier to make than if Ctrl+L were already bound to a command by default.

Solution

I think this issue can be fixed by simply changing KEY_I to KEY_L on line 1339 of /src/vs/editor/browser/controller/coreCommands.ts.

Conclusion

Although I'm certainly partial, I hope that the reasoning I've presented above is sound enough to persuade you to agree with me that the default keyboard shortcut for selecting the current line should be corrected. As I've thoroughly explained, there are many good reasons that the default keybinding should be Ctrl+L, and according to the history, Ctrl+I seems to have been used by accident.

If you have any concerns that I've failed to address, feel free to express them in the comments, and if you choose not to fix this issue, I'd understand. I've already changed my custom keybinding to L (on my Mac). I'm mainly just trying to help improve VS Code and minimize the adjustments that future new users will likely have to make, thus, enhancing their overall user experience & satisfaction. This may seem like a minor issue, and I guess if you said that, I'd have to agree with you, but as Michelangelo once said, "Trifles make perfection, and perfection is no trifle."

@le717
Copy link

le717 commented Sep 23, 2018

I got a notification when this issue was filed and I just want to add that this is probably my biggest pain point with VS Code's default shortcuts. I like to run VS Code off a flash drive at college for programming classes and having to remember that I need to remap line-selection to Ctrl+L bugs me whenever for some reason I have to set up a new installation (which occurs more often that you'd expect for various reasons). Having this shortcut remapped to Ctrl+L, as I believe it should be (and as @ma11hew28 has done an excellent job researching why it is not that by default) would be a nice change for new and existing users who expect that shortcut to act as it does in virtually all other editors and not flat-out no-op.

@alexdima alexdima removed the editor-bracket-matching Editor brace matching label Oct 8, 2018
@LucianaMarques
Copy link
Contributor

Has any pull request been made to close this issue? I'd like to give it a try if possible.

@ma11hew28
Copy link
Author

I don't think so, @LucianaMarques. Thanks for asking and offering. I say go for it! :-)

@LucianaMarques
Copy link
Contributor

Hi there, I finally submitted a Pull Request. Sorry for the huge delay!

@alexdima alexdima added this to the February 2019 milestone Jan 31, 2019
@alexdima
Copy link
Member

@ma11hew28 Thank you for the great analysis!
@LucianaMarques Thank you for the PR!

@le717
Copy link

le717 commented Feb 14, 2019

Thank you very much for fixing this! 😀This change will definitely lower the entry barrier for using VS Code.

@pfgallagher
Copy link

@alexandrudima In the future, could changes to default keybindings be displayed more prominently in the release notes? It took me a fair bit of time to figure out why I couldn't select individual lines.

Thank you!

@vscodebot vscodebot bot locked and limited conversation to collaborators Mar 31, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants