我的emacs

  突发奇想,贴一下自己的emacs配置(所用的组件大家可以自己去下,就不给链接了):

(custom-set-variables

'(cua-mode t nil (cua-base))

'(inhibit-startup-screen t)

'(js2-enter-indents-newline t)

'(js2-indent-on-enter-key nil)

'(lintnode-port 3003)

'(show-paren-mode t)

'(tool-bar-mode nil))

(custom-set-faces

)

;; Debug

(setq debug-on-error t)

;; Backup Files

(setq make-backup-files nil)

;; Autosave Files

(setq delete-auto-save-files t)

;; Oldversion Files

(setq delete-old-versions t)

;; External Clipboard

(setq x-select-enable-clipboard t)

;; Parentheses Setting

(setq show-paren-style 'parenthese)

;; Selection Highlight

(setq transient-mark-mode t)

;; M-x Setting

(icomplete-mode 1)

(define-key minibuffer-local-completion-map (kbd "SPC") 'minibuffer-complete-word)

;; Pic Viewing

(auto-image-file-mode t)

;; Semantic Mode

(global-font-lock-mode t)

(setq semantic-default-submodes '(global-semanticdb-minor-mode

global-semantic-idle-scheduler-mode

global-semantic-idle-summary-mode

global-semantic-idle-completions-mode

global-semantic-decoration-mode

global-semantic-highlight-func-mode

global-semantic-stickyfunc-mode

global-semantic-mru-bookmark-mode))

;;(semantic-mode 1)

;;(require 'semantic/analyze/refs)

;;(global-set-key "\C-q" 'senator-completion-menu-popup)

;;(global-set-key "\C-l" 'senator-complete-symbol)

;; Enable EDE

(global-ede-mode 1)

;; Window Shift

(global-set-key [M-left] 'windmove-left)

(global-set-key [M-right] 'windmove-right)

(global-set-key [M-up] 'windmove-up)

(global-set-key [M-down] 'windmove-down)

;; Chinese Support

(set-keyboard-coding-system 'chinese-iso-8bit-dos)

(set-selection-coding-system 'chinese-iso-8bit-dos)

;; Code Error

(setq ansi-color-for-comint-mode t)

;; Access Shell via F1

(global-set-key [f1] 'shell)

(global-set-key [C-f3] 'python-shell)

;; Color Theme

(setq frame-background-mode 'dark)

(set-foreground-color "white")

(set-background-color "black")

(set-cursor-color "yellow")

;; Title

(setq frame-title-format "Emacs@%b")

;; Email

(setq user-mail-address "LostAbaddon@gmail.com")

(setq user-full-name "LostAbaddon")

;; default browser

(setq browse-url-browser-function (quote browse-url-generic))

(setq browse-url-generic-program "google-chrome")

(add-to-list 'load-path "~/.emacs.d")

(require 'history)

(global-set-key (kbd "C-h") 'history)

(require 'linum)

(global-linum-mode t)

;; El-Get

(add-to-list 'load-path "~/.emacs.d/el-get")

(add-to-list 'load-path "~/.emacs.d/el-get/el-get")

(require 'el-get)

;; Auto-Complete

(add-to-list 'load-path "~/.emacs.d/auto-complete")

(require 'auto-complete-config)

(add-to-list 'ac-dictionary-directories "~/site-lisp/auto-complete-1.3.1/ac-dict")

(ac-config-default)

;; Org-Mode

(add-to-list 'load-path "~/.emacs.d/Org/lisp")

(require 'org-install)

(global-set-key (kbd "C-c t") 'org-time-stamp)

(global-set-key (kbd "C-c a") 'org-agenda)

;; YASnippet

(add-to-list 'load-path "~/.emacs.d/yasnippet/")

(add-to-list 'load-path "~/.emacs.d/yasnippet/snippets")

(require 'yasnippet)

(setq yas/root-directory "~/.emacs.d/yasnippet/snippets")

(yas/load-directory yas/root-directory)

(yas/global-mode 1)

;; Auto-Complete & YASnippet

(require 'auto-complete-yasnippet)

;; Zencoding

(add-to-list 'load-path "~/.emacs.d/zencoding")

(require 'zencoding-mode)

(add-hook 'sgml-mode-hook 'zencoding-mode)

;; JS and JSON Mode

(require 'js2)

(autoload 'js2-mode "js2" nil t)

(add-to-list 'auto-mode-alist '("\\.js$" . js2-mode))

(add-to-list 'auto-mode-alist '("\\.json$" . js2-mode))

;; Use JS mode as Flex Develop mode

(add-to-list 'auto-mode-alist '("\\.as$" . js2-mode))

;; Auto Indent

(global-set-key (kbd "RET") 'align-newline-and-indent)

;; Buffer Switcher

(iswitchb-mode 1)

(require 'wcy-swbuff)

;; then you can use <C-tab> and <C-S-kp-tab> to switch buffer.

(global-set-key (kbd "<C-tab>") 'wcy-switch-buffer-forward)

(global-set-key (kbd "<C-S-iso-lefttab>") 'wcy-switch-buffer-backward)

(setq wcy-switch-buffer-active-buffer-face 'highlight)

(setq wcy-switch-buffer-inactive-buffer-face 'secondary-selection )

(load-library "hideshow")

(add-hook 'c-mode-hook 'hs-minor-mode)

(add-hook 'c++-mode-hook 'hs-minor-mode)

(add-hook 'java-mode-hook 'hs-minor-mode)

(add-hook 'emacs-lisp-mode-hook 'hs-minor-mode)

(add-hook 'lisp-mode-hook 'hs-minor-mode)

(add-hook 'scheme-mode-hook 'hs-minor-mode)

(add-hook 'css-mode-hook 'hs-minor-mode)

(add-hook 'html-mode-hook 'hs-minor-mode)

(add-hook 'sgml-mode-hook 'hs-minor-mode)

(add-hook 'javascript-mode-hook 'hs-minor-mode)

(add-hook 'js2-mode-hook 'hs-minor-mode)

(add-hook 'js-mode-hook 'hs-minor-mode)

(global-set-key (kbd "C-c e") 'hs-show-block);; Expand

(global-set-key (kbd "C-c f") 'hs-hide-block);; Fold

(global-set-key (kbd "C-c l") 'hs-hide-level);; Hide Level

;; Auto Pair

(defun my-common-mode-auto-pair ()

(interactive)

(make-local-variable 'skeleton-pair-alist)

(setq skeleton-pair-alist '(

(? ? _ "''")

(? ? _ """")

(? ? _ "()")

(? ? _ "[]")

(?{ \n > _ \n ?} >)))

(setq skeleton-pair t)

(local-set-key (kbd "(") 'skeleton-pair-insert-maybe)

(local-set-key (kbd "\"") 'skeleton-pair-insert-maybe)

(local-set-key (kbd "{") 'skeleton-pair-insert-maybe)

(local-set-key (kbd "\'") 'skeleton-pair-insert-maybe)

(local-set-key (kbd "[") 'skeleton-pair-insert-maybe))

;; Frame Mode

(add-hook 'after-make-frame-functions

(lambda (new-frame)

(select-frame new-frame)

(tool-bar-mode 0)

(scroll-bar-mode 0)

(setq frame-background-mode 'dark)

(set-foreground-color "grey")

(set-background-color "black")

(set-cursor-color "gold1")

(set-mouse-color "gold1")

)

)

;; Transparent Background

(set-frame-parameter (selected-frame) 'alpha '(80 75))

(add-to-list 'default-frame-alist '(alpha 80 75))

;; Calendar

(setq calendar-latitude +31.11)

(setq calendar-longitude +121.29)

(setq calendar-location-name "Shanghai")

;; Auto Expand

(global-set-key [(M-/)] 'hippie-expand)

(setq hippie-expand-try-functions-list

'(try-expand-line

try-expand-line-all-buffers

try-expand-list

try-expand-list-all-buffers

try-expand-dabbrev

try-expand-dabbrev-visible

try-expand-dabbrev-all-buffers

try-expand-dabbrev-from-kill

try-complete-file-name

try-complete-file-name-partially

try-complete-lisp-symbol

try-complete-lisp-symbol-partially

try-expand-whole-kill))

;; Make y/n be yes/no

(fset 'yes-or-no-p 'y-or-n-p)

;;;; full screen

(defun toggle-fullscreen (&optional f)

(interactive)

(let ((current-value (frame-parameter nil 'fullscreen)))

(set-frame-parameter nil 'fullscreen

(if (equal 'fullboth current-value)

(if (boundp 'old-fullscreen) old-fullscreen nil)

(progn (setq old-fullscreen current-value)

'fullboth)))))

(global-set-key [f11] 'toggle-fullscreen)

;; Suspend the Emacs-Desktop

(load "desktop")

(desktop-load-default)

(desktop-read)

;; Leave Emacs Daemon

(defun leaveemacs ()

(interactive)

(save-buffers-kill-emacs))

(global-set-key (kbd "C-x x") 'leaveemacs)

;; My Own Function and ShortKeys

(defun dotemacs ()

(interactive)

(find-file "~/.emacs"))

(global-set-key (kbd "M-s") 'dotemacs)

(defun worklist ()

(interactive)

(find-file "~/Orgs/WorkList.org"))

(global-set-key (kbd "M-w") 'worklist)

(defun gtd ()

(interactive)

(find-file "~/Orgs/Works.org"))

(global-set-key (kbd "M-g") 'gtd)

(put 'downcase-region 'disabled nil)

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 212,383评论 6 493
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 90,522评论 3 385
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 157,852评论 0 348
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 56,621评论 1 284
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 65,741评论 6 386
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 49,929评论 1 290
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 39,076评论 3 410
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 37,803评论 0 268
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 44,265评论 1 303
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 36,582评论 2 327
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 38,716评论 1 341
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 34,395评论 4 333
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 40,039评论 3 316
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 30,798评论 0 21
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 32,027评论 1 266
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 46,488评论 2 361
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 43,612评论 2 350

推荐阅读更多精彩内容