Vim – Introduction



Vim – Introduction

0 0


Vim-Editor-Introduction-Part-I

Introduction to Vim - Part I

On Github SUNY-Albany-CCI-LearningEncounters / Vim-Editor-Introduction-Part-I

Vim

Introduction

Created by Luis Ibanez

Vim Introduction by Luis Ibanez is licensed under a Creative Commons by Attribution 4.0 License Apache 2.0 License

Vim Editor

Vim

Introduction

Editing

text

files

Launch

Vim

from a command line prompt

Add the name of the file to edit

  • Filename will appear at the bottom
  • Empty lines are shown with "~" symbols

To start inserting text, type:

i

Now you are in INSERT mode. Start inserting text.

Inserting

  • The "i" key puts you in INSERT mode
  • The -- INSERT -- message appears at the bottom
  • You can start typing text

Joyfully type your text...

Hit ESC key to escape from the editing mode

After pressing ESC

you are back in COMMAND mode.

It looks like this.

Vim has

  • INSERT mode
  • COMMAND mode

To ENTER

INSERT mode

  • Press "i"

To EXIT

INSERT mode

  • Press "ESC"

Let's insert

more text

Enter INSERT mode by typing:

i

Navigate with the arrow keys and start typing text

To exit INSERT mode, hit the key:

ESC

Now you are back in COMMAND mode

Let's save

this file

From COMMAND mode, type:

:w

Then press ENTER to save the file

Writing

Most Vim commands are a single letter ":w" stands for "write"

Let's quit

the editor

From COMMAND mode, type:

:q

Then press ENTER to quit the editor

Quitting

Most Vim commands are a single letter ":q" stands for "quit"

Most

Vim commands

are a

single letter

To learn More...

Launch the

Vim Tutor

From the command line prompt, type:

vimtutor

It will look like this

Navigate with the arrow keys...

Read all

Lesson 1

Do the editing

Exercises

as you read

Lesson 1

Enjoy

Vim !