Why do I keep missing my line pasting?

Hello there,

I think I got a wrong approach when yanking/pasting lines.

I’d like to mimic the vim Vjjd in Kakoune with xjjd but when I paste it somewhere, it still join an line at the end of the copied one.

How I the easiest way to do it ? I think my best chance is adding a X just before d but is there a better way ? And, I still miss the real impact of X cause with it, I can paste anywhere (in middle of a line) and it will paste after the line return.

What are the tricks about yanking/pasting ?

Do you mean xJJd ?
I’m not sure what you mean by " it still join an line at the end of the copied one." and " I can paste anywhere (in middle of a line) and it will paste after the line return.", but I’ll try to answer anyway :stuck_out_tongue:

After doing xJJ you can press l to select the remaining ‘\n’ characater. So the full sequence would be xJJld, but you also do xXX, XXX or even better: 3X.

In kakoune ‘\n’ is like any other character, you put you cursor on it and remplace it , delete it, and hover it in your ‘visual’ selection …
I don’t think it’s the case in vim, maybe that can be tricky when you come form this editor.

1 Like

Do you mean xJJd ?

Yep !

it still join an line at the end of the copied one.

In fact, I understood I have to take the last trailing line return because without it, I’ll just join the next line.

I made a little screencast to demonstrate :smiley:

screencast of bad yank/paste

I can paste anywhere (in middle of a line) and it will paste after the line return.

I mean I can put my cursor in the middle of a line and juste press p and it will paste after the next line return, in the next line so. This feels really crazy

I made another screencast :thinking: another screencast

After doing xJJ you can press l to select the remaining ‘\n’ characater. So the full sequence would be xJJld , but you also do xXX , XXX or even better: 3X .

That’s definitely the kind of mystic powers I was looking for ! Thanks a lot !