I can normally yank like this in the command-line mode :1,61y
, but how do I yank that to, say, the "*
(clipboard) register? :"*1,61y
doesn't work, and :h c_y
shows nothing.
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.
Yes. Hit Ctrl - R then " . If you have literal control characters in what you have yanked, use Ctrl - R , Ctrl - O , " .
#vim. Use CTRL-R " when entering a command in command mode to paste the current paste buffer contents. Substitute " for a buffer name, % for current filename, / for last search term, + for the X clipboard or a host of other substitutions. CTRL-R also works in insert mode, no more skipping back to normal mode to paste!
vim has two "modes": COMMAND mode and INSERT mode. In COMMAND mode, you execute commands (like undo, redo, find and replace, quit, etc.). In INSERT mode, you type text. There is a third mode, VISUAL mode, that is used to highlight and edit text in bulk.
The register name comes after the range and yank portions:
:1,61y *
See :h :yank
:
:[range]y[ank] [x] Yank [range] lines [into register x].
If you just type "*61yy
while in command mode, you will yank the next 61 lines into the *
buffer. (Note there is no colon before the command)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With