Kakoune: Provide default behavior for <a-c> and <a-d>

Created on 1 Feb 2017  Â·  6Comments  Â·  Source: mawww/kakoune

Hi

Currently, <a-c> and <a-d> are not mapped to anything by default.

I suggest these keys could have these very useful behaviors:

  • <c> yank and delete current selection and enter insert mode
  • <a-c> yank to null register and delete current selection and enter insert mode
  • <d> yank and delete current selection
  • <a-d> yank to null register and delete current selection

They fix a common problem that happens very often:

1 - you yank a selection (to the default "register by default)
2 - you go somewhere else in the document and delete something, like an extra new line for example.
3 - now you want to paste what you yanked, but bad surprise, your yanked selection is lost! It has been clobbered by the delete operation in between.

I'm sure you have also fallen in this trap more than once too.

At least hundreds of vimers have the same issue :

I know that I can already add the following lines in my kakrc:

map global normal <a-d> '"_d'
map global normal <a-c> '"_c'

But I believe they would fit nicely in the kakoune philosophy, since we don't introduce a totally different meaning for these keys ; they are just alternate behaviors of the existing keys.
It will be a perfect default that would help lots of new comers to kakoune and be very beneficial for old timers as well.

Most helpful comment

How about the Kill Ring from Emacs?

All 6 comments

Ugh, I already use shift-d for that and I never needed "_c so I'm not very keen on making this a default, but if more users agree I'll have no problem with it.

As much as I could use this (I also have those bindings in my configuration), the bindings are generally allocated depending on whether they provide a primitive or not, and we don't try to fill the space up with specializations just because they are unused. The only exception to that is when a specialization of one or a combination of other primitives is so redundant that it is given a mapping (e.g. <a-s>).

I think we'd better live our options open for those two keys, considering how easy it is to have what we want from the configuration file already, and also considering that we don't really need them that often (not as much as <a-s> for instance).

How about the Kill Ring from Emacs?

@alexherbo2: i'be been thinking about something like that, it should be doable with an external program, sometimes DE on linux have support for paste history in their clipboard.

I’ll like to not relying on external program for UI feature.

I think this issue can be closed.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

vbauerster picture vbauerster  Â·  3Comments

lenormf picture lenormf  Â·  4Comments

Delapouite picture Delapouite  Â·  4Comments

lenormf picture lenormf  Â·  4Comments

abitofalchemy picture abitofalchemy  Â·  3Comments