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

Key binding discussion #65

Closed
punassuming opened this issue Nov 2, 2014 · 13 comments
Closed

Key binding discussion #65

punassuming opened this issue Nov 2, 2014 · 13 comments

Comments

@punassuming
Copy link
Contributor

If we are concerned about ergonomics, what do you all think about adjusting some of the keybindings to less intensive keys?

I know with Vim when I got in that mind set, I remapped ; to : to save on pressing the shift. What about changing helm-M-x to SPC ; in the same vein? I have a hard time pressing all 3 keys.

In general, I think it would be good to remap bindings to 3 or less keys. The yank ring for example is typically tied to the y key. Why not SPC s y instead of the current SPC k i l?

I know that I can change everything on my side, but I am asking on a crowd level.

Also, has anyone seen what @tpope has done with unimpaired-vim, where he maps most movement specific keybindings to [ or ] + key? This extends the bracket key usage in Vim to multiple different aspects. For example next or previous error is ]l or [l respectively (referencing the listwin). Would a change away from using SPC for everything be frowned on, as I was thinking of trying to port over some of those features.

@syl20bnr
Copy link
Owner

syl20bnr commented Nov 2, 2014

Spacemacs key bindings are not written in stone. <SPC> k i l is funny and can be changed to <SPC> y right now :-)
But <SPC> : fits nicely with Vim way to execute ex commands, I don't want to change it because as Vim users we already have the muscle memory of : so <SPC> : is natural and easy to remember. It also offers good symmetry.

For the bracket my feeling is that it is not a better solution than <SPC> because it requires the pinky and I don't want to stress the pinky. <SPC> is very easy to reach so it is easy for your muscle memory to memorize it, moreover you won't have to train your muscle memory with a pinky movement that may damage your anatomy in the long run (I have absolutely no proof of that though ! :-)).

If a command needs repetition then create a micro-state for it (see the examples in the readme) in order to save boring required repetition of <SPC>.

I understand that <SPC> requires some time to get used to it but that's the whole point of spacemacs.

@syl20bnr
Copy link
Owner

syl20bnr commented Nov 3, 2014

I updated the last comment which was very very hard to read, I made it in a hurry between two appointments, sorry for this!

@danielwuz
Copy link
Contributor

@Ralesi +1

I would appreciate if we can have less key strokes for those frequent used command, e.g. evilnc-comment-or-uncomment-lines. This command is so often being used in my daily work that I bind it to M-; in my personal settings. Four keystrokes of this command seems too much for me.

@syl20bnr
Copy link
Owner

syl20bnr commented Nov 4, 2014

Originally it was just C in normal mode, we changed it recently to <SPC> n c c when switching to evil-nc. It is hard indeed but <SPC> n c opens up all the possibilities from nerd commenter whereas you just have comment toggle with M-;.

Anyway I propose to put a second binding for evilnc-comment-or-uncomment-lines on <SPC> ;.

@syl20bnr
Copy link
Owner

syl20bnr commented Nov 4, 2014

@Wolfy87 We could reconsider droping the n in <SPC> n c prefix. We don't care that's nerd commenter under the hood. We can move compilation under <SPC> C, it would make sense for me since to compile stuff is a harder action than jsut commenting stuff. So capital C reflects that compiling is a much more "heavy" command.

@punassuming
Copy link
Contributor Author

@Wolfy87 I like the split between 'c' for comments and 'C' for compilation as well. This goes along with my response to helm bindings we talked about in #71 about making the prefix bindings action specific and not necessarily package specific.

@punassuming
Copy link
Contributor Author

I went through the current bindings and here is what I find in terms of prefixes.

(NOTE: I have a few packages removed from default)

SPC Desc Prefix Command
SPC S Spelling Prefix Command
SPC a Applications Prefix Command
SPC as Shell Prefix Command
SPC b Buffers Prefix Command
SPC e Error Prefix Command
SPC f File Prefix Command
SPC g Git / VCS Prefix Command
SPC h help / helm Prefix Command
SPC i Insert Prefix Command
SPC j Join / Split Prefix Command
SPC n narrow / nerd-comment Prefix Command
SPC r replace / registers Prefix Command
SPC s search Prefix Command
SPC t toolbar / gui Prefix Command
SPC w window Prefix Command
SPC x text size / text editing Prefix Command
SPC z Cursor movement Prefix Command

@syl20bnr
Copy link
Owner

syl20bnr commented Nov 5, 2014

I'm surprised by this table, it does make sense even though I never made such a listing before. That's pretty cool :-)

Thank you for this, we will be able to use it as a basis to improve the documentation.

@valrus
Copy link
Contributor

valrus commented Nov 21, 2014

Sorry if this is obvious, but how can the SPC-prefix keys be rebound in my contrib layer? I disabled projectile and would like to have SPC p be used as a prefix for perspective.el instead. But (evil-leader/set-key "ps" 'persp-switch) doesn't work because SPC p isn't a prefix key. evil-leader doesn't seem to have any functions for unbinding keys. What do?

@syl20bnr
Copy link
Owner

@valrus Luckily enough it works if you put in your dotspacemacs/init function.

This make me think that we should not use projectile-commander since it brings nothing really new to the table. For shortcut discovery we already have guide-key. Moreover projectile-commander has a non-spacemacs-standard way to interact with the user.

@valrus
Copy link
Contributor

valrus commented Nov 21, 2014

Thank you!

@syl20bnr
Copy link
Owner

projectile-commander has been replaced by explicit key bindings in v0.16.0

@syl20bnr
Copy link
Owner

Since v0.29.0 it is now possible to change : and SPC : with dotspacemacs-command-key variable.

I'm still open to the other bindings discussed here, some of them have already been changed.

Closing the discussion for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants