0% found this document useful (0 votes)
104 views1 page

NG NDD Nyy: Handy-Dandy Vim Guide

This document provides a handy guide to some important Vim commands, including commands to go to the beginning or end of a line, delete or yank multiple lines, paste from the buffer, undo commands, and a global search/replace command. It also describes using abbreviations defined in .vimrc to expand text, like defining "main" to expand to "int main(void)".

Uploaded by

Philson Nah
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
104 views1 page

NG NDD Nyy: Handy-Dandy Vim Guide

This document provides a handy guide to some important Vim commands, including commands to go to the beginning or end of a line, delete or yank multiple lines, paste from the buffer, undo commands, and a global search/replace command. It also describes using abbreviations defined in .vimrc to expand text, like defining "main" to expand to "int main(void)".

Uploaded by

Philson Nah
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

HANDY-DANDY VIM GUIDE

Some important vim commands: $ go to end of current line 0 go to beginning of current line ^ go to first non-blank character in the current line G to go to last line nG to go to line n d$ from current position to end of line ndd to delete n lines starting from current line (lines deleted are put in buffer) nyy to yank (copy) n lines starting from curent line into the buffer p to paste whatever is in the buffer below the current line (hence, ndd followed by p mimics a cutand-paste; nyy followed by p mimics a copy-and-paste) P to paste whatever is in the buffer above the current line u to undo previous command x to delete current character (deleted character is put into buffer) And you can create abbreviation (ab) but defining it in .vimrc For example, I have in .vimrc this line: ab main int main(void) So everytime I type main it gets expanded into int main(void) for me. There is one very handy command I use in vim very often (not for programming though): :g/xxx/s//yyy/s to replace all occurences of xxx with yyy in the whole file

You might also like