Grindset
LessonsPracticeStats
Getting Started
  • Intro to Modesmodes
  • Basic Movementhjkl
  • Moving by Wordsweb
  • Insert ModeiaEsc
Insert Like a Pro
  • Uppercase Commandsshift
  • Insert at Line EndsIAEsc
  • Opening New LinesoO
  • Making Small Editssxr
Essential Motions
  • Moving by WORDsWEB
  • Moving to Line Ends0_$
  • Find CharacterfF;
  • Till CharactertT;
Basic Operators
  • Intro to Operatorsoperators
  • Delete Wordsdw
  • Change Wordscw
  • Delete LinesddD
  • Delete Multiple Linesdjk
  • Copy/Paste LinesypP
Advanced Vertical Movement
  • Relative Line Jumps{n}jk
  • Absolute Line JumpsggG
  • Paragraph Jumps}{
  • Window ScrollsCtrl+uCtrl+d
Search
  • Search/?
  • Repeat SearchnN
  • Quick Word Search*#
  • Search ReviewReview
Text Objects: Brackets
  • Intro to Text Objectstext objects
  • Delete Inside Bracketsdi{
  • Delete Around Bracketsda{
  • Change Inside Bracketsci{
  • Change Around Bracketsca{
  • Brackets ReviewReview
Text Objects: Quotes
  • Delete Inside Quotesdi"
  • Delete Around Quotesda"
  • Change Inside Quotesci"
  • Change Around Quotesca"
  • Quotes ReviewReview
Text Objects: Words
  • Delete Inside Worddiw
  • Delete Around Worddaw
  • Change Inside Wordciw
  • Words ReviewReview
Text Objects: Paragraphs
  • Delete Inside Paragraphdip
  • Delete Around Paragraphdap
  • Change Inside Paragraphcip
  • Paragraphs ReviewReview
Text Objects: Mega Review
  • Text Objects Mega ReviewMega Review
Visual Mode
  • Intro to Visual ModevEsc
  • Visual Mode Operatorsdcy
  • Switch Selection Endsvo
  • Visual Line ModeVEsc
  • Switch Visual Line EndsVo
  • Visual Line OperatorsVdy
Getting Started·Lesson 1

Intro to Modes

modes

The first idea to get comfortable with is modes. The same key does different things depending on which mode you are in.

Normal mode

This is home base. Keys are commands here, not text. You use it to:

  • move the cursor around
  • delete, change and copy text
  • combine small commands into bigger edits
1const total = price * quantity;
2if (total > limit) {
3 notify("over budget", total);
4}
NORMAL1:1

Pressing keys in normal mode moves the cursor; nothing gets typed.

Insert mode

This is the mode you already know from other editors: what you type goes into the file. Press i to enter it and Esc to go back to normal mode.

1const total = price * quantity;
2if (total > limit) {
3 notify("over budget", total);
4}
NORMAL1:7

`i` starts inserting, `Esc` returns to normal mode.

Rule of thumb
You'll spend most of your time in normal mode. Think of insert mode as a short trip: go in, type, come straight back out.

Try it out

1const total = price * quantity;
2if (total > limit) {
3 notify("over budget", total);
4}
NORMAL1:1
Next: Basic Movement

# Why have modes at all?

Because when letters aren't busy typing text, every key on the keyboard can be a command. That's how Vim edits so much with so few keystrokes.

Ctrl+j Next
Basic Movement