我经常会遇到像这样的代码块:
public class CustomFile {
public String path;
public String name;
public CustomFile (String pathToFile, String dbName) {
path = pathToFile;
name = dbName;
}
}
我希望能够将光标放在public CustomFile
上方的行上,并且能够删除所有空格,但不包括public String name;
。是否有允许我这样做的命令或宏?
答案 0 :(得分:10)
这看起来像你想要的:
C-x C-o runs the command delete-blank-lines, which is an interactive
compiled Lisp function in `simple.el'.
It is bound to C-x C-o.
(delete-blank-lines)
On blank line, delete all surrounding blank lines, leaving just one.
On isolated blank line, delete that one.
On nonblank line, delete any immediately following blank lines.