码迷,mamicode.com
首页 > 系统相关 > 详细

emacs 配置文件

时间:2016-05-20 11:21:06      阅读:212      评论:0      收藏:0      [点我收藏+]

标签:

emacs 配置文件

[2016/05/20]

  1. ;; 把 .emacs.d 目錄加入到 load-path 
  2. ;; 這樣的話本來需要放到 /usr/share/emacs/site-lisp/ 的東西 
  3. ;; 就只需要放到 .emacs.d 裏面 
  4. (add-to-list ‘load-path "~/.emacs.d/") 
  5.  
  6.  
  7.  
  8.  
  9. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 
  10. ;; ;; 
  11. ; 軟件界面 
  12. ;; ;; 
  13. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 
  14.  
  15. ;; 去掉歡迎界面 
  16. (setq inhibit-startup-message t) 
  17.  
  18. ;; 在标题栏提示文件名字 
  19. (setq frame-title-format "gu_castle@ %b") 
  20.  
  21. ;; 去掉工具栏 
  22. (tool-bar-mode nil) 
  23.  
  24. ;;去掉菜单栏 
  25. (menu-bar-mode nil) 
  26.  
  27. ;; 顯示行號 
  28. ;; 1) linum.el 放入 .emacs.d 
  29. (require ‘linum) ;; 引用包 
  30. (global-linum-mode) ;; 在全局使用顯示行號的模式 
  31.  
  32. ;; 去掉滚动栏 
  33. (scroll-bar-mode nil) 
  34.  
  35. ;; 顯示時間 
  36. (display-time-mode 1) 
  37. (setq display-time-24hr-format t) 
  38. (setq display-time-day-and-date t) 
  39.  
  40. ;; 启动窗口大小 
  41. (setq default-frame-alist 
  42. ‘((height . 37) (width . 85) 
  43. (menu-bar-lines . 20) (tool-bar-lines . 0))) 
  44.  
  45.  
  46.  
  47.  
  48. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 
  49. ;; ;; 
  50. ; 編輯界面 
  51. ;; ;; 
  52. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 
  53.  
  54. ;; 選擇高亮配色 
  55. ;; 1) color-theme.el 和 theme 文件夹放入 .emacs.d 
  56. ;; 2) 打開 Emacs,按 ‘M-x color-theme-select‘,選擇配色,按回車查看效果 
  57. ;; 3) 選好你中意的效果,然後按 d 出現配色的描述信息,以 matrix 配色爲例子: 
  58. ;; color-theme-matrix is an interactive Lisp function in 
  59. ;; `color-theme-library.el‘. 
  60. ;; (color-theme-matrix) 
  61. ;; Color theme by walterh@rocketmail.com, created 2003-10-16. 
  62. ;; 4) 進入 .emacs 寫入 (color-theme-matrix)。 
  63. (require ‘color-theme) 
  64. (color-theme-initialize) 
  65. (setq color-theme-is-global t) 
  66. ;;(color-theme-xp) 
  67. ;;(color-theme-high-contrast) 
  68. ;;(color-theme-classic) 
  69. ;;(color-theme-jb-simple) 
  70. ;;(color-theme-arjen) 
  71. (color-theme-matrix) 
  72.  
  73. ;; 显示括号匹配 
  74. (show-paren-mode t) 
  75. (setq show-paren-style ‘parentheses) 
  76.  
  77. ;; 回车缩进 
  78. (global-set-key "\C-m" ‘newline-and-indent) 
  79. (global-set-key (kbd "C-<return>") ‘newline) 
  80.  
  81. ;; 設置字體 
  82. ;; 1) emacs->options->Set Default Font 選擇字體 
  83. ;; 2) "M-x describe-font" & RET 
  84. ;; 3) 將第一行冒號後的部分抄到下面的引號裏面 
  85.  
  86. ;;(set-default-font 
  87. ;; " -unknown-Ubuntu Mono-normal-normal-normal-*-15-*-*-*-m-0-iso10646-1") 
  88. ;; Ubuntu Mono 
  89.  
  90. ;;(set-default-font 
  91. ;; " -outline-DejaVu Sans Mono-normal-normal-normal-mono-16-*-*-*-c-*-iso8859-2") 
  92. ;; DejaVu Sans Mono 
  93.  
  94. ;;(set-default-font 
  95. ;;"-outline-Lucida Console-normal-normal-normal-mono-16-*-*-*-c-*-iso10646-1") 
  96. ;; Lucida Console 
  97.  
  98. (set-default-font 
  99. "-outline-Andale Mono-normal-normal-normal-mono-16-*-*-*-c-*-iso10646-1") 
  100. ;; Andale mono 
  101.  
  102. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 
  103. ;; ;; 
  104. ; 其他功能 
  105. ;; ;; 
  106. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 
  107.  
  108. ;;使用 y or n 提問 
  109. ;;(fset ‘yes-or-no-p‘ ‘y-or-n-p‘) 
  110.  
  111. ;; 支持emacs和外部程序的粘贴 
  112. (setq x-select-enable-clipboard t) 
  113.  
  114. ;; 不產生備份文件 
  115. (setq-default make-backup-files nil) 
  116.  
  117. ;; 不自動去掉行尾空格 
  118. (setq delete-trailing-whitespace nil) 
  119.  
  120. ;; 設置默認查找文件的目錄 
  121. (setq default-directory "d:/Documents/") 
  122.  
  123. ;; 移動到第 n 行:M-g n 
  124. (global-set-key [(meta g)] ‘goto-line) 
  125.  
  126. ;; 插入當前時間 
  127. (defun insert-curtime() 
  128. "insert current time" 
  129. (interactive "*") 
  130. (insert (current-time-string))) 
  131.  
  132. ;; Eshell 清屏 
  133. (defun eshell/cls()  
  134. "to clear the eshell buffer."  
  135. (interactive)  
  136. (let ((inhibit-read-only t)) 
  137. (erase-buffer))) 
  138.  
  139. ;; hs-minor-mode 按鍵綁定 
  140. ;; 如果要使用這個鍵,先運行 M-x hs-minor-mode 
  141. (global-set-key (kbd "M-,") ‘hs-toggle-hiding) 

emacs 配置文件

标签:

原文地址:http://www.cnblogs.com/gu-castle/p/5511049.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!