aboutsummaryrefslogtreecommitdiffstats
path: root/emacs
diff options
context:
space:
mode:
authorGravatar Tom Willemse2018-07-09 19:00:02 -0700
committerGravatar Tom Willemse2018-07-09 19:00:02 -0700
commit4cf35095ff2011825d2f51714d96564a7ff950b5 (patch)
treef76bef2fd293c9a9806028793b7f065535c88f5e /emacs
parente49529e2ecefe3523db970338bd6f1480079bf26 (diff)
downloadnew-dotfiles-4cf35095ff2011825d2f51714d96564a7ff950b5.tar.gz
new-dotfiles-4cf35095ff2011825d2f51714d96564a7ff950b5.zip
Add some js2-mode configuration
Diffstat (limited to 'emacs')
-rw-r--r--emacs/.emacs.d/init/oni-js2-init.el45
1 files changed, 40 insertions, 5 deletions
diff --git a/emacs/.emacs.d/init/oni-js2-init.el b/emacs/.emacs.d/init/oni-js2-init.el
index 2b9e7c8..5eae8e3 100644
--- a/emacs/.emacs.d/init/oni-js2-init.el
+++ b/emacs/.emacs.d/init/oni-js2-init.el
@@ -1,13 +1,48 @@
-(require 'js2-mode)
+;;; oni-js2-init.el --- JS2-mode configuration -*- lexical-binding: t; -*-
-(setq js2-strict-trailing-comma-warning nil)
+;; Copyright (C) 2018 Tom Willemse
-(add-hook 'js2-mode-hook 'subword-mode)
+;; Author: Tom Willemse <tom@ryuslash.org>
+;; Keywords: local
-(add-hook 'js2-mode-hook 'flycheck-mode)
+;; 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:
+(require 'js2-mode)
+
+(defun oni-js2-init--js2-whitespace-mode ()
+ "Enable whitespace mode with only tabs showing."
+ (setq-local whitespace-style '(face tabs))
+ (whitespace-mode))
+
+(setq js2-strict-trailing-comma-warning nil)
(setq js2-basic-offset 2)
+(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)
+(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)
+(add-hook 'js2-mode-hook 'oni-js2-init--js2-whitespace-mode)
+
+(provide 'oni-js2-init)
+;;; oni-js2-init.el ends here