乐闻世界logo
搜索文章和话题

What are the common delete, copy, paste, undo and replace commands in Vim?

2月21日 15:13

Vim provides rich text editing commands. Delete commands include: x to delete character, dw to delete word, dd to delete line, d$ to delete to end of line, d0 to delete to beginning of line, dG to delete to end of file. Copy commands: yw to copy word, yy to copy line, y$ to copy to end of line. Paste commands: p to paste after cursor, P to paste before cursor. Undo and redo: u to undo, Ctrl+r to redo. Search: /pattern to search forward, ?pattern to search backward, n for next match, N for previous match. Replace: :s/old/new to replace first occurrence in current line, :s/old/new/g to replace all in current line, :%s/old/new/g to replace all in file. These commands are key to Vim's editing efficiency.

标签:Vim