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

Consider changing default dotspacemacs-major-mode-leader-key to "DEL" #5606

Closed
gilch opened this issue Mar 27, 2016 · 20 comments
Closed

Consider changing default dotspacemacs-major-mode-leader-key to "DEL" #5606

gilch opened this issue Mar 27, 2016 · 20 comments
Labels
- Mailling list - Key Bindings stale marked as a stale issue/pr (usually by a bot)

Comments

@gilch
Copy link
Contributor

gilch commented Mar 27, 2016

Rationale:
, is actually useful to vimmers as the opposite of ;. If you accidentally ; one too far, you can undo it with ,.

DEL (backspace), on the other hand, is exactly the same as h and <left> in normal mode, and therefore useless. It's also really easy to hit. It's a big button and I'm sure we've all had a lot of practice with it.

@syl20bnr
Copy link
Owner

It is not so easy to hit and , is a common leader used by vimmers. A lot of Spacemacs users are used to , so I'm not for changing it, I consider this proposal a user preference.

@sindikat
Copy link
Contributor

DEL is indeed useless in normal state. In Colemak Caps Lock is remapped to DEL too, there's no way to toggle Caps Lock, but now deleting previous characters is under your left pinky. In Colemak calling DEL is even easier than in QWERTY.

However, putting a command that is called frequently under pinky (that is also stretched a little) is a bad idea, but major-mode leader key is probably called much less frequently than DEL anyway.

I have no opinion, whether major-mode leader key should be remapped from , elsewhere, but it's useful to keep in mind that DEL can be put to good use.

@d12frosted
Copy link
Collaborator

However, putting a command that is called frequently under pinky (that is also stretched a little) is a bad idea

I am not vim editing style user, but my Caps Lock is mapped to Control, so I use it very frequently (even for navigation - C-n, C-p, C-f, C-b). And I can assure you that Caps Lock is good to use :)

@sindikat
Copy link
Contributor

Do you use the other Ctrl key, the one on the right? If not:

TRY TO TYPE THIS SENTENCE BY HOLDING ONLY LEFT SHIFT AND NOT USING THE OTHER SHIFT

Do you feel strain in your left pinky? If not at all, then you have a mighty left pinky, so sure, go ahead, use Caps Lock for Control. But if you do, that's essentially what you are doing with your pinky, when you press Control with it, all day long.

Mapping Caps Lock to Control is a hacky workaround, where instead we should rethink insane Emacs default keybindings, which demand using our pinkies so much. We can't fix keyboards, most people will be stuck with Ctrl, Shift and other keys under pinkies, but at least we can fix keybindings and start using more Alt instead of more Ctrl. But that's a topic for another discussion.

@StreakyCobra
Copy link
Contributor

TRY TO TYPE THIS SENTENCE BY HOLDING ONLY LEFT SHIFT AND NOT USING THE OTHER SHIFT

SPC b s i try to type this sentence by holding only left shift and not using the other shift ESC g U U

😇

@d12frosted
Copy link
Collaborator

TRY TO TYPE THIS SENTENCE BY HOLDING ONLY LEFT SHIFT AND NOT USING THE OTHER SHIFT

Seriously? Don't try to hit me with problems taken from vacuum. I rarely need to use upper case, but when I do need, I either use solution from @StreakyCobra or use M-u (bare, with prefix or on region).

Do you feel strain in your left pinky?

Working all day in Emacs and no pain :) But I know some people don't like hitting ctrl, so they use evil 😄 (yes, I know that it's not the only reason). Btw, compared to Caps Lock standard left control breaks my pinky finger indeed.

Mapping Caps Lock to Control is a hacky workaround

Solution is not hacky - it places Control to it's rightful position. 😸

where instead we should rethink insane Emacs default keybindings

No-no. Don't be so harsh. If they look insane to you it doesn't mean they're insane :)

but at least we can fix keybindings and start using more Alt instead of more Ctrl

At some point I was using CMD as meta and option (alt) as control. Not that useful. But yeah, Command button on my keyboard is easier to hit, thought I wouldn't map Caps Lock f to Command f. Because... Well, as you say

But that's a topic for another discussion.

Cheers :)

@nixmaniack
Copy link
Contributor

@StreakyCobra Exactly what I did! 😆 I don't use CapsLock.

@sindikat
Copy link
Contributor

You seem to all have missed the point. TRY TO WRITE THIS SENTENCE WITH PINKY HOLDING THE LEFT SHIFT ONLY is an exercise to see whether it's a discomfort for you to hold something with a pinky while typing, not because writing ALL CAPS with a single Shift held a good idea. If you press C-n, C-p a lot during the day, you are doing essentially the same as WRITING LONG SENTENCES WITH LEFT SHIFT HELD WITH A PINKY.

@d12frosted So, have you or have you not tried to WRITE A VERY LONG SENTENCE WITH A SHIFT HELD BY A LEFT PINKY ONLY? If you do feel even a little strain, it will accumulate over time.

Solution is not hacky - it places Control to it's rightful position.

Nonsense. The Emacs keybindings where designed after the Space-cadet keyboard, where Control was under a thumb. That now Control is under pinky and is used for absolutely everything in Emacs is a historical accident, there's no need to rationalize it.

@d12frosted
Copy link
Collaborator

You seem to all have missed the point.

No, I understood you. It's just the same as asking person to choke all wood on the Earth with knife. Yes, it's inconvenient, indeed. But don't miss the main problem here - why would you do it in the first place? 😸 It's inconvenient to me to write such sentences holding shift. I admit. But why would I ever want to write whole sentence upper case? And even if I really need to do so - I would rather use an axe instead of knife.

If you press C-n, C-p a lot during the day, you are doing essentially the same as WRITING LONG SENTENCES WITH LEFT SHIFT HELD WITH A PINKY.

I would disagree. It's not the same, because it's not that continuous process. Plus, when I navigate I don't move a lot my left hand. Because it's easy to access f. For all other letters I use right hand.

Nonsense. The Emacs keybindings where designed after the Space-cadet keyboard, where Control was under a thumb.

Oh right. I just wanted to say, that I like having control where the Caps Lock is. I don't like having C and M close to each other when I use Spacemacs (where a lot of stuff is called from M by default in emacs editing style).

@gilch
Copy link
Contributor Author

gilch commented Mar 28, 2016

It might make more sense to swap Ctrl and Alt on one side since you can at least hit Alt with your thumb. This wouldn't work on all keyboards though (some don't have two Alts). I'm already using Caps Lock for Enso, it's really not unusual for emacs users to swap Caps Lock and left-Ctrl, and for Colemack users, Caps Lock is another DEL anyway.

This is getting a little off-topic. A leader key is not as much of a strain as a modifier key. Everybody (even vimmers) already uses backspace (in insert mode) many times during the day. It's not hard to tap it, even with your ring finger.

, is a common leader used by vimmers.

Unfortunately true, but controversial. (SPC is a better choice, but that's used for everything else. I'd even take \ but that's for a one-off holy-mode.)

Don’t Throw Away the Reverse Character Search Command
[...]
On some keyboards, the \ command is inconvenient to reach, so Vim makes it easy
to set the leader key to something else (see :h mapleader ). A common choice is to set
the comma key as leader. If you take this route, I strongly recommend mapping the
reverse character search command to another key. Here’s an example:

let mapleader=","
noremap \ ,

The ; and , commands complement each other. If you take one of them away, then
the whole family of character search commands becomes much less useful.
-- Excerpt from Practical Vim by Drew Neil p. 116

This suggests another option: keep , as the leader, but remap its old function evil-repeat-find-char-reverse to DEL. It's not such a bad idea, I think, but it's two changes for Spacemacs users migrating from Vim instead of one. If we go with this it should be documented and the default configuration.

A lot of Spacemacs users are used to , so I'm not for changing it

As the owner your opinion counts for a lot, but Spacemacs is supposed to be crowd-configured. I'm only suggesting changing the default in the documentation and dotfile template for the benefit of new users. Existing users who already have a dotfile with the old default will not be affected.

@d12frosted
Copy link
Collaborator

@sindikat just to make things funny I cut (not off) my pinky finger :D now it's hard to navigate 😆

@nixmaniack
Copy link
Contributor

@d12frosted switch to hybrid mode for the time being and use hjkl for navigation. 😆 You know spacemacs's spaceship is built to travel universe hence great care has been taken to handle every possible situation! 😜

@ghost
Copy link

ghost commented Mar 29, 2016

This got really derailed quite fast... Anyway, to be back on the original topic of things, I have always remapped the leader to \ because that's what the original leader key in vim is; it drives me nuts when people map , to \ without mapping the reverse because they're missing out on the great functionality of ,. At the very least, I think that mapping the original functionality of , to \ should be done if major-mode-leader-key will remain ,.

As far as the off topic about the caps lock goes: I actually agree with the premise of the control key being caps. Functionally speaking, caps -> ctrl is an objective benefit over most traditional layouts. Further, your pinky is not stretched nearly as far as say using DEL/backspace stretches it. However, I do think that using the alt key's traditional placement for ctrl and using the caps key as alt would be, ergonomically speaking, even better. The thumb should be used for more frequently pressed keys (especially those held down for a long duration with multiple keys being hit as ctrl often is).

Rethinking software keybinds to fix hardware/physical problems is ridiculous, however. It's like insisting your web browser be colored pink because your monitor displays the color white wrong; just fix the damn calibration or get a new monitor if you must. There's nothing wrong with the ctrl/alt/meta etc., keybindings; key placement is arbritrary on keyborads thanks to remapping, so move them where they're comfortable for you.

@aldanor
Copy link

aldanor commented Mar 30, 2016

Having \ as major-mode-leader-key (while mapping , to its original function) is actually not such a bad idea at all.

@gilch
Copy link
Contributor Author

gilch commented Mar 30, 2016

The \ is already bound to evil-execute-in-emacs-state, which is also worth keeping.

If we use \ (Vim's default leader) as major-mode-leader-key and , as evil-repeat-find-char-reverse (its original function), then we could use DEL (backspace) as evil-execute-in-emacs-state.

@pfernandez
Copy link

New user here from vim. I just wanted to point out that a typing a leader is not necessarily the same as opening a major mode menu. I think of a leader as a prefix for my personal keystrokes.

I remapped mine to m.

@dwahyudi
Copy link

dwahyudi commented Nov 28, 2017

Spacemacs beginner here.
So, how do I make my , works like vim anyway?

edit: found it.
dotspacemacs-major-mode-leader-key nil

@smile13241324
Copy link
Collaborator

@gilch as this discussion seems to be pretty stale please consider closing the issue.

@didibus
Copy link
Contributor

didibus commented Jun 10, 2019

For others looking into this issue. I suggest the use of: https://github.com/syl20bnr/spacemacs/tree/master/layers/%2Bvim/evil-snipe

It allows f to act as ; and F to act as original ,. So just by repeating f or F after say fy it will repeat forward or backward. It also allows you to specify the search scope, so if you want, it can be on the whole buffer, which is very convenient. And it rebinds s/S, arguably, not super useful Vi command, to be a 2 char version of f/F, which is nice when you need to be more precise.

@github-actions
Copy link

github-actions bot commented Jun 9, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Please let us know if this issue is still valid!

@github-actions github-actions bot added the stale marked as a stale issue/pr (usually by a bot) label Jun 9, 2020
@github-actions github-actions bot closed this as completed Sep 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
- Mailling list - Key Bindings stale marked as a stale issue/pr (usually by a bot)
Projects
Mailing list
  
Other
Development

No branches or pull requests