From 36c8b991eeaa75ac2572faff2c4ce58b426a1620 Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Sun, 16 Oct 2016 22:32:11 +0200 Subject: Make sure init files have unique names --- emacs/.emacs.d/init.org | 12 ++++---- emacs/.emacs.d/init/dired-init.org | 43 -------------------------- emacs/.emacs.d/init/ediff-init.org | 41 ------------------------- emacs/.emacs.d/init/js-mode-init.org | 16 ---------- emacs/.emacs.d/init/magit-init.org | 30 ------------------ emacs/.emacs.d/init/oni-dired-init.org | 43 ++++++++++++++++++++++++++ emacs/.emacs.d/init/oni-ediff-init.org | 41 +++++++++++++++++++++++++ emacs/.emacs.d/init/oni-js-mode-init.org | 16 ++++++++++ emacs/.emacs.d/init/oni-magit-init.org | 30 ++++++++++++++++++ emacs/.emacs.d/init/oni-php-mode-init.org | 51 +++++++++++++++++++++++++++++++ emacs/.emacs.d/init/oni-sh-mode-init.org | 13 ++++++++ emacs/.emacs.d/init/php-mode-init.org | 45 --------------------------- emacs/.emacs.d/init/sh-mode-init.org | 13 -------- 13 files changed, 200 insertions(+), 194 deletions(-) delete mode 100644 emacs/.emacs.d/init/dired-init.org delete mode 100644 emacs/.emacs.d/init/ediff-init.org delete mode 100644 emacs/.emacs.d/init/js-mode-init.org delete mode 100644 emacs/.emacs.d/init/magit-init.org create mode 100644 emacs/.emacs.d/init/oni-dired-init.org create mode 100644 emacs/.emacs.d/init/oni-ediff-init.org create mode 100644 emacs/.emacs.d/init/oni-js-mode-init.org create mode 100644 emacs/.emacs.d/init/oni-magit-init.org create mode 100644 emacs/.emacs.d/init/oni-php-mode-init.org create mode 100644 emacs/.emacs.d/init/oni-sh-mode-init.org delete mode 100644 emacs/.emacs.d/init/php-mode-init.org delete mode 100644 emacs/.emacs.d/init/sh-mode-init.org (limited to 'emacs') diff --git a/emacs/.emacs.d/init.org b/emacs/.emacs.d/init.org index 4e79fb0..39cdc45 100644 --- a/emacs/.emacs.d/init.org +++ b/emacs/.emacs.d/init.org @@ -697,21 +697,21 @@ To start off, first I need to enable lexical binding. errors. #+BEGIN_SRC emacs-lisp - (with-eval-after-load 'js (load "js-mode-init")) + (with-eval-after-load 'js (load "oni-js-mode-init")) #+END_SRC - [[file:init/php-mode-init.org][php-mode]] :: I use PHP mode for files that only contain PHP code, no HTML or anything. #+BEGIN_SRC emacs-lisp - (with-eval-after-load 'php-mode (load "php-mode-init")) + (with-eval-after-load 'php-mode (load "oni-php-mode-init")) #+END_SRC - [[file:init/sh-mode-init.org][sh-mode]] :: Used for most types of shell scripting (bash, zsh, etc.). #+BEGIN_SRC emacs-lisp - (with-eval-after-load 'sh-mode (load "sh-mode-init")) + (with-eval-after-load 'sh-mode (load "oni-sh-mode-init")) #+END_SRC ** Emacs lisp mode @@ -932,20 +932,20 @@ To start off, first I need to enable lexical binding. enough /yet/. #+BEGIN_SRC emacs-lisp - (with-eval-after-load 'dired (load "dired-init")) + (with-eval-after-load 'dired (load "oni-dired-init")) #+END_SRC - [[file:init/magit-init.org][Magit]] :: The Emacs git interface. By now I think I may know magit better than the git cli. #+BEGIN_SRC emacs-lisp - (with-eval-after-load 'magit (load "magit-init")) + (with-eval-after-load 'magit (load "oni-magit-init")) #+END_SRC - [[file:init/ediff-init.org][Ediff]] :: A reall diff application. #+BEGIN_SRC emacs-lisp - (with-eval-after-load 'ediff (load "ediff-init")) + (with-eval-after-load 'ediff (load "oni-ediff-init")) #+END_SRC ** Gnus diff --git a/emacs/.emacs.d/init/dired-init.org b/emacs/.emacs.d/init/dired-init.org deleted file mode 100644 index 8966d71..0000000 --- a/emacs/.emacs.d/init/dired-init.org +++ /dev/null @@ -1,43 +0,0 @@ -#+TITLE: Dired - -#+BEGIN_SRC emacs-lisp - (require 'dired) - (require 'dired-x) -#+END_SRC - -Show human-readable sizes in dired buffers. - -#+BEGIN_SRC emacs-lisp - (setq dired-listing-switches "-alh") -#+END_SRC - -Show the same info for subdirectories, but don't show the =.= and =..= -directories, since those are most likely already shown in the buffer. - -#+BEGIN_SRC emacs-lisp - (setq dired-subdir-switches "-Alh") -#+END_SRC - -Add a keybinding to dired buffers to change to wdired. - -#+BEGIN_SRC emacs-lisp - (defun oni:dired-add-wdired-keybinding () - "Add a keybinding for wdired mode." - (define-key dired-mode-map (kbd "E") 'wdired-change-to-wdired-mode)) - - (add-hook 'dired-mode-hook 'oni:dired-add-wdired-keybinding) -#+END_SRC - -Open PDF files in zathura. - -#+BEGIN_SRC emacs-lisp - (add-to-list 'dired-guess-shell-alist-user - `(,(rx ".pdf" eos) "zathura")) -#+END_SRC - -Open Jpeg, Gif and PNG files in feh. - -#+BEGIN_SRC emacs-lisp - (add-to-list 'dired-guess-shell-alist-user - `(,(rx (or ".jpg" ".jpeg" ".png" ".gif") eos) "feh")) -#+END_SRC diff --git a/emacs/.emacs.d/init/ediff-init.org b/emacs/.emacs.d/init/ediff-init.org deleted file mode 100644 index 588a605..0000000 --- a/emacs/.emacs.d/init/ediff-init.org +++ /dev/null @@ -1,41 +0,0 @@ -#+TITLE: Ediff - -#+BEGIN_SRC emacs-lisp - (require 'ediff) -#+END_SRC - -Don't use a special frame for the ediff control buffer. - -#+BEGIN_SRC emacs-lisp - (setq ediff-window-setup-function 'ediff-setup-windows-plain) -#+END_SRC - -Show the different buffers next to eachother instead of underneath -eachother. - -#+BEGIN_SRC emacs-lisp - (setq ediff-split-window-function 'split-window-horizontally) -#+END_SRC - -Don't show whitespace changes in ediff buffers. - -#+BEGIN_SRC emacs-lisp - (setq ediff-diff-options "-w") -#+END_SRC - -Show ediff in a fullscreen frame. - -#+BEGIN_SRC emacs-lisp - (defun oni:turn-on-fullscreen () - (unless (memq (frame-parameter nil 'fullscreen) - '(fullscreen fullboth)) - (set-frame-parameter nil 'fullscreen 'fullboth))) - - (defun oni:turn-off-fullscreen () - (when (memq (frame-parameter nil 'fullscreen) - '(fullscreen fullboth)) - (set-frame-parameter nil 'fullscreen nil))) - - (add-hook 'ediff-mode-hook 'oni:turn-on-fullscreen) - (add-hook 'ediff-cleanup-hook 'oni:turn-off-fullscreen) -#+END_SRC diff --git a/emacs/.emacs.d/init/js-mode-init.org b/emacs/.emacs.d/init/js-mode-init.org deleted file mode 100644 index e28e84d..0000000 --- a/emacs/.emacs.d/init/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/magit-init.org b/emacs/.emacs.d/init/magit-init.org deleted file mode 100644 index 217d45c..0000000 --- a/emacs/.emacs.d/init/magit-init.org +++ /dev/null @@ -1,30 +0,0 @@ -#+TITLE: Magit - -#+BEGIN_SRC emacs-lisp - (require 'magit) -#+END_SRC - -Magit is a very nice interface to Git for Emacs. It allows you to do -just about anything with Git without leaving the comfort of your Emacs -session. - -Show refined diffs in magit. This makes it much easier to see /what/ -has changed on a line. - -#+BEGIN_SRC emacs-lisp - (setq magit-diff-refine-hunk 'all) -#+END_SRC - -Make the magit status buffer always open as the only window in Emacs. - -#+BEGIN_SRC emacs-lisp - (defvar oni:magit-status-rx - (rx bos "*magit: ")) - - (defun oni:display-buffer-in-only-window (buffer alist) - (delete-other-windows) - (display-buffer-same-window buffer alist)) - - (add-to-list 'display-buffer-alist - `(,oni:magit-status-rx oni:display-buffer-in-only-window)) -#+END_SRC diff --git a/emacs/.emacs.d/init/oni-dired-init.org b/emacs/.emacs.d/init/oni-dired-init.org new file mode 100644 index 0000000..8966d71 --- /dev/null +++ b/emacs/.emacs.d/init/oni-dired-init.org @@ -0,0 +1,43 @@ +#+TITLE: Dired + +#+BEGIN_SRC emacs-lisp + (require 'dired) + (require 'dired-x) +#+END_SRC + +Show human-readable sizes in dired buffers. + +#+BEGIN_SRC emacs-lisp + (setq dired-listing-switches "-alh") +#+END_SRC + +Show the same info for subdirectories, but don't show the =.= and =..= +directories, since those are most likely already shown in the buffer. + +#+BEGIN_SRC emacs-lisp + (setq dired-subdir-switches "-Alh") +#+END_SRC + +Add a keybinding to dired buffers to change to wdired. + +#+BEGIN_SRC emacs-lisp + (defun oni:dired-add-wdired-keybinding () + "Add a keybinding for wdired mode." + (define-key dired-mode-map (kbd "E") 'wdired-change-to-wdired-mode)) + + (add-hook 'dired-mode-hook 'oni:dired-add-wdired-keybinding) +#+END_SRC + +Open PDF files in zathura. + +#+BEGIN_SRC emacs-lisp + (add-to-list 'dired-guess-shell-alist-user + `(,(rx ".pdf" eos) "zathura")) +#+END_SRC + +Open Jpeg, Gif and PNG files in feh. + +#+BEGIN_SRC emacs-lisp + (add-to-list 'dired-guess-shell-alist-user + `(,(rx (or ".jpg" ".jpeg" ".png" ".gif") eos) "feh")) +#+END_SRC diff --git a/emacs/.emacs.d/init/oni-ediff-init.org b/emacs/.emacs.d/init/oni-ediff-init.org new file mode 100644 index 0000000..588a605 --- /dev/null +++ b/emacs/.emacs.d/init/oni-ediff-init.org @@ -0,0 +1,41 @@ +#+TITLE: Ediff + +#+BEGIN_SRC emacs-lisp + (require 'ediff) +#+END_SRC + +Don't use a special frame for the ediff control buffer. + +#+BEGIN_SRC emacs-lisp + (setq ediff-window-setup-function 'ediff-setup-windows-plain) +#+END_SRC + +Show the different buffers next to eachother instead of underneath +eachother. + +#+BEGIN_SRC emacs-lisp + (setq ediff-split-window-function 'split-window-horizontally) +#+END_SRC + +Don't show whitespace changes in ediff buffers. + +#+BEGIN_SRC emacs-lisp + (setq ediff-diff-options "-w") +#+END_SRC + +Show ediff in a fullscreen frame. + +#+BEGIN_SRC emacs-lisp + (defun oni:turn-on-fullscreen () + (unless (memq (frame-parameter nil 'fullscreen) + '(fullscreen fullboth)) + (set-frame-parameter nil 'fullscreen 'fullboth))) + + (defun oni:turn-off-fullscreen () + (when (memq (frame-parameter nil 'fullscreen) + '(fullscreen fullboth)) + (set-frame-parameter nil 'fullscreen nil))) + + (add-hook 'ediff-mode-hook 'oni:turn-on-fullscreen) + (add-hook 'ediff-cleanup-hook 'oni:turn-off-fullscreen) +#+END_SRC diff --git a/emacs/.emacs.d/init/oni-js-mode-init.org b/emacs/.emacs.d/init/oni-js-mode-init.org new file mode 100644 index 0000000..e28e84d --- /dev/null +++ b/emacs/.emacs.d/init/oni-js-mode-init.org @@ -0,0 +1,16 @@ +#+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-magit-init.org b/emacs/.emacs.d/init/oni-magit-init.org new file mode 100644 index 0000000..217d45c --- /dev/null +++ b/emacs/.emacs.d/init/oni-magit-init.org @@ -0,0 +1,30 @@ +#+TITLE: Magit + +#+BEGIN_SRC emacs-lisp + (require 'magit) +#+END_SRC + +Magit is a very nice interface to Git for Emacs. It allows you to do +just about anything with Git without leaving the comfort of your Emacs +session. + +Show refined diffs in magit. This makes it much easier to see /what/ +has changed on a line. + +#+BEGIN_SRC emacs-lisp + (setq magit-diff-refine-hunk 'all) +#+END_SRC + +Make the magit status buffer always open as the only window in Emacs. + +#+BEGIN_SRC emacs-lisp + (defvar oni:magit-status-rx + (rx bos "*magit: ")) + + (defun oni:display-buffer-in-only-window (buffer alist) + (delete-other-windows) + (display-buffer-same-window buffer alist)) + + (add-to-list 'display-buffer-alist + `(,oni:magit-status-rx oni:display-buffer-in-only-window)) +#+END_SRC diff --git a/emacs/.emacs.d/init/oni-php-mode-init.org b/emacs/.emacs.d/init/oni-php-mode-init.org new file mode 100644 index 0000000..17b6ce7 --- /dev/null +++ b/emacs/.emacs.d/init/oni-php-mode-init.org @@ -0,0 +1,51 @@ +#+TITLE: PHP + +Turn on electric pairing in php-mode. + +#+BEGIN_SRC emacs-lisp + (add-hook 'php-mode-hook 'electric-pair-local-mode) +#+END_SRC + +Turn on electric indenting in php-mode. + +#+BEGIN_SRC emacs-lisp + (add-hook 'php-mode-hook 'electric-indent-local-mode) +#+END_SRC + +Enable flycheck in php-mode. + +#+BEGIN_SRC emacs-lisp + (add-hook 'php-mode-hook 'flycheck-mode) +#+END_SRC + +Reset =require-final-newline= because the default php-mode style +disables it. + +#+BEGIN_SRC emacs-lisp + (defun oni:set-require-final-newline () + (setq require-final-newline t)) + + (add-hook 'php-mode-hook 'oni:set-require-final-newline) +#+END_SRC + +Enable company mode for completion. + +#+BEGIN_SRC emacs-lisp + (add-hook 'php-mode-hook 'company-mode) +#+END_SRC + +Load a PHP-specific completion back-end when company mode is loaded. + +#+BEGIN_SRC emacs-lisp + (eval-when-compile (require 'company)) + + (with-eval-after-load 'company + (require 'company-php) + (add-to-list 'company-backends 'company-ac-php-backend)) +#+END_SRC + +Enable ggtags-mode for tags browsing with global. + +#+BEGIN_SRC emacs-lisp + (add-hook 'php-mode-hook 'ggtags-mode) +#+END_SRC diff --git a/emacs/.emacs.d/init/oni-sh-mode-init.org b/emacs/.emacs.d/init/oni-sh-mode-init.org new file mode 100644 index 0000000..6a9f394 --- /dev/null +++ b/emacs/.emacs.d/init/oni-sh-mode-init.org @@ -0,0 +1,13 @@ +#+TITLE: Shell Script + +Enable electric pairing in shell script buffers. + +#+BEGIN_SRC emacs-lisp + (add-hook 'sh-mode-hook 'electric-pair-local-mode) +#+END_SRC + +Enable electric indentation in shell script buffers. + +#+BEGIN_SRC emacs-lisp + (add-hook 'sh-mode-hook 'electric-indent-local-mode) +#+END_SRC diff --git a/emacs/.emacs.d/init/php-mode-init.org b/emacs/.emacs.d/init/php-mode-init.org deleted file mode 100644 index 0b425fe..0000000 --- a/emacs/.emacs.d/init/php-mode-init.org +++ /dev/null @@ -1,45 +0,0 @@ -#+TITLE: PHP - -Turn on electric pairing in php-mode. - -#+BEGIN_SRC emacs-lisp - (add-hook 'php-mode-hook 'electric-pair-local-mode) -#+END_SRC - -Turn on electric indenting in php-mode. - -#+BEGIN_SRC emacs-lisp - (add-hook 'php-mode-hook 'electric-indent-local-mode) -#+END_SRC - -Enable flycheck in php-mode. - -#+BEGIN_SRC emacs-lisp - (add-hook 'php-mode-hook 'flycheck-mode) -#+END_SRC - -Reset =require-final-newline= because the default php-mode style -disables it. - -#+BEGIN_SRC emacs-lisp - (defun oni:set-require-final-newline () - (setq require-final-newline t)) - - (add-hook 'php-mode-hook 'oni:set-require-final-newline) -#+END_SRC - -Enable company mode for completion. - -#+BEGIN_SRC emacs-lisp - (add-hook 'php-mode-hook 'company-mode) -#+END_SRC - -Load a PHP-specific completion back-end when company mode is loaded. - -#+BEGIN_SRC emacs-lisp - (eval-when-compile (require 'company)) - - (with-eval-after-load 'company - (require 'company-php) - (add-to-list 'company-backends 'company-ac-php-backend)) -#+END_SRC diff --git a/emacs/.emacs.d/init/sh-mode-init.org b/emacs/.emacs.d/init/sh-mode-init.org deleted file mode 100644 index 6a9f394..0000000 --- a/emacs/.emacs.d/init/sh-mode-init.org +++ /dev/null @@ -1,13 +0,0 @@ -#+TITLE: Shell Script - -Enable electric pairing in shell script buffers. - -#+BEGIN_SRC emacs-lisp - (add-hook 'sh-mode-hook 'electric-pair-local-mode) -#+END_SRC - -Enable electric indentation in shell script buffers. - -#+BEGIN_SRC emacs-lisp - (add-hook 'sh-mode-hook 'electric-indent-local-mode) -#+END_SRC -- cgit v1.2.3-54-g00ecf