diff --git a/emacs/init.org b/emacs/init.org index 14f16f7..f5db6c9 100644 --- a/emacs/init.org +++ b/emacs/init.org @@ -2,6 +2,7 @@ #+OPTIONS: author:nil num:nil #+STARTUP: showall #+LINK: yoshi-theme http://ryuslash.org/projects/yoshi-theme.html +#+PROPERTY: tangle init2.el * GUI @@ -13,7 +14,7 @@ Disable =menu-bar-mode= since I haven't used the menu bar much ever, even when I first started using Emacs. - #+BEGIN_SRC emacs-lisp :tangle init2.el + #+BEGIN_SRC emacs-lisp (menu-bar-mode -1) #+END_SRC @@ -22,7 +23,7 @@ Since Emacs gives a pretty good indication of where in the buffer I'm working I really don't need to have the scroll bar visible. - #+BEGIN_SRC emacs-lisp :tangle init2.el + #+BEGIN_SRC emacs-lisp (scroll-bar-mode -1) #+END_SRC @@ -30,7 +31,7 @@ I've never used the tool bar much, so remove it. - #+BEGIN_SRC emacs-lisp :tangle init2.el + #+BEGIN_SRC emacs-lisp (tool-bar-mode -1) #+END_SRC @@ -43,7 +44,7 @@ and exist. Place them at the end of =load-path= so they don't mess up package precedence. - #+BEGIN_SRC emacs-lisp :tangle init2.el + #+BEGIN_SRC emacs-lisp (eval-and-compile (defun oni:path-init (dir) "Add DIR to `load-path' and all its subdirectories, unless @@ -58,7 +59,7 @@ Add my project [[yoshi-theme]] to =custom-theme-load-path= and load it. - #+BEGIN_SRC emacs-lisp :tangle init2.el + #+BEGIN_SRC emacs-lisp (add-to-list 'custom-theme-load-path "~/projects/emacs/yoshi-theme/") (load-theme 'yoshi t) #+END_SRC @@ -66,7 +67,7 @@ Add any other interesting paths to =load-path= and, if it exists, load the ~loaddefs.el~ file from these directories. - #+BEGIN_SRC emacs-lisp :tangle init2.el + #+BEGIN_SRC emacs-lisp (mapc #'(lambda (dir) (add-to-list 'load-path dir) (let ((loaddefs (concat dir "/loaddefs.el"))) @@ -81,7 +82,7 @@ Don't ask ~yes~ or ~no~, ask ~y~ or ~n~, I've never had an accidental ~y~ so far. - #+BEGIN_SRC emacs-lisp :tangle init2.el + #+BEGIN_SRC emacs-lisp (defalias 'yes-or-no-p 'y-or-n-p) #+END_SRC @@ -90,7 +91,7 @@ Use =ibuffer= instead of the default =list-buffers= because it has many more features. - #+BEGIN_SRC emacs-lisp :tangle init2.el + #+BEGIN_SRC emacs-lisp (defalias 'list-buffers 'ibuffer) #+END_SRC @@ -98,7 +99,7 @@ Do the same with =hippie-expand= and =dabbrev-expand=. - #+BEGIN_SRC emacs-lisp :tangle init2.el + #+BEGIN_SRC emacs-lisp (defalias 'dabbrev-expand 'hippie-expand) #+END_SRC @@ -108,7 +109,7 @@ whenever I'm working in a mode that supports it anyway. This should only execute once ~eldoc~ has been loaded. - #+BEGIN_SRC emacs-lisp :tangle init2.el + #+BEGIN_SRC emacs-lisp (eval-after-load "eldoc" '(diminish 'eldoc-mode)) #+END_SRC @@ -116,7 +117,7 @@ Use the standard EMMS configuration and add some MPD settings. - #+BEGIN_SRC emacs-lisp :tangle init2.el + #+BEGIN_SRC emacs-lisp (defun oni:emms-init () "Initialization function for EMMS." (require 'emms-setup) @@ -137,7 +138,7 @@ Add some keybindings for EMMS. - #+BEGIN_SRC emacs-lisp :tangle init2.el + #+BEGIN_SRC emacs-lisp (defun oni:emms-toggle-playing () "Toggle between playing/paused states." (interactive) @@ -165,7 +166,7 @@ Load ~flymake-cursor~ after loading ~flymake~, add Python and Go to "allowed" files and add go error output to error patterns. - #+BEGIN_SRC emacs-lisp :tangle init2.el + #+BEGIN_SRC emacs-lisp (defun oni:flymake-init () "Initialization function for flymake." (require 'flymake-cursor) @@ -189,7 +190,7 @@ Disable the GUI for flymake errors. This causes the flymake errors to be shown in the minibuffer. - #+BEGIN_SRC emacs-lisp :tangle init2.el + #+BEGIN_SRC emacs-lisp (setq flymake-gui-warnings-enabled nil) #+END_SRC @@ -197,7 +198,7 @@ info patterns, set the log file to somewhere in my home directory and set logging level to 0. - #+BEGIN_SRC emacs-lisp :tangle init2.el + #+BEGIN_SRC emacs-lisp (setq flymake-info-line-regexp (eval-when-compile (regexp-opt @@ -250,7 +251,7 @@ After loading ~flycheck~ Remove the default python checkers and replace them with my own, which tries both ~flake8~ and ~pylint~. - #+BEGIN_SRC emacs-lisp :tangle init2.el + #+BEGIN_SRC emacs-lisp (eval-after-load "flycheck" '(progn (mapc (lambda (c) (delete c flycheck-checkers)) @@ -262,7 +263,7 @@ Make the ~C-l~ look like a line of ~-~ up to =fill-column= or =fci-rule-column= and remove the string displayed before the ~C-l~. - #+BEGIN_SRC emacs-lisp :tangle init2.el + #+BEGIN_SRC emacs-lisp (defun oni:pretty-control-l-function (win) "Just make a string of either `fci-rule-column' or `fill-column' length -1. Use the `-' character. WIN is ignored." @@ -275,14 +276,14 @@ Remove the string displayed before the ~C-l~. - #+BEGIN_SRC emacs-lisp :tangle init2.el + #+BEGIN_SRC emacs-lisp (setq pp^L-^L-string-pre nil) #+END_SRC Enable =pretty-control-l-mode= at startup and whenever a new frame is created. - #+BEGIN_SRC emacs-lisp :tangle init2.el + #+BEGIN_SRC emacs-lisp (add-hook 'emacs-startup-hook 'pretty-control-l-mode) (add-hook 'after-make-frame-functions '(lambda (arg) (pretty-control-l-mode))) @@ -292,21 +293,21 @@ Automatically join some channels when connecting to freenode.net. - #+BEGIN_SRC emacs-lisp :tangle init2.el + #+BEGIN_SRC emacs-lisp (setq erc-autojoin-channels-alist '(("freenode.net" "#ninthfloor" "#emacs"))) #+END_SRC Don't show ~PART~ messages. - #+BEGIN_SRC emacs-lisp :tangle init2.el + #+BEGIN_SRC emacs-lisp (setq erc-hide-list '("PART")) #+END_SRC Insert a timestamp every time a message comes in, print it on the left and print the hour and minute parts of the time. - #+BEGIN_SRC emacs-lisp :tangle init2.el + #+BEGIN_SRC emacs-lisp (setq erc-insert-timestamp-function 'erc-insert-timestamp-left) (setq erc-timestamp-format "[%H:%M] ") (setq erc-timestamp-only-if-changed-flag nil) @@ -314,14 +315,14 @@ Set my nickname. - #+BEGIN_SRC emacs-lisp :tangle init2.el + #+BEGIN_SRC emacs-lisp (setq erc-nick "ryuslash") #+END_SRC When starting ERC disable truncating lines, don't let ERC fill each line and enable =visual-line-mode=. - #+BEGIN_SRC emacs-lisp :tangle init2.el + #+BEGIN_SRC emacs-lisp (defun oni:erc-mode-func () "Function for `erc-mode-hook'." (erc-fill-mode -1) @@ -336,7 +337,7 @@ Add ~unison~ to the list of =eshell-visual-commands= because it expects unbuffered input and eshell just doesn't give that. - #+BEGIN_SRC emacs-lisp :tangle init2.el + #+BEGIN_SRC emacs-lisp (eval-after-load "em-term" '(add-to-list 'eshell-visual-commands "unison")) #+END_SRC @@ -344,7 +345,7 @@ Don't let eshell highlight it's prompt, this way I can decide the colors for it myself. - #+BEGIN_SRC emacs-lisp :tangle init2.el + #+BEGIN_SRC emacs-lisp (setq eshell-highlight-prompt nil) #+END_SRC @@ -361,7 +362,7 @@ And set the =eshell-prompt-regexp= to - #+BEGIN_SRC emacs-lisp :tangle init2.el + #+BEGIN_SRC emacs-lisp (defun oni:eshell-prompt-function () "Show a pretty shell prompt." (let ((status (if (zerop eshell-last-command-status) ?+ ?-)) @@ -397,7 +398,7 @@ Don't truncate lines in eshell, wrap them. - #+BEGIN_SRC emacs-lisp :tangle init2.el + #+BEGIN_SRC emacs-lisp (defun oni:eshell-mode-func () "Function for `eshell-mode-hook'." (setq truncate-lines nil)) @@ -407,7 +408,7 @@ Bind the ~f8~ key to easily show eshell. - #+BEGIN_SRC emacs-lisp :tangle init2.el + #+BEGIN_SRC emacs-lisp (defun oni:raise-eshell () "Start or switch back to `eshell'. Also change directories to current working directory."