dotfiles/emacs/.emacs.d/init/oni-js2-init.el

47 lines
1.4 KiB
EmacsLisp
Raw Normal View History

2018-07-10 04:00:02 +02:00
;;; oni-js2-init.el --- JS2-mode configuration -*- lexical-binding: t; -*-
2018-07-10 04:00:02 +02:00
;; Copyright (C) 2018 Tom Willemse
2018-07-10 04:00:02 +02:00
;; Author: Tom Willemse <tom@ryuslash.org>
;; Keywords: local
2018-07-10 04:00:02 +02:00
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with this program. If not, see <https://www.gnu.org/licenses/>.
;;; Commentary:
;; My `js2-mode' configuration.
;;; Code:
2018-07-10 04:00:02 +02:00
(require 'js2-mode)
2018-07-10 05:00:59 +02:00
(require 'js2-refactor)
2018-07-10 04:00:02 +02:00
(setq js2-strict-trailing-comma-warning nil)
(setq js2-basic-offset 2)
2018-07-10 04:00:02 +02:00
(add-hook 'js2-mode-hook 'subword-mode)
(add-hook 'js2-mode-hook 'flycheck-mode)
(add-hook 'js2-mode-hook 'company-mode)
(add-hook 'js2-mode-hook 'fci-mode)
2018-07-10 04:00:02 +02:00
(add-hook 'js2-mode-hook 'electric-pair-local-mode)
(add-hook 'js2-mode-hook 'tern-mode)
(add-hook 'js2-mode-hook 'js2-refactor-mode)
(add-hook 'js2-mode-hook 'fic-mode)
2018-07-10 04:30:56 +02:00
(add-hook 'js2-mode-hook 'whitespace-only-tabs-mode)
2018-07-10 04:00:02 +02:00
2018-07-10 05:00:59 +02:00
(js2r-add-keybindings-with-prefix "C-c r")
2018-07-10 04:00:02 +02:00
(provide 'oni-js2-init)
;;; oni-js2-init.el ends here