aboutsummaryrefslogtreecommitdiffstats
path: root/emacs/.emacs.d/init
diff options
context:
space:
mode:
Diffstat (limited to 'emacs/.emacs.d/init')
-rw-r--r--emacs/.emacs.d/init/oni-elec-pair-init.el30
-rw-r--r--emacs/.emacs.d/init/oni-eshell-init.el54
-rw-r--r--emacs/.emacs.d/init/oni-eshell-init.org46
-rw-r--r--emacs/.emacs.d/init/oni-js-mode-init.el35
-rw-r--r--emacs/.emacs.d/init/oni-js-mode-init.org16
-rw-r--r--emacs/.emacs.d/init/oni-js2-init.el2
-rw-r--r--emacs/.emacs.d/init/oni-org-init.el4
-rwxr-xr-xemacs/.emacs.d/init/oni-web-mode-init.el7
8 files changed, 130 insertions, 64 deletions
diff --git a/emacs/.emacs.d/init/oni-elec-pair-init.el b/emacs/.emacs.d/init/oni-elec-pair-init.el
new file mode 100644
index 0000000..6874d10
--- /dev/null
+++ b/emacs/.emacs.d/init/oni-elec-pair-init.el
@@ -0,0 +1,30 @@
+;;; oni-elec-pair-init.el --- Electric pair config -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2018 Tom Willemse
+
+;; Author: Tom Willemse <tom@ryuslash.org>
+;; Keywords: local
+
+;; 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 configuration for `electric-pair-mode' and friends.
+
+;;; Code:
+
+(setq electric-pair-skip-whitespace 'chomp)
+
+(provide 'oni-elec-pair-init)
+;;; oni-elec-pair-init.el ends here
diff --git a/emacs/.emacs.d/init/oni-eshell-init.el b/emacs/.emacs.d/init/oni-eshell-init.el
new file mode 100644
index 0000000..bae1acb
--- /dev/null
+++ b/emacs/.emacs.d/init/oni-eshell-init.el
@@ -0,0 +1,54 @@
+;;; oni-eshell-init.el --- Eshell config -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2018 Tom Willemse
+
+;; Author: Tom Willemse <tom@ryuslash.org>
+;; Keywords: local
+
+;; 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 Eshell configuration.
+
+;;; Code:
+
+(require 'eshell)
+(require 'em-prompt)
+
+(defun oni-eshell-init-C-d ()
+ "Call `delete-char' or close the buffer if it fails."
+ (interactive)
+ (condition-case err
+ (call-interactively #'delete-char)
+ (error (if (and (eq (car err) 'end-of-buffer)
+ (looking-back eshell-prompt-regexp nil))
+ (kill-buffer)
+ (signal (car err) (cdr err))))))
+
+(defun oni-eshell-init-enable-truncating-buffers ()
+ "Add `eshell-truncate-buffer' to `eshell-output-filter-functions'."
+ (add-to-list 'eshell-output-filter-functions 'eshell-truncate-buffer))
+
+(add-hook 'eshell-load-hook #'oni-eshell-init-enable-truncating-buffers)
+(add-hook 'eshell-mode-hook 'eshell-fringe-status-mode)
+
+(defun oni:set-eshell-C-d ()
+ "Set `C-d' to quit eshell if used at end of prompt."
+ (define-key eshell-mode-map (kbd "C-d") #'oni-eshell-init-C-d))
+
+(add-hook 'eshell-first-time-mode-hook #'oni:set-eshell-C-d)
+
+(provide 'oni-eshell-init)
+;;; oni-eshell-init.el ends here
diff --git a/emacs/.emacs.d/init/oni-eshell-init.org b/emacs/.emacs.d/init/oni-eshell-init.org
deleted file mode 100644
index b3c6391..0000000
--- a/emacs/.emacs.d/init/oni-eshell-init.org
+++ /dev/null
@@ -1,46 +0,0 @@
-#+TITLE: Eshell configuration
-
-#+BEGIN_SRC emacs-lisp
- (require 'eshell)
- (require 'em-prompt)
-#+END_SRC
-
-Truncate the eshell buffer when it gets larger than
-=eshell-buffer-maximum-lines= number of lines. For some reason I have
-to use the =eshell-load-hook= instead of just relying on ~eshell.el~
-and ~esh-mode.el~ being loaded because it seems that
-=with-eval-after-load= loads this file before ~eshell.el~ is actually
-loaded.
-
-#+BEGIN_SRC emacs-lisp
- (defun oni:enable-truncating-eshell-buffers ()
- (add-to-list 'eshell-output-filter-functions 'eshell-truncate-buffer))
-
- (add-hook 'eshell-load-hook #'oni:enable-truncating-eshell-buffers)
-#+END_SRC
-
-Show the status of each command in the fringe of the eshell buffer.
-
-#+BEGIN_SRC emacs-lisp
- (add-hook 'eshell-mode-hook 'eshell-fringe-status-mode)
-#+END_SRC
-
-Close the buffer when C-d is pressed and we're at the end of the
-buffer.
-
-#+BEGIN_SRC emacs-lisp
- (defun oni:eshell-C-d ()
- "Call `delete-char' or close the buffer if it fails."
- (interactive)
- (condition-case err
- (call-interactively #'delete-char)
- (error (if (and (eq (car err) 'end-of-buffer)
- (looking-back eshell-prompt-regexp nil))
- (kill-buffer)
- (signal (car err) (cdr err))))))
-
- (defun oni:set-eshell-C-d ()
- (define-key eshell-mode-map (kbd "C-d") #'oni:eshell-C-d))
-
- (add-hook 'eshell-first-time-mode-hook #'oni:set-eshell-C-d)
-#+END_SRC
diff --git a/emacs/.emacs.d/init/oni-js-mode-init.el b/emacs/.emacs.d/init/oni-js-mode-init.el
new file mode 100644
index 0000000..d7886ce
--- /dev/null
+++ b/emacs/.emacs.d/init/oni-js-mode-init.el
@@ -0,0 +1,35 @@
+;;; oni-js-mode-init.el --- js-mode config -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2018 Tom Willemse
+
+;; Author: Tom Willemse <tom@ryuslash.org>
+;; Keywords: local
+
+;; 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:
+
+;; Configuration for `js-mode'.
+
+;;; Code:
+
+(require 'js)
+
+(setq js-enabled-frameworks '(javascript))
+
+(add-hook 'js-mode-hook 'electric-pair-local-mode)
+(add-hook 'js-mode-hook 'electric-indent-local-mode)
+
+(provide 'oni-js-mode-init)
+;;; oni-js-mode-init.el ends here
diff --git a/emacs/.emacs.d/init/oni-js-mode-init.org b/emacs/.emacs.d/init/oni-js-mode-init.org
deleted file mode 100644
index e28e84d..0000000
--- a/emacs/.emacs.d/init/oni-js-mode-init.org
+++ /dev/null
@@ -1,16 +0,0 @@
-#+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
-
-Turn on electric indent mode for js-mode buffers.
-
-#+BEGIN_SRC emacs-lisp
- (add-hook 'js-mode-hook 'electric-indent-local-mode)
-#+END_SRC
diff --git a/emacs/.emacs.d/init/oni-js2-init.el b/emacs/.emacs.d/init/oni-js2-init.el
index 506a2e5..df2191d 100644
--- a/emacs/.emacs.d/init/oni-js2-init.el
+++ b/emacs/.emacs.d/init/oni-js2-init.el
@@ -27,7 +27,9 @@
(require 'js2-mode)
(require 'js2-refactor)
+(setq js2-include-node-externs t)
(setq js2-strict-trailing-comma-warning nil)
+(setq js2-strict-missing-semi-warning nil)
(setq js2-basic-offset 2)
(add-hook 'js2-mode-hook 'subword-mode)
diff --git a/emacs/.emacs.d/init/oni-org-init.el b/emacs/.emacs.d/init/oni-org-init.el
index 223fb08..67559ff 100644
--- a/emacs/.emacs.d/init/oni-org-init.el
+++ b/emacs/.emacs.d/init/oni-org-init.el
@@ -29,13 +29,13 @@
(require 'org-capture)
(setq org-src-fontify-natively t)
+(setq org-return-follows-link t)
+(setq org-fontify-whole-heading-line t)
(setq org-hide-emphasis-markers t)
(setq org-return-follows-link t)
(add-hook 'org-mode-hook 'auto-fill-mode)
-
(add-hook 'org-mode-hook 'org-bullets-mode)
-
(provide 'oni-org-init)
;;; oni-org-init.el ends here
diff --git a/emacs/.emacs.d/init/oni-web-mode-init.el b/emacs/.emacs.d/init/oni-web-mode-init.el
index 3538f23..42734d2 100755
--- a/emacs/.emacs.d/init/oni-web-mode-init.el
+++ b/emacs/.emacs.d/init/oni-web-mode-init.el
@@ -24,6 +24,13 @@
;;; Code:
+(setq web-mode-attr-indent-offset 2)
+(setq web-mode-auto-quote-style 1)
+(setq web-mode-code-indent-offset 2)
+(setq web-mode-comment-style 2)
+(setq web-mode-css-indent-offset 2)
+(setq web-mode-css-indent-offset 2)
+
(add-hook 'web-mode-hook 'whitespace-only-tabs-mode)
(add-hook 'web-mode-hook 'flycheck-mode)
(add-hook 'web-mode-hook 'electric-pair-local-mode)