Skip to content

Instantly share code, notes, and snippets.

@yveszoundi
Created June 27, 2016 11:29
Show Gist options
  • Save yveszoundi/3b90779e9a1cf65ac6429c64e0ebb125 to your computer and use it in GitHub Desktop.
Save yveszoundi/3b90779e9a1cf65ac6429c64e0ebb125 to your computer and use it in GitHub Desktop.
Eclim format region or buffer
(defun eclim-java-format ()
"Format the source code of the current java source file."
(interactive)
(let ((positions (if (region-active-p)
(list (region-beginning) (region-end))
(list 0 (1- (point-max))))))
(eclim/execute-command "java_format" "-p" "-f" ("-h" (car positions)) ("-t" (cadr positions) ) "-e")))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment