;;;basic
1 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2 ;;光标为竖线;方块为box
3 ;;(setq-default cursor-type 'bar)
4 (setq-default blink-matching-delay 0.5)
5
6 ;;关闭起动时的那个“开机画面”
7 (setq inhibit-startup-message t)
8
9 (setq echo-keystrokes 0.1)
10
11 (line-number-mode t) ;; show line numbers
12 (column-number-mode t) ;; show column numbers
13 (when (fboundp size-indication-mode)
14 (size-indication-mode t)) ;; show file size (emacs 22+)
15
16 ;光标靠近鼠标指针时,让鼠标指针自动让开,别挡住视线
17 (mouse-avoidance-mode 'animate)
18
19 ;在标题栏显示buffer的名字,而不是 emacs@wangyin.com 这样没用的提示
20 ;(setq frame-title-format "emacs@%b")
21
22 ;;;设置标题栏显示文件的完整路径名
23 (setq frame-title-format
24 '("%S" (buffer-file-name "%f"
25 (dired-directory dired-directory "%b"))))
26
27 ;;;;;;;;;;;;;;;;;;;;;;
28 (tool-bar-mode nil)
29 (menu-bar-mode nil)
30 (scroll-bar-mode nil)
31 (fringe-mode nil)
32 ;直接打开和显示图片
33 (auto-image-file-mode)
34
35 ;显示时间
36 (display-time)
37
38 ;显示匹配的括号
39 (show-paren-mode t)
40
41 ;;;;;;;;;;;;;;;;;;;;;
42 (global-font-lock-mode 1)
43
44 ;; Also highlight parens
45 (setq show-paren-delay 0
46 show-paren-style 'parenthesis)
47
48 (show-paren-mode 1)
49
50 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
51 (fset 'yes-or-no-p 'y-or-n-p)
52 ;以 y/n代表 yes/no
53
54 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
55 ;(setq default-fill-column 80);默认显示 80列
56
57 ;文件管理器
58 (global-set-key [f5] 'dired-jump)
59
60 (setq delete-by-moving-to-trash t)
61
62 (custom-set-variables
63 ;; custom-set-variables was added by Custom.
64 ;; If you edit it by hand, you could mess it up, so be careful.
65 ;; Your init file should contain only one such instance.
66 ;; If there is more than one, they won't work right.
67 '(blink-cursor-mode nil))
68
69 ;ibuffer mode
70 (global-set-key (kbd "C-x C-b") 'ibuffer)
71 (autoload 'ibuffer "ibuffer" "List buffers." t)
72
73 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
74 ;;;bookmark
75 (setq bookmark-default-file "e:/emacs-etc/emacs.bmk")
76
77 ;; 同步更新书签文件 ;; 或者退出时保存
78 (setq bookmark-save-flag 1)
79
80 ;;;(mapcar
81 ;;; (function (lambda (setting)
82 ;;; (setq auto-mode-alist
83 ;;; (cons setting auto-mode-alist))))
84 ;;; '(("\\.jsp$". nxml-mode)))
85
86 ;;;;;;;;;;;;;;custom face
87 ;;;(custom-set-faces
88 ;;; '(font-lock-comment-face ((((class color)) (:foreground "green1"))))
89 ;;; '(font-lock-string-face ((((class color)) (:foreground "green4"))))
90 ;;; '(font-lock-keyword-face ((((class color)) (:foreground "blue"))))
91 ;;; '(font-lock-type-face ((((class color)) (:foreground "blue"))))
92 ;;; '(font-lock-variable-name-face ((((class color)) (:foreground "brown"))))
93 ;;; '(font-lock-function-name-face ((((class color)) (:foreground "blue")))))
94
95 ;;;;;;;;;;;debug
96 (setq debug-on-error t)
97
98 ;;;;;;;;;;;psd-mode
99 ;(defalias 'full-copy-sparse-keymap 'copy-keymap)
100 (defun full-copy-sparse-keymap (km)
101 "Recursively copy the sparse keymap KM"
102 (cond ((consp km)
103 (cons (full-copy-sparse-keymap (car km))
104 (full-copy-sparse-keymap (cdr km))))
105 (t km)))