Introduction
Most likey there will be a time (for one reason or another) where you need to insert a number of spaces to a set of lines within a text file.
Within this short article we will show you how via the use of VIM.
Steps
1. Within VIM select blockwise visual mode, by pressing CTRL-V.
2. Use the cursor keys to select the lines you want to add the spaces to.
3. Then enter :'<,’> norm I .
4. This will then insert a single space to the beginning of your select lines.
Lets break down the command :'<,’> norm I
:'<,’> : For the line I selected
norm : Execute the following sequence of keystrokes as if I was in normal mode
I: Insert at the beginning of the line the following characters
[space]: The character(s) you would like to insert
References
- NETCONF & YANG: Automate Network Configs via Python - April 2, 2026
- Palo Alto – How to Configure Your Next-Generation Firewall - April 2, 2026
- How to Harden Linux SSH: Keys, Fail2ban & Ciphers - March 1, 2026
Want to become a Linux expert ?
Here is our hand-picked selection of the best courses you can find online:
Linux Mastery course
Linux Administration Bootcamp
and our recommended certification practice exams:
Delta Practice Tests