Linux下emacs简单配置

来源:互联网 发布:新手开淘宝页面简介 编辑:程序博客网 时间:2024/06/06 00:24

配置文件~/.emacs

默认字体可以通过界面设置并保存

<span style="font-size:12px;">(custom-set-variables  ;; custom-set-variables was added by Custom.  ;; If you edit it by hand, you could mess it up, so be careful.  ;; Your init file should contain only one such instance.  ;; If there is more than one, they won't work right. '(column-number-mode t) '(font-use-system-font t) '(inhibit-startup-screen t) '(show-paren-mode t))(custom-set-faces  ;; custom-set-faces was added by Custom.  ;; If you edit it by hand, you could mess it up, so be careful.  ;; Your init file should contain only one such instance.  ;; If there is more than one, they won't work right. '(default ((t (:inherit nil :stipple nil :background "white" :foreground "black" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :height 120 :width normal :foundry "bitstream" :family "Courier 10 Pitch")))))(setq column-number-mode t) ;显示列号。 (setq visible-bell t);关闭烦人的出错时的提示声。(setq mouse-yank-at-point t);不要在鼠标点击的那个地方插入剪贴板内容。我不喜欢那样,经常把我的文档搞的一团糟。我觉得先用光标定位,然后鼠标中键点击要好的多。不管你的光标在文档的那个位置,或是在 minibuffer,鼠标中键一点击,X selection 的内容就被插入到那个位置。 (setq kill-ring-max 200);用一个很大的 kill ring. 这样防止我不小心删掉重要的东西。我很努莽的,你知道 :P (setq default-fill-column 60);把 fill-column 设为 60. 这样的文字更好读。 ;(setq-default indent-tabs-mode nil)(setq default-tab-width 8)(setq tab-stop-list ())(loop for x downfrom 40 to 1 do      (setq tab-stop-list (cons (* x 4) tab-stop-list)));不用 TAB 字符来indent, 这会引起很多奇怪的错误。编辑 Makefile 的时候也不用担心,因为 makefile-mode 会把 TAB 键设置成真正的 TAB 字符,并且加亮显示的。 ;(setq sentence-end "\\([。!?]\\|……\\|[.?!][]\"')}]*\\($\\|[ \t]\\)\\)[ \t\n]*")(setq sentence-end-double-space nil);设置 sentence-end 可以识别中文标点。不用在 fill 时在句号后插入两个空格。 (setq enable-recursive-minibuffers t);可以递归的使用 minibuffer。我经常需要这么做。 ;(setq scroll-margin 3      scroll-conservatively 10000);防止页面滚动时跳动, scroll-margin 3 可以在靠近屏幕边沿3行时就开始滚动,可以很好的看到上下文。(setq default-major-mode 'text-mode);把缺省的 major mode 设置为 text-mode, 而不是几乎什么功能也没有的 fundamental-mode. (show-paren-mode t)(setq show-paren-style 'parentheses);括号匹配时显示另外一边的括号,而不是烦人的跳到另一个括号。(mouse-avoidance-mode 'animate);光标靠近鼠标指针时,让鼠标指针自动让开,别挡住视线。 (setq frame-title-format "emacs@%b");在标题栏显示buffer的名字,而不是  这样没用的提示。 (auto-image-file-mode);让 Emacs 可以直接打开和显示图片。 (global-font-lock-mode t);进行语法加亮。 ;(put 'set-goal-column 'disabled nil)(put 'narrow-to-region 'disabled nil)(put 'upcase-region 'disabled nil)(put 'downcase-region 'disabled nil)(put 'LaTeX-hide-environment 'disabled nil);把这些缺省禁用的功能打开。 </span>





0 0