kakoune
kakoune copied to clipboard
[Discussion] Swap Space and Comma commands
Current positions
Space → Clear multiple selections Alt Space → Remove a selection , → Enter in User mode ; → Reduce selections to their cursor
Changes
Space → Enter in User mode ; → Clear multiple selections Alt ; → Remove a selection , → Reduce selections to their cursor
Updates from the thread
In addition to an easy second move from Space, , (Clear multiple selections) is a good pair (although not physical) with ; (Reduce selections to their cursor).
If that change happens, how about in the same occasion swap ; (Clear multiple selections) and , (Reduce selections to their cursor) commands?
I think that clearing multiple selections (;) is a way more common operation than reducing selections to their cursor (,). So it would make sense to have it more accessible.
map global normal <space> ,
map global normal , <space>
Or there are some consequences?
Question is more about defaults, I swapped the mappings, presumably others did too, if the majority prefers to swap then perhaps it makes sense to rethink the default mappings.
Question is more about defaults
Ah, sorry.
if the majority prefers to swap then perhaps it makes sense to rethink the default mappings.
Well, I've noticed that some of keybindings were changed since when gifs for kakoune.org were recorded, for example Alt+' was replaced with Alt+Shift+9. Which confused be, because at first launch of Kakoune I've tried to do the same stuff as shown in gifs and was wondering why isn't it working.
So in my opinion mappings should be changed only if the change has strong meaningful explanation or sane mnemonic meaning. Like recent change of Alt+M - it was moved to Alt+_ to make Alt+M backward Alt+m. This makes sense, but for me there's no so strong excuse for swapping Space and ,. I'm actually clearing multiple selections more often than entering user
mode, so current Space behavior is more comfortable for me. However this may be the result of such an awkward position of user
mode key.
I like one quote from some talk on Vim meetup:
You can change any key in Vim to do anything you want. It's wonderful. It's horrible. You'll never know, if you sit down on someone else's Vim, what's gonna happen when you hit any key. If that's doesn't just fill your heart with thrill and terror then... don't use Vim.
That's one more point from me to leave it as is and just use mappings. I'm not highly against the change, just skeptic about the need, when we have map
and basically use our editor only by ourselves. And mapping it once will work forever.
If those keys will be swapped I think some of current users will swap them back (me included, maybe). New users, that will come after the change probably will be ok with it, because again I've never thought about swapping Alt+' and Alt+Shift+9 back as it was before I started to use Kakoune.
In addition to an easy second move from Space, , (Clear multiple selections) is a good pair (although not physical) with ; (Reduce selections to their cursor).
Maybe we should post this discussion on reddit and discuss, so we get more feedback on this? not all users have github accounts.
If that change happens, how about in the same occasion swap ; (Clear multiple selections) and , (Reduce selections to their cursor) commands?
So the final keys would look like: Space: enter user ;: clear multiple selections ,: reduce selection to cursor ?
Why do you think that this is needed to be like so? It looks for me like change in sake of change.
I think that clearing multiple selections (;) is a way more common operation than reducing selections to their cursor (,). So it would make sense to have it more accessible.
Isn't clearing multiple selections is far more common than user mode?
We can guess as much as we want but without any statistic data it's worth nothing. Personally I use reducing selection to single char quite a lot.
So in my opinion mappings should be changed only if the change has strong meaningful explanation or sane mnemonic meaning.
It's easy to remap keys but updating docs, videos on kakoune.org, golf solutions requires more work. So IMO - it's not broken - don't touch it .
I support both these changes, especially swapping space and ,. Having made that last change myself, this wouldn't affect me personally, but I think these are much better defaults for new users.
I found the wording of the issue a little confusing with regards to the current and proposed actions of , and ;.
@TeddyDD In addition to the statistics, there is the Alt chording (Remove a selection) to consider.
Alt ; is more accessible than Alt ,.
This proposal is based on assumption that everybody is using qwerty
keyboard layout, so I put my objection here.
When I started using kakoune I swapped defaults straight away to the following:
map global normal <space> ,
map global normal , <space>
But after some time, I've gained some experience and understood why space was chosen as key for remove all selections except main
. Because indeed it is most common operation, at least in my experience. But I didn't want to give up using space for user mode, so I found a trade off in order to maintain space as a leader
and easy access to remove all selections except main
:
map global user <space> <space> -docstring 'remove selections except main'
map global normal <space> ,
Pressing double space is easier and is keyboard layout agnostic.
Hi, I missed that discussion,
I must say that on principle, I quite like the proposed change, I think ;
, ,
and <a-;>
would form a nice group of related commands, and are pretty accessible. Additionally, I like the idea of freeing space to the user, as it seems spacemacs shown it can be pretty powerful to have space as a complex command introducer.
Regarding the qwerty-centeredness of those mapping, Kakoune is qwerty centered by design, think of /
and ?
, [
and {
...
We have however history to take into account, and <space>
is one of the oldest Kakoune command, lots of scripts depend on it, and this would be a huge breaking change. On that ground, I am not sure it would be worth it to change that now.
@mawww Regarding breaking changes, how about giving a name to commands?
Example
sTchou<ret>
Proposal
<select>Tchou<return>
Pros
- It removes pressure for breaking changes.
- It makes scripts easier to understand.
Pros / Cons
- It removes pressure on the keyboard.
I kinda like the Idea of that EVERYTHING is a named function in Emacs. So moving cursor to next line is a function, mowing to next word is a function. It allows users to implement their own functions to replace builtin ones, or wrap builtins to another functions. I understand that in Emacs it is possible, because Emacs is just an interpreter of Lisp, so maybe it isn't possible to do in Kakoune.
I'm using master and commit 2d8456db102e13f37a5cd271868c330d73580f6d seems to have introduced this change as the ,
and Space
keys seems to have been swapped.
Some feedback about the change: TBH, I prefer the old behavior, I use user mappings a lot more than I clear selections.
It feels a lot easier to use ,
than Space
, ,
is closer to the home row, and, pressing Space feels weird when not typing.
Pressing it with the left hand makes my hand go in a weird position, and pressing it with the right hate makes me move it away from the home row.
I was very surprised with these changes also, I was presenting an internal company talk and updated the system earlier that day and didn't really use kakoune until the talk as I didn't expect my editor to break of all things. :D (I am not angry, it's more like a funny anecdote)
Pressing space is extremely ergonomic and clearing selections is an extremely common task for most people, I reckon.
I prefer the idea from @vbauerster as it is layout agnostic. I use CZ QWERTZ, my semicolon is above the tab key, my comma is next to M, and other things are different too, but that's beside the point.
If nothing else, it would be nice to include config snippets for how to get old behavior back when making a breaking change release (if it exists, I am sorry, I must have missed it)
I was also surprised. It can be reverted with:
map global normal , <space>
map global normal <space> ,
Should this be closed now? It seems there will be no coming back. I personally don't mind the current mappings. They make more sense semantically.