From e53bd5e8888a6c883620cf77720b841b59bfaa04 Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Sat, 4 May 2013 18:22:24 +0200 Subject: Revert "Move as much as possible to custom.el" This reverts commit ca90f4623b44157ffa08555b4ac448d1b440ac5f. --- emacs/init.org | 757 +++++++++++++++++++++++++++++++++++++++++++- emacs/site-lisp/oni.el | 7 - emacs/site-lisp/org-init.el | 1 + 3 files changed, 753 insertions(+), 12 deletions(-) diff --git a/emacs/init.org b/emacs/init.org index 278dda6..cf691ef 100644 --- a/emacs/init.org +++ b/emacs/init.org @@ -4,6 +4,20 @@ #+PROPERTy: tangle init.el #+OPTIONS: num:nil +* Turn off useless visual components :gui: + + Turn the menu, scroll-bar and tool-bar off quickly. If this happens + later on then the GUI will show these components for a longer time. + Even though these options are also specified in my [[file:../.Xdefaults][Xdefaults]] I like + having them here too, as a precaution and to turn them off for + non-graphical interfaces as well. + + #+BEGIN_SRC emacs-lisp :padline no + (menu-bar-mode -1) + (scroll-bar-mode -1) + (tool-bar-mode -1) + #+END_SRC + * Setup load-path :load_path: Not everything can be installed with ~package.el~. Or some things can, @@ -43,6 +57,7 @@ with a completely white background (for too long). #+BEGIN_SRC emacs-lisp + (setq custom-theme-directory "~/.emacs.d/themes") (oni:eval-after-init (load-theme 'yoshi t)) #+END_SRC @@ -99,6 +114,16 @@ (add-to-list 'compilation-finish-functions 'ext:comp-finish-function) #+END_SRC +* Scroll compilation window :compilation: + + Even though I don't need to see the result of the compilation if + everything went as it should, scroll the output window so that I can + see whether there are any warnings and I should have a look anyway. + + #+BEGIN_SRC emacs-lisp + (setq compilation-scroll-output t) + #+END_SRC + * Enable auto-fill-mode :auto_fill: =auto-fill-mode= automatically inserts newlines when a line becomes @@ -284,8 +309,43 @@ (add-hook 'html-mode-hook 'oni:turn-on-tagedit-mode) #+END_SRC +* Disable the pylint and pyflakes checkers :flycheck: + + I use flake8 in =python-mode=, so I have no need for the =python-pylint= + and =python-pyflakes= checkers. Since this works on a variable that is + defined in the ~flycheck~ package, it should only run *after* ~flycheck~ + has been loaded. + + #+BEGIN_SRC emacs-lisp + (eval-after-load "flycheck" + '(progn + (mapc (lambda (c) (delq c flycheck-checkers)) + '(python-pylint python-pyflakes)))) + #+END_SRC + * Make ^L look pretty :ppcL: + Occasionally I might put a ~^L~ character in some code to create a + page separator. But seeing ~^L~ there isn't all that pretty, not when + you have something like ~pp^L-mode~. Show a line of ~-~ all the way to + the =fill-column= - =1=. To do this we should also remove the prefix. + + If the variable =fci-rule-colum= is bound, use that, so that it + always goes up-to, but not beyond the little red line shown at the + right margin. + + #+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." + (ignore win) + (make-string + (1- (if (boundp 'fci-rule-column) fci-rule-column fill-column)) ?-)) + + (setq pp^L-^L-string-function 'oni:pretty-control-l-function + pp^L-^L-string-pre nil) + #+END_SRC + This mode should be activated each time a frame is made, since it uses certain frame properties. @@ -295,6 +355,81 @@ '(lambda (arg) (pretty-control-l-mode))) #+END_SRC +* Auto-join some channels in ERC :erc: + + If ever I log in to IRC with ERC I would like to join these + channels, seeing as how *if* I talk, it's usually in one of these. + Though it's rare. + + #+BEGIN_SRC emacs-lisp + (setq erc-autojoin-channels-alist + '(("freenode.net" "#ninthfloor" "#emacs" "#dispass"))) + #+END_SRC + +* Don't show part messages in ERC :erc: + + They don't interest me. + + #+BEGIN_SRC emacs-lisp + (setq erc-hide-list '("PART")) + #+END_SRC + + I used to hide more messages, but I found out that it can be + confusing to not be able to see *any* joins and quits at all. + +* Move the timestamp in ERC :erc: + + I prefer having a timestamp on the left-side of a message in the + form of ~00:00~ instead of te usual. Having it right-aligned messes up + the non-filled text and having it only show up when it's changed + makes the buffer messy. + + #+BEGIN_SRC emacs-lisp + (setq erc-insert-timestamp-function 'erc-insert-timestamp-left + erc-timestamp-format "[%H:%M] " + erc-timestamp-only-if-changed-flag nil) + #+END_SRC + +* Set IRC nickname :erc: + + This way I don't have to tell ERC what my nickname is every time. + + #+BEGIN_SRC emacs-lisp + (setq erc-nick "ryuslash") + #+END_SRC + +* Turn off filling in ERC :erc: + + Turn of =erc-fill-mode= so that =visual-line-mode= can do its thing. + + #+BEGIN_SRC emacs-lisp + (defun oni:turn-off-erc-fill-mode () (erc-fill-mode -1)) + (add-hook 'erc-mode-hook 'oni:erc-mode-func) + #+END_SRC + +* Specify some visual commands for eshell :eshell: + + Eshell uses buffered input, always, but some commands need + unbuffered input, put those commands in =eshell-visual-commands= to + have them open in a dedicated =*term*= buffer. Since this variable is + defined in the ~em-term~ module, it should only be changed after shis + module loads. + + #+BEGIN_SRC emacs-lisp + (eval-after-load "em-term" + '(add-to-list 'eshell-visual-commands "unison")) + #+END_SRC + +* Disable prompt highlighting in eshell :eshell: + + Since I'm using a custom prompt with some custom colors I don't need + the eshell prompt to be highlighted, which overwrites any colors I + specify. + + #+BEGIN_SRC emacs-lisp + (setq eshell-highlight-prompt nil) + #+END_SRC + * Customize eshell prompt :eshell: Create a prompt that shows the following: @@ -340,6 +475,14 @@ " \n> "))) #+END_SRC + Set the prompt function to the function above and tell eshell the + format of its prompt. + + #+BEGIN_SRC emacs-lisp + (setq eshell-prompt-function 'oni:eshell-prompt-function + eshell-prompt-regexp "^> ") + #+END_SRC + * Add a pop-up function for eshell :eshell: When working I often need to switch to a shell to issue some quick @@ -378,6 +521,19 @@ (add-hook 'eshell-mode-hook 'buffer-disable-undo) #+END_SRC +* Disable bidirectional support :bidi: + + Since I don't ever get any mail from people that use right-to-left + text, and even if I did I wouldn't be able to read it, I don't need + bidirectional text support. You shouldn't actually disable it (if + that's even still possible) since, supposedly, it is an integral + part of the display engine now, but telling it to always use + left-to-right should keep it from slowing your emacs down. + + #+BEGIN_SRC emacs-lisp + (setq-default bidi-paragraph-direction 'left-to-right) + #+END_SRC + * Enable some "advanced" functions These functions are disabled by default, because beginners find them @@ -419,6 +575,173 @@ (add-hook 'jabber-alert-muc-hooks 'jabber-muc-libnotify) #+END_SRC +* Enable history :jabber: + + Enable chat history for both regular chats and multi-user chats. I + disabled history completely for a long time, but sometimes you miss + things that way. Store history in per-contact files under + ~HOME/.emacs.d/jabber-hist~. + + #+BEGIN_SRC emacs-lisp + (setq jabber-history-enabled t + jabber-history-muc-enabled t + jabber-use-global-history nil + jabber-history-dir "~/.emacs.d/jabber-hist") + #+END_SRC + +* Setup accounts for jabber :jabber: + + Each account should have the current hostname appended to its + account name, so that multiple PCs can log in on the same account at + the same time and it's easy to note from where I'm talking. + + #+BEGIN_SRC emacs-lisp + (setq jabber-account-list `((,(concat "tom@ryuslash.org/" (oni:hostname)) + (:connection-type . ssl)))) + #+END_SRC + +* Have ido ignore certain buffers :ido: + + These buffers are either uninteresting, reached through other means + (such as a special keybinding) or they get in the way of how I work. + For any or all of these reasons I wish to ignore them. + + - ~^\\`\s~ :: Any buffers that start with a space should be ignored. + + - ~^irc\\.~ :: Any buffer that starts with ~irc.~ is a buffer that has + informational messages on the irc server I'm connected + to, these don't change often and have other ways of + grabbing my attention. If I need them I will find them. + + - ~^\\#~ :: Any buffer starting with an ~#~ is most-likely an IRC chat + buffer, these have ways of letting me know it there is + anything interesting going on there, I don't usually need + them clogging up my ido. + + - ~^\\*Customize Option:~ :: Anything starting with ~*Customize Option:~ + is part of Emacs's customize interface and thus doesn't need to + be shown in the ido buffer list. + + - ~*-jabber-roster-*~ :: Is also accessible through ~f6~, so no need for + it in my ido list. + + - ~*Messages*~ :: Also accessible through ~C-h e~, so no need for it. + + - ~*fsm-debug*~ :: A buffer used by ~jabber.el~ to track some debug + information, I have never had to look at it yet. + + - ~*magit-process*~ :: The buffer where magit's git process runs, + usually accessible with ~$~ from any magit buffer, and the only + other time I need to find is if I have to kill it to reset + magit's process. + + - ~*magit-edit-log*~ :: The commit message buffer from magit. Usually + accessible with ~C-c c~ if needed. + + - ~*Backtrace*~ :: Usually only interesting for as long as I'm looking + at it, if I bury it, I usually don't need it + anymore. + + - ~*Ibuffer*~ :: is reached by the key compination ~C-x C-b~, is + therefore not needed to show up when using ido, and + even gets glitchy when using ido, because the + information doesn't get updated. + + Since this requires a variable defined in the ~ido~ module, delay + execution until it is loaded. + + #+BEGIN_SRC emacs-lisp + (defun oni:ido-init () + "Initialization functionn for ido." + (setq ido-ignore-buffers + (list "^\\` " "^irc\\." "^\\#" "^\\*Customize Option:" + (eval-when-compile + (regexp-opt + '("*-jabber-roster-*" + "*Messages*" + "*fsm-debug*" + "*magit-process*" + "*magit-edit-log*" + "*Backtrace*" + "*Ibuffer*")))))) + + (eval-after-load "ido" '(oni:ido-init)) + #+END_SRC + +* Disable automatic merging in ido :ido: + + ido has this wonderful/infuriating feature of trying to correct your + mistakes by suggesting files in other directories if it can't find + the file you wish to open in the current directory. This becomes + bothersome especially when working with django, since the same files + tend to show up in several directories. Disable it. + + According to the docstring this should be a way to disable it, + previously I just used a very long timeout by setting + =ido-auto-merge-delay-time= to ~1000000~. + + #+BEGIN_SRC emacs-lisp + (setq ido-auto-merge-work-directories-length -1) + #+END_SRC + +* Instruct ido to open buffers in selected window :ido: + + By default, when more than one frame exists and you try to switch + to a buffer that is already visible in another frame, ido pops up + the other frame. This is not what I want, just open the buffer in + the selected window no matter what. + + #+BEGIN_SRC emacs-lisp + (setq ido-default-buffer-method 'selected-window) + #+END_SRC + +* Minimize maximum minibuffer height for ido :ido: + + I hate it when the minibuffer gets bigger than one line, so don't + let ido do that. + + #+BEGIN_SRC emacs-lisp + (setq ido-max-window-height 1) + #+END_SRC + +* Don't save history for ido :ido: + + I don't see the point in saving that history. + + #+BEGIN_SRC emacs-lisp + (setq ido-save-directory-list-file nil) + #+END_SRC + +* Turn on ido-mode :ido: + + =ido-mode= is an excellent file and buffer selection tool, it + improves upon regular selection in numerous ways. + + #+BEGIN_SRC emacs-lisp + (ido-mode) + #+END_SRC + +* Exclude functions from ido-ubiquitous :ido_ubiquitous: + + Not all functions work well with =ido-ubiquitous-mode=, like + =org-refile=, so exclude them from using =ido-ubiquitous-mode=. + + #+BEGIN_SRC emacs-lisp + (setq ido-ubiquitous-command-exceptions '(org-refile org-capture-refile)) + #+END_SRC + +* Enable ido-ubiquitous-mode :ido_ubiquitous: + + =ido-ubiquitous-mode= lets you use ido for almost anything! Anything + which looks and acts like file or buffer selection anyway. + + Since it is installed with ELPA, wait until /after/ emacs has been + initialized. + + #+BEGIN_SRC emacs-lisp + (add-hook 'emacs-startup-hook 'ido-ubiquitous-mode) + #+END_SRC + * Enable idomenu :idomenu: Imenu is an awesome feature, but since I don't use any menus it is @@ -429,6 +752,26 @@ (global-set-key (kbd "M-n") 'idomenu) #+END_SRC +* Use electric default in minibuffer :minibuffer: + + The =minibuffer-electric-default-mode= hides the default value if you + start typing. This leaves more room for typing. I also want the + "short" default indicator (~[default]~ instead of ~(default: default)~). + + #+BEGIN_SRC emacs-lisp + (setq minibuffer-eldef-shorten-default t) + (minibuffer-electric-default-mode) + #+END_SRC + +* Don't show help message on empty parts :mode_line: + + When hovering the mouse over empty parts of the mode-line, just show + nothing, don't clutter up my echo area and ~*Messages*~ buffer. + + #+BEGIN_SRC emacs-lisp + (setq mode-line-default-help-echo "") + #+END_SRC + * Enable jedi :jedi: jedi is an interesting auto-completion program for the Python @@ -437,9 +780,20 @@ run =jedi:setup= when =python-mode= starts to enable it. #+BEGIN_SRC emacs-lisp + (eval-after-load "jedi" '(setcar jedi:server-command "python2")) (add-hook 'python-mode-hook 'jedi:setup) #+END_SRC +* Don't use a tooltip :jedi: + + The coolest thing about jedi is its eldoc-like argument display. If + it can figure out what the arguments are they're shown. But please + don't use tooltips, just the echo area. + + #+BEGIN_SRC emacs-lisp + (setq jedi:tooltip-method nil) + #+END_SRC + * Org initialization :org: Since my intialization for =org-mode= got so big, I moved it to a @@ -542,6 +896,33 @@ (require 'uniquify) #+END_SRC +* Use 4 spaces per indentation level + + Often I see 8 being used, but that just seems too wide to me. + + #+BEGIN_SRC emacs-lisp + (setq-default c-basic-offset 4 + tab-width 4) + #+END_SRC + +* Place fill-column-indicator :fill_column_indicator: + + Place the ruler one character farther than what I usually prefer to + have my lines wrap to, this will indicate where it should not cross, + not where it should not continue. + + #+BEGIN_SRC emacs-lisp + (setq-default fci-rule-column 73) + #+END_SRC + +* Disable use of tabs + + By default, use spaces, not tabs. Tabs are madness. + + #+BEGIN_SRC emacs-lisp + (setq-default indent-tabs-mode nil) + #+END_SRC + * Don't warn about mumamo :php: I haven't yet seen a mode that offers good multiple major modes @@ -551,13 +932,129 @@ (setq-default php-mode-warn-if-mumamo-off nil) #+END_SRC +* Ensure a final newline + + When looking at diffs, it can be annoying to have 2 extra line + changes, just because te previous last line suddenly gets a newline + and the new one doesn't. Plus it's very uniform to have a ~\n~ at the + end of _every_ line. + + #+BEGIN_SRC emacs-lisp + (setq-default require-final-newline t) + #+END_SRC + +* Truncate lines + + Just let most line run off the screen. I don't like wrapping my code + around. I shouldn't make my lines too long in the first place, but + in case I have a very small window I prefer the lines to remain + unchanged, visually. + + #+BEGIN_SRC emacs-lisp + (setq-default truncate-lines t) + #+END_SRC + +* Send appointments to jabber :jabber: + + When an appointment is coming up, show me in a buffer, but also + send a message to my jabber account. + + #+BEGIN_SRC emacs-lisp + (setq appt-disp-window-function #'oni:appt-display-window-and-jabber) + #+END_SRC + +* Don't display diary when appt is initialized :appt: + + If the diary is displayed after the initialization of =appt= I would + get a diary buffer each time I load =org-mode=. Since I don't use the + diary, except for what =org-mode= puts in there for notifications and + such, I really don't want to see it, ever. + + #+BEGIN_SRC emacs-lisp + (setq appt-display-diary nil) + #+END_SRC + +* Don't case fold with auto modes + + I haven't had to deal with wrongly-cased filenames since I stopped + using windows. + + #+BEGIN_SRC emacs-lisp + (setq auto-mode-case-fold nil) + #+END_SRC + +* Save all auto saves in /tmp + + Having auto save files everywhere cloggs up the filesystem. Move + them all into ~/tmp~, though I should probably use a less volatile + location. + + #+BEGIN_SRC emacs-lisp + (setq auto-save-file-name-transforms + `((".*" "~/.local/share/emacs/autosave/" t))) + #+END_SRC + +* Save all backup files to /tmp + + Having backuf files everywhere also cloggs up the filesystem. Move + them all into ~/tmp~ as well, though here too I should probably use a + less volatile location. + + #+BEGIN_SRC emacs-lisp + (setq backup-directory-alist `((".*" . "~/.local/share/emacs/backup/"))) + #+END_SRC + * Automatically determine browser :browse: Use the =BROWSER= environment variable to figure out which browser to - call for =browse-url=. + call for =browse-url=. And use the =browse-url-generic= function to open + urls, otherwise this setting would have no meaning. #+BEGIN_SRC emacs-lisp - (setq browse-url-generic-program (getenv "BROWSER")) + (setq browse-url-browser-function 'browse-url-generic + browse-url-generic-program (getenv "BROWSER")) + #+END_SRC + +* Customize C indentation :c: + + When writing C code, when calling a function I prefer the + indentation to look like: + + #+BEGIN_SRC c :tangle no + call_some_function( + argument1, + argument2 + ); + #+END_SRC + + To be able to shorten lines with long function calls. As opposed to + the default: + + #+BEGIN_SRC c :tangle no + call_some_function( + argument1, + argument2, + ); + #+END_SRC + + Which doesn't really help in making lines shorter. And I also + happen to think it looks hideous. + + #+BEGIN_SRC emacs-lisp + (setq c-offsets-alist + '((statement-block-intro . +) + (knr-argdecl-intro . 5) + (substatement-open . +) + (substatement-label . 0) + (label . 0) + (statement-case-open . +) + (statement-cont . +) + (arglist-intro . +) + (arglist-close . 0) + (inline-open . 0) + (brace-list-open . +) + (topmost-intro-cont first c-lineup-topmost-intro-cont + c-lineup-gnu-DEFUN-intro-cont))) #+END_SRC * Move customize settings into their own file :custom: @@ -571,6 +1068,22 @@ (setq custom-file "~/.emacs.d/custom.el") #+END_SRC +* Setup some frame parameters + + Disable borders, disable scroll-bars, tool-bars and menu-bars (this + is the third place I'm doing this, I *really* want them gone, don't + I). And set the preferred font. + + #+BEGIN_SRC emacs-lisp + (setq default-frame-alist + `((border-width . 0) + (internal-border-width . 0) + (vertical-scroll-bars . nil) + (menu-bar-lines . nil) + (tool-bar-lines . nil) + (font . "Inconsolata:pixelsize=18"))) + #+END_SRC + * Stop elnode from running automatically :elnode: I like elnode, but it really should stop starting itself up every @@ -600,13 +1113,161 @@ (setq geiser-repl-history-filename "~/.emacs.d/geiser-history") #+END_SRC +* Change gnus init file + + My gnus init file is separate, since I don't always immediately use + gnus. + + #+BEGIN_SRC emacs-lisp + (setq gnus-init-file "~/.emacs.d/gnus") + #+END_SRC + +* Automatically update gtags TAGS :gtags: + + Before there was this option I had some complicated function to do + the same thing from somewhere, now that isn't necessary anymore. + + #+BEGIN_SRC emacs-lisp + (setq gtags-auto-update t) + #+END_SRC + +* Display help-at-point + + When the cursor is in a location where a help message would be + shown by hovering the mouse over it, show that help after a short + time of idling on that spot. Another step in using no mouse + whatsoever without losing any functionality. + + #+BEGIN_SRC emacs-lisp + (setq help-at-pt-display-when-idle t) + #+END_SRC + * Set inferior lisp program to SBCL :lisp: SBCL seems like a very good Lisp implementation to use, widely - supported by packagers too. + supported by packagers too. =--noinform= keeps the copyright message + from showing up and =--no-linedit= is used by the =linedit= package to + determine that it shouldn't be enabled. + + #+BEGIN_SRC emacs-lisp + (setq inferior-lisp-program "sbcl --noinform --no-linedit") + #+END_SRC + +* Inhibit stuff + + I don't need to see the startup message, I don't want the default + init messing with my own stuff and I don't even know what + =inhibit-local-menu-bar-menus= does, but it doesn't sound like I need + is, since I don't use menu bars. + + #+BEGIN_SRC emacs-lisp + (setq inhibit-default-init t + inhibit-local-menu-bar-menus t + inhibit-startup-message t) + #+END_SRC + +* Change the initial major mode and message + + The =lisp-interaction-mode= is a nice idea on paper, but usually when + I want to use the ~*scratch*~ buffer, it just gets in my way, so use + =emacs-lisp-mode= instead. Also, by now I know what the ~*scratch*~ + buffer is for, so I really don't need that message telling me what + it does. + + #+BEGIN_SRC emacs-lisp + (setq initial-major-mode 'emacs-lisp-mode + initial-scratch-message nil) + #+END_SRC + +* Store jabber avatar cache under .emacs.d :jabber: + + Even though I don't use avatars anymore I don't want ~jabber.el~ + creating directories all over the place, so just to be safe I put + it under ~HOME/.emacs.d~. + + #+BEGIN_SRC emacs-lisp + (setq jabber-avatar-cache-directory "~/.emacs.d/jabber-avatars/") + #+END_SRC + +* Setup formats :jabber: + + Most of the time I prefer having my message start at the beginning + of the line, in case someone sends me a piece of code or I send + them some, it's easier to read if you don't have to change it first. + + But that leaves a lot of empty space on that prompt line, best fill + it up as mucha as is still useful. + + Also show the chat buffer names as just the contact's name prefixed + with a ~+~ to keep them short and clean. + + #+BEGIN_SRC emacs-lisp + (setq jabber-chat-buffer-format "+%n" + jabber-chat-foreign-prompt-format "%t %u/%r <\n" + jabber-chat-local-prompt-format "%t %u/%r >\n" + jabber-groupchat-buffer-format "++%n" + jabber-groupchat-prompt-format "%t %u --\n") + #+END_SRC + +* Don't use avatars :jabber: + + I did for a while, but since there is no concensus over what is + good and what is bad, buffers start looking messy, so I just + disabled them completely. I know most of the people I chat with + personally, so it doesn't really add much anyway. + + #+BEGIN_SRC emacs-lisp + (setq jabber-chat-buffer-show-avatar nil + jabber-vcard-avatars-publish nil + jabber-vcard-avatars-retrieve nil) + #+END_SRC + +* Don't fill :jabber: + + Just like ERC, don't fill lines so that =visual-line-mode= can do + its thing. + + #+BEGIN_SRC emacs-lisp + (setq jabber-chat-fill-long-lines nil) + #+END_SRC + +* Don't send chatstates :jabber: + + Don't let people know what I'm doing, don't send them information + on that I'm typing or not, etc. This isn't very useful and it + sometimes creates confusion when I accidentally start typing in the + wrong buffer. #+BEGIN_SRC emacs-lisp - (setq inferior-lisp-program "sbcl") + (setq jabber-chatstates-confirm nil) + #+END_SRC + +* Autojoin some channels :jabber: + + Just one, really, the only one I'm in. + + #+BEGIN_SRC emacs-lisp + (setq jabber-muc-autojoin '("aethon@muc.ryuslash.org")) + #+END_SRC + +* Keep the roster buffer clean :jabber: + + Most of the time I really don't need to see the keybindings for the + roster buffers, so hide them initially. And the offline contacts as + well. + + #+BEGIN_SRC emacs-lisp + (setq jabber-roster-show-bindings nil) + (setq jabber-show-offline-contacts nil) + #+END_SRC + +* Defer font locking a little :fontlock: + + By deferring font-lock for a very short time it should improve + scrolling performance. + + #+BEGIN_SRC emacs-lisp + (setq jit-lock-defer-time 0.2) #+END_SRC * Turn on compilation-shell-minor-mode for pony buffers :pony: @@ -666,8 +1327,10 @@ (require 'emms-player-mpd) (add-to-list 'emms-player-list 'emms-player-mpd) + (setq emms-player-mpd-music-directory "/mnt/music/mp3") (require 'emms-mode-line) + (setq emms-mode-line-mode-line-function 'oni:mode-line-current-song) (emms-mode-line 1))) #+END_SRC @@ -677,11 +1340,41 @@ for it yet. #+BEGIN_SRC emacs-lisp + (setq magit-repo-dirs '("~/projects/")) + (setq message-log-max 1000) + (setq message-send-mail-function 'message-send-mail-with-sendmail) + (setq message-sendmail-extra-arguments '("-a" "ryuslash")) + (setq package-archives + '(("melpa" . "http://melpa.milkbox.net/packages/") + ("marmalade" . "http://marmalade-repo.org/packages/") + ("gnu" . "http://elpa.gnu.org/packages/"))) + (setq package-load-list '((htmlize "1.39") + (lua-mode "20111107") + all)) (setq php-function-call-face 'font-lock-function-name-face) (setq php-mode-force-pear t) (setq pony-tpl-indent-moves t) + (setq rainbow-delimiters-max-face-count 12) (setq redisplay-dont-pause t) + (setq send-mail-function 'sendmail-send-it) + (setq sendmail-program "/usr/bin/msmtp") + (setq sentence-end-double-space nil) + (setq smex-key-advice-ignore-menu-bar t) + (setq smex-save-file "~/.emacs.d/smex-items") + (setq split-height-threshold 40) + (setq time-stamp-active t) + (setq time-stamp-format "%04y-%02m-%02d %02H:%02M:%02S (%u)") + (setq type-break-good-rest-interval (* 60 10)) + (setq type-break-interval (* 60 50)) + (setq type-break-keystroke-threshold '(nil . nil)) + (setq uniquify-buffer-name-style 'post-forward) + (setq use-dialog-box nil) + (setq user-full-name "Tom Willemse") + (setq user-mail-address "tom@ryuslash.org") (setq w3m-fill-column 72) + (setq window-combination-resize t) + (setq yas-fallback-behavior nil) + (setq yas-prompt-functions '(yas-ido-prompt)) (add-hook 'after-change-major-mode-hook 'set-current-mode-icon) (add-hook 'after-save-hook 'oni:after-save-func t) @@ -758,9 +1451,31 @@ (add-to-list 'auto-mode-alist '("^PKGBUILD$" . shell-script-mode)) (add-to-list 'auto-mode-alist '("^\\.Xmodmap$" . xmodmap-mode)) + (add-to-list 'debug-ignored-errors "^Can't shift all lines enough") + + (add-to-list + 'display-buffer-alist + '("^\\*\\(?:.+-\\)?scratch\\*$" display-buffer-same-window)) + (add-to-list + 'display-buffer-alist + '("^\\*git-project-list\\*$" git-project-show-window)) + (add-to-list + 'display-buffer-alist + '("^\\*magit: .*\\*$" display-buffer-same-window)) + + (blink-cursor-mode -1) + (column-number-mode -1) + (line-number-mode -1) + (tooltip-mode -1) + (package-initialize) - (oni:eval-after-init (ido-ubiquitous-mode)) + (auto-insert-mode) + (electric-indent-mode) + (savehist-mode) + (show-paren-mode) + (winner-mode) + (smex-initialize) (help-at-pt-set-timer) (windmove-default-keybindings) @@ -778,6 +1493,29 @@ (eval-after-load "smartparens" '(diminish 'smartparens-mode)) (eval-after-load "yasnippet" '(diminish 'yas-minor-mode)) + + ;;; Popping up multiple frames out of the blue does not usually play + ;;; well with (manual) tiling window managers. + (setq ediff-window-setup-function 'ediff-setup-windows-plain) + + ;;; Not being able to find newly written functions in imenu is a pain. + (setq imenu-auto-rescan t) + + ;;; Yanking at click makes not sense to me. I normally have my cursor + ;;; where it needs to point and if I *have* to use the mouse I prefer + ;;; just clicking it wherever it lands, without having to drag it all + ;;; the way to the proper place. + (setq mouse-yank-at-point t) + + ;;; Always having to move the cursor around so much after scrolling + ;;; gets annoying. + (setq scroll-preserve-screen-position t) + + ;;; I store my blog posts in `~/documents/blog', not the default + ;;; `~/Blog'. + (setq eltuki-blog-dir "~/documents/blog") + + (setq sp-cancel-autoskip-on-backward-movement nil) (defun oni:scroll-down-or-prev-page (arg) "Either scroll down or go to the previous page. @@ -813,6 +1551,9 @@ ;;; Emacs Alsa Player (add-to-list 'load-path "~/.emacs.d/site-lisp/eap") (load "eap-autoloads") + + (setq eap-music-library "/mnt/music") + (setq eap-playlist-library "~/music/playlists") ;;;; Auto-complete @@ -828,6 +1569,12 @@ ac-source-variables ac-source-features)) + ;;;; Magit + + (setq magit-default-tracking-name-function + 'magit-default-tracking-name-branch-only) + (setq magit-diff-refine-hunk 'all) + ;;; Finally, load any `customize' settings and slime. (load custom-file) (load (expand-file-name "~/quicklisp/slime-helper.el")) diff --git a/emacs/site-lisp/oni.el b/emacs/site-lisp/oni.el index 1fb56d0..fb4545a 100644 --- a/emacs/site-lisp/oni.el +++ b/emacs/site-lisp/oni.el @@ -333,13 +333,6 @@ When dealing with braces, add another line and indent that too." (c-set-offset 'arglist-close '0) (setq-local fci-rule-column 80)) -(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." - (ignore win) - (make-string - (1- (if (boundp 'fci-rule-column) fci-rule-column fill-column)) ?-)) - (defun oni:prog-mode-func () "Function for `prog-mode-hook'." (setq-local comment-auto-fill-only-comments t)) diff --git a/emacs/site-lisp/org-init.el b/emacs/site-lisp/org-init.el index 53cd826..ca822aa 100644 --- a/emacs/site-lisp/org-init.el +++ b/emacs/site-lisp/org-init.el @@ -148,6 +148,7 @@ ("ACQUIRE" :foreground "#ff756e" :background "#171719" :box (:width 1 :color "#282830")) ("IGNORED" :foreground "#999999" :background "#222224" :box (:width 1 :color "#333335")))) (setq org-use-fast-todo-selection t) +(setq org-agenda-skip-function-global 'oni:skip-ex-tag) (setq org-use-property-inheritance '("slug")) (add-hook 'org-agenda-mode-hook 'org-agenda-to-appt) -- cgit v1.2.3-54-g00ecf