开发者

Delete Blocks of Whitespace in Emacs

开发者 https://www.devze.com 2023-02-23 13:23 出处:网络
I often end up with blocks of code like this: public class CustomFile { public String path; public String name;

I often end up with blocks of code like this:

public class CustomFile {

    public String path;
    public String name;





    public CustomFile (String pathToFile, String db开发者_StackOverflow中文版Name) {
    path = pathToFile;
    name = dbName;
    }
}

I want to be able to put my cursor on the line above public CustomFile and be able to delete all of the whitespace up to but not including public String name;. Is there a command or macro that will allow me to do this?


This looks like what you want:

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.
0

精彩评论

暂无评论...
验证码 换一张
取 消