[Assorted-commits] SF.net SVN: assorted: [496] configs/trunk/src/emacs/yang.el
Brought to you by:
yangzhang
From: <yan...@us...> - 2008-02-24 07:17:54
|
Revision: 496 http://assorted.svn.sourceforge.net/assorted/?rev=496&view=rev Author: yangzhang Date: 2008-02-23 23:17:57 -0800 (Sat, 23 Feb 2008) Log Message: ----------- folded in sbw's .emacs Modified Paths: -------------- configs/trunk/src/emacs/yang.el Modified: configs/trunk/src/emacs/yang.el =================================================================== --- configs/trunk/src/emacs/yang.el 2008-02-24 07:00:01 UTC (rev 495) +++ configs/trunk/src/emacs/yang.el 2008-02-24 07:17:57 UTC (rev 496) @@ -259,6 +259,17 @@ ;; }}} +;; modes {{{ + +(defun linux-c-mode () + "C mode with adjusted defaults for use with the Linux kernel." + (interactive) + (c-mode) + (c-set-style "K&R") + (setq c-basic-offset 8)) + +;; }}} + ;; commands {{{ ;; TODO fill-line @@ -316,6 +327,31 @@ ;;; TODO how to fix this? ;;(global-set-key "\C-%" 'match-paren) +;; Silas' simple match-paren +;(defun match-paren (arg) +; "Go to the matching paren if on a paren" +; (interactive "p") +; (cond ((looking-at "\\s\(") (forward-list 1) (backward-char 1)) +; ((looking-at "\\s\)") (forward-char 1) (backward-list 1)) +; (t (message "no paren under cursor")))) + +(defun forward-open-curly () + (interactive) + (forward-char) (search-forward "{" nil t) (backward-char)) +(defun forward-closed-curly () + (interactive) + (forward-char) (search-forward "}" nil t) (backward-char)) +(defun backward-open-curly () + (interactive) + (backward-char) + (if (equal nil (search-backward "{" nil t)) + (forward-char))) +(defun backward-closed-curly () + (interactive) + (backward-char) + (if (equal nil (search-backward "}" nil t)) + (forward-char))) + ;; }}} ;; macros {{{ @@ -328,10 +364,27 @@ ;; key bindings {{{ +(global-set-key "C-xj" 'compile) (global-set-key [f5] 'goto-line) (global-set-key "\C-ha" 'apropos) (global-set-key (kbd "C-c j") 'join-lines) +;; Silas' key bindings + +;(global-set-key "\e[1;5A" 'backward-paragraph) ;; C-up +;(global-set-key "\e[1;5B" 'forward-paragraph) ;; C-down +;(global-set-key "\e[1;5C" 'forward-word) ;; C-right +;(global-set-key "\e[1;5D" 'backward-word) ;; C-left +; +;(global-set-key "\e[1;5H" 'backward-open-curly) ;; C-home +;(global-set-key "\e[5;5~" 'backward-closed-curly) ;; C-pageup +;(global-set-key "\e[1;5F" 'forward-open-curly) ;; C-pageup +;(global-set-key "\e[6;5~" 'forward-closed-curly) ;; C-pageup +;(global-set-key [f11] 'shrink-window-horizontally) +;(global-set-key [f12] 'enlarge-window-horizontally) +; +;(global-set-key "\e[2;5~" 'indent-relative-maybe) + ;; TODO make the following scroll without moving the cursor ;(defun scroll-up-one (arg) @@ -354,11 +407,10 @@ ;; options {{{ -;; TODO what's the default? ;; TODO make work in XEmacs ;; default to better frame titles -;(setq frame-title-format -; (concat "%b - emacs@" system-name)) +(setq frame-title-format + (concat "%b - emacs@" system-name)) ;; enable word wrapping (add-hook 'text-mode-hook 'turn-on-auto-fill) @@ -374,11 +426,22 @@ ;; expand tabs into spaces (setq-default indent-tabs-mode nil) +(setq-default fill-column 80) +;; auto fill +(setq-default auto-fill-function 'do-auto-fill) + +;; tab, indent dimensions +(setq-default c-basic-offset 4) +(setq-default tab-width 4) + +;; Make lines wrap automatically in text mode. +;;(add-hook 'text-mode-hook +;;'(lambda () (auto-fill-mode 1))) + ;; larger default font ;(set-face-font 'default "9x15") -;; TODO what does this do? ;; default to unified diffs (setq diff-switches "-u") @@ -477,6 +540,26 @@ +;; Silas' custom set variables + +;(custom-set-variables +; ;; custom-set-variables was added by Custom -- don't edit or cut/paste it! +; ;; Your init file should contain only one such instance. +; '(auto-compression-mode t nil (jka-compr)) +; '(case-fold-search t) +; '(current-language-environment "UTF-8") +; '(default-input-method "rfc1345") +; '(global-font-lock-mode t nil (font-lock)) +; '(hl-line-face (quote highlight)) +; '(show-paren-mode t nil (paren)) +; '(transient-mark-mode t)) +;(custom-set-faces +; ;; custom-set-faces was added by Custom -- don't edit or cut/paste it! +; ;; Your init file should contain only one such instance. +; '(highlight ((((type tty) (class color)) (:underline t))))) + + + ;;;(setq default-frame-alist '((background-color . "white")) ;;; font-lock-face-attributes ;;; '((font-lock-comment-face "Sienna") This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |