vi - Reference
  • 23 Sep 2024
  • 1 Minute to read
  • Dark
    Light
  • PDF

vi - Reference

  • Dark
    Light
  • PDF

Article summary

vi is the default text editor on all Nodegrid appliances. The following table provides an overview of the most commonly used commands with the vi editor.

Command

Mode

Description

vi <filename>

-

To edit a file vi filename

ESC

Edit Mode

Exit Edit Mode

Enter Edit Mode

i

Command Mode

Insert text (access Edit Mode)

I

Command Mode

Insert text at beginning of line

a

Command Mode

Append text after cursor

A

Command Mode

Append text at end of line

o

Command Mode

Append a new line beneath the current one

O

Command Mode

Adds a new line above the current line

Quit

:w

Command Mode

Save

:wq

Command Mode

Save and Exit

:q

Command Mode

Exit

:q!

Command Mode

Exit and dont Save

Navigation

G

Command Mode

Jump to last line of file

<line number> G

Jump to line number of file


I

Command Mode

Jump to end of file

gg

Command Mode

Jump to beginning of file

num

Shows the current line number


Display

:set number

Command Mode

Save

:set nonumber

Command Mode

Save

Find

/<text_to_find>

Command Mode

Forwards lookup for a given string

?<text_to_find>

Command Mode

Backwards lookup for a given string

n

Command Mode

Proceeds to the next occurrence of the searched string


Was this article helpful?

ESC

Eddy AI, facilitating knowledge discovery through conversational intelligence