Javatpoint Logo
Javatpoint Logo

vi switch from command mode

To start typing in vi editor, you have to be in insert mode. There are different commands in vi editor through which you can start typing at different locations in insert mode. They are defined below.

i

The i command allows us to write before the current character.

Example:

Linux vi Switch1

Look at the above snapshot, our cursor is at e. We forgot to write word command before word example. Hence, here we can use i command.

Linux vi Switch2

Look at the above snapshot, after pressing i, we wrote word command.

I

The command I allows us to write at the start of the current line.

Example:

Linux vi Switch3

Look at the above snapshot, we want to write word Hello at the starting of the line.

Linux vi Switch4

Look at the above snapshot, after pressing I, we have typed Hello at the starting of the line.

A

The A command allows us to start typing at the end of the current line.

Example:

Linux vi Switch5

Look at the above snapshot, we want to move at the end of the current line.

Linux vi Switch6

Look at the above snapshot, after pressing A, we have written one more line.

o

The o command allows us to start typing a new line after the current line.

Example:

Linux vi Switch7

Look at the above snapshot, we are at the middle of the line and want to start a new line.

Linux vi Switch8

Look at the above snapshot, after pressing o, we arrived at next line and typed there.

O

The O command allows us to start typing on a new line before the current line.

Example:

Linux vi Switch9

Look at the above snapshot, we are at the middle of the line and want to write before the current line.

Linux vi Switch10

Look at the above snapshot, after pressing O, we have written in a new line before the current line.

Next TopicLinux vi move





Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA