5

I've been trying to record a rather simple macro with two substitutions. The whole macro is: dd"+pkdd:%s/\t/, /g :%s/ \(kb\d\+\),/ \1.0,/g "+y$

However, the second substitution is there to reformat numbers from a format 123 to 123.0 but the input does not always need the substitution so it fails. When it fails the whole macro stops so the last part ("+y$) does not execute.

Is there any way to prevent this?

6

I've figured it out thanks to this. One needs to put an e flag to the substitution so the substitution looks like this: :%s/ \(kb\d\+\),/ \1.0,/ge. e suppresses the error message and lets the macro finish.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.