Search code examples
vimperator

Copy Arbitrary Text by Keyboard with Vimperator


Is there a way to copy arbitrary text via keyboard with vimperator?

I just figured out how to copy/yank links.

I could imagine a shortcut for jumping from div/span/etc.. to div/span/etc.. but I could not find anything about this in the documentation.


Solution

  • Yes, the caret and visual modes are used for this purpose. The caret mode is like normal mode in Vim. Press c to enter caret mode, and navigate to the text you wish to copy, then press v to enter visual mode and select the text. Then press y. In visual mode, y yanks the selection.

    Of course, using this combined with search is more efficient, since search will put the caret at the beginning of the search term, just as it does in Vim.

    Edit: You can also yank text selected with the mouse using Y if you for some reason would want to do that.