Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

vim replace multiple lines

# Replace all instances of foo with bar
:%s/foo/bar/g

# Replace all instances of foo in lines 6 to 10 inclusive with bar
:6,10s/foo/bar/g
Comment

how to edit multiple lines in vim

Move the cursor to the appropriate location.
Enter 'VISUAL BLOCK' mode (Ctrl v).
Use your directional keys to select required number of lines (j or k).
Press I (capital i).
Press Esc.

Note: Once exited out of 'VISUAL BLOCK' mode, changes will take effect.
Comment

vim replace between lines

:5,12s/foo/bar/g
Comment

PREVIOUS NEXT
Code Example
Shell :: install gulp ubuntu 
Shell :: htpasswd add user 
Shell :: failed to start openbsd secure shell server 
Shell :: ubuntu wsl go to desktop 
Shell :: git merge branch to master command line 
Shell :: git commit messages 
Shell :: linux read text file command line 
Shell :: trailing whitespace git apply 
Shell :: icon theme and widget ubuntu 
Shell :: docker remove dangling images 
Shell :: octoprint log location 
Shell :: ubuntu not showing video thumbnails 
Shell :: @material-ui/icons 
Shell :: change crontab editor 
Shell :: command to list system services 
Shell :: clock skew detected github 
Shell :: docker disable auto start 
Shell :: how to install apt 
Shell :: install.packages( tidyverse ) not working 
Shell :: bash for i in range 
Shell :: how to see staged files in git 
Shell :: print hello world in shell script 
Shell :: if command has output bash 
Shell :: uninstall npm package 
Shell :: append to a file from terminal 
Shell :: create folder with shell/bash 
Shell :: git reset to undo a merge 
Shell :: kubectl get namespaces 
Shell :: docker login command line push 
Shell :: skip husky 
ADD CONTENT
Topic
Content
Source link
Name
9+6 =