VI Editor

VI Editor is a powerful and efficient text editor once you become familiar with its commands.

What is VI Editor

The vi editor is a text editor under Unix and Linux architecture. It can be challenging to learn and use it. After you become familiar with its commands, it will be your powerful and efficient tool to work on the OpenWrt-based routers and Linux operation system.

The OutdoorRouter's SSH terminal supports VI editor in comand-line mode. You can use the VI editor to search and edit most files after having the file path.

For a file named example.php, the command to open it with VI editor under SSH terminal will be

vi example.php

Basic Commands

Here are some basic commands for operating the VI editor under an SSH terminal.

  • h, j, k, l: Move the cursor left, down, up, and right, respectively.

  • i: Enter Insert mode before the cursor.

  • a: Enter Insert mode after the cursor.

  • dd: Delete a line.

  • yy: Yank (copy) a line.

  • p: Paste the contents of the buffer after the cursor.

  • :w: Write (save) the file.

  • :q: Quit the editor.

  • :wq or ZZ: Write and quit.

  • :q!: Quit without saving changes.

Last updated