Exploring Key Features of Vim
Mastering Vim functionality can significantly boost your productivity, especially in command-line environments. Here's a breakdown of key Vim concepts:
Modes:
Vim operates in three primary modes:
Insert Mode (i): This mode allows you to type text into the file. Press I (or other insert mode keys) to enter this mode.
Command Mode (ESC): This is the default mode when you open Vim. In this mode, keystrokes don't directly modify the text. Instead, they perform actions like moving the cursor, deleting text, saving the file, or exiting Vim. Press ESC to switch to command mode from any other mode.
Visual Mode (v or ctrl-v): This mode allows you to select text visually for operations like copying, deleting, or replacing. Different keys like v, ctrl-v, or directional arrows with shift are used to enter different visual mode selections (character, line, block, etc.).
Basic Navigation:
Arrow Keys: Move the cursor up, down, left, or right.
h: Move left one character.
l: Move right one character.
j: Move down one line.
k: Move up one line.
0 (zero): Move to the beginning of the line.
$: Move to the end of the line.
G: Move to the end of the file.
gg: Move to the beginning of the file.
Saving and Exiting:
:wq= Save the file and quit Vim.
:q!= Quit Vim without saving (use with caution!).
Subscribe to my newsletter
Read articles from krishna prasad kondra directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
krishna prasad kondra
krishna prasad kondra
Currently, Learning the ways of cloud and DevOps.