Kakoune: [Discussion] Swap Space and Comma commands

Created on 25 Oct 2018  Â·  17Comments  Â·  Source: mawww/kakoune

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.

Most helpful comment

@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.

All 17 comments

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lenormf picture lenormf  Â·  4Comments

abitofalchemy picture abitofalchemy  Â·  3Comments

lenormf picture lenormf  Â·  4Comments

alexherbo2 picture alexherbo2  Â·  4Comments

valerdi picture valerdi  Â·  4Comments