Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VIM: how to append yanked text to unnamed register

Tags:

I know "Ayy can append current line to register a.

How do I append current line to unnamed register?

like image 861
xiaochen Avatar asked Aug 30 '13 15:08

xiaochen


People also ask

How do I paste a yanked line in terminal?

Pasting (Putting) To put the yanked or deleted text, move the cursor to the desired location and press p to put (paste) the text after the cursor or P to put (paste) before the cursor.

How do you paste text into yanked?

Yes. Hit Ctrl - R then " . If you have literal control characters in what you have yanked, use Ctrl - R , Ctrl - O , " .

How do I yank to a register in Vim?

2.2. Vim is a powerful editor. First, in the Normal mode, we move our cursor on the last word “editor” and press yaw to yank the word editor into the unnamed register “”. Next, we move the cursor to an empty line and press p without giving a register name. We'll see the yanked text “editor” is pasted.

How do I delete a register in Vim?

To clear the a register, for instance, I type q a q to set the a register to an empty string.


1 Answers

You can use this

:let @"=@".getline('.') 

to append to the unnamed register. I do not believe there is a keyboard shortcut to do this. (However you could create a mapping if you wanted.)


The reason I say that there is no keyboard shortcut for this is because :h quote_alpha only talks about uppercase letters (for appending). And there is no equivalent statement in :h quote_quote

like image 120
FDinoff Avatar answered Oct 22 '22 01:10

FDinoff