(Re)formatting PHP code in Vim
问题 How do I format PHP code that looks like this class SomeClass { function insideclass() { } } into this, using Vim without any external tool? class SomeClass { function insideclass() { } } I am not arguing that this is the best way to format the code, but this is what we are following in the team. Edit : Removed reference to the snippet addon, which caused some confusion about the question. 回答1: You have two unrelated problems and you won't find a unique solution to both. You don't like the