Skip to content
hαrsh vαirαgi edited this page Jul 17, 2025 · 10 revisions

Demo

We are going to see a demo of how code-editor improve your productivity.

Click here to see the preview of code-editor.

initial-demo

What have we done?

  • We just opened the index.html file using vi index.html command.
  • Enters in insert mode pressing the i key.
  • Edited the html file and saved it using ctrl + s.

Usage

In this documentation we'll learn how to use code-editor (neovim) in brief.

Modes

code-editor (neovim) works a bit differently from most code editors. Instead of just typing directly into the code, you switch between different modes. Think of modes as different gears that change what your keyboard does. This might seem strange at first, but it's what makes code-editor incredibly efficient once you get the hang of it.

There are mainly five modes in code-editor (neovim) that we are going to see.

Click here to see the preview of each.
Mode Preview
Normal normal-mode
Insert insert-mode
Visual visual-mode
Visual Block visual-block-mode
Terminal terminal-mode

Normal Mode

When you open code-editor (neovim) using the vi command it's the default opened mode.

  • How to Enter: If you're ever unsure what mode you're in, just press the esc key a couple of times, this way you go back to this mode.
  • What it Does: This mode is for commands (not for the terminal but for code-editor).
  • Command: You need to mandatorily use a colon : before every command you execute. For example you can try a basic command to execute :echo "hello".

Insert Mode

Where you focus most of your time and efforts.

  • How to Enter: Press i (for "insert") while in normal mode. There are other ways to enter insert mode (like a to append after the cursor, o to open a new line below the current one), but i is the most common.
  • What it Does: This is the mode where you actually type text into your code, just like in vscode.
  • How to Exit: Press the esc key to return to normal mode.

Visual Mode

  • How to Enter: Press v (for "visual") while in normal mode or alt + v in insert mode.
  • What it Does: Visual mode lets you select text. You can use arrow keys to highlight the text you want to select and format them.
  • How to Exit: Press the esc key to return to normal mode.

Viusal Block Mode

Where you interact with multiline editing.

  • How to Enter: Press ctrl+v while in normal mode.
  • What it Does: Visual Block mode is like visual mode, but it allows you to select text in a rectangular block. This is incredibly useful for editing columns of text, like in tables or code with consistent indentation.
  • How it Works: Once in visual block mode, use the arrow keys to define the rectangular block you want to select. The cursor's starting position will be one corner of the rectangle.
  • How to Exit: Press the esc key to return to normal mode.

Terminal Mode

Where you interact with your linux shell.

  • How to Enter: Press ctrl+t while in normal mode. This opens a terminal window just like other code editors.
  • What it Does: Terminal mode gives you a fully functional command-line terminal directly within code-editor (neovim). You can run shell commands, execute programs, and do anything you would normally do in a terminal.
  • How to Exit: Press the esc key to return to normal mode and ctrl+d to close the window.
Clone this wiki locally