Use command: g in vim with multiple actions

How can I use something like this?

:g/^$/kJ 

Here kJ are two teams, not just one (e.g. 'd')

My specific example: I have several lines similar to

 queryBuilder .append("xyz"); 

and I want them to look like this:

 queryBuilder.append("xyz"); 

So what I want to do for each row

 :g/^[\t]*\..*$/kJx 

which matches the correct pattern, but seems to only execute k.

Are there other vim commands? How would you complete this task?

+6
source share
1 answer

Add the normal command to execute all of them, for example:

 :g/^[\t]*\..*$/normal kJx 
+9
source

Source: https://habr.com/ru/post/920627/


All Articles