I have a paatern like this.
func(a, "a");
func(b, "b");
func(abc, "abc");
...
I wish to replace them with
func(a);
func(b);
func(abc);
...
In vim, how can i do it?
I have a paatern like this.
func(a, "a");
func(b, "b");
func(abc, "abc");
...
I wish to replace them with
func(a);
func(b);
func(abc);
...
In vim, how can i do it?
This should do it.
If you're wanting a mass edit of the lines, it can be done using regex. Follow these steps:
On #5, it's a regex search and replace. "s" denotes the operation, then the match pattern, then what to replace it with. All delimited by a / key in between them and one at the end.
If you want more info, you can find some here: http://vimregex.com/
This might work but can't say for sure until we can see more of the input:
Try this subsitution:
Explanation:
%
- Run on whole file, "
- Matches the comma to first quote literally.\{-}"
- Match zero or more characters, as few as possible till"
//
- Replace the matched pattern with nothing.