Last active
August 26, 2020 07:13
-
-
Save lidaobing/757037 to your computer and use it in GitHub Desktop.
.emacs
This file contains hidden or 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
(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. | |
'(TeX-PDF-mode t) | |
'(auto-compression-mode t nil (jka-compr)) | |
'(browse-url-browser-function 'browse-url-firefox) | |
'(c-offsets-alist | |
'((arglist-intro . +) | |
(namespace-open . 0) | |
(namespace-close . 0) | |
(innamespace . 0))) | |
'(case-fold-search t) | |
'(column-number-mode t) | |
'(cua-mode t nil (cua-base)) | |
'(cursor-type 'bar) | |
'(debian-changelog-full-name "LI Daobing") | |
'(default-input-method "chinese-py-punct") | |
'(describe-char-unidata-list | |
'(name old-name general-category decomposition iso-10646-comment)) | |
'(dired-recursive-deletes 'top) | |
'(display-battery-mode t) | |
'(display-time-mode t) | |
'(ecb-options-version "2.32") | |
'(ecb-show-help-format 'html) | |
'(emms-source-file-default-directory "/home/nichloas/document/music") | |
'(eshell-visual-commands | |
'("vi" "screen" "top" "less" "more" "lynx" "ncftp" "pine" "tin" "trn" "elm" "lftp" "ipython" "info" "mutt" "htop")) | |
'(fill-column 72) | |
'(gnuserv-frame t) | |
'(hippie-expand-dabbrev-skip-space t) | |
'(ido-everywhere t) | |
'(imenu-sort-function 'imenu--sort-by-name) | |
'(indent-tabs-mode nil) | |
'(jde-compile-option-directory "./classes") | |
'(jde-jdk-registry '(("1.6.0" . "/usr/lib/jvm/java-6-sun/"))) | |
'(mouse-yank-at-point t) | |
'(package-selected-packages '(org-edna)) | |
'(planner-carry-tasks-forward 0) | |
'(planner-publishing-directory "~/public_html/private/") | |
'(planner-renumber-notes-automatically t) | |
'(po-default-file-header "") | |
'(py-python-command "/usr/bin/python2.4") | |
'(safe-local-variable-values '((encoding . utf8) (encoding . utf-8))) | |
'(sendmail-program "/usr/bin/msmtp") | |
'(show-paren-mode t) | |
'(show-trailing-whitespace nil) | |
'(size-indication-mode t) | |
'(speedbar-show-unknown-files t) | |
'(tab-width 4) | |
'(text-mode-hook '(turn-on-auto-fill text-mode-hook-identify)) | |
'(uniquify-buffer-name-style 'forward nil (uniquify)) | |
'(user-mail-address "[email protected]") | |
'(visible-bell t) | |
'(w3m-key-binding 'info) | |
'(w3m-use-cookies t)) | |
(if (>= emacs-major-version 23) | |
;;(set-frame-font "Bitstream Vera Sans Mono-10" t) | |
(set-frame-font "Monaco-10" t) | |
;;; (set-default-font "Monaco-11" t) | |
;;; (set-default-font "WenQuanYi Zen Hei Mono-12" t) | |
) | |
(recentf-mode t) | |
(require 'dired-x) | |
(setq dired-omit-extensions (remove ".pdf" dired-omit-extensions)) | |
(autoload 'wdired-change-to-wdired-mode "wdired") | |
(add-hook 'dired-load-hook | |
'(lambda () | |
(define-key dired-mode-map "r" 'wdired-change-to-wdired-mode) | |
(define-key dired-mode-map | |
[menu-bar immediate wdired-change-to-wdired-mode] | |
'("Edit File Names" . wdired-change-to-wdired-mode)))) | |
(server-start) | |
(global-font-lock-mode t) | |
(add-to-list 'load-path "~/.local/share/emacs/site-lisp/") | |
;; (add-to-list 'load-path "/var/lib/auctex/emacs-snapshot") | |
(set-language-environment "UTF-8") | |
(prefer-coding-system 'chinese-iso-8bit) | |
(prefer-coding-system 'utf-8) | |
(if (and (eq window-system 'x) | |
(< emacs-major-version 23)) | |
(progn | |
(create-fontset-from-fontset-spec | |
(concat | |
"-*-lucidatypewriter-medium-R-Normal-*-14-*-*-*-*-*-fontset-lucida," | |
"mule-unicode-0100-24ff:-gnu-unifont-*-*-*-*-*-*-*-*-*-*-iso10646-1," | |
"chinese-gb2312:-*-ar pl shanheisun uni-*-*-*-*-*-*-*-*-*-*-gb2312.1980-0,") | |
t | |
t) | |
(set-face-font 'default "fontset-lucida"))) | |
;; (if (eq window-system 'x) | |
;; (progn | |
;; (create-fontset-from-fontset-spec | |
;; (concat | |
;; "-*-monaco-medium-R-Normal-*-12-*-*-*-*-*-fontset-monaco," | |
;; "mule-unicode-0100-24ff:-gnu-unifont-*-*-*-*-*-*-*-*-*-*-iso10646-1," | |
;; "chinese-gb2312:-*-ar pl shanheisun uni-*-*-*-*-*-*-*-*-*-*-gb2312.1980-0,") | |
;; t | |
;; t) | |
;; (set-face-font 'default "fontset-monaco"))) | |
;;; (progn | |
;;; (set-fontset-font "fontset-default" 'ascii | |
;;; "-B&H-LucidaTypewriter-Medium-R-Normal-Sans-17-120-100-100-M-100-ISO8859-1") | |
;;; (set-fontset-font "fontset-default" 'japanese-jisx0208 | |
;;; "-*-ar pl shanheisun uni-*-*-*-*-*-*-*-*-*-*-jisx0208.1983-0") | |
;;; (set-fontset-font "fontset-default" 'japanese-jisx0212 | |
;;; "-*-ar pl shanheisun uni-*-*-*-*-*-*-*-*-*-*-jisx0212.1990-0") | |
;;; (set-fontset-font "fontset-default" 'chinese-gb2312 | |
;;; "-*-ar pl shanheisun uni-*-*-*-*-*-*-*-*-*-*-gb2312.1980-0") | |
;;; (set-fontset-font "fontset-default" 'mule-unicode-0100-24ff | |
;;; "-gnu-unifont-*-*-*-*-*-*-*-*-*-*-iso10646-1") | |
;;; )) | |
;; "-efont-*-*-*-*-*-16-*-*-*-*-*-iso10646-1") | |
;; (set-fontset-font "fontset-default" 'mule-unicode-2500-33ff | |
;; "-efont-*-*-*-*-*-16-*-*-*-*-*-iso10646-1") | |
;; (set-fontset-font "fontset-standard" 'chinese-gb2312 | |
;; "-isas-fangsong ti-*-*-*-*-16-*-*-*-*-*-gb2312.1980-0") | |
;; (create-fontset-from-fontset-spec | |
;; "-bitstream-bitstream vera sans mono-medium-r-*-*-*-*-*-*-*-*-fontset-bitstream") | |
;; (set-fontset-font "fontset-bitstream" 'chinese-gb2312 | |
;; "-*-fangsong ti-*-*-*-*-16-*-*-*-*-*-gb2312.1980-0") | |
;; (set-face-font 'default "fontset-bitstream"))) | |
(setq frame-title-format (format "emacs%d.%d@%%b,%%f" emacs-major-version emacs-minor-version)) | |
(fset 'yes-or-no-p 'y-or-n-p) | |
(global-auto-revert-mode t) | |
(auto-image-file-mode t) | |
(setq browse-url-browser-function 'w3m-browse-url) | |
(global-set-key "\C-xm" 'browse-url-at-point) | |
;; (require 'emacs-wiki-srctag) | |
;; (add-to-list 'emacs-wiki-src-tag-modes-alist | |
;; '("perl" . perl-mode)) | |
(setq emacs-wiki-default-page "index") | |
(setq emacs-wiki-default-project "PubWiki") | |
(setq emacs-wiki-publishing-directory "~/public_html/") | |
(setq emacs-wiki-style-sheet | |
"<link rel=\"stylesheet\" type=\"text/css\" href=\"default.css\" />") | |
(setq emacs-wiki-projects | |
`(("PubWiki" . | |
((emacs-wiki-directories . ("~/public_html/wiki/")) | |
(emacs-wiki-project-server-prefix . "/~nichloas/") | |
(emacs-wiki-publishing-directory . "~/public_html/"))) | |
("LabWiki" . | |
((emacs-wiki-directories . ("~/public_html/lab/wiki/")) | |
(emacs-wiki-project-server-prefix . "/~nichloas/lab/") | |
(emacs-wiki-publishing-directory . "~/public_html/lab/"))))) | |
;; (require 'emacs-wiki-srctag) | |
;; (add-to-list 'emacs-wiki-src-tag-modes-alist '("latex" . latex-mode)) | |
(setq kill-whole-line t) | |
(setq backup-directory-alist '(("." . "~/.backups"))) | |
(setq delete-old-versions t) | |
;; (setq semanticdb-default-save-directory (expand-file-name "~/.semantic")) | |
(setq hippie-expand-try-functions-list '(try-expand-dabbrev | |
try-expand-dabbrev-all-buffers | |
try-expand-dabbrev-from-kill | |
try-expand-line | |
try-complete-file-name-partially | |
try-complete-file-name | |
try-expand-all-abbrevs | |
try-complete-lisp-symbol-partially | |
try-complete-lisp-symbol)) | |
(add-hook 'tex-mode-hook '(lambda () (auto-fill-mode t))) | |
(add-hook 'tex-mode-hook 'flyspell-mode) | |
(add-hook 'tex-mode-hook 'reftex-mode) | |
(add-hook 'TeX-mode-hook '(lambda () (auto-fill-mode t))) | |
(add-hook 'TeX-mode-hook 'flyspell-mode) | |
(add-hook 'TeX-mode-hook 'reftex-mode) | |
(autoload 'default-generic-mode "generic") | |
;; (global-semantic-stickyfunc-mode 1) | |
(add-hook 'dired-load-hook | |
(lambda () | |
(load "dired-x") | |
;; Set dired-x global variables here. For example: | |
;; (setq dired-guess-shell-gnutar "gtar") | |
;; (setq dired-x-hands-off-my-keys nil) | |
)) | |
(add-hook 'dired-mode-hook | |
(lambda () | |
;; Set dired-x buffer-local variables here. For example: | |
(setq dired-omit-files-p t) | |
)) | |
(require 'dired-x) | |
(setq dired-guess-shell-alist-user | |
(list | |
(list "\\.dia$" "dia * &") | |
(list "\\.eps$" "gv * &") | |
(list "\\.ods$" "oocalc * &") | |
(list "\\.doc$" "oowriter * &") | |
(list "\\.odt$" "oowriter * &") | |
(list "\\.pdb$" "pymol * &" "rasmol * &") | |
(list "\\.sxw$" "oowriter * &") | |
(list "\\.xdc$" "xdrawchem * &") | |
)) | |
(mouse-wheel-mode t) | |
(if (functionp 'pc-selection-mode) | |
(pc-selection-mode)) | |
(add-hook 'c-mode-common-hook | |
'imenu-add-menubar-index) | |
(add-hook 'python-mode-hook | |
'imenu-add-menubar-index) | |
(when (and (boundp 'vc-handled-backends) | |
(file-exists-p "/usr/share/emacs/site-lisp/vc-svn.el")) | |
(setq vc-handled-backends (append vc-handled-backends (list 'SVN)))) | |
(winner-mode t) | |
;; (require 'planner-id) | |
;; (require 'planner-bibtex) | |
;; (planner-insinuate-calendar) | |
;; (require 'planner-deadline) | |
;; (require 'planner-w3m) | |
(setq sgml-set-face t) | |
(setq emms-player-list '(emms-player-mplayer) | |
emms-source-list '((emms-source-directory-tree "~/document/music"))) | |
(global-set-key "\M-/" 'hippie-expand) | |
(global-set-key "\C-ce" 'eshell) | |
(global-set-key "\C-xf" 'find-file-at-point) | |
(global-set-key "\C-x\C-b" 'ibuffer) | |
(global-set-key "\r" 'newline-and-indent) | |
(global-set-key [(f3)] 'find-tag) | |
(global-set-key [(f4)] 'plan) | |
(global-set-key [(f5)] 'svn-status) | |
(global-set-key [(f7)] 'planner-create-task-from-buffer) | |
(global-set-key (quote [S-f7]) 'planner-create-task) | |
(global-set-key [(f8)] 'compile) | |
(global-set-key [(f11)] 'list-bookmarks) | |
(global-set-key (quote [S-f11]) (quote bookmark-set)) | |
(setq require-final-newline t) | |
(auto-revert-mode t) | |
(require 'ido) | |
(if (functionp 'ido-mode) | |
(ido-mode t)) | |
(setq sgml-insert-missing-element-comment nil) | |
;; (recentf-mode t) | |
;;(if (eq window-system 'x) | |
;; (progn | |
;; (setq load-path (cons "/usr/share/emacs/site-lisp/preview-latex/" load-path)) | |
;; (load "preview-latex"))) | |
(defun my-indent-setup () | |
(c-set-offset 'arglist-intro '+)) | |
(add-hook 'c-mode-hook 'my-indent-setup) | |
(put 'scroll-left 'disabled nil) | |
(setq planner-project "WikiPlanner") | |
(setq muse-project-alist | |
'(("WikiPlanner" | |
("~/Plans" ;; where your Planner pages are located | |
:default "TaskPool" ;; use value of `planner-default-page' | |
:major-mode planner-mode | |
:visit-link planner-visit-link) | |
;; This next part is for specifying where Planner pages | |
;; should be published and what Muse publishing style to | |
;; use. In this example, we will use the XHTML publishing | |
;; style. | |
(:base "planner-xhtml" | |
;; value of `planner-publishing-directory' | |
:path "~/public_html/private")) | |
("knowledge" | |
("~/my_documents/articles" :default "index") | |
(:base "html" :path "~/my_documents/articles/html")))) | |
;; (if (eq window-system nil) | |
;; (set-background-color "white")) | |
(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. | |
) | |
(if (functionp 'debian-pkg-add-load-path-item) | |
(debian-pkg-add-load-path-item | |
(concat "/usr/share/emacs/site-lisp/bongo"))) | |
(autoload 'bongo "bongo" "Start the Bongo media player." t) | |
(autoload 'volume "volume" "Tweak your sound card volume." t) | |
;; (set-frame-font "-B&H-LucidaTypewriter-Medium-R-Normal-Sans-17-120-100-100-M-100-ISO8859-1") | |
;; (set-default-font "Lucida Sans Typewriter-9" t)) | |
;; (if (eq emacs-major-version 22) | |
;; (progn | |
;; (add-to-list 'load-path "/usr/share/emacs/site-lisp/auctex/" 'append) | |
;; ( | |
(setq debian-changelog-mailing-address "[email protected]") | |
(define-key global-map "\C-cl" 'org-store-link) | |
(define-key global-map "\C-ca" 'org-agenda) | |
(setq org-link-abbrev-alist | |
'(("bugzilla" . "http://10.1.2.9/bugzilla/show_bug.cgi?id=") | |
("google" . "http://www.google.com/search?q=") | |
("ads" . "http://adsabs.harvard.edu/cgi-bin/ | |
nph-abs_connect?author=%s&db_key=AST"))) | |
(setq | |
auto-mode-alist | |
(append '(("\\.gnuplot\\'" . gnuplot-mode)) auto-mode-alist)) | |
(if (functionp 'session-initialize) | |
(add-hook 'after-init-hook 'session-initialize)) | |
(desktop-save-mode 1) | |
(setq history-length 250) | |
(add-to-list 'desktop-globals-to-save 'file-name-history) | |
(eval-after-load "tree-widget" | |
'(if (boundp 'tree-widget-themes-load-path) | |
(add-to-list 'tree-widget-themes-load-path | |
"~/.local/share/emacs/site-lisp/"))) | |
;; (autoload 'glade-mode "glade-mode") | |
;; (setq | |
;; auto-mode-alist | |
;; (append '(("\\.glade\\'" . glade-mode)) auto-mode-alist)) | |
(require 'xcscope "xcscope" t) | |
(if (featurep 'xcscope) | |
(progn | |
(define-key global-map [(control f3)] 'cscope-set-initial-directory) | |
(define-key global-map [(control f4)] 'cscope-unset-initial-directory) | |
(define-key global-map [(control f5)] 'cscope-find-this-symbol) | |
(define-key global-map [(control f6)] 'cscope-find-global-definition) | |
(define-key global-map [(control f7)] | |
'cscope-find-global-definition-no-prompting) | |
(define-key global-map [(control f8)] 'cscope-pop-mark) | |
(define-key global-map [(control f9)] 'cscope-next-symbol) | |
(define-key global-map [(control f10)] 'cscope-next-file) | |
(define-key global-map [(control f11)] 'cscope-prev-symbol) | |
(define-key global-map [(control f12)] 'cscope-prev-file) | |
(define-key global-map [(meta f9)] 'cscope-display-buffer) | |
(define-key global-map [(meta f10)] 'cscope-display-buffer-toggle))) | |
(global-set-key (kbd "S-SPC") 'nil) | |
(global-set-key (kbd "C-SPC") 'nil) | |
;; (require 'mpg123 "mpg123" t) | |
;; (if (featurep 'mpg123) | |
;; (progn | |
;; (setq mpg123-default-dir "~/workspace/music") | |
;; (setq mpg123-file-name-coding-system 'utf-8))) | |
;; (set-frame-parameter (selected-frame) 'alpha '(85 50)) | |
;; (add-to-list 'default-frame-alist '(alpha 85 50)) | |
(defun toggle-transparency () | |
(interactive) | |
(if (/= | |
(cadr (find 'alpha (frame-parameters nil) :key #'car)) | |
100) | |
(set-frame-parameter nil 'alpha '(100 100)) | |
(set-frame-parameter nil 'alpha '(85 50)))) | |
(global-set-key (kbd "C-c t") 'toggle-transparency) | |
;;;### (autoloads (rspec-buffer-is-spec-p rspec-mode) "rspec-mode" | |
;;;;;; ".local/share/emacs/site-lisp/rspec-mode.el" (19505 34022)) | |
;;; Generated autoloads from .local/share/emacs/site-lisp/rspec-mode.el | |
(autoload 'rspec-mode "rspec-mode" "\ | |
Minor mode for rSpec files | |
\(fn &optional ARG)" t nil) | |
(autoload 'rspec-buffer-is-spec-p "rspec-mode" "\ | |
Returns true if the current buffer is a spec | |
\(fn)" nil nil) | |
(eval-after-load 'ruby-mode '(add-hook 'ruby-mode-hook (lambda nil (when (rspec-buffer-is-spec-p) (rspec-mode))))) | |
(eval-after-load 'ruby-mode '(add-hook 'ruby-mode-hook (lambda nil (local-set-key (kbd "C-c ,v") 'rspec-verify) (local-set-key (kbd "C-c ,a") 'rspec-verify-all) (local-set-key (kbd "C-c ,t") 'rspec-toggle-spec-and-target)))) | |
(eval-after-load 'rails '(add-hook 'rails-minor-mode-hook (lambda nil (local-set-key (kbd "C-c ,v") 'rspec-verify) (local-set-key (kbd "C-c ,a") 'rspec-verify-all) (local-set-key (kbd "C-c ,t") 'rspec-toggle-spec-and-target)))) | |
;;;*** |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment