aboutsummaryrefslogtreecommitdiffstats
path: root/emacs
diff options
context:
space:
mode:
authorGravatar Tom Willemse2016-10-10 22:28:55 +0200
committerGravatar Tom Willemse2016-10-10 22:28:55 +0200
commite6f86a45211583f099615cd649e69b3c49a14a42 (patch)
tree65ee275a7037b72543b6f231afe91d61dd83ee1f /emacs
parent7bf363a46ad6f97aeda7b7c910f84bba42ef5b94 (diff)
downloadnew-dotfiles-e6f86a45211583f099615cd649e69b3c49a14a42.tar.gz
new-dotfiles-e6f86a45211583f099615cd649e69b3c49a14a42.zip
Add js-mode configuration
Diffstat (limited to 'emacs')
-rw-r--r--emacs/.emacs.d/GNUmakefile2
-rw-r--r--emacs/.emacs.d/init.org18
-rw-r--r--emacs/.emacs.d/init/js-mode-init.org10
3 files changed, 29 insertions, 1 deletions
diff --git a/emacs/.emacs.d/GNUmakefile b/emacs/.emacs.d/GNUmakefile
index 29ea17e..61e7e00 100644
--- a/emacs/.emacs.d/GNUmakefile
+++ b/emacs/.emacs.d/GNUmakefile
@@ -4,7 +4,7 @@ AUTOLOADS_FILE = site-lisp/site-autoloads.el
UNWANTED = $(AUTOLOADS_FILE) site-lisp/flycheck_% site-lisp/flycheck-%
SITE_LISPS = $(addsuffix c,$(filter-out $(UNWANTED),$(wildcard site-lisp/*.el)))
-all: init.elc $(AUTOLOADS_FILE) $(SITE_LISPS)
+all: init.elc init/js-mode-init.elc $(AUTOLOADS_FILE) $(SITE_LISPS)
%.el: %.org
$(call tangle,emacs-lisp)
diff --git a/emacs/.emacs.d/init.org b/emacs/.emacs.d/init.org
index c4970c6..82dd919 100644
--- a/emacs/.emacs.d/init.org
+++ b/emacs/.emacs.d/init.org
@@ -30,6 +30,13 @@ To start off, first I need to enable lexical binding.
(add-to-list 'package-archives '("org" . "http://orgmode.org/elpa/")))
#+END_SRC
+ Add the directory with my mode-specific configuration files to the
+ load path.
+
+ #+BEGIN_SRC emacs-lisp
+ (add-to-list 'load-path (locate-user-emacs-file "init/"))
+ #+END_SRC
+
Add all my vendored packages to the load path.
#+BEGIN_SRC emacs-lisp
@@ -674,6 +681,17 @@ To start off, first I need to enable lexical binding.
* Major modes
+ Configuration for major modes is specified in dedicated
+ configuration files.
+
+ - [[file:init/js-mode.org][js-mode]] :: JavaScript mode is used by me for json files. js2-mode
+ doesn't work very nicely with json, always showing syntax
+ errors.
+
+ #+BEGIN_SRC emacs-lisp
+ (with-eval-after-load 'js (load "js-mode-init"))
+ #+END_SRC
+
** Emacs lisp mode
Enable paredit mode.
diff --git a/emacs/.emacs.d/init/js-mode-init.org b/emacs/.emacs.d/init/js-mode-init.org
new file mode 100644
index 0000000..e7836c1
--- /dev/null
+++ b/emacs/.emacs.d/init/js-mode-init.org
@@ -0,0 +1,10 @@
+#+TITLE: JavaScript mode
+
+I use js-mode for json files because js2-mode always complains about
+syntax errors.
+
+Turn on electric pairing for js-mode buffers.
+
+#+BEGIN_SRC emacs-lisp
+ (add-hook 'js-mode-hook 'electric-pair-local-mode)
+#+END_SRC