From 596f5badff928bf80ba5d1733b2f15179137521f Mon Sep 17 00:00:00 2001 From: Hunter Haugen Date: Sat, 23 Oct 2010 12:11:40 -0700 Subject: [PATCH] Adding erc/saveplace/shortcuts to emacs. +useful --- .emacs | 14 ++++++------ .emacs.hunner.el | 59 +++++++++++++++++++++++++++++++++++------------- 2 files changed, 50 insertions(+), 23 deletions(-) diff --git a/.emacs b/.emacs index 9b94895..6861bf1 100644 --- a/.emacs +++ b/.emacs @@ -1,15 +1,15 @@ (defconst dot-emacs (concat (getenv "HOME") "/" ".emacs.hunner.el") - "My dot emacs file") + "My dot emacs file") (require 'bytecomp) (setq compiled-dot-emacs (byte-compile-dest-file dot-emacs)) (if (or (not (file-exists-p compiled-dot-emacs)) - (file-newer-than-file-p dot-emacs compiled-dot-emacs) - (equal (nth 4 (file-attributes dot-emacs)) (list 0 0))) - (load dot-emacs) - (load compiled-dot-emacs)) + (file-newer-than-file-p dot-emacs compiled-dot-emacs) + (equal (nth 4 (file-attributes dot-emacs)) (list 0 0))) + (load dot-emacs) + (load compiled-dot-emacs)) (add-hook 'kill-emacs-hook - '(lambda () (and (file-newer-than-file-p dot-emacs compiled-dot-emacs) - (byte-compile-file dot-emacs)))) + '(lambda () (and (file-newer-than-file-p dot-emacs compiled-dot-emacs) + (byte-compile-file dot-emacs)))) diff --git a/.emacs.hunner.el b/.emacs.hunner.el index 5463a0f..cc5047c 100644 --- a/.emacs.hunner.el +++ b/.emacs.hunner.el @@ -1,6 +1,6 @@ -(require 'cl) +;; (require 'cl) -(mapcar (lambda (x) (add-to-list 'load-path (expand-file-name x))) +(mapc (lambda (x) (add-to-list 'load-path (expand-file-name x))) '("~/.emacs.d" )) @@ -8,10 +8,13 @@ (mapcar #'require packages)) (require-all '( + saveplace color-theme irblack parenface bar-cursor + tls + erc )) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -30,6 +33,12 @@ ;(load-file "~/.emacs.d/color-theme-inkpot.el") ;(color-theme-inkpot) +;; OS X settings +;; (setq mac-option-key-is-meta nil) +;; (setq mac-command-key-is-meta t) +;; (setq mac-command-modifier 'meta) +;; (setq mac-option-modifier nil) + (bar-cursor-mode 1) (menu-bar-mode 0) (scroll-bar-mode -1) @@ -166,6 +175,7 @@ commands)) (set-keys '( ("C-c t" totd) + ("C-c n" global-linum-mode) ("C-c s p" (lambda () (interactive) (if (shellfm-running-p) (shellfm-pause) @@ -183,7 +193,8 @@ ("C-S-" shrink-window) ("C-S-" enlarge-window) ("M-s" save-buffer) - ("M-n" global-linum-mode) + ("M-p" ctrl-y-in-vi) + ("M-n" ctrl-e-in-vi) ("M-N" make-frame) ("M-W" delete-frame) ("M-w" ido-kill-buffer) @@ -200,16 +211,16 @@ )) ;;toggle full-screen -(defun toggle-fullscreen () -(interactive) -(set-frame-parameter - nil - 'fullscreen - (if (frame-parameter nil 'fullscreen) - nil - 'fullboth))) +;; (defun toggle-fullscreen () +;; (interactive) +;; (set-frame-parameter +;; nil +;; 'fullscreen +;; (if (frame-parameter nil 'fullscreen) +;; nil +;; 'fullboth))) -(global-set-key [(meta return)] 'toggle-fullscreen) +;; (global-set-key [(meta return)] 'toggle-fullscreen) ;; Transparency (set-frame-parameter (selected-frame) 'alpha '(85 85)) @@ -219,11 +230,20 @@ (interactive) (if (/= (cadr (find 'alpha (frame-parameters nil) :key #'car)) - 10) - (set-frame-parameter nil 'alpha '(10 10)) + 40) + (set-frame-parameter nil 'alpha '(40 40)) (set-frame-parameter nil 'alpha '(85 85)))) (global-set-key (kbd "C-c T") 'toggle-transparency) +;; Vim-like scrolling +(defun ctrl-e-in-vi (n) + (interactive "p") + (scroll-up n)) + +(defun ctrl-y-in-vi (n) + (interactive "p") + (scroll-down n)) + ;; (global-set-key (kbd "") ;; (lambda () (interactive) ;; (if (shellfm-running-p) @@ -232,8 +252,15 @@ ;; ERC stuff ;; (setq erc-encoding-coding-alist (quote (("#lisp" . utf-8) -;; ("#nihongo" . iso-2022-jp) ("#truelambda" . iso-latin-1) -;; ("#bitlbee" . iso-latin-1)))) +;; ("#nihongo" . iso-2022-jp) +;; ("#" . iso-latin-1) +;; ("#" . iso-latin-1)))) +(autoload 'erc "erc") +(add-hook 'erc-mode-hook + '(lambda () + (setq scroll-margin 0) + (setq erc-scrolltobottom-mode 1))) +(load "~/.emacs.d/erc-bip") ;; Passwords here ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Haskell mode