Skip to content

Latest commit

 

History

History
57 lines (40 loc) · 1.37 KB

QUICKSTART.md

File metadata and controls

57 lines (40 loc) · 1.37 KB

Vim Quick Start Guide

Vim Configuration (.vimrc)

set number relativenumber    # Show line numbers (absolute for current line, relative for others)
set expandtab               # Convert tabs to spaces
set tabstop=4               # Number of spaces a tab counts for
set shiftwidth=4            # Number of spaces for each step of autoindent
set softtabstop=4           # Number of spaces a tab counts for while editing

Basic Navigation

  • h - Move left
  • j - Move down
  • k - Move up
  • l - Move right

Mode Switching

  • Esc - Switch to normal mode
  • i - Switch to insert mode
  • v - Switch to visual mode

File Operations

  • :w - Save file
  • :q - Quit
  • :wq - Save and quit

Movement Commands

  • {NUMBER}k - Move up NUMBER lines
  • {NUMBER}j - Move down NUMBER lines
  • a - Moves the cursor 1 character to the right and enters insert mode
  • w - Jump to the start of the next word
  • b - Jump to the start of the previous word

Editing Commands

  • x - Delete character under cursor (in normal mode)
  • d - Delete (requires a motion command)
  • dd - Delete entire line

Copy and Paste

  • y - Yank (copy)
  • p - Paste
  • Note: delete and yank operations go into the same buffer, ready for p to use

Visual Mode Selection

  • v - Character-wise visual mode
  • Shift+v - Line-wise visual mode
  • Ctrl+v - Block-wise visual mode