Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
chen bin
committed
Aug 31, 2011
1 parent
11fd85f
commit dbc6dbd
Showing
1,920 changed files
with
477,136 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
(require 'better-registers) | ||
(better-registers-install-save-registers-hook) | ||
(load better-registers-save-file) | ||
|
||
(provide 'init-better-registers) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
;C/C++ SECTION | ||
(defun my-c-mode-hook () | ||
(local-set-key "\M-f" 'c-forward-into-nomenclature) | ||
(local-set-key "\M-b" 'c-backward-into-nomenclature) | ||
(setq c-basic-offset 4) | ||
(setq c-style-variables-are-local-p nil) | ||
;give me NO newline automatically after electric expressions are entered | ||
(setq c-auto-newline nil) | ||
|
||
;if (0) becomes if (0) | ||
; { { | ||
; ; ; | ||
; } } | ||
(c-set-offset 'substatement-open 0) | ||
|
||
;first arg of arglist to functions: tabbed in once | ||
;(default was c-lineup-arglist-intro-after-paren) | ||
(c-set-offset 'arglist-intro '+) | ||
|
||
;second line of arglist to functions: tabbed in once | ||
;(default was c-lineup-arglist) | ||
(c-set-offset 'arglist-cont-nonempty '+) | ||
|
||
;switch/case: make each case line indent from switch | ||
(c-set-offset 'case-label '+) | ||
|
||
;make the ENTER key indent next line properly | ||
(local-set-key "\C-m" 'newline-and-indent) | ||
|
||
;syntax-highlight aggressively | ||
;(setq font-lock-support-mode 'lazy-lock-mode) | ||
(setq lazy-lock-defer-contextually t) | ||
(setq lazy-lock-defer-time 0) | ||
|
||
;make DEL take all previous whitespace with it | ||
(c-toggle-hungry-state 1) | ||
|
||
;make open-braces after a case: statement indent to 0 (default was '+) | ||
(c-set-offset 'statement-case-open 0) | ||
|
||
;make a #define be left-aligned | ||
(setq c-electric-pound-behavior (quote (alignleft))) | ||
|
||
;do not impose restriction that all lines not top-level be indented at least | ||
;1 (was imposed by gnu style by default) | ||
(setq c-label-minimum-indentation 0) | ||
(if (or *linux* *cygwin*) | ||
(gtags-mode 1) | ||
) | ||
) | ||
(add-hook 'c-mode-hook 'my-c-mode-hook) | ||
(add-hook 'cc-mode-hook 'my-c-mode-hook) | ||
|
||
(provide 'init-cc-mode) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
;load cedet now, emacs23' embedded cedet is now powerful enough | ||
;@see http://appsintheopen.com/articles/1-setting-up-emacs- \ | ||
;for-rails-development/part/6-setting-up-the-emacs-code-browser | ||
;TIPs: | ||
; Having used ecb for a few year now, the only commands I ever use are: | ||
; * Jump to the directory window CTRL-c . gd (ctrl and c together, | ||
; release and press '.', release and press 'g' then 'd') | ||
; * Jump to the history window CTRL-c . gh | ||
; * Jump to the last window you were in CTRL-c . gl | ||
; * Jump to the method window CTRL-c . gm | ||
; * Jump to the first editor window CTRL-c . g1 | ||
; The directory browser can be controlled without using the mouse too ¨C | ||
; just use the arrow keys and enter ¨C give it a go! | ||
; NO embedded cedet becasue 'ecb' ask for latest cedet | ||
(load-file "~/.emacs.d/site-lisp/cedet/common/cedet.el") | ||
(setq semantic-load-turn-everything-on t) | ||
; * This turns on which-func support (Plus all other code helpers) | ||
; This is a minor mode which starts semantic-complete-analyze-inline during | ||
; idle time. | ||
; This has additional effect of showing list of completions in tooltip | ||
; if you leave Emacs alone for too long. | ||
; (global-semantic-idle-completions-mode 1) | ||
; (global-semantic-idle-summary-mode 1) | ||
(require 'semantic-sb nil t) | ||
(require 'semanticdb nil t) | ||
|
||
;; customisation of modes | ||
(defun my-cedet-hook () | ||
(local-set-key "\C-c," 'semantic-ia-complete-symbol) | ||
(local-set-key "\C-c." 'senator-complete-symbol) | ||
(local-set-key "\C-c/" 'semantic-ia-complete-symbol-menu) | ||
(local-set-key "\C-c>" 'semantic-complete-analyze-inline) | ||
(local-set-key "\C-c=" 'semantic-decoration-include-visit) | ||
(local-set-key "\C-cp" 'semantic-analyze-proto-impl-toggle) | ||
) | ||
(add-hook 'c-mode-common-hook 'my-cedet-hook) | ||
|
||
(defun my-c-mode-cedet-hook () | ||
(local-set-key "." 'semantic-complete-self-insert) | ||
(local-set-key ">" 'semantic-complete-self-insert) | ||
;(local-set-key "\C-ct" 'eassist-switch-h-cpp) | ||
;(local-set-key "\C-xt" 'eassist-switch-h-cpp) | ||
) | ||
(add-hook 'c-mode-common-hook 'my-c-mode-cedet-hook) | ||
|
||
(setq-default semanticdb-default-save-directory "~/tmp/semantic") | ||
|
||
(custom-set-variables '(semantic-idle-scheduler-idle-time 10)) | ||
|
||
(provide 'init-cedet) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
(require 'cmake-mode) | ||
(setq auto-mode-alist (append '(("CMakeLists\\.txt\\'" . cmake-mode)) | ||
'(("\\.cmake\\'" . cmake-mode)) | ||
auto-mode-alist)) | ||
(provide 'init-cmake-mode) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
;; Use cperl-mode instead of the default perl-mode | ||
(add-to-list 'auto-mode-alist '("\\.\\([pP][Llm]\\|al\\)\\'" . cperl-mode)) | ||
(add-to-list 'interpreter-mode-alist '("perl" . cperl-mode)) | ||
(add-to-list 'interpreter-mode-alist '("perl5" . cperl-mode)) | ||
(add-to-list 'interpreter-mode-alist '("miniperl" . cperl-mode)) | ||
|
||
(provide 'init-cperl-mode) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
(require 'csharp-mode) | ||
(setq auto-mode-alist (append '(("\\.cs$" . csharp-mode)) auto-mode-alist)) | ||
(provide 'init-csharp-mode) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
(load-library "ecb") | ||
(global-set-key (kbd "C-x C-e") 'ecb-activate) | ||
(global-set-key (kbd "C-x C-q") 'ecb-deactivate) | ||
|
||
(provide 'init-ecb) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
(require 'w3m-load) | ||
(setq w3m-coding-system 'utf-8 | ||
w3m-file-coding-system 'utf-8 | ||
w3m-file-name-coding-system 'utf-8 | ||
w3m-input-coding-system 'utf-8 | ||
w3m-output-coding-system 'utf-8 | ||
w3m-terminal-coding-system 'utf-8) | ||
(setq w3m-use-cookies t) | ||
(setq w3m-cookie-accept-bad-cookies t) | ||
(setq w3m-home-page | ||
(if (file-readable-p "~/html/home.html") | ||
(concat "file://" (expand-file-name "~/html/home.html")) | ||
"http://www.google.com.au")) | ||
|
||
(setq w3m-use-toolbar t | ||
;w3m-use-tab nil | ||
w3m-key-binding 'info | ||
) | ||
|
||
(setq w3m-search-default-engine "g") | ||
(eval-after-load "w3m-search" '(progn | ||
; C-u S g RET <search term> RET | ||
(add-to-list 'w3m-search-engine-alist '("g" | ||
"http://www.google.com.au/search?hl=zh-CN&q=%s" utf-8)) | ||
(add-to-list 'w3m-search-engine-alist '("wz" | ||
"http://zh.wikipedia.org/wiki/Special:Search?search=%s" utf-8)) | ||
(add-to-list 'w3m-search-engine-alist '("q" | ||
"http://www.google.com.au/search?hl=en&q=%s+site:stackoverflow.com" utf-8)) | ||
(add-to-list 'w3m-search-engine-alist '("s" | ||
"http://www.google.com.au/codesearch?q=%s" utf-8)) | ||
(add-to-list 'w3m-search-engine-alist '("b" | ||
"http://blogsearch.google.com.au/blogsearch?q=%s" utf-8)) | ||
(add-to-list 'w3m-search-engine-alist '("w" | ||
"http://en.wikipedia.org/wiki/Special:Search?search=%s" utf-8)) | ||
(add-to-list 'w3m-search-engine-alist '("d" | ||
"http://dictionary.reference.com/search?q=%s" utf-8)) | ||
)) | ||
|
||
(setq w3m-command-arguments '("-F" "-cookie") | ||
w3m-mailto-url-function 'compose-mail | ||
browse-url-browser-function 'w3m | ||
mm-text-html-renderer 'w3m) | ||
|
||
(defun ted-delicious-url () | ||
"Bookmark this page with del.icio.us." | ||
(interactive) | ||
(w3m-goto-url | ||
(concat "http://del.icio.us/redguardtoo?" | ||
"url=" (w3m-url-encode-string w3m-current-url) | ||
"&title=" (w3m-url-encode-string w3m-current-title)))) | ||
;bind this function to ‘a’, which is the normal w3m bookmark binding: | ||
(eval-after-load "w3m" '(progn | ||
(define-key w3m-info-like-map "A" 'ted-delicious-url))) | ||
|
||
(require 'w3m-lnum) | ||
(autoload 'w3m-link-numbering-mode "w3m-lnum" nil t) | ||
(add-hook 'w3m-mode-hook 'w3m-link-numbering-mode) | ||
|
||
(provide 'init-emacs-w3m) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
(when (not *cygwin*) | ||
(require 'fill-column-indicator) | ||
) | ||
(provide 'init-fill-column-indicator) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
(if (or *linux* *cygwin*) | ||
(if (file-exists-p "/usr/share/emacs/site-lisp/gtags.el") | ||
(load-file "/usr/share/emacs/site-lisp/gtags.el") | ||
) | ||
(add-hook 'gtags-mode-hook | ||
(lambda() | ||
(local-set-key "\M-t" 'gtags-find-tag) ; find a tag, definition | ||
(local-set-key "\M-r" 'gtags-find-rtag) ; find a tag reference | ||
(local-set-key "\C-t" 'gtags-pop-stack) | ||
(local-set-key "\M-." 'gtags-find-symbol) | ||
;\M-, is used by search in dired | ||
(local-set-key "\M-m" 'gtags-find-file) | ||
(local-set-key "\M-/" 'gtags-find-pattern) | ||
(local-set-key "\M-;" 'gtags-find-with-grep))) | ||
) | ||
|
||
(provide 'init-gtags) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
(when *emacs23* | ||
(global-linum-mode t) | ||
|
||
;@see http://www.emacswiki.org/emacs-en/GnusEncryptedAuthInfo | ||
(require 'epa-file) (epa-file-enable) | ||
|
||
;http://stackoverflow.com/questions/3875213/ \ | ||
;turning-on-linum-mode-when-in-python-c-mode | ||
(setq linum-mode-inhibit-modes-list '(eshell-mode | ||
shell-mode | ||
erc-mode | ||
jabber-roster-mode | ||
jabber-chat-mode | ||
gnus-group-mode | ||
w3m-mode | ||
gnus-summary-mode | ||
gnus-article-mode)) | ||
(defadvice linum-on (around linum-on-inhibit-for-modes) | ||
"Stop the load of linum-mode for some major modes." | ||
(unless (member major-mode linum-mode-inhibit-modes-list) | ||
ad-do-it)) | ||
(ad-activate 'linum-on) | ||
) | ||
(provide 'init-linum-mode) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
; @see http://blog.nethazard.net/post-to-wordpress-blogs-with-emacs-org-mode/ | ||
(require 'org2blog-autoloads) | ||
; setup proxy | ||
;(setq url-proxy-services '(("http" . "127.0.0.1:8580"))) ; fr*egate | ||
;(setq url-proxy-services '(("http" . "127.0.0.1:8000"))) ; gae | ||
(setq org2blog/wp-blog-alist | ||
'(("wp" | ||
:url "http://emacsguru.wordpress.com/xmlrpc.php" | ||
:username "emacsguru" | ||
:default-title "" | ||
:default-categories ("Linux") | ||
:tags-as-categories nil | ||
) | ||
)) | ||
(provide 'init-org2blog) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
; override `better register` which also uses [f1] | ||
; You can use C-u M-x yari to reload all completion targets. | ||
(require 'yari) | ||
(defun ri-bind-key () | ||
(local-set-key [f1] 'yari-anything)) | ||
(add-hook 'ruby-mode-hook 'ri-bind-key) | ||
|
||
(provide 'init-yari) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
(require 'yasnippet) | ||
(yas/initialize) | ||
(yas/load-directory "~/.emacs.d/site-lisp/yasnippet/snippets") | ||
|
||
(provide 'init-yasnippet) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.