Closed fommil closed 9 years ago
Hmm... maybe attach something to the find-file-hook
hook that will position the file.
yup, we might have some regex in ENSIME that finds the right place to put new imports... probably the thing we need here.
I can probably cook something up from https://github.com/ensime/ensime-emacs/blob/master/ensime-editor.el#L493
(defun scala-mode:goto-start-of-code ()
"Go to the start of the real code in the file: object, class or trait."
(interactive)
(let* ((case-fold-search nil))
(search-forward-regexp "\\([[:space:]]+\\|^\\)\\(class\\|object\\|trait\\)" nil t)
(move-beginning-of-line nil)))
put it in your scala-mode-hook
(if anybody actually wrote comments in Scala, perhaps we should jump to those as well)
it would be pretty useful to jump to the first non-package, non-import line in a scala file when opening.