regex (vim) for print … to print(…) for python2 to python3
问题 This post is helpful only if you have strings inside of the print command. Now I have tons of sourcecode with a statement such as print milk,butter which should be formatted to print(milk,butter) And capturing the end of the line with \n was not sucessfull. Any hints? 回答1: I am not familiar with 2to3, but from all the comments, it looks like the correct tool for the job. That said, perhaps we can use this question as an excuse for a short lesson in some vim basics. First, you want a pattern