DEV Community

Kervie Sazon
Kervie Sazon

Posted on

Linux Fundamentals - Part 4: Continuation... Vim Experienced User Level, Veteran User Level and Expert User Level

Vim Experienced User Level

Focus on editing efficiency and movement shortcuts.

Advanced Navigation

Instead of moving one character or line at a time, Vim lets you jump directly to places in the text:
G - go to the end of the file.
gg - go to the beginning.
nG - go to line number n.
Example;
14G
The cursor go directly to the line 14.
Ctrl + g - show current line number
These commands help you quickly travel through large files without scrolling — super useful when dealing with configuration files or log files.

Searching Text with Vim

Learning how to search for words or phrases is powerful when editing long files:
/keyword - search forward (top to bottom)
?keyword - search backward (bottom to top)
Example:
?kervie
The cursor search for the word kervie from the bottom to the top.
n - next occurrence (forward)
N - previous occurrence (backward)
This lets you jump immediately to what you need instead of scanning line by line.
NOTE: This is case sensitive

Vim Substitution

Vim can replace a given a pattern keyword throughout the whole text. Vim also gives you an option to replace your pattern within a certain range of line numbers.

:s/oldWord/newWord - Used to change the first word in the line.
Example:
To replace the first occurrence of keyword apple with banana in the line, you can use command :s/apple/banana.

:s/oldWord/newWord/g - With g to replace the words in the same line.

10,20s/oldWord/newWord/g - Replace only between lines 10 to 20.
Example:
The :20,40s/apple/banana/g command would substitute “apple” for “banana” only between lines 20 and 40.

:%s/oldWord/newWord/g - To replace a word in whole document.

Vim Veteran User Level

External Shell Commands:

You don’t have to leave Vim to run basic shell commands:
:!ls - run ls in the system shell without quitting Vim.
:!date - run date.
This is helpful if you want to check file lists, dates, permissions, and more without abandoning your editor.

Advanced Save Options

You can save your work without quitting or even save it under a new file name:
:w - To save changes without closing.
:w otherfile.txt - To save to a different file.
This allows you to keep backups or version your changes manually.

Read or Write Portions of Text

Vim lets you extract or import text chunks:
v - Press v in normal mode to highlight a phrase.
:w selected.txt - To save highlighted text to a new file.
:r file.txt - To insert contents of file.txt into current file
This is extremely useful when copying pieces out of large text files or combining file content.

Vim Expert User Level

At the expert level, you start using power features and custom behavior:

Open New Lines Efficiently

Instead of switching to insert mode manually:
o - To insert a new line below the cursor and enter insert mode.
O - To insert a new line above
These let you structure text faster.

Yank (Copy) and Paste Better

You already know dd deletes and p pastes — but now:
y → yank (copy) text
5y → yank 5 lines at once
This lets you duplicate text without deleting originals.

Customize Vim

Vim reads settings from a file you can create:
~/.vimrc - your personal Vim configuration
Here you can enable syntax highlighting, change key behavior, set colors, and more.

Today, I advanced my Vim skills beyond the basics and explored Experienced, Veteran, and Expert user levels, based on real-world usage of Vim for Linux system administration.

Tomorrow, I will start studying Shell/Bash Scripting as Part 5 of my Linux learning journey, base on the roadmap that I followed.

Top comments (0)