spacemacs/layers/+lang/scala/funcs.el
Joao Azevedo d947556406 Add ENSIME jump handlers to the proper modes
Move scala handler to scala layer
2017-12-17 15:24:47 -05:00

40 lines
1.2 KiB
EmacsLisp

;;; funcs.el --- Scala Layer functions File for Spacemacs
;;
;; Copyright (c) 2012-2017 Sylvain Benner & Contributors
;;
;; Author: Sylvain Benner <sylvain.benner@gmail.com>
;; URL: https://github.com/syl20bnr/spacemacs
;;
;; This file is not part of GNU Emacs.
;;
;;; License: GPLv3
(defun spacemacs//scala-setup-ensime ()
"Setup ENSIME for Scala."
(spacemacs//java-setup-ensime)
(add-to-list 'spacemacs-jump-handlers-scala-mode 'ensime-edit-definition))
(defun spacemacs//scala-disable-flycheck-scala ()
(push 'scala flycheck-disabled-checkers))
(defun spacemacs/scala-join-line ()
"Adapt `scala-indent:join-line' to behave more like evil's line join.
`scala-indent:join-line' acts like the vanilla `join-line',
joining the current line with the previous one. The vimmy way is
to join the current line with the next.
Try to move to the subsequent line and then join. Then manually move
point to the position of the join."
(interactive)
(let (join-pos)
(save-excursion
(goto-char (line-end-position))
(unless (eobp)
(forward-line)
(call-interactively 'scala-indent:join-line)
(setq join-pos (point))))
(when join-pos
(goto-char join-pos))))