February 15, 2017

[HDGEM] How to cut-and-paste or copy-and-paste in vim

Visual selection is a common feature in applications, but Vim's visual selection has several benefits.

To cut-and-paste or copy-and-paste:

  1. Position the cursor at the beginning of the text you want to cut/copy.
  2. Press v to begin character-based visual selection, or V to select whole lines, or Ctrl-v or Ctrl-q to select a block.
  3. Move the cursor to the end of the text to be cut/copied. While selecting text, you can perform searches and other advanced movement.
  4. Press d (delete) to cut, or y (yank) to copy.
  5. Move the cursor to the desired paste location.
  6. Press p to paste after the cursor, or P to paste before.
Visual selection (steps 1-3) can be performed using a mouse.

If you want to change the selected text, press c instead of d or y in step 4. In a visual selection, pressing c performs a change by deleting the selected text and entering insert mode so you can type the new text

--
Posted By Blogger to HDGEM at 2/15/2017 12:26:00 PM
Post a Comment

Featured Post

The new Dell XPS 13’s overall design is 30% thinner and lighter than its predecessor

The new Dell XPS 13 has twice the performance of the XPS 13 launched in 2015, as well as improved battery life that should enable the model...