Merge remote-tracking branch 'ryuslash/drd' into phoenix

Conflicts:
	.config/herbstluftwm/autostart
	.emacs.d/init.el
	.xinitrc
	.zprofile
	Makefile
	xmonad/xmonad.hs
This commit is contained in:
Tom Willemsen 2013-04-11 15:37:01 +02:00
commit 55ca176cd5
68 changed files with 1391 additions and 731 deletions

View file

@ -25,32 +25,32 @@ urxvt.boldFont: xft:Envy Code R:weight=bold:pixelsize=18
urxvt.italicFont: xft:Envy Code R:slant=italic:pixelsize=18
urxvt.depth: 32
urxvt.background: [90]#111113
urxvt.background: #111113
urxvt.foreground: #eeeeec
urxvt.color0: #171719
urxvt.color8: #999999
urxvt.color0: #111113
urxvt.color8: #eeeeec
urxvt.color1: #973732
urxvt.color9: #ff756e
urxvt.color1: #734a4a
urxvt.color9: #bf7d7d
urxvt.color2: #405c2e
urxvt.color10: #9ad870
urxvt.color2: #52734a
urxvt.color10: #8abf6d
urxvt.color3: #835c0e
urxvt.color11: #ffbb56
urxvt.color3: #6b734a
urxvt.color11: #b2bf6d
urxvt.color4: #2729b6
urxvt.color12: #78a2c1
urxvt.color4: #4a5b73
urxvt.color12: #6d97bf
urxvt.color5: #5c325d
urxvt.color13: #c39cc3
urxvt.color5: #6b4a73
urxvt.color13: #b27dbf
urxvt.color6: #208181
urxvt.color14: #93d8d8
urxvt.color6: #4a7373
urxvt.color14: #7dbfbf
urxvt.color7: #222224
urxvt.color15: #a9a9a9
urxvt.color15: #a5a5a4
Xft.antialias: true
Xft.rgba: rgb
@ -61,7 +61,25 @@ Xft.hintstyle: hintslight
Emacs.menuBar: off
Emacs.toolbar: off
Emacs.useXIM: off
! Emacs.background: #252a2b
Emacs.background: #111113
Emacs.borderWidth: 0
Emacs.font: Envy Code R-13
Emacs.foreground: #eeeeec
Emacs.internalBorder: 0
Emacs.paneFont: Envy Code R-13
Emacs.pointerColor: #eeeeec
Emacs*menu*font: Envy Code R-13
Emacs*menu*foreground: #eeeeec
Emacs*menu*background: #222224
Emacs*menu*buttonForeground: #a5a5a4
Emacs*menu*verticalSpacing: 0
Emacs*menu*shadowThickness: 1
Emacs*menu*margin: 0
Emacs.pane.menubar.translations: #override\
Ctrl <Key> n: down()\n\
Ctrl <Key> p: up()\n\
Ctrl <Key> f: right()\n\
Ctrl <Key> b: left()\n\
xfontsel.sampleText: \
static void print_sample_message(XWindow *win) {\n\

View file

@ -2,3 +2,5 @@ DESTDIR:=$(DESTDIR)/herbstluftwm
objects=autostart panel.sh
include ../../dotfiles.mk
install-autostart: MODE=744

View file

@ -1,71 +1,121 @@
#!/bin/zsh
#!/bin/bash
function hc () {
herbstclient $@
# this is a simple config for herbstluftwm
function hc() {
herbstclient "$@"
}
modkey="Mod4"
hc emit_hook reload
hc keybind $modkey+Ctrl+b resize left +0.05
hc keybind $modkey+Ctrl+f resize right +0.05
hc keybind $modkey+Ctrl+n resize down +0.05
hc keybind $modkey+Ctrl+p resize up +0.05
hc keybind $modkey+Ctrl+q quit
hc keybind $modkey+Ctrl+r reload
hc keybind $modkey+Shift+1 spawn dmenu_run -p 'Run:' -b -nb '#111113' -nf '#eeeeec' -sb '#171719'
hc keybind $modkey+Shift+b shift left
hc keybind $modkey+Shift+f shift right
hc keybind $modkey+Shift+n shift down
hc keybind $modkey+Shift+p shift up
hc keybind $modkey+Shift+s split horizontal 0.5
hc keybind $modkey+b focus -i left
hc keybind $modkey+c spawn urxvt
hc keybind $modkey+comma cycle_monitor -1
hc keybind $modkey+e spawn emacsclient -ca emacs
hc keybind $modkey+f focus -i right
hc keybind $modkey+k close
hc keybind $modkey+n focus -i down
hc keybind $modkey+o cycle_all
hc keybind $modkey+p focus -i up
hc keybind $modkey+period cycle_monitor 1
hc keybind $modkey+q remove
hc keybind $modkey+s split vertical 0.5
hc keybind $modkey+space cycle_layout 1
hc keybind $modkey+w spawn conkeror
hc keybind Ctrl+Mod1+l spawn i3lock -c 000000
hc keybind XF86AudioNext spawn mpc next
hc keybind XF86AudioPlay spawn mpc toggle
hc keybind XF86AudioPrev spawn mpc prev
hc keybind XF86AudioStop spawn mpc stop
# remove all existing keybindings
hc keyunbind --all
hc set default_frame_layout 2
hc set focus_stealing_prevention 0
hc set frame_bg_transparent 1
hc set frame_border_width 0
hc set raise_on_focus 1
hc set window_border_active_color "#999999"
hc set window_border_normal_color "#222224"
hc set window_border_width 1
# keybindings
Mod=Mod4
hc keybind $Mod-Shift-q quit
hc keybind $Mod-Shift-r reload
hc keybind $Mod-Shift-c close
hc set_layout max
hc keybind $Mod-c spawn urxvt
hc keybind $Mod-e spawn emacsclient -ca emacs
hc keybind $Mod-w spawn conkeror
hc pad 0 -5 -5 -5 -5
# tags
TAG_NAMES=( {1..9} )
TAG_KEYS=( {1..9} 0 )
hc mousebind $modkey-Button1 move
hc mousebind $modkey-Button2 resize
hc mousebind $modkey-Button3 zoom
hc rename default "${TAG_NAMES[0]}" || true
for i in ${!TAG_NAMES[@]} ; do
hc add "${TAG_NAMES[$i]}"
key="${TAG_KEYS[$i]}"
if ! [ -z "$key" ] ; then
hc keybind "$Mod-$key" use_index "$i"
hc keybind "$Mod-Shift-$key" move_index "$i"
fi
done
# cycle through tags
hc keybind $Mod-period use_index +1 --skip-visible
hc keybind $Mod-comma use_index -1 --skip-visible
hc keybind $Mod-Right use_index +1 --skip-visible
hc keybind $Mod-Left use_index -1 --skip-visible
# layouting
hc keybind $Mod-r remove
hc keybind $Mod-space cycle_layout 1
hc keybind $Mod-u split vertical 0.5
hc keybind $Mod-o split horizontal 0.5
hc keybind $Mod-s floating toggle
# hc keybind $Mod-f fullscreen toggle
# hc keybind $Mod-p pseudotile toggle
# resizing
RESIZESTEP=0.05
hc keybind $Mod-Control-h resize left +$RESIZESTEP
hc keybind $Mod-Control-j resize down +$RESIZESTEP
hc keybind $Mod-Control-k resize up +$RESIZESTEP
hc keybind $Mod-Control-l resize right +$RESIZESTEP
# mouse
hc mouseunbind --all
hc mousebind $Mod-Button1 move
hc mousebind $Mod-Button2 resize
hc mousebind $Mod-Button3 zoom
# focus
hc keybind $Mod-BackSpace cycle_monitor
hc keybind $Mod-Tab cycle_all +1
hc keybind $Mod-Shift-Tab cycle_all -1
# hc keybind $Mod-c cycle
hc keybind $Mod-b focus left
hc keybind $Mod-n focus down
hc keybind $Mod-p focus up
hc keybind $Mod-f focus right
hc keybind $Mod-i jumpto urgent
hc keybind $Mod-Shift-h shift left
hc keybind $Mod-Shift-j shift down
hc keybind $Mod-Shift-k shift up
hc keybind $Mod-Shift-l shift right
# colors
hc set frame_border_active_color '#222222'
hc set frame_border_normal_color '#101010'
hc set frame_bg_normal_color '#565656'
hc set frame_bg_active_color '#345F0C'
hc set frame_border_width 1
hc set window_border_width 3
hc set window_border_inner_width 1
hc set window_border_normal_color '#454545'
hc set window_border_active_color '#9fbc00'
hc set always_show_frame 1
hc set frame_gap 4
# add overlapping window borders
hc set window_gap -2
hc set frame_padding 2
hc set smart_window_surroundings 0
hc set smart_frame_surroundings 1
hc set mouse_recenter_gap 0
# rules
hc unrule -F
hc rule focus=on
hc rule windowtype=_NET_WM_WINDOW_TYPE_DIALOG focus=on pseudotile=on
hc rule class=Xephyr pseudotile=on
hc rule instance=Xine\ Window pseudotile=on
hc rule class=Pinentry pseudotile=on
hc rule class=Dispass pseudotile=on
hc rule title="GIMP Startup" pseudotile=on
#hc rule class=XTerm tag=3 # move all xterms to tag 3
hc rule focus=off # normally do not focus new clients
# give focus to most common terminals
hc rule class~'(.*[Rr]xvt.*|.*[Tt]erm|Konsole)' focus=on
hc rule windowtype~'_NET_WM_WINDOW_TYPE_(DIALOG|UTILITY|SPLASH)' pseudotile=on
hc rule windowtype='_NET_WM_WINDOW_TYPE_DIALOG' focus=on
hc rule windowtype~'_NET_WM_WINDOW_TYPE_(NOTIFICATION|DOCK)' manage=off
# xbindkeys
# unlock, just to be sure
hc unlock
# ~/.config/herbstluftwm/panel.sh &
herbstclient set tree_style '╾│ ├└╼─┐'
# hc load default "(split horizontal:0.550000:0 (split vertical:0.850000:0 (split horizontal:0.180000:1 (clients max:0) (clients max:0 0x140001a)) (clients max:0)) (clients max:0 0xc00077))"
# do multi monitor setup here, e.g.:
# hc set_monitors 1280x1024+0+0 1280x1024+1280+0
# or simply:
# hc detect_monitors
hc pad 0 21

View file

@ -3,3 +3,5 @@ map <C-n> scroll down
map <C-p> scroll up
map <C-f> scroll right
map <C-b> scroll left
set guioptions cs

View file

@ -1,10 +1,10 @@
require("content-policy.js");
require("favicon");
load_paths.push("file:///home/slash/projects/markam/conkeror/");
load_paths.push("file:///usr/local/clark/share/conkeror/modules/");
theme_load_paths.push("/home/slash/.conkerorrc/themes/");
require("markam");
require("clark");
define_browser_object_class(
"history-url", null,
@ -159,19 +159,22 @@ define_key(content_buffer_normal_keymap, "C-y", "paste-url-new-buffer");
define_key(content_buffer_normal_keymap, "H", "find-url-from-history");
define_key(content_buffer_normal_keymap, "h", "find-url-from-history-new-buffer");
define_key(default_base_keymap, "C-x f", "follow-new-buffer");
define_key(content_buffer_normal_keymap, "b", clark_keymap);
add_hook("before_quit_hook", oni_before_quit_func);
add_hook("content_policy_hook", content_policy_bytype);
add_hook("mode_line_hook", mode_line_adder(buffer_count_widget, true));
add_hook("mode_line_hook", mode_line_adder(buffer_icon_widget, true));
add_hook("mode_line_hook", mode_line_adder(buffer_count_widget));
add_hook("mode_line_hook", mode_line_adder(buffer_icon_widget), true);
add_hook("mode_line_hook", mode_line_adder(clark_bookmarked_widget), true);
add_hook("mode_line_hook", mode_line_adder(downloads_status_widget));
remove_hook("download_added_hook", open_download_buffer_automatically);
hints_minibuffer_annotation_mode(true);
theme_load("naquadah");
theme_load("yoshi");
external_content_handlers.set("application/pdf", "xpdf");
external_content_handlers.set("application/pdf", "zathura");
external_content_handlers.set("application/vnd.ms-excel", "libreoffice");
var gh_url = "http://github.com/";
function read_url_github_ad_command_handler(input)
@ -283,12 +286,12 @@ let (mozrepl_init = get_home_directory()) {
session_pref('extensions.mozrepl.initUrl', make_uri(mozrepl_init).spec);
};
if ('@hyperstruct.net/mozlab/mozrepl;1' in Cc) {
let mozrepl = Cc['@hyperstruct.net/mozlab/mozrepl;1']
.getService(Ci.nsIMozRepl);
if (!mozrepl.isActive())
mozrepl.start(4242);
}
// if ('@hyperstruct.net/mozlab/mozrepl;1' in Cc) {
// let mozrepl = Cc['@hyperstruct.net/mozlab/mozrepl;1']
// .getService(Ci.nsIMozRepl);
// if (!mozrepl.isActive())
// mozrepl.start(4242);
// }
register_user_stylesheet(
"data:text/css," +
@ -305,3 +308,4 @@ register_user_stylesheet(
oni_add_sheet("github.css");
oni_add_sheet("help.css");
oni_add_sheet("git-scm.css");

1
.conkerorrc/styles/.gitignore vendored Normal file
View file

@ -0,0 +1 @@
*.css

View file

@ -1,4 +1,7 @@
DESTDIR:=$(DESTDIR)/styles
objects=github.css help.css
objects=github.css help.css git-scm.css
include ../../dotfiles.mk
$(objects): %.css: %.less
lessc -x $^ > $@

View file

@ -0,0 +1,4 @@
@import "tango";
@monospace-font: "Envy Code R";
@background: #111113;

View file

@ -0,0 +1,18 @@
@import "base";
@-moz-document domain(git-scm.com) {
.book#main {
background: @background !important;
color: @aluminium-1 !important;
code, pre {
background: @aluminium-6 !important;
color: @aluminium-2 !important;
font-family: @monospace-font !important;
}
&, code, pre {
border: none !important;
}
}
}

View file

@ -1,161 +0,0 @@
@-moz-document url(https://github.com/), url(https://github.com/dashboard) {
#dashboard .filter-bar {
background: #222224 !important;
border-bottom: none !important;
}
#dashboard .filter-bar li a.filter_selected {
color: #eeeeec !important;
}
#dashboard .repos {
border: none !important;
background-color: #171719 !important;
}
#dashboard .repos .bottom-bar {
background-color: #222224 !important;
}
#dashboard .repos .top-bar {
background: #222224 !important;
border-bottom: none !important;
}
#dashboard .repos h2 {
color: inherit !important;
}
#dashboard ul.repo_list li.private {
background: #222224 !important;
}
#dashboard ul.repo_list li a {
border-width: 0 !important;
}
#footer {
text-shadow: none !important;
}
.button .minibutton {
background: #171719 !important;
}
.header {
background: #222224 !important;
color: #eeeeec !important;
border-bottom: none !important;
text-shadow: none !important;
}
.header .divider-vertical {
background: #222224 !important;
border-right: none !important;
}
.header .top-nav a {
color: #eeeeec !important;
}
.header .topsearch a#advanced_search {
color: #eeeeec !important;
}
.header #user-links a {
color: #eeeeec !important;
}
.markdown-body code,
.markdown-body tt {
background-color: #222224 !important;
border: none !important;
color: #eeeeec !important;
font-family: "Envy Code R" !important;
}
.minibutton.dark-grey {
background: #171719 !important;o
}
.news .alert {
border-top: none !important;
}
.news .alert .branch-link,
.news .alert .pull-info {
background: #222224 !important;
color: #eeeeec !important;
}
.news .alert .gravatar {
background: none !important;
}
.news .alert .simple .title {
color: #eeeeec !important;
}
.news .commits li img {
background: none !important;
}
.news blockquote {
color: #eeeeec !important;
}
.pagehead .container > ul.tabs {
background: #171719 !important;
border: none !important;
}
.pagehead .container > ul.tabs li a {
text-shadow: none !important;
border: none !important;
}
.pagehead .container > ul.tabs li a:hover {
background: #222224 !important;
}
.pagehead .container > ul.tabs li a.selected {
background: #222224 !important;
}
.pagehead-actions a.feed {
background: #222224 !important;
border: none !important;
}
.pagination {
background: #171719 !important;
border: none !important;
}
.pagination a {
text-shadow: none !important;
border-bottom: none !important;
}
.pagination a:hover {
background: #222224 !important;
}
a {
color: #ffbb56 !important;
}
a:visited {
color: #ee82ee !important;
}
a.header-logo-blacktocat,
a.header-logo-blacktocat:visited {
color: #eeeeec !important;
}
body {
background-color: #111113 !important;
color: #eeeeec !important;
}
}

View file

@ -0,0 +1,162 @@
@import "base";
@-moz-document url("https://github.com/"), url("https://github.com/dashboard") {
#dashboard {
.filter-bar {
background: @aluminium-5 !important;
border-bottom: none !important;
li a.filter_selected {
color: @aluminium-1 !important;
}
}
.repos {
border: none !important;
background-color: @aluminium-6 !important;
.bottom-bar {
background-color: @aluminium-5 !important;
}
.top-bar {
background: @aluminium-5 !important;
border-bottom: none !important;
}
h2 {
color: inherit !important;
}
}
ul.repo_list li {
&.private {
background: @aluminium-5 !important;
}
a {
border-width: 0 !important;
}
}
}
#footer {
text-shadow: none !important;
}
.button .minibutton {
background: @aluminium-6 !important;
}
.header {
background: @aluminium-5 !important;
color: @aluminium-1 !important;
border-bottom: none !important;
text-shadow: none !important;
.divider-vertical {
background: @aluminium-5 !important;
border-right: none !important;
}
.top-nav a,
.topsearch a#advanced_search,
#user-links a {
color: @aluminium-1 !important;
}
}
.markdown-body {
code, tt {
background-color: @aluminium-5 !important;
border: none !important;
color: @aluminium-1 !important;
font-family: @monospace-font !important;
}
}
.minibutton.dark-grey {
backgrond: @aluminium-6 !important;
}
.news {
.alert {
border-top: none !important;
.branch-info,
.pull-info {
background: @aluminium-5 !important;
color: @aluminium-1 !important;
}
.gravatar {
background: none !important;
}
.simple .title {
color: @aluminium-1 !important;
}
}
.commits li img {
background: none !important;
}
blockquote {
color: @aluminium-1 !important;
}
}
.pagehead .container > ul.tabs {
background: @aluminium-6 !important;
border: none !important;
li a {
text-shadow: none !important;
border: none !important;
&:hover,
&.selected {
background: @aluminium-5 !important;
}
}
}
.pagehead-actions a.feed {
background: @aluminium-5 !important;
border: none !important;
}
.pagination {
background: @aluminium-6 !important;
border: none !important;
a {
text-shadow: none !important;
border-bottom: none !important;
&:hover {
background: @aluminium-5 !important;
}
}
}
a {
color: @orange-1 !important;
&:visited {
color: @plum-1 !important;
}
&.header-logo-blacktocat {
&, &:visited {
color: @aluminium-1 !important;
}
}
}
body {
background-color: @background !important;
color: @aluminium-1 !important;
}
}

View file

@ -1,19 +0,0 @@
@-moz-document url(chrome://conkeror-help/content/help.html) {
body {
background: #111113 !important;
color: #eeeeec !important;
}
a {
color: #ffbb56 !important;
}
a:visited {
color: #ee82ee !important;
}
pre, .key {
background: #222224 !important;
font-family: "Envy Code R" !important;
}
}

View file

@ -0,0 +1,21 @@
@import "base";
@-moz-document url("chrome://conkeror-help/content/help.html") {
body {
background: @background !important;
color: @aluminium-1 !important;
}
a {
color: @orange-1 !important;
&:visited {
color: @plum-1 !important;
}
}
pre, .key {
background: @aluminium-5 !important;
font-family: @monospace-font !important;
}
}

View file

@ -0,0 +1,27 @@
@butter-1: #fce94f;
@butter-2: #edd400;
@butter-3: #c4a000;
@orange-1: #fcaf3e;
@orange-2: #f57900;
@orange-3: #ce5c00;
@chocolate-1: #e9b96e;
@chocolate-2: #c17d11;
@chocolate-3: #8f5902;
@chameleon-1: #8ae234;
@chameleon-2: #73d216;
@chameleon-3: #4e9a06;
@sky-blue-1: #729fcf;
@sky-blue-2: #3465a4;
@sky-blue-3: #204a87;
@plum-1: #ad7fa8;
@plum-2: #75507b;
@plum-3: #5c3566;
@scarlet-red-1: #ef2929;
@scarlet-red-2: #cc0000;
@scarlet-red-3: #a40000;
@aluminium-1: #eeeeec;
@aluminium-2: #d3d7cf;
@aluminium-3: #babdb6;
@aluminium-4: #888a85;
@aluminium-5: #555753;
@aluminium-6: #2e3436;

View file

@ -1,4 +1,4 @@
DESTDIR:=$(DESTDIR)/themes
modules=naquadah
modules=naquadah yoshi
include ../../dotfiles.mk

View file

@ -0,0 +1,5 @@
DESTDIR:=$(DESTDIR)/yoshi
objects=conkeror--scrollbars.css hints--url-panel.css minibuffer.css \
mode-line.css new-tabs.css tab-bar.css theme.json
include ../../../dotfiles.mk

View file

@ -0,0 +1,36 @@
@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
/* The "background" behind the scrolling part of the scrollbar. */
scrollbar {
background-color: #222;
}
/* corner between horizontal and vertical scrollbars */
scrollcorner {
background-color: black;
}
/* The scroll up/down buttons. */
scrollbarbutton {
background-color: #666;
}
/* The actual scrolling part of the scrollbar. */
thumb {
background-color: #666;
}
thumb, scrollbarbutton {
-moz-border-bottom-colors: #000 #333;
-moz-border-left-colors: #aaa #888;
-moz-border-right-colors: #000 #333;
-moz-border-top-colors: #aaa #888;
}
scrollbarbutton:hover:active, scrollbarbutton[active="true"] {
-moz-border-bottom-colors: #aaa #888;
-moz-border-left-colors: #000 #333;
-moz-border-right-colors: #aaa #888;
-moz-border-top-colors: #000 #333;
}

View file

@ -0,0 +1,17 @@
@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
.panel {
border-top: 4px double #333333;
color: white;
background-color: black;
}
.panel .panel-row-label {
font-weight: bold;
}
.panel .url-panel-label {
font-weight: bold;
}

View file

@ -0,0 +1,49 @@
@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
#minibuffer {
background-color: #111113;
border: none;
color: #EEEEEC;
font: 16px "Envy Code R";
}
#minibuffer-input, #minibuffer-input * {
color: #EEEEEC;
}
#minibuffer-prompt {
color: #EEEEEC;
}
/* Completions display */
tree.completions treechildren { border: none !important; }
tree.completions treecol { -moz-binding: none !important; }
tree.completions {
-moz-appearance: none !important;
border: 0px none !important;
background-color: #111113 !important;
-moz-border-top-colors: -moz-initial !important;
color: #EEEEEC !important;
font: 18px "Envy Code R";
}
tree.completions treechildren::-moz-tree-row {
background-color: #111113 !important;
border: none;
}
tree.completions treechildren::-moz-tree-row(current) {
background-color: #536580 !important;
color: #EEEEEC;
}
tree.completions treechildren::-moz-tree-cell-text(completion-description) {
color: #b8ffa6 !important;
}
tree.completions treechildren::-moz-tree-cell-text(current) {
color: #EEEEEC !important;
}

View file

@ -0,0 +1,11 @@
.mode-line {
font: 16px "Envy Code R";
padding: 0px;
border: none;
color: #EEEEEC;
background-color: #222224;
}
.mode-line label {
color: #EEEEEC;
}

View file

@ -0,0 +1,54 @@
#tab2-bar {
background: #222;
}
.tab2 {
margin: 2px 0px 0px 2px;
padding: 0px;
height: 22px;
border-width: 2px;
border-bottom-width: 0;
border-style: solid;
-moz-border-radius: 3px 3px 0 0;
-moz-border-left-colors: #888 #555;
-moz-border-right-colors: #000 #171717;
-moz-border-top-colors: #888 #555;
background: #333;
min-width: 200px;
max-width: 200px;
overflow: hidden; /* Chops end of label */
}
.tab2[selected=true] {
-moz-border-left-colors: #aaa #888;
-moz-border-right-colors: #000 #333;
-moz-border-top-colors: #aaa #888;
background: #666;
}
.tab2:hover {
-moz-border-left-colors: #eee #bbb;
-moz-border-right-colors: #333 #666;
-moz-border-top-colors: #eee #bbb;
background: #999;
}
.tab2-label {
margin-left: 4px;
padding-top: 1px;
color: #fff;
font: 11px Tahoma;
}
.tab2-icon {
margin: 1px !important;
padding: 1px;
width: 20px;
height: 15px;
max-height: 15px;
-moz-border-radius: 1px;
background: black;
color: white;
font: 900 11px Tahoma;
text-align: center;
}

View file

@ -0,0 +1,41 @@
@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
/* TABS */
#tab2-bar {
background: #000;
}
#tab2-bar .tab2 {
margin: 0;
padding: 0;
border: none;
/*height: 19px;
border: 1px solid #666;
min-width: 200px;
max-width: 200px;*/
background: #333;
overflow: hidden;
}
#tab2-bar .tab2-label {
margin: 0;
color: white;
font: 11px Tahoma;
}
#tab2-bar .tab2-icon {
height: 16px;
width: 16px;
background: #222;
color: white;
border: 1px solid #999;
font: 900 11px Tahoma;
text-align: center;
}
#tab2-bar .tab2[selected=true] {
border: 1px solid white;
background: #666;
border: 1px solid #999;
}

View file

@ -0,0 +1,9 @@
{ "sheets" : [
"conkeror--scrollbars.css",
"new-tabs.css",
"minibuffer.css",
"mode-line.css",
"hints--url-panel.css",
"tab-bar.css"
]
}

View file

@ -1,11 +0,0 @@
DESTDIR:=$(DESTDIR)/.emacs.d
objects=init.elc init.el gnus.elc gnus.el init2.elc init2.el
modules=eshell site-lisp snippets
EMACS=emacs
include ../dotfiles.mk
init2.el: init.org
$(EMACS) -Q -batch \
-eval "(progn (require 'org) (require 'ob-tangle) (org-babel-tangle-file \"$^\"))"

View file

@ -1,310 +0,0 @@
#+TITLE: Emacs init
#+STYLE: <link href="http://ryuslash.ninth.su/test2.css" rel="stylesheet">
#+OPTIONS: author:nil
#+STARTUP: showall
#+LINK: yoshi-theme http://ryuslash.org/projects/yoshi-theme.html
* Emacs init
Before doing anything else I should make sure that both the
directories ~/usr/local/emacs/share/emacs/site-lisp~ and
~/usr/share/emacs/site-list~ are included in =load-path=, along with
their subdirectories, but only if they haven't already been added
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
(eval-and-compile
(defun oni:path-init (dir)
"Add DIR to `load-path' and all its subdirectories, unless
DIR is already in `load-path'."
(unless (or (member dir load-path) (not (file-exists-p dir)))
(let ((default-directory dir))
(add-to-list 'load-path dir t)
(normal-top-level-add-subdirs-to-load-path))))
(oni:path-init "/usr/share/emacs/site-lisp")
(oni:path-init "/usr/local/emacs/share/emacs/site-lisp"))
#+END_SRC
Add my project [[yoshi-theme]] to =custom-theme-load-path= and load it.
#+BEGIN_SRC emacs-lisp :tangle init2.el
(add-to-list 'custom-theme-load-path "~/projects/emacs/yoshi-theme/")
(load-theme 'yoshi t)
#+END_SRC
Remove the ~menu-bar~, ~tool-bar~ and ~scroll-bar~ from the UI since I
don't use them at all.
#+BEGIN_SRC emacs-lisp :tangle init2.el
(menu-bar-mode -1)
(scroll-bar-mode -1)
(tool-bar-mode -1)
#+END_SRC
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
(mapc #'(lambda (dir)
(add-to-list 'load-path dir)
(let ((loaddefs (concat dir "/loaddefs.el")))
(when (file-exists-p loaddefs)
(load loaddefs))))
'("~/projects/emacs/mode-icons" "~/.emacs.d/site-lisp"
"~/projects/emacs/pony-mode/src" "~/projects/emacs/php-mode"))
#+END_SRC
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
(defalias 'yes-or-no-p 'y-or-n-p)
#+END_SRC
Use =ibuffer= instead of the default =list-buffers= because it has many
more features.
#+BEGIN_SRC emacs-lisp :tangle init2.el
(defalias 'list-buffers 'ibuffer)
#+END_SRC
Do the same with =hippie-expand= and =dabbrev-expand=.
#+BEGIN_SRC emacs-lisp :tangle init2.el
(defalias 'dabbrev-expand 'hippie-expand)
#+END_SRC
Don't show it when ~eldoc~ is running, I almost assume that it is
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
(eval-after-load "eldoc" '(diminish 'eldoc-mode))
#+END_SRC
Use the standard EMMS configuration and add some MPD settings.
#+BEGIN_SRC emacs-lisp :tangle init2.el
(defun oni:emms-init ()
"Initialization function for EMMS."
(require 'emms-setup)
(require 'emms-player-mpd)
(emms-standard)
(add-to-list 'emms-info-functions 'emms-info-mpd)
(add-to-list 'emms-player-list 'emms-player-mpd)
(setq emms-player-mpd-server-name "localhost")
(setq emms-player-mpd-server-port "6600")
(setq emms-player-mpd-music-directory "/mnt/music/mp3"))
(eval-after-load "emms-source-file" '(oni:emms-init))
(setq emms-source-file-default-directory "/mnt/music/")
#+END_SRC
Add some keybindings for EMMS.
#+BEGIN_SRC emacs-lisp :tangle init2.el
(defun oni:emms-toggle-playing ()
"Toggle between playing/paused states."
(interactive)
(if (eq emms-player-playing-p nil)
(emms-start)
(emms-pause)))
(defun oni:start-emms ()
"Check to see if the function `emms' exists, if not call
`emms-player-mpd-connect' and assume that will have loaded it."
(interactive)
(unless (fboundp 'emms)
(emms-player-mpd-connect))
(emms))
(global-set-key (kbd "<XF86AudioNext>") 'emms-next)
(global-set-key (kbd "<XF86AudioPlay>") 'oni:emms-toggle-playing)
(global-set-key (kbd "<XF86AudioPrev>") 'emms-previous)
(global-set-key (kbd "<XF86AudioStop>") 'emms-stop)
(global-set-key (kbd "<XF86Tools>") 'oni:start-emms)
#+END_SRC
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
(defun oni:flymake-init ()
"Initialization function for flymake."
(require 'flymake-cursor)
(add-to-list ; Make sure pyflakes is loaded
'flymake-allowed-file-name-masks ; for python files.
'("\\.py\\'" ext:flymake-pyflakes-init))
(add-to-list ; Error line repexp for go
'flymake-err-line-patterns ; compilation.
'("^\\([a-zA-Z0-9_]+\\.go\\):\\([0-9]+\\):\\(.*\\)$"
1 2 nil 3))
(add-to-list ; Go uses makefiles, makes
'flymake-allowed-file-name-masks ; flymaking 'easy'.
'("\\.go$" flymake-simple-make-init)))
(eval-after-load "flymake" '(oni:flymake-init))
#+END_SRC
Disable the GUI for flymake errors, add a bunch of pep8, flymake
and pyflakes messages to warning and 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
(setq flymake-gui-warnings-enabled nil)
(setq flymake-info-line-regexp
(eval-when-compile
(regexp-opt
'("Invalid name"
"String statement has no effect"
"Missing docstring"
"Empty docstring"
"multiple imports on one line"
"expected 2 blank lines, found 1"
"expected 2 blank lines, found 0"
"TODO:"
"whitespace after '{'"
"whitespace before '}'"
"whitespace before ':'"
"whitespace after '('"
"whitespace before ')'"
"whitespace after '['"
"whitespace before ']'"
"the backslash is redundant between brackets"
"continuation line over-indented for visual indent"
"continuation line under-indented for visual indent"
"Too many statements"
"comparison to None should be"
"missing whitespace around operator"
"missing whitespace after ','"
"line too long"
"at least two spaces before inline comment"
"trailing whitespace"
"imported but unused"
"Unused import"
"too many blank lines"))))
(setq flymake-log-file-name (expand-file-name "~/.emacs.d/flymake.log"))
(setq flymake-log-level 0)
(setq flymake-warn-line-regexp
(eval-when-compile
(regexp-opt '("warning"
"Warning"
"redefinition of unused"
"Redefining built-in"
"Redefining name"
"Unused argument"
"Unused variable"
"Dangerous default value {} as argument"
"no newline at end of file"
"Access to a protected member"))))
#+END_SRC
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
(eval-after-load "flycheck"
'(progn
(mapc (lambda (c) (delete c flycheck-checkers))
'(python-pylint python-pyflakes))))
#+END_SRC
** Eshell
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
(eval-after-load "em-term"
'(add-to-list 'eshell-visual-commands "unison"))
#+END_SRC
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
(setq eshell-highlight-prompt nil)
#+END_SRC
In the prompt:
- Show the exit status of the last program/command run represented
by a green ~+~ and a red ~-~ sign.
- Show the current hostname with the =mode-line-buffer-id= face.
- Show an abbreviation of the current directory (as seen in ~fish~)
using the =font-lock-string-face= face.
- If we're in a git repository, show the current branch with the
=font-lock-function-name-face= face.
- Show the status of priviledges in blue.
And set the =eshell-prompt-regexp= to
#+BEGIN_SRC emacs-lisp :tangle init2.el
(defun oni:eshell-prompt-function ()
"Show a pretty shell prompt."
(let ((status (if (zerop eshell-last-command-status) ?+ ?-))
(hostname (shell-command-to-string "hostname"))
(dir (abbreviate-file-name (eshell/pwd)))
(branch
(shell-command-to-string
"git branch --contains HEAD 2>/dev/null | sed -e '/^[^*]/d'"))
(userstatus (if (zerop (user-uid)) ?# ?$)))
(concat
(propertize (char-to-string status)
'face `(:foreground ,(if (= status ?+)
"green"
"red")))
" "
(propertize (substring hostname 0 -1) 'face 'mode-line-buffer-id)
" "
(propertize (oni:shorten-dir dir) 'face 'font-lock-string-face)
" "
(when (not (string= branch ""))
(propertize
;; Cut off "* " and "\n"
(substring branch 2 -1)
'face 'font-lock-function-name-face))
" \n"
(propertize (char-to-string userstatus)
'face `(:foreground "blue"))
"> ")))
(setq eshell-prompt-function 'oni:eshell-prompt-function
eshell-prompt-regexp "^[#$]> ")
#+END_SRC
Don't truncate lines in eshell, wrap them.
#+BEGIN_SRC emacs-lisp :tangle init2.el
(defun oni:eshell-mode-func ()
"Function for `eshell-mode-hook'."
(setq truncate-lines nil))
(add-hook 'eshell-mode-hook 'oni:eshell-mode-func)
#+END_SRC
Bind the ~f8~ key to easily show eshell.
#+BEGIN_SRC emacs-lisp :tangle init2.el
(defun oni:raise-eshell ()
"Start or switch back to `eshell'.
Also change directories to current working directory."
(interactive)
(let ((dir (file-name-directory
(or (buffer-file-name) "~/")))
(hasfile (not (eq (buffer-file-name) nil))))
(eshell)
(if (and hasfile (eq eshell-process-list nil))
(progn
(eshell/cd dir)
(eshell-reset)))))
(global-set-key (kbd "<f8>") 'oni:raise-eshell)
#+END_SRC

View file

@ -1,6 +0,0 @@
(setq newsticker-automatically-mark-items-as-old nil)
(setq newsticker-html-renderer 'w3m-region)
(setq newsticker-obsolete-item-max-age 604800)
(setq newsticker-use-full-width nil)
(provide 'newsticker-init)

View file

@ -1,6 +0,0 @@
# -*- coding: utf-8 -*-
# name: from ... import ...
# contributor: Tom Willemsen
# key: from
# --
from ${1:module} import ${2:class_or_module}

View file

@ -1,5 +1,5 @@
[user]
name = Tom Willemsen
name = Tom Willemse
email = tom@ryuslash.org
[core]
editor = emacs -nw

2
.hgrc
View file

@ -1,4 +1,4 @@
[ui]
username = Tom Willemsen <tom@ryuslash.org>
username = Tom Willemse <tom@ryuslash.org>
[extensions]
hgext.bookmarks =

View file

@ -1,4 +1,3 @@
### -*- eval: (git-auto-commit-mode 1) -*-
# ~/.muttrc
###
@ -57,7 +56,7 @@ set index_format = "%3C %Z %D [%-12.12L] %s"
set alias_format = "%4n %t %-20a %r"
# composing mail
set realname = "Tom Willemsen" # who am I?
set realname = "Tom Willemse" # who am I?
set envelope_from # which from?
set sig_dashes # dashes before my sig... sweet
set edit_headers # show headers when composing

View file

@ -8,7 +8,7 @@ pythonfile = ~/.offlineimap.py
[Account ryuslash.org]
localrepository = ryuslash.org-local
remoterepository = ryuslash.org-remote
postsynchook = mu index --muhome=~/.mu/ryuslash --maildir=~/documents/mail/ryuslash.org; ~/usr/bin/emacs-send-mail ryuslash.org
postsynchook = /home/slash/usr/bin/emacs-send-mail ryuslash.org; /home/slash/usr/bin/mode-line-mail ryuslash.org ryu
[Repository ryuslash.org-local]
type = Maildir
@ -25,7 +25,7 @@ nametrans = lambda folder: folder.lower()
[Account aethon]
localrepository = aethon-local
remoterepository = aethon-remote
postsynchook = mu index --muhome=~/.mu/aethon --maildir=~/documents/mail/aethon; ~/usr/bin/emacs-send-mail aethon
postsynchook = /home/slash/usr/bin/emacs-send-mail aethon; /home/slash/usr/bin/mode-line-mail aethon ae
[Repository aethon-local]
type = Maildir
@ -44,7 +44,7 @@ nametrans = lambda folder: re.sub('^INBOX$', 'inbox', re.sub('^\[Gmail\]/
[Account gmail]
localrepository = gmail-local
remoterepository = gmail-remote
postsynchook = mu index --muhome=~/.mu/gmail --maildir=~/documents/mail/gmail; ~/usr/bin/emacs-send-mail gmail
postsynchook = /home/slash/usr/bin/emacs-send-mail gmail; /home/slash/usr/bin/mode-line-mail gmail g
[Repository gmail-local]
type = Maildir
@ -63,7 +63,7 @@ nametrans = lambda folder: re.sub('^INBOX$', 'inbox', re.sub('^\[Gmail\]/
[Account ninthfloor]
localrepository = ninthfloor-local
remoterepository = ninthfloor-remote
postsynchook = mu index --muhome=~/.mu/ninthfloor --maildir=~/documents/mail/ninthfloor; ~/usr/bin/emacs-send-mail ninthfloor
postsynchook = /home/slash/usr/bin/emacs-send-mail ninthfloor; /home/slash/usr/bin/mode-line-mail ninthfloor 9f
[Repository ninthfloor-local]
type = Maildir

View file

@ -3,38 +3,29 @@
(in-package :stumpwm)
(require 'cl-ppcre)
(defmacro elisp (&body body)
"Run BODY through emacsclient."
`(sb-ext:run-program
"/usr/bin/emacsclient"
'("-e" ,(string-downcase (format nil "~S" (cons 'progn body))))
:wait nil))
;; Naquadah
(defun colour (key)
(let ((colours (list :aluminium-1 #xeeeeec
:aluminium-2 #xd3d7cf
:aluminium-3 #xbabdb6
:aluminium-4 #x888a85
:aluminium-5 #x555753
:aluminium-6 #x2e3436
:butter-1 #xfce94f
:butter-2 #xedd400
:butter-3 #xc4a000
:orange-1 #xfcaf3e
:orange-2 #xf57900
:orange-3 #xce5c00
:chocolate-1 #xe9b96e
:chocolate-2 #xc17d11
:chocolate-3 #x9f5902
:chameleon-1 #x8ae234
:chameleon-2 #x73d216
:chameleon-3 #x4e9a06
:sky-blue-1 #x729fcf
:sky-blue-2 #x3465a4
:sky-blue-3 #x204a87
:plum-1 #xad7fa8
:plum-2 #x75507b
:plum-3 #x5c3566
:scarlet-red-1 #xef2929
:scarlet-red-2 #xcc0000
:scarlet-red-3 #xa40000
:background #x252a2b
:black #x0c191c
:cyan "cyan3")))
(let ((colours (list :lblack #xeeeeec :dblack #x111113
:lwhite #xa5a5a4 :dwhite #x222224
:lred #xbf6d6d :dred #x744a4a
:lorange #xbfa47d :dorange #x73634a
:lyellow #xb2bf6d :dyellow #x6b734a
:lgreen #x8abf6d :dgreen #x52734a
:lturquoise #x7dbf97 :dturquoise #x4a735b
:lcyan #x7dbfbf :dcyan #x4a7373
:lblue #x6d97bf :dblue #x4a5b73
:lpurple #x8a7dbf :dpurple #x524a73
:lmagenta #xb27dbf :dmagenta #x6b4a73
:lpink #xbf6da4 :dpink #x734a63)))
(getf colours key)))
(defvar *conkeror-program* "conkeror"
@ -47,6 +38,12 @@
"The executable to run to start i3lock.")
(defvar *urxvt-program* "urxvt"
"The executable to run to start URxvt.")
(defvar *lock-screen-hook* nil
"Hook run right before the screen gets locked.")
(defvar *screen-unlocked-hook* nil
"Hook run right after the screen is unlocked.")
(defvar *mpd-was-playing-p* nil
"Indicator of whether or not MPD was playing when it was paused.")
(defun get-mail-count (mailbox &optional (inbox "inbox"))
"Check how many new messages there are in MAILBOX."
@ -55,6 +52,38 @@
(format nil "/home/slash/documents/mail/~A/~A/new/*.*"
mailbox inbox))))
(defun mpd-playing-p ()
"Check if MPD is currently in the playing state."
(and (cl-ppcre:scan
"\\n\\[playing\\]"
(with-output-to-string (status)
(sb-ext:run-program "/usr/bin/mpc" '() :output status)))
t))
(defun set-jabber-away ()
"Tell emacs to set jabber to away presence."
(elisp
(when (and (fboundp 'jabber-send-away-presence)
*jabber-connected*)
(jabber-send-away-presence))))
(defun set-jabber-online ()
"Tel emacs to set jabber to online presence."
(elisp
(when (and (fboundp 'jabber-send-default-presence)
*jabber-connected*)
(jabber-send-default-presence))))
(defun mpd-pause ()
"Pause MPD playback."
(when (setf *mpd-was-playing-p* (mpd-playing-p))
(sb-ext:run-program "/usr/bin/mpc" '("pause") :wait nil)))
(defun mpd-play ()
"Resume MPD playback."
(when *mpd-was-playing-p*
(sb-ext:run-program "/usr/bin/mpc" '("play") :wait nil)))
(defcommand run-emacs () ()
"Open Emacs"
(run-shell-command *emacs-program*))
@ -87,31 +116,38 @@
"Open URxvt"
(run-or-raise *urxvt-program* '(:class "URxvt")))
(defcommand run-i3lock () ()
"Lock screen"
(run-shell-command *i3lock-program*))
(defun run-stumpwm-hook-on-exit (process)
"Run `*screen-unlocked-hook*' if PROCESS' status is `:exited'."
(when (eq (sb-ext:process-status process) :exited)
(run-hook *screen-unlocked-hook*)))
(set-bg-color (colour :background))
(set-border-color (colour :aluminium-6))
(set-fg-color (colour :aluminium-1))
(set-float-focus-color (colour :black))
(set-float-unfocus-color (colour :aluminium-6))
(set-focus-color (colour :black))
(defcommand lock-screen () ()
"Lock the screen using i3lock. Run *lock-screen-hook* before locking
it and run *screen-unlocked-hook* after it has been unlocked."
(run-hook *lock-screen-hook*)
(sb-ext:run-program
"/usr/bin/i3lock" '("-n" "-c" "000000") :wait nil
:status-hook #'run-stumpwm-hook-on-exit))
(set-bg-color (colour :dwhite))
(set-border-color (colour :lwhite))
(set-fg-color (colour :lblack))
(set-float-focus-color (colour :dblack))
(set-float-unfocus-color (colour :dwhite))
(set-focus-color (colour :dblack))
(set-font "-*-tamsyn-medium-r-normal-*-17-*-*-*-*-0-iso8859-1")
(set-unfocus-color (colour :aluminium-6))
(set-win-bg-color (colour :background))
(set-unfocus-color (colour :dwhite))
(set-win-bg-color (colour :dwhite))
(setf *colors* (mapcar #'colour '(:black :scarlet-red-1 :chameleon-1
:butter-1 :sky-blue-1 :plum-1 :cyan
:aluminium-1)))
(setf *colors* (mapcar #'colour '(:lwhite :lred :lgreen :lyellow :lblue
:lmagenta :lcyan :lblack)))
(setf *input-window-gravity* :bottom-left)
(setf *message-window-gravity* :top-right)
(setf *mode-line-background-color* (colour :background))
(setf *mode-line-border-color* (colour :aluminium-6))
(setf *mode-line-foreground-color* (colour :aluminium-1))
(setf *mode-line-background-color* (colour :dwhite))
(setf *mode-line-border-color* (colour :dwhite))
(setf *mode-line-foreground-color* (colour :lblack))
(setf *shell-program* (getenv "SHELL"))
(setf *transient-border-width* 1)
(setf *window-format* "%m%50t")
(setf *window-border-style* :thin)
(setf *screen-mode-line-format*
(list "[%n]"
@ -120,14 +156,16 @@
(get-mail-count "ryuslash.org")
(get-mail-count "gmail")
(get-mail-count "aethon")
(get-mail-count "ninthfloor")))
'(:eval
(format-expand *window-formatters* *window-format*
(current-window)))))
(get-mail-count "ninthfloor")))))
(add-hook *lock-screen-hook* 'set-jabber-away)
(add-hook *lock-screen-hook* 'mpd-pause)
(add-hook *screen-unlocked-hook* 'set-jabber-online)
(add-hook *screen-unlocked-hook* 'mpd-play)
(set-prefix-key (kbd "C-z"))
(define-key *top-map* (kbd "C-M-l") "run-i3lock")
(define-key *top-map* (kbd "C-M-l") "lock-screen")
(define-key *root-map* (kbd "c") "raise-urxvt")
(define-key *root-map* (kbd "C") "run-urxvt")

View file

@ -1,11 +1,16 @@
# -*- eval: (git-auto-commit-mode 1) -*-
export BROWSER=firefox
export BROWSER=conkeror
export EDITOR="emacsclient -c -a emacs"
export INFOPATH="${HOME}/documents/info:${INFOPATH}"
INFOPATH="$HOME/documents/info"
INFOPATH="$INFOPATH:/usr/local/emacs/share/info"
INFOPATH="$INFOPATH:/usr/share/info"
INFOPATH="$INFOPATH:/usr/local/clark/share/info"
export INFOPATH="$INFOPATH:/usr/local/stumpwm/share/info"
PATH="${HOME}/usr/bin:${PATH}:/usr/local/bin:/usr/local/stumpwm/bin"
PATH="/usr/local/scwm/bin:$PATH"
PATH="/usr/local/clfswm/bin:$PATH"
PATH="/usr/local/clark/bin:$PATH"
export PATH="/usr/local/emacs/bin:$PATH"
if [ -z "$SSH_AGENT_PID" ]; then

12
.zshrc
View file

@ -33,6 +33,7 @@ alias mysql="mysql --pager"
# Suffix aliases
alias -s pdf="zathura"
alias -s xls="libreoffice"
setopt notify
setopt PROMPT_SUBST # Allow for functions in the prompt
@ -52,17 +53,14 @@ add-zsh-hook precmd precmd_maybe_festival
add-zsh-hook precmd vcs_info
add-zsh-hook chpwd chpwd_update_git_vars
zstyle ':vcs_info:*' actionformats '%F{2}(%f%s %r %b%F{2})%f %a
%S'
zstyle ':vcs_info:*' actionformats '%B%F{5}%a%f%%b %s:%r-%b %S'
zstyle ':vcs_info:*' enable bzr git hg svn
zstyle ':vcs_info:*' formats '%F{2}(%f%s %r %b%F{2})%f
%S'
zstyle ':vcs_info:*' nvcsformats '
%~'
zstyle ':vcs_info:*' formats '%s:%r-%b %S'
zstyle ':vcs_info:*' nvcsformats '%~'
zstyle ':vcs_info:bzr:*' branchformat '%b'
# Set the prompt.
PROMPT='%F{1}(%F{2}(%f%m %l%F{2})%f ${vcs_info_msg_0_}%F{1})%f %# '
PROMPT='%B%(?.%F{2}+.%F{1}-) %F{6}%m%b%f ${vcs_info_msg_0_} %# '
# Set terminal name to current running application
case $TERM in

View file

@ -1,5 +1,5 @@
export DESTDIR:=$(HOME)
modules=.emacs.d .config .conkerorrc .local .moc .mutt .ncmpcpp \
modules=emacs .config .conkerorrc .local .moc .mutt .ncmpcpp \
.pentadactyl .sawfish .ssh .w3m .weechat .zsh
objects=.bash_profile .beetsconfig .conky_box.lua .conkyrc .gitconfig \
.guile .hgrc .offlineimap.py .offlineimaprc .screenrc .scwmrc \

View file

@ -55,7 +55,8 @@ $(install-objects): install-%: %
@$(if $(call newer,$*), \
echo -e "$(FG_GRE)+ $(FG_YEL)$(MKDPREFIX)$* $(CLR_RE)to $(DESTDIR) as $(MODE)"; \
install -pDm $(MODE) "$*" "$(DESTDIR)/$*", \
echo -e "$(FG_RED)- $(FG_YEL)$(MKDPREFIX)$*$(CLR_RE)")
$(if $(call older,$*) ,\
echo -e "$(FG_RED)- $(FG_YEL)$(MKDPREFIX)$*$(CLR_RE)"))
$(install-modules): install-%:
@$(MAKE) -s -C $* install MKDPREFIX=$(MKDPREFIX)$*/

View file

@ -13,5 +13,4 @@ templates/
rinit.*
!rinit.org
history
init2.el
*.html

7
emacs/Makefile Normal file
View file

@ -0,0 +1,7 @@
DESTDIR:=$(DESTDIR)/.emacs.d
objects=init.elc init.el gnus.elc gnus.el
modules=eshell site-lisp snippets
EMACS=emacs
include ../dotfiles.mk

View file

@ -45,11 +45,12 @@
(address "tom.willemsen@archlinux.us")
(eval (setq message-sendmail-extra-arguments '("-a" "arch"))))
("aethon:"
(name "Tom Willemsen")
(address "thomas@aethon.nl")
(signature-file "~/documents/work/aethon/signature.txt")
(eval (setq message-sendmail-extra-arguments '("-a" "aethon")
flyspell-default-dictionary "nl")))))
(add-hook 'gnus-group-mode-hook 'gnus-topic-mode)
;-----[ BBDB ]--------------------------------------------------------
;; (require 'bbdb)
;; (bbdb-initialize 'gnus 'message)

617
emacs/init.el Normal file
View file

@ -0,0 +1,617 @@
;;; Turn the menu, scroll-bar and tool-bar off quickly, so they don't
;;; jump around as much.
(menu-bar-mode -1)
(scroll-bar-mode -1)
(tool-bar-mode -1)
(defmacro eval-after-init (&rest body)
"Defer execution of BODY until after Emacs init.
Some functionality is dependent on code loaded by package.el.
Instead of requiring package.el to load very early on, have some
functionality deferred to a point after Emacs has initialized and
package.el is loaded anyway."
`(add-hook 'emacs-startup-hook #'(lambda () ,@body)))
;;; Load my very own theme.
(eval-after-init (load-theme 'yoshi t))
;;; Add some project directories and my site-lisp directory to the
;;; load path to make it easy to (auto)load them.
(mapc #'(lambda (dir)
(add-to-list 'load-path dir)
(let ((loaddefs (concat dir "/loaddefs.el")))
(when (file-exists-p loaddefs)
(load loaddefs))))
'("~/projects/emacs/mode-icons" "~/.emacs.d/site-lisp"
"~/projects/emacs/pony-mode/src" "~/projects/emacs/php-mode"))
;;; I have never, yet, accidentally said `y' or `n' when asked.
(defalias 'yes-or-no-p 'y-or-n-p)
;;; These are much more feature-rich.
(defalias 'list-buffers 'ibuffer)
(defalias 'dabbrev-expand 'hippie-expand)
(defun ext:comp-finish-function (buf str)
"Close the compilation buffer quickly if everything went OK."
(if (string-match "exited abnormally" str)
;; there were errors
(message "compilation errors, press C-x ` to visit")
;; no errors, make the compilation window go away in 0.5 seconds
(when (member (buffer-name) '("*Compilation*" "*compilation*"))
(run-at-time 0.5 nil 'delete-windows-on buf)
(message "No compilation errors!"))))
(add-to-list 'compilation-finish-functions 'ext:comp-finish-function)
;;; I close the compilation window if there are no errors. Seeing it
;;; scroll past lets me see if there were any warnings I might want to
;;; look at.
(setq compilation-scroll-output t)
;;; Enable the excellent `paredit-mode' for any lisp-like languages.
(add-hook 'clojure-mode-hook 'paredit-mode)
(add-hook 'emacs-lisp-mode-hook 'paredit-mode)
(add-hook 'lisp-mode-hook 'paredit-mode)
(add-hook 'sawfish-mode-hook 'paredit-mode)
(add-hook 'scheme-mode-hook 'paredit-mode)
;;; Remove the pylint and pyflakes checkers from the flycheck
;;; configuration so the flake8 checker remains.
(eval-after-load "flycheck"
'(progn
(mapc (lambda (c) (delq c flycheck-checkers))
'(python-pylint python-pyflakes))))
(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)) ?-))
;;; Use `oni:pretty-control-l-function' to create a nice horizontal
;;; line.
(setq pp^L-^L-string-function 'oni:pretty-control-l-function)
;;; Don't put anything before the pp^L string.
(setq pp^L-^L-string-pre nil)
;;; Enable pp^L at startup and again for each frame created.
(add-hook 'emacs-startup-hook 'pretty-control-l-mode)
(add-hook 'after-make-frame-functions
'(lambda (arg) (pretty-control-l-mode)))
(setq erc-autojoin-channels-alist
'(("freenode.net" "#ninthfloor" "#emacs")))
(setq erc-hide-list '("PART"))
(setq erc-insert-timestamp-function 'erc-insert-timestamp-left)
(setq erc-timestamp-format "[%H:%M] ")
(setq erc-timestamp-only-if-changed-flag nil)
(setq erc-nick "ryuslash")
(defun oni:erc-mode-func ()
"Function for `erc-mode-hook'."
(erc-fill-mode -1)
(visual-line-mode)
(setq truncate-lines nil))
(add-hook 'erc-mode-hook 'oni:erc-mode-func)
;;; Since unison requires unbuffered input it should not show up in
;;; eshell, but a real term shell.
(eval-after-load "em-term"
'(add-to-list 'eshell-visual-commands "unison"))
;;; To be able to highlight the eshell prompt just as I want it with
;;; regular text properties the standard highlighting should be turned
;;; off, otherwise it always overwrites whatever text properties it
;;; finds.
(setq eshell-highlight-prompt nil)
(defun oni:eshell-prompt-function ()
"Show a pretty shell prompt."
(let ((status (if (zerop eshell-last-command-status) ?+ ?-))
(hostname (shell-command-to-string "hostname"))
(dir (abbreviate-file-name (eshell/pwd)))
(branch
(shell-command-to-string
"git branch --contains HEAD 2>/dev/null | sed -e '/^[^*]/d'"))
(userstatus (if (zerop (user-uid)) ?# ?$)))
(concat
(propertize (char-to-string status)
'face `(:foreground ,(if (= status ?+)
"green"
"red")))
" "
(propertize (substring hostname 0 -1) 'face 'mode-line-buffer-id)
" "
(propertize (oni:shorten-dir dir) 'face 'font-lock-string-face)
" "
(when (not (string= branch ""))
(propertize
;; Cut off "* " and "\n"
(substring branch 2 -1)
'face 'font-lock-function-name-face))
" \n"
(propertize (char-to-string userstatus)
'face `(:foreground "blue"))
"> ")))
(setq eshell-prompt-function 'oni:eshell-prompt-function
eshell-prompt-regexp "^[#$]> ")
(defun oni:eshell-mode-func ()
"Function for `eshell-mode-hook'."
(setq truncate-lines nil))
(add-hook 'eshell-mode-hook 'oni:eshell-mode-func)
(defun oni:raise-eshell ()
"Start or switch back to `eshell'.
Also change directories to current working directory."
(interactive)
(let ((dir (file-name-directory
(or (buffer-file-name) "~/")))
(hasfile (not (eq (buffer-file-name) nil))))
(eshell)
(if (and hasfile (eq eshell-process-list nil))
(progn
(eshell/cd dir)
(eshell-reset)))))
(global-set-key (kbd "<f8>") 'oni:raise-eshell)
;;; 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.
(setq-default bidi-paragraph-direction 'left-to-right)
;;; Enable the following commands because they're useful sometimes and
;;; I'm not an Emacs beginner anymore, they don't confuse me.
(put 'upcase-region 'disabled nil)
(put 'downcase-region 'disabled nil)
(put 'narrow-to-region 'disabled nil)
(put 'scroll-left 'disabled nil)
(defun oni:jabber-init ()
"Initialization function for jabber."
(remove-hook 'jabber-alert-presence-hooks 'jabber-presence-echo))
(eval-after-load "jabber" '(oni:jabber-init))
(autoload 'jabber-message-libnotify "jabber-libnotify")
(autoload 'jabber-muc-libnotify "jabber-libnotify")
(add-hook 'jabber-alert-message-hooks 'jabber-message-libnotify)
(add-hook 'jabber-alert-muc-hooks 'jabber-muc-libnotify)
(setq jabber-history-enabled t
jabber-history-muc-enabled t)
(setq jabber-use-global-history nil
jabber-history-dir "~/.emacs.d/jabber-hist")
(setq jabber-account-list '(("ryuslash@jabber.org")
("tom@ryuslash.org/drd"
(:connection-type . ssl))))
(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))
(setq ido-auto-merge-delay-time 1000000)
(setq ido-default-buffer-method 'selected-window)
(setq ido-max-window-height 1)
(setq ido-save-directory-list-file nil)
(ido-mode)
(setq ido-ubiquitous-command-exceptions
'(org-refile org-capture-refile))
(add-hook 'emacs-startup-hook 'ido-ubiquitous-mode)
(global-set-key (kbd "M-n") 'idomenu)
(setq minibuffer-eldef-shorten-default t)
(minibuffer-electric-default-mode)
(setq mode-line-default-help-echo "")
(eval-after-load "jedi" '(setcar jedi:server-command "python2"))
(add-hook 'python-mode-hook 'jedi:setup)
(setq jedi:tooltip-method nil)
(defface git-commit-summary-face
'((t (:inherit org-level-1)))
"Face for the git title line."
:group 'local)
(defface git-commit-overlong-summary-face
'((t (:background "#873732")))
"Face for commit titles that are too long."
:group 'local)
(defface git-commit-nonempty-second-line-face
'((t (:inherit git-commit-overlong-summary-face)))
"Face for the supposedly empty line in commit messages."
:group 'local)
(eval-after-load "org" '(require 'org-init))
(defun indent-defun ()
"Indent the current defun."
(interactive)
(save-excursion
(mark-defun)
(indent-region (region-beginning) (region-end))))
(global-set-key (kbd "C-M-z") 'indent-defun)
(defadvice term-handle-exit (after oni:kill-buffer-after-exit activate)
"Kill the term buffer if the process finished."
(let ((msg (ad-get-arg 1)))
(when (string-equal msg "finished\n")
(kill-buffer (current-buffer)))))
(defun oni:change-prev-case (num dir)
(let ((regfunc (if (eq dir 'up) 'upcase-region 'downcase-region))
(wordfunc (if (eq dir 'up) 'upcase-word 'downcase-word)))
(if (> num 1)
(funcall regfunc (point) (- (point) num))
(funcall wordfunc -1))))
(defun oni:upcase-prev (num)
(interactive "p")
(oni:change-prev-case num 'up))
(defun oni:downcase-prev (num)
(interactive "p")
(oni:change-prev-case num 'down))
(global-set-key (kbd "C-c u") 'oni:upcase-prev)
(global-set-key (kbd "C-c d") 'oni:downcase-prev)
(defun oni:vala-mode-func ()
"Function for `vala-mode-hook'."
(setq indent-tabs-mode nil))
(add-hook 'vala-mode-hook 'oni:vala-mode-func)
(eval-after-load "rainbow-mode" '(oni:rainbow-mode-init))
(eval-after-load "smex" '(oni:smex-init))
(eval-after-load "yasnippet" '(oni:yasnippet-init))
(autoload 'define-slime-contrib "slime")
(autoload 'gtags-mode "gtags" nil t)
(autoload 'jabber-connect "jabber" nil t)
(autoload 'php-mode "php-mode" nil t)
(autoload 'po-mode "po-mode" nil t)
(autoload 'pony-mode "pony-mode" nil t)
(autoload 'sawfish-mode "sawfish" nil t)
(autoload 'server-running-p "server")
(autoload 'slime-js-minor-mode "slime-js" nil t)
(autoload 'xmodmap-mode "xmodmap-mode" nil t)
(autoload 'w3m-bookmark-view "w3m" nil t)
(autoload 'w3m-goto-url "w3m" nil t)
(require 'uniquify)
(require 'ext)
(require 'oni)
(setq-default c-basic-offset 4)
(setq-default fci-rule-column 73)
(setq-default indent-tabs-mode nil)
(setq-default php-mode-warn-if-mumamo-off nil)
(setq-default require-final-newline t)
(setq-default tab-width 4)
(setq-default truncate-lines t)
(setq appt-disp-window-function #'oni:appt-display-window-and-jabber)
(setq appt-display-diary nil)
(setq auto-mode-case-fold nil)
(setq auto-save-file-name-transforms oni:auto-save-name-transforms)
(setq avandu-article-render-function #'avandu-view-w3m)
(setq backup-directory-alist oni:backup-directory-alist)
(setq browse-url-browser-function 'browse-url-generic)
(setq browse-url-generic-program (getenv "BROWSER"))
(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)))
(setq comment-auto-fill-only-comments t)
(setq custom-file "~/.emacs.d/custom.el")
(setq custom-theme-directory "~/.emacs.d/themes")
(setq default-frame-alist
`((border-width . 0)
(internal-border-width . 0)
(vertical-scroll-bars . nil)
(menu-bar-lines . nil)
(tool-bar-lines . nil)
(font . "Envy Code R:pixelsize=18")))
(setq elnode-do-init nil)
(setq fci-rule-color "darkred")
(setq frame-title-format '(:eval (concat "emacs: " (buffer-name))))
(setq geiser-repl-history-filename "~/.emacs.d/geiser-history")
(setq gnus-init-file "~/.emacs.d/gnus")
(setq gtags-auto-update t)
(setq help-at-pt-display-when-idle t)
(setq highlight-80+-columns 72)
(setq identica-enable-striping t)
(setq inferior-lisp-program "sbcl")
(setq inhibit-default-init t)
(setq inhibit-local-menu-bar-menus t)
(setq inhibit-startup-message t)
(setq initial-major-mode 'emacs-lisp-mode)
(setq initial-scratch-message nil)
(setq jabber-avatar-cache-directory "~/.emacs.d/jabber-avatars/")
(setq jabber-chat-buffer-format "*jab:%n*")
(setq jabber-chat-buffer-show-avatar nil)
(setq jabber-chat-fill-long-lines nil)
(setq jabber-chat-foreign-prompt-format "%t %u/%r <\n")
(setq jabber-chat-local-prompt-format "%t %u/%r >\n")
(setq jabber-chatstates-confirm nil)
(setq jabber-muc-autojoin '("aethon@muc.ryuslash.org"))
(setq jabber-roster-show-bindings nil)
(setq jabber-vcard-avatars-publish nil)
(setq jabber-vcard-avatars-retrieve nil)
(setq jit-lock-defer-time 0.2)
(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 'smtpmail-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)
(add-hook 'before-save-hook 'oni:before-save-func)
(add-hook 'c-mode-hook 'oni:c-mode-func)
(add-hook 'css-mode-hook 'oni:css-mode-func)
(add-hook 'diary-display-hook 'oni:diary-display-func)
(add-hook 'emacs-startup-hook 'oni:emacs-startup-func)
(add-hook 'emacs-lisp-mode-hook 'oni:emacs-lisp-mode-func)
(add-hook 'go-mode-hook 'oni:go-mode-func)
(add-hook 'gtags-mode-hook 'oni:gtags-mode-func)
(add-hook 'haskell-mode-hook 'oni:haskell-mode-func)
(add-hook 'html-mode-hook 'oni:html-mode-func)
(add-hook 'jabber-chat-mode-hook 'oni:jabber-chat-mode-func)
(add-hook 'jabber-roster-mode-hook 'oni:jabber-roster-mode-func)
(add-hook 'java-mode-hook 'oni:java-mode-func)
(add-hook 'js-mode-hook 'oni:js-mode-func)
(add-hook 'js2-mode-hook 'oni:js2-mode-func)
(add-hook 'lua-mode-hook 'oni:lua-mode-func)
(add-hook 'magit-log-edit-mode-hook 'oni:magit-log-edit-mode-func)
(add-hook 'markdown-mode-hook 'oni:markdown-mode-func)
(add-hook 'message-mode-hook 'oni:message-mode-func)
(add-hook 'org-mode-hook 'oni:org-mode-func)
(add-hook 'php-mode-hook 'oni:php-mode-func)
(add-hook 'prog-mode-hook 'oni:prog-mode-func)
(add-hook 'python-mode-hook 'oni:python-mode-func)
(add-hook 'rst-mode-hook 'oni:rst-mode-func)
(add-hook 'term-mode-hook 'oni:term-mode-func)
(add-hook 'texinfo-mode-hook 'oni:texinfo-mode-func)
(add-hook 'write-file-hooks 'oni:write-file-func)
(add-hook 'yas-minor-mode-hook 'oni:yas-minor-mode-func)
(define-key key-translation-map (kbd "C-j") (kbd "C-l"))
(define-key key-translation-map (kbd "C-l") (kbd "C-j"))
(global-set-key (kbd "'") 'oni:self-insert-dwim)
(global-set-key (kbd "<XF86HomePage>") 'oni:raise-scratch)
(global-set-key (kbd "<XF86Mail>") 'gnus)
(global-set-key (kbd "<f10>") 'git-project-show-files)
(global-set-key (kbd "<f5>") 'ext:reload-buffer)
(global-set-key (kbd "<f6>") 'jabber-switch-to-roster-buffer)
(global-set-key (kbd "<f7>") 'magit-status)
(global-set-key (kbd "<hiragana>") 'oni:show-org-index)
(global-set-key (kbd "C-<") 'oni:indent-shift-left)
(global-set-key (kbd "C->") 'oni:indent-shift-right)
(global-set-key (kbd "C-M-4") 'split-window-vertically)
(global-set-key (kbd "C-M-SPC") 'er/expand-region)
(global-set-key (kbd "C-M-d") 'kill-word)
(global-set-key (kbd "C-M-w") 'backward-kill-word)
(global-set-key (kbd "C-S-k") 'kill-whole-line)
(global-set-key (kbd "C-a") 'oni:move-beginning-of-dwim)
(global-set-key (kbd "C-c a") 'org-agenda)
(global-set-key (kbd "C-c c") 'org-capture)
(global-set-key (kbd "C-c i p") 'identica-update-status-interactive)
(global-set-key (kbd "C-c p") 'oni:show-buffer-position)
(global-set-key (kbd "C-c t") 'oni:raise-ansi-term)
(global-set-key (kbd "C-d") 'oni:kill-region-or-forward-char)
(global-set-key (kbd "C-e") 'oni:move-end-of-dwim)
(global-set-key (kbd "C-k") 'oni:kill-region-or-line)
(global-set-key (kbd "C-w") 'oni:kill-region-or-backward-char)
(global-set-key (kbd "M-0") 'delete-window)
(global-set-key (kbd "M-1") 'delete-other-windows)
(global-set-key (kbd "M-2") 'split-window-below)
(global-set-key (kbd "M-3") 'split-window-right)
(global-set-key (kbd "M-4") 'split-window-horizontally)
(global-set-key (kbd "M-o") 'other-window)
(global-set-key (kbd "\"") 'oni:self-insert-dwim)
(if (daemonp)
(global-set-key "\C-x\C-c" 'oni:close-client-window))
(when (or window-system (daemonp))
(global-unset-key "\C-z"))
(add-to-list 'auto-mode-alist '("\\.jl$" . sawfish-mode))
(add-to-list 'auto-mode-alist '("\\.js\\(on\\)?$" . js2-mode))
(add-to-list 'auto-mode-alist
'("\\.m\\(ark\\)?d\\(?:o?wn\\)?$" . markdown-mode))
(add-to-list 'auto-mode-alist '("\\.php[345]?$" . php-mode))
(add-to-list 'auto-mode-alist '("\\.po\\'\\|\\.po\\." . po-mode))
(add-to-list 'auto-mode-alist '("\\.tpl$" . html-mode))
(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 . nil))))
(add-to-list
'display-buffer-alist
'("^\\*git-project-list\\*$" . ((git-project-show-window . nil))))
(add-to-list
'display-buffer-alist
'("^\\*magit: .*\\*$" . ((display-buffer-same-window . nil))))
(blink-cursor-mode -1)
(column-number-mode -1)
(line-number-mode -1)
(tooltip-mode -1)
(package-initialize)
(auto-insert-mode)
(electric-indent-mode)
(savehist-mode)
(show-paren-mode)
(winner-mode)
(smex-initialize)
(help-at-pt-set-timer)
(windmove-default-keybindings)
(global-diff-hl-mode)
;;; Diminish lighter for a bunch of minor modes that should be on in
;;; certain modes and usually just clogg up the mode line.
(diminish 'auto-fill-function)
(eval-after-load "eldoc" '(diminish 'eldoc-mode))
(eval-after-load "paredit" '(diminish 'paredit-mode))
(eval-after-load "auto-complete" '(diminish 'auto-complete-mode))
(eval-after-load "flycheck" '(diminish 'flycheck-mode))
(eval-after-load "smartparens" '(diminish 'smartparens-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)
(add-hook 'python-mode-hook 'smartparens-mode)
(add-hook 'html-mode-hook 'smartparens-mode)
(defun oni:scroll-down-or-prev-page (arg)
"Either scroll down or go to the previous page.
Depending on the value of `buffer-narrowed-p'."
(interactive "P")
(if (buffer-narrowed-p)
(progn
(narrow-to-page (or arg -1))
(goto-char (point-min)))
(scroll-down-command arg)))
(defun oni:scroll-up-or-next-page (arg)
"Either scroll up or go to the next page.
Depending on the value of `buffer-narrowed-p'."
(interactive "P")
(if (buffer-narrowed-p)
(progn
(narrow-to-page (or arg 1))
(goto-char (point-min)))
(scroll-up-command arg)))
(global-set-key (kbd "<prior>") 'oni:scroll-down-or-prev-page)
(global-set-key (kbd "<next>") 'oni:scroll-up-or-next-page)
;;; 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")
;;; Turn on `compilation-minor-mode' whenever `pony-minor-mode' starts
;;; in a `comint-mode' buffer. Since buffers like `*ponymanage*' and
;;; `*ponyserver*' don't have their own specialized modes, but use
;;; `comint-mode' and turn on `pony-minor-mode', and I don't want to
;;; enable `compilation-minor-mode' for *every* `comint-mode' buffer,
;;; we can add a hook that adds a local hook.
(defun turn-on-compilation-for-pony ()
(add-hook 'pony-minor-mode-hook 'compilation-minor-mode nil t))
(add-hook 'comint-mode-hook 'turn-on-compilation-for-pony)
;;; Finally, load any `customize' settings and slime.
(load custom-file)
(load (expand-file-name "~/quicklisp/slime-helper.el"))

View file

@ -1,7 +1,7 @@
DESTDIR:=$(DESTDIR)/site-lisp
objects=dzen.elc dzen.el eltuki.elc eltuki.el ext.elc ext.el \
metalexpress.elc metalexpress.el mu4e-init.elc mu4e-init.el \
newsticker-init.elc newsticker-init.el oni.elc oni.el org-init.elc \
org-init.el quick-edit-mode.elc quick-edit-mode.el
oni.elc oni.el org-init.elc org-init.el quick-edit-mode.elc \
quick-edit-mode.el
include ../../dotfiles.mk

View file

@ -1,8 +1,8 @@
;;; dzen.el --- Control DZEN2 from emacs
;; Copyright (C) 2012 Tom Willemsen
;; Copyright (C) 2012 Tom Willemse
;; Author: Tom Willemsen <slash@drd>
;; Author: Tom Willemse <slash@drd>
;; Keywords: convenience
;; This program is free software; you can redistribute it and/or modify

View file

@ -1,8 +1,8 @@
;;; eltuki.el --- Tekuti functions
;; Copyright (C) 2012 Tom Willemsen
;; Copyright (C) 2012 Tom Willemse
;; Author: Tom Willemsen <slash@drd>
;; Author: Tom Willemse <slash@drd>
;; Keywords: convenience
;; This program is free software; you can redistribute it and/or modify

View file

@ -1,8 +1,8 @@
;;; ext.el --- More emacs functions
;; Copyright (C) 2012 Tom Willemsen
;; Copyright (C) 2012 Tom Willemse
;; Author: Tom Willemsen <tom@ryuslash.org>
;; Author: Tom Willemse <tom@ryuslash.org>
;; Keywords: local
;; This program is free software; you can redistribute it and/or modify

View file

@ -1,8 +1,8 @@
;;; metalexpress.el --- Listen to Metal Express Radio
;; Copyright (C) 2012 Tom Willemsen
;; Copyright (C) 2012 Tom Willemse
;; Author: Tom Willemsen <thomas@aethon.nl>
;; Author: Tom Willemse <thomas@aethon.nl>
;; Keywords: multimedia
;; This program is free software; you can redistribute it and/or modify

View file

@ -1,8 +1,8 @@
;;; mu4e-init.el --- mu4e initialization
;; Copyright (C) 2012 Tom Willemsen
;; Copyright (C) 2012 Tom Willemse
;; Author: Tom Willemsen <slash@drd>
;; Author: Tom Willemse <slash@drd>
;; Keywords:
;; This program is free software; you can redistribute it and/or modify

View file

@ -1,8 +1,8 @@
;;; oni.el --- Functions for emacs
;; Copyright (C) 2012 Tom Willemsen
;; Copyright (C) 2012 Tom Willemse
;; Author: Tom Willemsen <tom@ryuslash.org>
;; Author: Tom Willemse <tom@ryuslash.org>
;; Keywords: local
;; This program is free software; you can redistribute it and/or modify
@ -109,12 +109,6 @@ DOT are intentionally being skipped."
(require 'auto-complete-config)
(ac-config-default))
(defun oni:erc-mode-func ()
"Function for `erc-mode-hook'."
(erc-fill-mode -1)
(visual-line-mode)
(setq truncate-lines nil))
(defun oni:go-mode-func ()
"Function for `go-mode-hook'."
(setq indent-tabs-mode nil)
@ -135,19 +129,6 @@ DOT are intentionally being skipped."
(fci-mode)
(flycheck-mode))
(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*"))))))
(defun oni:indent-shift-left (start end &optional count)
"Rigidly indent region.
Region is from START to END. Move
@ -195,14 +176,7 @@ If COUNT has been specified indent by that much, otherwise look at
(defun oni:jabber-chat-mode-func ()
"Function for `jabber-chat-mode-hook'."
(visual-line-mode)
(setq mode-line-format (append (cddr jabber-chat-header-line-format)
'(global-mode-string))
header-line-format nil))
(defun oni:jabber-init ()
"Initialization function for jabber."
(remove-hook 'jabber-alert-presence-hooks 'jabber-presence-echo))
(visual-line-mode))
(defun oni:jabber-roster-mode-func ()
"Function for `jabber-roster-mode-hook'."
@ -369,13 +343,6 @@ When dealing with braces, add another line and indent that too."
(setq-local fci-rule-column 80)
(flycheck-mode))
(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."
(make-string
(1- (if (boundp 'fci-rule-column)
fci-rule-column fill-column)) ?-))
(defun oni:prog-mode-func ()
"Function for `prog-mode-hook'."
(rainbow-delimiters-mode)
@ -406,7 +373,7 @@ When dealing with braces, add another line and indent that too."
(let ((buffer (get-buffer "*ansi-term*")))
(if (and buffer (not arg))
(switch-to-buffer buffer)
(call-interactively 'ansi-term))))
(ansi-term (getenv "SHELL")))))
(defun oni:raise-scratch (&optional mode)
"Show the *scratch* buffer.

View file

@ -1,8 +1,8 @@
;;; org-init.el --- Org initialization
;; Copyright (C) 2012 Tom Willemsen
;; Copyright (C) 2012 Tom Willemse
;; Author: Tom Willemsen <slash@drd>
;; Author: Tom Willemse <slash@drd>
;; Keywords:
;; This program is free software; you can redistribute it and/or modify
@ -77,6 +77,7 @@
(expand-file-name "~/documents/org/misc/bookmarks.org"))
"Agenda files that are work-agnostic, should always show up.")
(setq org-agenda-cmp-user-defined (lambda (a b) 1))
(setq org-agenda-custom-commands
'(("P" . "Personal only")
("Pa" "Personal agenda" agenda ""
@ -100,7 +101,7 @@
(search . " %i %-12:c")))
(setq org-agenda-sorting-strategy
'((agenda habit-down time-up priority-down category-keep)
(todo priority-down category-keep)
(todo user-defined-down)
(tags priority-down category-keep)
(search category-keep)))
(setq org-agenda-tags-column -101)

View file

@ -1,8 +1,8 @@
;;; quick-edit-mode.el --- Quickly edit stuff
;; Copyright (C) 2012 Tom Willemsen
;; Copyright (C) 2012 Tom Willemse
;; Author: Tom Willemsen <slash@drd>
;; Author: Tom Willemse <slash@drd>
;; Keywords: convenience
;; This program is free software; you can redistribute it and/or modify

View file

@ -0,0 +1,6 @@
# -*- coding: utf-8 -*-
# name: from ... import ...
# contributor: Tom Willemse
# key: from
# --
from ${1:module} import ${2:class_or_module}