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
- How to Configure a BIND Server on Ubuntu - March 15, 2018
- What is a BGP Confederation? - March 6, 2018
- Cisco – What is BGP ORF (Outbound Route Filtering)? - March 5, 2018
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:
AlphaPrep Practice Tests - Free Trial