代码拉取完成,页面将自动刷新
同步操作将从 latpaw/emacs 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
(defvar preferred-javascript-indent-level 2)
;; Need to first remove from list if present, since elpa adds entries too, which
;; may be in an arbitrary order
(eval-when-compile (require 'cl))
(autoload 'js2-mode "js2-mode" nil t)
(setq auto-mode-alist (cons '("\\.js\\(\\.erb\\|on\\)?\\'" . js2-mode) auto-mode-alist))
;; json
(setq auto-mode-alist (cons '("\\.json\\'" . json-mode) auto-mode-alist))
;; js2-mode
(add-hook 'js2-mode-hook '(lambda ()
(setq mode-name "JS2")
(require 'requirejs-mode)
(requirejs-mode)
(require 'js-doc)
(define-key js2-mode-map "\C-cd" 'js-doc-insert-function-doc)
(define-key js2-mode-map "@" 'js-doc-insert-tag)
))
(setq js2-use-font-lock-faces t
js2-mode-must-byte-compile nil
js2-basic-offset preferred-javascript-indent-level
js2-indent-on-enter-key t
js2-auto-indent-p t
js2-bounce-indent-p t)
(eval-after-load 'js2-mode
'(progn
(require 'js2-imenu-extras)
(js2-imenu-extras-setup)))
;; js-mode
(setq js-indent-level preferred-javascript-indent-level)
;; standard javascript-mode
(setq javascript-indent-level preferred-javascript-indent-level)
(add-to-list 'interpreter-mode-alist (cons "node" 'js2-mode))
(eval-after-load 'coffee-mode
`(setq coffee-js-mode 'js2-mode
coffee-tab-width preferred-javascript-indent-level))
(add-hook 'coffee-mode-hook 'flymake-coffee-load)
;; ---------------------------------------------------------------------------
;; Run and interact with an inferior JS via js-comint.el
;; ---------------------------------------------------------------------------
(setq inferior-js-program-command "js")
(defun add-inferior-js-keys ()
(local-set-key "\C-x\C-e" 'js-send-last-sexp)
(local-set-key "\C-\M-x" 'js-send-last-sexp-and-go)
(local-set-key "\C-cb" 'js-send-buffer)
(local-set-key "\C-c\C-b" 'js-send-buffer-and-go)
(local-set-key "\C-cl" 'js-load-file-and-go))
(dolist (hook '(js2-mode-hook js-mode-hook))
(add-hook hook 'add-inferior-js-keys))
(provide 'init-javascript)
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。