Sitemap
Nirbhay Singh

Nirbhay Singh

Technophile, Assistant Vice President at CITI, talks about AI, DevOps, Cloud, SRE, Linux and Programming. https://buymeacoffee.com/nirbhaysingh281

Member-only story

Vim editor in Linux

2 min readFeb 9, 2023

Vim (Vi Improved) is a text editor in Linux that is widely used for editing configuration files, programming, and scripting. Vim has two modes of operation: Normal mode and Insert mode. In Normal mode, you can perform various operations such as moving the cursor, deleting text, and executing commands. In Insert mode, you can insert text into the file.

Here are some of the basic commands to use Vim:

  1. Open a file in Vim: vim filename
  2. Move the cursor:
  • Up: k
  • Down: j
  • Left: h
  • Right: l

3. Insert text: i (enter Insert mode) and then type the text you want to insert. To return to Normal mode, press Esc.

4. Delete a character: x (while in Normal mode)

5. Delete a line: dd (while in Normal mode)

6. Undo changes: u (while in Normal mode)

7. Redo changes: Ctrl + r (while in Normal mode)

8. Save changes: :w (while in Normal mode)

9. Quit Vim: :q (while in Normal mode)

10. Quit and save changes: :wq (while in Normal mode)

11. Quit without saving changes: :q! (while in Normal mode)

12. Copy a line: yy (while in Normal mode)

13. Paste a copied line: p (while in Normal mode)

--

--

Technophile, Assistant Vice President at CITI, talks about AI, DevOps, Cloud, SRE, Linux and Programming. https://buymeacoffee.com/nirbhaysingh281