Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
238 lines (211 sloc) 8.96 KB
;; Function to load a directory recursively, given a stringp.
(defun load-dir-recursive (str)
(if (fboundp 'normal-top-level-add-subdirs-to-load-path)
(let* ((my-lisp-dir (expand-file-name str))
(default-directory my-lisp-dir))
(normal-top-level-add-to-load-path '("."))
(normal-top-level-add-subdirs-to-load-path))))
;; Use said function.
(mapc 'load-dir-recursive (list "/home/steve/.emacs.d/elisp"
"/home/steve/local/lib/erlang/lib/tools-2.6.6.5/emacs"
"/home/steve/.emacs.d/elisp/writegood-mode"))
;; Transparency
(set-frame-parameter (selected-frame) 'alpha '(95 65))
(add-to-list 'default-frame-alist '(alpha 95 65))
;; Crude window manipulation.
(global-set-key (kbd "C-s-b") 'shrink-window-horizontally)
(global-set-key (kbd "C-s-f") 'enlarge-window-horizontally)
(global-set-key (kbd "C-s-n") 'shrink-window)
(global-set-key (kbd "C-s-p") 'enlarge-window)
;; Fullscreen, all the way.
(defun fullscreen ()
(interactive)
(x-send-client-message nil 0 nil "_NET_WM_STATE" 32
'(2 "_NET_WM_STATE_FULLSCREEN" 0)))
(require 'erlang-start)
;; zap-up-to-char is more useful than zap-to-char
(autoload 'zap-up-to-char "misc"
"kill up to, but not including argth occurrence of char.
\(fn arg char)"
'interactive)
(global-set-key "\M-z" 'zap-up-to-char)
;; get rid of useless bars.
(menu-bar-mode -1)
(tool-bar-mode -1)
(scroll-bar-mode -1)
(setq erlang-root-dir "/home/steve/local/lib/erlang")
(setq exec-path (cons "/home/steve/local/bin" exec-path))
(require 'erlang-start)
;; various useful customizations
(blink-cursor-mode 0)
(setq inhibit-startup-message t)
;; (set-default 'truncate-lines t)
(set-default 'column-number-mode t)
;; google chrome as default browser
(defun browse-url-chrome (url &rest args)
(interactive (browse-url-interactive-arg "url: "))
(let ((browse-url-browser-function 'browse-url-generic)
(browse-url-generic-program "chromium-browser"))
(apply #'browse-url url args)))
(setq browse-url-browser-function 'browse-url-generic
browse-url-generic-program "chromium-browser")
(require 'writegood-mode)
(global-set-key "\C-cg" 'writegood-mode)
;; autoload js2 mode.
(autoload 'js2-mode "js2-mode" nil t)
(add-to-list 'auto-mode-alist '("\\.js$" . js2-mode))
;; Set modes for dot-files.
(add-to-list 'auto-mode-alist '("dot-" . shell-script-mode))
(add-to-list 'auto-mode-alist '("dot-emacs" . emacs-lisp-mode))
;; load color-theme stuff.
(require 'color-theme)
(eval-after-load "color-theme"
'(progn
(color-theme-initialize)
(color-theme-dark-laptop)))
;; jabber itself!
(if window-system
(require 'jabber-autoloads))
;; erc keywords
(setq erc-keywords '("\\b[nn]ow\\s?(js|js)\\b" "\\bdnode\\b"))
;; cperl-mode is superior to perl-mode, 'kay?
(mapc
(lambda (pair)
(if (eq (cdr pair) 'perl-mode)
(setcdr pair 'cperl-mode)))
(append auto-mode-alist interpreter-mode-alist))
;; various indenting / display stuff.
(setq c-default-style "linux"
c-basic-offset 4
js-indent-level 2)
;; indent cases of switch statements.
(c-set-offset 'case-label '+)
;; assembly mode
(autoload 'asm86-mode "asm86-mode" nil t)
(setq auto-mode-alist
(append '(("\\.asm$" . asm86-mode) ("\\.s$" . asm86-mode) ("\\.inc$" . asm86-mode)) auto-mode-alist))
(add-hook 'asm86-mode-hook 'turn-on-font-lock)
(setq asm86-extended-style-headers t)
;; markdown mode!
(autoload 'markdown-mode "markdown-mode.el"
"major mode for editing markdown files" t)
(setq auto-mode-alist
(cons '("\\.md$" . markdown-mode) auto-mode-alist))
;;; emacs/w3 configuration
(condition-case () (require 'w3-auto "w3-auto") (error nil))
;; custom variables. bleh.
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(LaTeX-command "latex")
'(TeX-PDF-mode t)
'(TeX-engine (quote default))
'(auto-image-file-mode t)
'(c-basic-offset 4)
'(cperl-autoindent-on-semi t)
'(cperl-font-lock nil)
'(cperl-hairy t)
'(delete-selection-mode nil)
'(erc-autoaway-message "idle... (autoaway after %i seconds of idletime)")
'(erc-autoaway-mode t)
'(erc-email-userid "steve")
'(erc-fill-column 75)
'(erc-fill-static-center 25)
'(erc-insert-away-timestamp-function (quote erc-insert-timestamp-right))
'(erc-insert-timestamp-function (quote erc-insert-timestamp-right))
'(erc-nick "stevew")
'(erc-prompt "brillig >")
'(erc-timestamp-format-left "[%a %b %e %y]")
'(erc-timestamp-format-right " [%h:%m] ")
'(erc-try-new-nick-p nil)
'(erc-user-full-name "Steve Wang")
'(espresso-indent-level 2)
'(exec-path (quote ("/home/steve/local/bin" "/home/steve/.cabal/bin" "/home/steve/bin" "/usr/local/bin" "/usr/bin" "/bin" "/usr/bin/x11" "/usr/x11r6/bin" "/usr/games" "/usr/lib/mit/bin" "/usr/lib/mit/sbin" "." "/usr/lib/emacs/23.3/x86_64-suse-linux")))
'(fill-column 75)
'(flyspell-default-dictionary nil)
'(global-mark-ring-max 32)
'(global-whitespace-mode nil)
'(global-whitespace-newline-mode t)
'(gnus-check-bogus-newsgroups t)
'(gnus-select-method (quote (nnimap "imap.gmail.com" (nnimap-address "imap.gmail.com") (nnimap-server-port 993) (nnimap-stream ssl))))
'(hippie-expand-dabbrev-skip-space t)
'(imap-log t)
'(jabber-account-list (quote (("stevejohnwang@chat.facebook.com" (:network-server . "chat.facebook.com") (:connection-type . network)) ("steve.john.wang@gmail.com" (:network-server . "talk.google.com") (:connection-type . ssl)))))
'(jabber-chat-buffer-show-avatar nil)
'(jabber-history-enable-rotation t)
'(jabber-history-enabled t)
'(jabber-history-muc-enabled t)
'(jabber-muc-colorize-foreign t)
'(jabber-muc-colorize-local t)
'(jabber-muc-nick-saturation 0.8)
'(jabber-roster-show-bindings nil)
'(jabber-show-resources (quote always))
'(jabber-vcard-avatars-publish nil)
'(jabber-vcard-avatars-retrieve nil)
'(js2-auto-indent-p t)
'(js2-bounce-indent-p nil)
'(js2-cleanup-whitespace t)
'(js2-consistent-level-indent-inner-bracket-p t)
'(js2-enter-indents-newline t)
'(js2-highlight-level 3)
'(js2-include-browser-externs t)
'(js2-indent-on-enter-key nil)
'(js2-mode-indent-inhibit-undo t)
'(js2-pretty-multiline-decl-indentation-p t)
'(js2-skip-preprocessor-directives t)
'(kill-ring-max 100)
'(lintnode-location "/home/steve/.emacs.d/elisp/lintnode")
'(mail-source-report-new-mail-interval 1)
'(mark-even-if-inactive t)
'(mark-ring-max 32)
'(markdown-command-needs-filename t)
'(markdown-enable-math t)
'(message-confirm-send t)
'(mm-inline-text-html-with-images t)
'(mode-require-final-newline (quote visit-save))
'(read-mail-command (quote gnus))
'(require-final-newline (quote visit-save))
'(rmail-preserve-inbox t)
'(rmail-remote-password nil)
'(rmail-remote-password-required nil)
'(save-interprogram-paste-before-kill t)
'(scroll-bar-mode nil)
'(standard-indent 4)
'(tex-pdf-mode t t)
'(tex-source-correlate-method (quote synctex))
'(tex-source-correlate-mode t)
'(tex-source-correlate-start-server t)
'(tex-view-program-list (quote (("okular" "okular --unique %o#src:%n%b"))))
'(tex-view-program-selection (quote (((output-dvi style-pstricks) "okular") (output-dvi "okular") (output-pdf "okular") (output-html "okular"))))
'(transient-mark-mode 1)
'(undo-limit 1000000)
'(undo-strong-limit 1200000)
'(uniquify-buffer-name-style (quote post-forward-angle-brackets) nil (uniquify))
'(user-mail-address "steve.john.wang@gmail.com")
'(which-func-maxout 500000)
'(which-func-modes (quote (emacs-lisp-mode c-mode c++-mode cperl-mode python-mode makefile-mode sh-mode diff-mode js2-mode haskell-mode ruby-mode)))
'(which-function-mode t)
'(whitespace-action (quote (auto-cleanup)))
'(whitespace-global-modes nil)
'(whitespace-line-column 75)
'(x-select-enable-clipboard t))
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(default ((t (:inherit nil :stipple nil :background "#0C1021" :foreground "#F8F8F8" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :height 100 :width normal :foundry "unknown" :family "DejaVu Sans Mono"))))
'(jabber-activity-personal-face ((t (:foreground "#0088FF" :weight bold))))
'(jabber-chat-prompt-local ((t (:foreground "#0aa" :weight bold))))
'(jabber-roster-user-online ((t (:foreground "#69f" :slant normal :weight bold)))))
;; hack to make js2-global-externs actually have an effect.
(set 'js2-global-externs (list "JSON" "console" "setTimeout" "setInterval"
"clearTimeout" "clearInterval" "require"
"module" "exports" "process" "__dirname"
"__filename" "$" "now" "MathJax" "Buffer"))
;; Enable disabled commands.
(put 'set-goal-column 'disabled nil)
(put 'upcase-region 'disabled nil)
(put 'downcase-region 'disabled nil)
Something went wrong with that request. Please try again.