diff options
author | Luo Jinghua <sunmoon1997@gmail.com> | 2010-01-03 21:26:05 +0800 |
---|---|---|
committer | Luo Jinghua <sunmoon1997@gmail.com> | 2010-01-03 21:26:05 +0800 |
commit | 39d289c40eb270a2821a7e0b435ece2fd2b16806 (patch) | |
tree | 836e6be7eb3c6706514316fd49be52c3b7950ba6 | |
parent | bbe41e3d44c43908f086e0deade5df921702dfe8 (diff) |
emacs: bind C-d to kill-whole-line
-rw-r--r-- | emacs | 20 |
1 files changed, 20 insertions, 0 deletions
@@ -44,9 +44,29 @@ (add-to-list 'load-path "~/.emacs.d/session") (add-to-list 'load-path "~/.emacs.d/lisp") + +;;session (require 'session) (add-hook 'after-init-hook 'session-initialize) +;;kill a line +(defun kill-whole-line nil + "delete the whole line" + (interactive) + (beginning-of-line) + (push-mark) + (beginning-of-line 2) + (kill-region (point) (mark))) +(global-set-key (kbd "C-d") 'kill-whole-line) + +;; compile .emacs +(defun autocompile nil + "compile itself if ~/.emacs" + (interactive) + (if (string= (buffer-file-name) (concat default-directory ".emacs")) + (byte-compile-file (buffer-file-name)))) +(add-hook 'after-save-hook 'autocompile) + ;;---------------------------------------------------------------------------- (setq tab-width 4) ;;(setq c-basic-offset 4) |