From fe8e8c09fd392d20c9fdbb9b25f35edfc46bbacb Mon Sep 17 00:00:00 2001 From: syl20bnr Date: Mon, 8 Dec 2014 00:39:19 -0500 Subject: [PATCH] Standardize some key bindings for javascript layer --- contrib/lang/javascript/README.md | 17 ++++++++--------- contrib/lang/javascript/packages.el | 11 +++++------ 2 files changed, 13 insertions(+), 15 deletions(-) diff --git a/contrib/lang/javascript/README.md b/contrib/lang/javascript/README.md index 587100dcd..8b9270609 100644 --- a/contrib/lang/javascript/README.md +++ b/contrib/lang/javascript/README.md @@ -100,15 +100,14 @@ Bindings should match the plain emacs assignments. ### Auto-complete and documentation (tern) - Key Binding | Description ---------------------|------------------------------------------------------------ -SPC m . | jump to the definition of the thing under the cursor -SPC m , | brings you back to last place you were when you pressed M-.. -SPC m c | rename variable under the cursor using tern -SPC m f | jump to definition for the given name -SPC m g | find docs of the thing under the cursor. Press again to open the associated URL (if any) -SPC m t | find the type of the thing under the cursor -SPC m w | toggle js2-mode warnings and errors + Key Binding | Description +---------------------|------------------------------------------------------------ +SPC m c | rename variable under the cursor using tern +SPC m d | find docs of the thing under the cursor. Press again to open the associated URL (if any) +SPC m g | jump to the definition of the thing under the cursor +SPC m G | jump to definition for the given name +SPC m C-g | brings you back to last place you were when you pressed M-.. +SPC m t | find the type of the thing under the cursor [js2-mode]: https://github.com/mooz/js2-mode [js2-refactor]: https://github.com/magnars/js2-refactor.el diff --git a/contrib/lang/javascript/packages.el b/contrib/lang/javascript/packages.el index cd9faa3cc..284a7b1fd 100644 --- a/contrib/lang/javascript/packages.el +++ b/contrib/lang/javascript/packages.el @@ -97,13 +97,12 @@ which require an initialization must be listed explicitly in the list.") :init (add-hook 'js2-mode-hook (lambda () (tern-mode t))) :config (progn - (spacemacs/declare-prefix-for-mode 'js2-mode "mt" "tern") - (evil-leader/set-key-for-mode 'js2-mode "m." 'tern-find-definition) - (evil-leader/set-key-for-mode 'js2-mode "m," 'tern-pop-find-definition) - (evil-leader/set-key-for-mode 'js2-mode "mf" 'tern-find-definition-by-name) (evil-leader/set-key-for-mode 'js2-mode "mc" 'tern-rename-variable) - (evil-leader/set-key-for-mode 'js2-mode "mt" 'tern-get-type) - (evil-leader/set-key-for-mode 'js2-mode "mg" 'tern-get-docs)))) + (evil-leader/set-key-for-mode 'js2-mode "md" 'tern-get-docs) + (evil-leader/set-key-for-mode 'js2-mode "mg" 'tern-find-definition) + (evil-leader/set-key-for-mode 'js2-mode "mG" 'tern-find-definition-by-name) + (evil-leader/set-key-for-mode 'js2-mode (kbd "m C-g") 'tern-pop-find-definition) + (evil-leader/set-key-for-mode 'js2-mode "mt" 'tern-get-type)))) (defun javascript/init-tern-auto-complete () (use-package tern-auto-complete