Merge remote-tracking branch 'origin/stripped-down' into stripped-down

This commit is contained in:
Tom Willemse 2018-07-17 00:38:59 -07:00
commit 91d97b939a
10 changed files with 139 additions and 64 deletions

View file

@ -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
@ -347,6 +348,10 @@ 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"))
(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"))

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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)

View file

@ -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

View file

@ -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)

View file

@ -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)