Removing Space Blocks in Emacs

I often end up with code blocks as follows:

public class CustomFile { public String path; public String name; public CustomFile (String pathToFile, String dbName) { path = pathToFile; name = dbName; } } 

I want my cursor to be above the line above public CustomFile and remove all spaces, but not including the public String name; . Is there a command or macro that will allow me to do this?

+4
source share
1 answer

It looks the way you want:

 Cx Co runs the command delete-blank-lines, which is an interactive compiled Lisp function in `simple.el'. It is bound to Cx Co. (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. 
+10
source

Source: https://habr.com/ru/post/1347618/


All Articles