Copy, Cut and Paste in VIM Editor

Copying, Cutting and Pasting are top most three operations people use excessively. According to my knowledge VIM has made these operations extremely easy as compared to other editors. Here is how those are used:
Copying text

  • y: yank (copy) whatever’s selected
  • yy: yank the current line
Cutting text
Cutting text is simple: it’s the same as deleting. So whatever syntax you’re using for that, you’re actually just pulling that deleted text into a buffer and preparing it to be pasted.

  • dd: delete the current line
  • x: exterminate (delete) the character under the cursor
  • X: exterminate (delete) the character before the cursor
Pasting text
  • p: paste the copied (or deleted) text after the current cursor position
  • P: paste the copied (or deleted) text before the current cursor position]

You could use MODIFIERS & NOUNS along with above operations which make your task so easy. I will give you a small example here,
1. How to delete a "communication" word in a below sentence?
    "Real communication happens in silence only"
    If cursor is at beginning of the word then use dw - delete word
    If cursor is somewhere in middle of the word then use diw - delete inside word

Like that you could make use of MODIFIERS & NOUNS to carry out any operation so efficiently and effectively.

Comments

Popular posts from this blog

MBR partitioning with 'parted' utility

Disk Partitioning: MBR vs GPT

Replace default splash screen in Yocto