Close
AlgoliaLogoLight
Close full mode
logo

Replacement within a single line

Git RepositoryEdit on Github

Replacement within a single line

Incase you want to search and replace some word in line of code

How to do with vim?

Steps

//Example
let obj = {
key1: 'value1',
key2: 'value3',
key3: 'value3',
};
  • drop cursor on line do you want to select
  • type :s/key/value/g
  • then the line contain key get replace to value
  • Done!
//Example
let obj = {
value1: 'value1',
key2: 'value3',
key3: 'value3',
};

demo

Loading comments...