Episode #24 | Getting Started with Vim


Wednesday, 13 Feb 2019 Kudzai Nyandoro 13:16 Minutes

Description:

Learning to use the Vim text editor can be intimidating. Vim has a steep learning curve, but once you have the basics down, it can be a great and highly efficient text editor. Vim can be used for programming, writing blogs, short stories or novels. It has an extensive plugin system, it is highly configurable and it supports many programming languages. Vim has robust search and replace and it integrates very well with numerous other tools.

Notes:

Enter into vim.

$ vim

Edit mode.

i

Normal Mode.

ESC

Visual mode.

V

Select.

Shift + V

Go up.

K

Go down.

J

Go to the left.

H

Go to the right.

L

Go to the end of the line and start insert mode.

Shift + A

Quit vim.

:q

Vertical split

:vsp

Horizontal split

:sp

Go to the beginning of the line.

0

Go to the end of the line.

Shift  +  $

Force quit.

:q!

Write and save.

:w

Delete the line

:dd

Delete

d

Undo

u

Paste

p

Delete one character at a time.

x

Go to the top of the file.

GG

Go to the bottom of the file.

CTRL + G

Go to line 2.

:2

Go to line 3.

:3

Write, save and quit.

:wq

Go to the next line and start insert mode.

O

Go to the top of the line and start insert mode.

Shift + O

Search

/

Find the first character forward.

F  then any character you want to go to forward.

Find the first character backward

Shift + F  then any character you want to go to backward.

Turn off highlighting.
vim
:nohl