EMACS配置

  1 ;; author: chinazhangjie
  2 ;; e-mail: chinajiezhang@gmail.com
  3 
  4 ;; 指针颜色设置为白色
  5 (set-cursor-color "white")
  6 ;; 鼠标颜色设置为白色
  7 (set-mouse-color "white")
  8 
  9 
 10 ;; 从color-theme中获取
 11 ;; 网上下载color-theme.el,放到加载路径(/usr/share/emacs/site-lisp )下
 12 ;; M-x color-theme-select,鼠标左键选中,回车查看效果
 13 ;; d查看信息,将出现以下信息:
 14 ;; color-theme-matrix is an interactive Lisp function in `color-theme.el'.
 15 ;; (color-theme-matrix)
 16 ;; Color theme by walterh@rocketmail.com, created 2003-10-16.
 17 ;; 选择(color-theme-blue-mood)便可
 18 (require 'color-theme)
 19 (color-theme-initialize)
 20 (color-theme-gnome2)
 21 
 22 
 23 ;; 一打开就起用 text 模式。  
 24 (setq default-major-mode 'text-mode)
 25 
 26 ;; 语法高亮
 27 (global-font-lock-mode t)
 28 
 29 ;; 以 y/n表明 yes/no
 30 (fset 'yes-or-no-p 'y-or-n-p) 
 31 
 32 ;; 显示括号匹配 
 33 (show-paren-mode t)
 34 (setq show-paren-style 'parentheses)
 35 
 36 ;; 显示时间,格式以下
 37 (display-time-mode 1)  
 38 (setq display-time-24hr-format t)  
 39 (setq display-time-day-and-date t)  
 40 
 41 (transient-mark-mode t) 
 42 
 43 ;; 支持emacs和外部程序的粘贴
 44 (setq x-select-enable-clipboard t) 
 45 
 46 ;; 在标题栏提示你目前在什么位置
 47 (setq frame-title-format "liruiyun@%b")  
 48 
 49 ;; 默认显示 80列就换行 
 50 (setq default-fill-column 80) 
 51 
 52 ;; 去掉工具栏
 53 (tool-bar-mode nil)
 54 
 55 ;;去掉菜单栏
 56 ;;(menu-bar-mode nil)
 57 
 58 ;; 去掉滚动栏
 59 (scroll-bar-mode nil)
 60 
 61 ;; 设置字体
 62 ;; 方法为: emacs->options->Set Default Font->"M-x describe-font"查看当前使用的字体名称、字体大小
 63 (set-default-font " -bitstream-Courier 10 Pitch-normal-normal-normal-*-17-*-*-*-m-0-iso10646-1")
 64 
 65 ;; 显示列号
 66 (setq column-number-mode t)
 67 (setq line-number-mode t)
 68 
 69 ;; 使用 C++ mode, 感谢csdn yq_118
 70 (add-to-list 'auto-mode-alist (cons "\\.h$" #'c++-mode))
 71 
 72 ;; 设置缩进
 73 (setq c-basic-offset 4)
 74 (setq indent-tabs-mode nil)
 75 (setq default-tab-width 4)
 76 (setq tab-width 4)
 77 (setq tab-stop-list ())
 78 (loop for x downfrom 40 to 1 do
 79       (setq tab-stop-list (cons (* x 4) tab-stop-list)))
 80 
 81 
 82 ;; 回车缩进
 83 (global-set-key "\C-m" 'newline-and-indent)
 84 (global-set-key (kbd "C-<return>") 'newline)
 85 
 86 ;; 实现全屏效果,快捷键为f6
 87 (global-set-key [f6] 'my-fullscreen) 
 88 (defun my-fullscreen ()
 89 (interactive)
 90 (x-send-client-message
 91 nil 0 nil "_NET_WM_STATE" 32
 92 '(2 "_NET_WM_STATE_FULLSCREEN" 0))
 93 )
 94 
 95 ;; 最大化
 96 (defun my-maximized ()
 97 (interactive)
 98 (x-send-client-message
 99 nil 0 nil "_NET_WM_STATE" 32
100 '(2 "_NET_WM_STATE_MAXIMIZED_HORZ" 0))
101 (x-send-client-message
102 nil 0 nil "_NET_WM_STATE" 32
103 '(2 "_NET_WM_STATE_MAXIMIZED_VERT" 0))
104 )
105 ;; 启动emacs时窗口最大化
106 (my-maximized)
107 
108 ;; 启动窗口大小
109 (setq default-frame-alist
110       '((height . 35) (width . 125) (menu-bar-lines . 20) (tool-bar-lines . 0))) 
111 (put 'upcase-region 'disabled nil)
112 
113 (require 'xcscope)
114 (add-hook 'c-mode-common-hook '(lambda() (require 'xcscope)))
115 
116 ;;change windows with M-left/right/up/down
117 (global-set-key [M-left] 'windmove-left)
118 (global-set-key [M-right] 'windmove-right)
119 (global-set-key [M-up] 'windmove-up)
120 (global-set-key [M-down] 'windmove-down)
121 
122 ;;set mark : shift space
123 (global-set-key [?\S- ] 'set-mark-command)
124 ;;切换输入法: C SPACE
125 (ibus-mode t)

 

补充:html

解决花括号格式问题linux

一、输入M+xc++

二、输入c-set-style 回车windows

三、输入linux或者bsd 回车工具

而后花括号会采用c语言风格oop

参考:http://www.cnblogs.com/chinazhangjie/archive/2011/06/01/2067263.html字体

相关文章
相关标签/搜索