Chinaunix首页 | 论坛 | 博客
  • 博客访问: 542757
  • 博文数量: 146
  • 博客积分: 5030
  • 博客等级: 大校
  • 技术积分: 1820
  • 用 户 组: 普通用户
  • 注册时间: 2007-07-16 20:57
文章分类

全部博文(146)

文章存档

2011年(1)

2010年(4)

2009年(30)

2008年(111)

我的朋友

分类: LINUX

2010-09-11 14:16:19

;;---------------for windows----------------------------------------
(getenv "PATH")
(setenv "PATH"
  (concat
   "C:\\cygwin\\usr\\local\\bin" ";"
   "C:\\cygwin\\usr\\bin" ";"
   "C:\\cygwin\\bin" ";"
   (getenv "PATH")
  )
)
(when (string-equal system-type "windows-nt")
  (setq exec-path
'(
"D:/emacs-23.2/bin/"
"C:/Windows/system32/"
"C:/Windows/"
"C:/cygwin/bin/"
)
 ))
 
(set-default-font "Calibri-14") 

;;------------------------------------------------------------------
(setq default-major-mode 'text-mode);一打开就起用 text 模式。
(setq column-number-mode t) ;; 列号
(global-font-lock-mode t);语法高亮
(auto-image-file-mode t);打开图片显示功能
(fset 'yes-or-no-p 'y-or-n-p);以 y/n代表 yes/no,可能你觉得不需要,呵呵。
(column-number-mode t);显示列号
(show-paren-mode t);显示括号匹配
(display-time-mode 1);显示时间,格式如下
(setq display-time-24hr-format t)
(setq display-time-day-and-date t)
(mouse-avoidance-mode 'animate);光标靠近鼠标指针时,让鼠标指针自动让开,别挡住视线。很好玩阿,这个功能
;;(setq mouse-yank-at-point t);支持中键粘贴
(transient-mark-mode t);这个忘了,郁闷!
(setq x-select-enable-clipboard t);支持emacs和外部程序的粘贴
(setq frame-title-format "tao.chen@glu.com:w");在标题栏提示你目前在什么位置
(setq default-fill-column 80);默认显示 80列就换行
(setq backup-directory-alist (quote (("." . "~/backups"))))
(tool-bar-mode -1)
(setq visible-bell nil)
;;不要生成临时文件
(setq-default make-backup-files nil)
;;生成临时文件
;;(setq-default make-backup-file t)
;;-------------------------设置Emacs的前景色和背景色(手工设置)-------------------------
(setq default-frame-alist
'(
  (foreground-color . "Wheat")
  (background-color . "DarkSlateGray")
  (cursor-color . "green1")
  ) ls
)

;;-------------------------大多數情況下,回車後是要縮進的-------------------------
;;(global-set-key "\C-m" 'newline-and-indent)
;;(global-set-key (kbd "C-") 'newline) 

(setq indent-tabs-mode nil)
(setq default-tab-width 4)
(setq tab-width 4)
(setq tab-stop-list ())
(setq tab-stop-list '(4 8 12 16 20 24 28 32 36 40 44 48 52 56 60 64 68 72 76 80)) 
(defconst my-c-style
  '((c-tab-always-indent        . t)
    (c-comment-only-line-offset . 0)
    (c-hanging-braces-alist     . ((substatement-open after)
                                   (brace-list-open)))
    (c-hanging-colons-alist     . ((member-init-intro before)
                                   (inher-intro)
                                   (case-label after)
                                   (label after)
                                   (access-label after)))
    (c-cleanup-list             . (scope-operator
                                   empty-defun-braces
                                   defun-close-semi))
    (c-offsets-alist            . ((arglist-close . c-lineup-arglist)
                                   (substatement-open . 0)
                                   (case-label        . 4)
                                   (block-open        . 0)
                                   (knr-argdecl-intro . -)))
    (c-echo-syntactic-information-p . t)
    )
  "My C Programming Style")

;; offset customizations not in my-c-style
(setq c-offsets-alist '((member-init-intro . ++)))

;; Customizations for all modes in CC Mode.
(defun my-c-mode-common-hook ()
  ;; add my personal style and set it for the current buffer
  (c-add-style "PERSONAL" my-c-style t)
  ;; other customizations
  (setq tab-width 4
        ;; this will make sure spaces are used instead of tabs
        indent-tabs-mode nil)
  ;; we like auto-newline and hungry-delete
  ;;(c-toggle-auto-hungry-state 1)
  ;; key bindings for all supported languages.  We can put these in
  ;; c-mode-base-map because c-mode-map, c++-mode-map, objc-mode-map,
  ;; java-mode-map, idl-mode-map, and pike-mode-map inherit from it.
  (define-key c-mode-base-map "\C-m" 'c-context-line-break)
  )

(add-hook 'c-mode-common-hook 'my-c-mode-common-hook)


;;;;绑定按键 自动补齐
(global-set-key [(meta ?/)] 'hippie-expand)
(setq hippie-expand-try-functions-list 
'(try-expand-dabbrev
try-expand-dabbrev-visible
try-expand-dabbrev-all-buffers
try-expand-dabbrev-from-kill
try-complete-file-name-partially
try-complete-file-name
try-expand-all-abbrevs
try-expand-list
try-expand-line
try-complete-lisp-symbol-partially
try-complete-lisp-symbol))

阅读(1323) | 评论(1) | 转发(0) |
给主人留下些什么吧!~~

chinaunix网友2010-09-13 22:08:58

很好的, 收藏了 推荐一个博客,提供很多免费软件编程电子书下载: http://free-ebooks.appspot.com