From 2cc7412dfaf1369db021358d32b32c1ea345d51e Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Mon, 16 Jul 2018 20:17:49 -0700 Subject: Add electric pair config --- emacs/.emacs.d/init.el | 2 ++ emacs/.emacs.d/init/oni-elec-pair-init.el | 30 ++++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 emacs/.emacs.d/init/oni-elec-pair-init.el (limited to 'emacs/.emacs.d') diff --git a/emacs/.emacs.d/init.el b/emacs/.emacs.d/init.el index 3674054..781fa7f 100644 --- a/emacs/.emacs.d/init.el +++ b/emacs/.emacs.d/init.el @@ -347,6 +347,8 @@ ORIG-FUN is the function being wrapped, ARGS are the arguments specified" (with-eval-after-load 'org (load "oni-org-init")) +(with-eval-after-load 'elec-pair (load "oni-elec-pair-init")) + (add-to-list 'grep-files-aliases '("js" . "*.js *.jsx *.json")) (add-to-list 'grep-files-aliases '("css" . "*.css *.less *.sass *.scss")) (add-to-list 'grep-files-aliases '("php" . "*.php *.inc *.module")) 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 +;; 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 . + +;;; 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 -- cgit v1.2.3-54-g00ecf From 34eb203919ed05cf1cb0f4e405bcee4870872277 Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Mon, 16 Jul 2018 20:25:42 -0700 Subject: Move eshell config to separate file --- emacs/.emacs.d/init/oni-eshell-init.el | 54 +++++++++++++++++++++++++++++++++ emacs/.emacs.d/init/oni-eshell-init.org | 46 ---------------------------- 2 files changed, 54 insertions(+), 46 deletions(-) create mode 100644 emacs/.emacs.d/init/oni-eshell-init.el delete mode 100644 emacs/.emacs.d/init/oni-eshell-init.org (limited to 'emacs/.emacs.d') 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 +;; 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 . + +;;; 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 -- cgit v1.2.3-54-g00ecf From 5119e4592cbf052d8e5a59e575bed72cdeaf4665 Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Mon, 16 Jul 2018 20:29:00 -0700 Subject: Load flycheck init --- emacs/.emacs.d/init.el | 2 ++ 1 file changed, 2 insertions(+) (limited to 'emacs/.emacs.d') diff --git a/emacs/.emacs.d/init.el b/emacs/.emacs.d/init.el index 781fa7f..7ac74f9 100644 --- a/emacs/.emacs.d/init.el +++ b/emacs/.emacs.d/init.el @@ -349,6 +349,8 @@ ORIG-FUN is the function being wrapped, ARGS are the arguments specified" (with-eval-after-load 'elec-pair (load "oni-elec-pair-init")) +(with-eval-after-load 'flycheck (load "oni-flycheck-init")) + (add-to-list 'grep-files-aliases '("js" . "*.js *.jsx *.json")) (add-to-list 'grep-files-aliases '("css" . "*.css *.less *.sass *.scss")) (add-to-list 'grep-files-aliases '("php" . "*.php *.inc *.module")) -- cgit v1.2.3-54-g00ecf From 74052aa9eced3d05ec30f26dd31a7427ad875e79 Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Mon, 16 Jul 2018 20:36:19 -0700 Subject: Move js-mode config out of org-mode --- emacs/.emacs.d/init/oni-js-mode-init.el | 35 ++++++++++++++++++++++++++++++++ emacs/.emacs.d/init/oni-js-mode-init.org | 16 --------------- 2 files changed, 35 insertions(+), 16 deletions(-) create mode 100644 emacs/.emacs.d/init/oni-js-mode-init.el delete mode 100644 emacs/.emacs.d/init/oni-js-mode-init.org (limited to 'emacs/.emacs.d') 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 +;; 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 . + +;;; 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 -- cgit v1.2.3-54-g00ecf From 4b9fecb6f4225800265411102058ffec5a682a36 Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Mon, 16 Jul 2018 20:38:31 -0700 Subject: Include node externs and don't warn about semicolons --- emacs/.emacs.d/init/oni-js2-init.el | 2 ++ 1 file changed, 2 insertions(+) (limited to 'emacs/.emacs.d') 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) -- cgit v1.2.3-54-g00ecf From 082419878340c77124d3116b31570a71fb4db40a Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Mon, 16 Jul 2018 20:44:17 -0700 Subject: Update org-mode config --- emacs/.emacs.d/init/oni-org-init.el | 34 ++++++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) (limited to 'emacs/.emacs.d') diff --git a/emacs/.emacs.d/init/oni-org-init.el b/emacs/.emacs.d/init/oni-org-init.el index 14caaa2..ef29a96 100644 --- a/emacs/.emacs.d/init/oni-org-init.el +++ b/emacs/.emacs.d/init/oni-org-init.el @@ -1,11 +1,41 @@ +;;; oni-org-init.el --- Org mode config -*- lexical-binding: t; -*- + +;; Copyright (C) 2018 Tom Willemse + +;; Author: Tom Willemse +;; 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 . + +;;; Commentary: + +;; Org mode configuration. + +;;; Code: + (require 'org) (require 'org-bullets) (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 -- cgit v1.2.3-54-g00ecf From cb9fb07a4656a84f913b85f4be60b1b0be6b5b0d Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Mon, 16 Jul 2018 20:50:10 -0700 Subject: Add fabfile.py as projectile project file --- emacs/.emacs.d/init.el | 1 + 1 file changed, 1 insertion(+) (limited to 'emacs/.emacs.d') diff --git a/emacs/.emacs.d/init.el b/emacs/.emacs.d/init.el index 7ac74f9..4503849 100644 --- a/emacs/.emacs.d/init.el +++ b/emacs/.emacs.d/init.el @@ -230,6 +230,7 @@ ORIG-FUN is the function being wrapped, ARGS are the arguments specified" (setq projectile-completion-system 'ivy) (add-to-list 'projectile-project-root-files "yarn.lock") +(add-to-list 'projectile-project-root-files "fabfile.py") (with-eval-after-load 'server (diminish 'server-buffer-clients -- cgit v1.2.3-54-g00ecf From f635ce335ed0187d3d81a40ac18049aa16c65af1 Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Mon, 16 Jul 2018 20:50:45 -0700 Subject: Update web-mode config --- emacs/.emacs.d/init/oni-web-mode-init.el | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'emacs/.emacs.d') 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) -- cgit v1.2.3-54-g00ecf From e31e7663ab77266d6572f8f5c8e786436361ea2d Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Mon, 16 Jul 2018 20:51:14 -0700 Subject: Add windows-specific projectile settings --- emacs/.emacs.d/site-lisp/oni-windows-nt.el | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'emacs/.emacs.d') diff --git a/emacs/.emacs.d/site-lisp/oni-windows-nt.el b/emacs/.emacs.d/site-lisp/oni-windows-nt.el index 06db487..19b80a4 100755 --- a/emacs/.emacs.d/site-lisp/oni-windows-nt.el +++ b/emacs/.emacs.d/site-lisp/oni-windows-nt.el @@ -54,6 +54,10 @@ (setq grep-program (shell-quote-argument "c:/cygwin64/bin/grep.exe")) (setq grep-use-null-device nil) (setq delete-by-moving-to-trash t) +(setq projectile-enable-caching nil) +(setq projectile-generic-command "\"C:\\Program Files\\Git\\usr\\bin\\find.exe\" . -type d \"(\" -path \"*/node_modules\" -o -path \"*/upload-test\" -o -path \"*/dlls\" -o -path \"*/apps/*/img\" -o -path \"*/apps/*/video\" -o -path \"*/apps/*/font\" -o -path \"*/apps/*/content\" -o -path \"*/apps/*/favicons\" -o -path \"*/apps/*/pages.*\" -o -path \"*/.intl\" \")\" -prune -o -type f -print0") +(setq projectile-git-command "\"C:/Program Files/Git/bin/git.exe\" ls-files -zco --exclude-standard") +(setq projectile-indexing-method 'alien) (setq-default buffer-file-coding-system 'utf-8-unix) -- cgit v1.2.3-54-g00ecf