Fork me on GitHub
#emacs
<
2019-12-06
>
theeternalpulse19:12:54

is there an evil-mode way of turning a yank line y y to be inserted at the cursor when p rather than newline?

ag19:12:26

I don’t get the question, I feel what you’re looking for is P

theeternalpulse19:12:54

well, p just inserts it in the lines above. Basically when you do yy it yanks the line but p and P never insert at cursor, but below or above where the cursor is

ag19:12:53

do you want to replace the existing stuff with yanked stuff? I don’t get it

theeternalpulse19:12:46

I want to insert a yanked line at the cursor without the newline

ag19:12:48

If you killed a line, you’d yank a line. I suppose you can write advising function that taps into evil-yank-characters or evil-yank-line and modify kill-ring content, but I feel you’re trying to solve a problem which is not a problem :)

ag19:12:54

I often get that urge to “fix” something, would spend hours trying to write lots of emacs-lisp only at the end to realize that I don’t have the problem to begin with. Emacs is weird, it makes you do weird stuff - just because you can.

yuhan20:12:36

I believe that's the reason for evil-textobj-line - ie. using yal instead of yy to begin with

yuhan20:12:56

I have a habit of using 0Y quite often

theeternalpulse22:12:38

@UCPS050BV yil actually worked nicely

theeternalpulse22:12:58

yal copies the whitespace, yil seems to ignore it

theeternalpulse22:12:31

I actually never think of l as a text object lol,

pesterhazy16:12:01

I guess you could use i ^R " instead of p?

theeternalpulse19:12:39

basically pased ignoring the newlines at the beginning and end of the yanked text