spacemacs/layers/+lang/javascript/funcs.el
2016-12-18 11:44:32 +02:00

32 lines
934 B
EmacsLisp
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

;;; 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
;; tern
(defun spacemacs//set-tern-key-bindings (mode)
"Set the key bindings for tern and the given MODE."
(add-to-list (intern (format "spacemacs-jump-handlers-%S" mode))
'(tern-find-definition :async t))
(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 ()
"Detect tern binary and warn if not found."
(let ((found (executable-find "tern")))
(unless found
(spacemacs-buffer/warning "tern binary not found!"))
found))