2016-04-06 12:20:44 +00:00
|
|
|
|
;;; funcs.el --- Javascript Layer functions File for Spacemacs
|
|
|
|
|
;;
|
|
|
|
|
;; Copyright (c) 2012-2016 Sylvain Benner & Contributors
|
|
|
|
|
;;
|
|
|
|
|
;; Author: Muneeb Shaikh <muneeb@reversehack.in>
|
|
|
|
|
;; URL: https://github.com/syl20bnr/spacemacs
|
|
|
|
|
;;
|
|
|
|
|
;; This file is not part of GNU Emacs.
|
|
|
|
|
;;
|
|
|
|
|
;;; License: GPLv3
|
|
|
|
|
|
2016-06-21 23:03:18 +00:00
|
|
|
|
|
|
|
|
|
;; tern
|
|
|
|
|
|
|
|
|
|
(defun spacemacs//set-tern-key-bindings (mode)
|
|
|
|
|
"Set the key bindings for tern and the given MODE."
|
2016-09-04 16:24:43 +00:00
|
|
|
|
(add-to-list (intern (format "spacemacs-jump-handlers-%S" mode))
|
2016-08-22 16:08:25 +00:00
|
|
|
|
'tern-find-definition)
|
2016-06-21 23:03:18 +00:00
|
|
|
|
(spacemacs/set-leader-keys-for-major-mode mode
|
|
|
|
|
"rrV" 'tern-rename-variable
|
|
|
|
|
"hd" 'tern-get-docs
|
|
|
|
|
"gG" 'tern-find-definition-by-name
|
|
|
|
|
(kbd "C-g") 'tern-pop-find-definition
|
|
|
|
|
"ht" 'tern-get-type))
|
|
|
|
|
|
|
|
|
|
(defun spacemacs//tern-detect ()
|
2016-04-06 12:20:44 +00:00
|
|
|
|
"Detect tern binary and warn if not found."
|
2016-04-08 03:13:25 +00:00
|
|
|
|
(let ((found (executable-find "tern")))
|
|
|
|
|
(unless found
|
|
|
|
|
(spacemacs-buffer/warning "tern binary not found!"))
|
|
|
|
|
found))
|