Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

vim insert text at the the beginning of multiple lines

# Basic syntax:
1. Press ESC to ensure you are in command mode
2. Use CTRL+v to enter visual block mode
3. Move Up / Down to select the rows you want to add text to
4. Press SHIFT+i and type the text you want to insert (it will only
	show up on the current row for now)
5. Press ESC, and the typed text will appear in the lines you selected in 3
    
# To insert text at the beginning of every line in the file, use:
:%s!^!text_to_insert!
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #vim #insert #text #beginning #multiple #lines
ADD COMMENT
Topic
Name
5+3 =