| ||||
| 引用:
windows 下面我甚少用 emacs 写程序,主要是拿来处理 ini / html / cue 这些带格式的文本,非常好使。最方便的就是可以定义键盘宏,处理一些非常繁琐的编辑工作,效果极佳。还有一大作用就是拿来写 LaTeX ,emacs+auctex 非常好。至于配置过程,基本上都是找网上现成的抄,而且也没什么很复杂的东西。事情多一点的是两个:一是 auctex 需要编译,不过有个 cygwin,很顺利也就过去了;二是字体不好配,这个费了我挺多功夫在网上搜索的,不过配好了也就不用管了。 引用:
俺的 .emacs 配置没啥内容,都是网上七拼八凑来的,侬自己看吧: (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. '(current-language-environment "Chinese-GB18030") '(show-paren-mode t) '(transient-mark-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. ) ;; Code all below is added by wizard ;; Place for my extra packages ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (setq load-path (cons "~/.emacs.d" load-path)) ;; 中文字体啊!中文字体 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (setq w32-charset-info-alist (cons '("gbk" w32-charset-gb2312 . 936) w32-charset-info-alist)) (setq default-frame-alist (append '((font . "fontset-gbk")) default-frame-alist)) (create-fontset-from-fontset-spec "-outline-Courier New-normal-r-normal-normal-14-96-96-96-c-*-fontset-gbk") (set-fontset-font "fontset-default" nil "-outline-宋体-normal-r-normal-*-16-*-96-96-p-*-iso10646-1" nil 'prepend) (set-fontset-font "fontset-gbk" 'kana "-outline-宋体-normal-r-normal-*-16-*-96-96-p-*-iso10646-1" nil 'prepend) (set-fontset-font "fontset-gbk" 'han "-outline-宋体-normal-r-normal-*-16-*-96-96-p-*-iso10646-1" nil 'prepend) (set-fontset-font "fontset-gbk" 'cjk-misc "-outline-宋体-normal-r-normal-*-16-*-96-96-p-*-iso10646-1" nil 'prepend) (set-fontset-font "fontset-gbk" 'symbol "-outline-宋体-normal-r-normal-*-16-*-96-96-p-*-iso10646-1" nil 'prepend) (set-default-font "fontset-gbk") ;; Code for gnuserv ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (require 'gnuserv) (gnuserv-start) ;; 在当前frame打开 (setq gnuserv-frame (selected-frame)) ;; 打开后让emacs跳到前面来 (setenv "GNUSERV_SHOW_EMACS" "1") ;; Code for using NTEmacs under cygwin ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; This assumes that Cygwin is installed in C:\cygwin (the ;; default) and that C:\cygwin\bin is not already in your ;; Windows Path (it generally should not be). ;; ;(setq exec-path (cons "C:/cygwin/bin" exec-path)) ;(setenv "PATH" (concat "C:\\cygwin\\bin;" (getenv "PATH"))) ;; ;; NT-emacs assumes a Windows command shell, which you change ;; here. ;; ;(setq shell-file-name "bash") ;(setenv "SHELL" shell-file-name) ;(setq explicit-shell-file-name shell-file-name) ;; ;; This removes unsightly ^M characters that would otherwise ;; appear in the output of java applications. ;; ;(add-hook 'comint-output-filter-functions ; 'comint-strip-ctrl-m) ;; ;; Make NTEmacs supprot cygwin path ;(require 'cygwin-mount) ;(cygwin-mount-activate) ;; Code for spell check ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (setq-default ispell-program-name "aspell") (setq-default ispell-local-dictionary "american") (autoload 'flyspell-mode "flyspell" "On-the-fly spelling checker." t) ;; Code for AUCTeX ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (load "auctex.el" nil t t) (setq TeX-auto-save t) (setq TeX-parse-self t) (add-hook 'LaTeX-mode-hook 'turn-on-auto-fill) ;; 为 AUCTeX 添加一些额外命令,如 ctex 包装的编译命令,它们能够帮助处理一些中文问题 (setq my-tex-commands-extra (list (list "ctex_latex" "ctex -latex \"%s.tex\" & ctex -clean \"%s\"" 'TeX-run-LaTeX nil t) (list "ctex_pdflatex" "ctex -pdflatex \"%s.tex\" & ctex -clean \"%s\"" 'TeX-run-LaTeX nil t) (list "ctex_dvipdfmx" "ctex -dvipdfmx \"%s.dvi\"" 'TeX-run-command nil t) (list "ctex_bibtex" "ctex -bibtex \"%s\"" 'TeX-run-BibTeX nil t) ;; (list "ctex_clean" "clean \"%s\"" 'TeX-run-command nil t) (list "yap" "yap -1 \"%dS\" \"%d\"" 'TeX-run-discard "non-nil" t) (list "acrobat" "\"C:/Program Files/Adobe/Acrobat 7.0/Acrobat/Acrobat.exe\" \"%s.pdf\"" 'TeX-run-discard nil t))) ;; (list "acrobat" "start \"%s.pdf\"" 'TeX-run-background nil t))) ;; 添加上面定义的命令 (require 'tex) (setq TeX-command-list (append TeX-command-list my-tex-commands-extra)) ;; preview-latex ;(load "preview-latex.el" nil t t) ;(setq-default TeX-master nil) ;(add-hook 'LaTeX-mode-hook #'LaTeX-install-toolbar) ;(add-hook 'LaTeX-mode-hook 'turn-on-auto-fill) ;(add-hook 'LaTeX-mode-hook 'turn-on-reftex) ;; Come from book "Learning Emacs in 24 Hours" ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (require 'sams-lib) ;; "file template" support (require 'template) (template-initialize) ;; backup settings (setq kept-old-versions 1) (setq kept-new-versions 5) ;; "backup folder" support (require 'backup-dir) (setq bkup-backup-directory-info '((t "~/.emacs.d/backup" ok-create full-path))) ;; "convient undo and redo" support (require 'redo) (global-set-key [(ctrl +)] (quote redo)) ;; "quick browse between buffers" (load-library "yic-buffer") (global-set-key [(meta prior)] 'bury-buffer) (global-set-key [(meta next)] 'yic-next-buffer) ;; "buffer switch list" ;(require 'iswitchb) ;(iswitchb-default-keybindings) ;; "desktop" support ;(load "desktop") ;(Desktop-Load-Default) ;(Desktop-read) ;; autosave bookmark (setq bookmark-save-flag 1) ;; cool! hippie expand can help you to find anything! ;; like function name, variable name, a long word ... etc.etc. ;(global-set-key "\240" (quote hippie-expand)) ;; ~~~~~ ;; I use "meta space" here ... ;; Ohter code ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; display column number (setq column-number-mode t) ;; no bell ring, display message on screen (setq visible-bell t) ;; use "alt-left" & "alt-right" to move from "{[(" to corresbonding ")]}" (global-set-key [(meta right)] (quote forward-sexp)) (global-set-key [(meta left)] (quote backward-sexp)) ;; use spaces instead of tabs for indent (setq-default indent-tabs-mode nil) ;; don't ask me "yes or no", ask me "y or n" (fset 'yes-or-no-p 'y-or-n-p) ;; 在标题栏显示buffer的名字 (setq frame-title-format "%b - emacs") ;; 用Shift选取region ;; maximize emacs while startup (Only for NTEmacs) (w32-send-sys-command 6148 ;; 很多人绑定一些比较特殊的键的时候,都搞不清楚在 ;; (global-set-key ... 'my-funtion) ;; 里写些什么。特别是在 xterm 里的时候就更不知所措了。其实有一个万无一失的办法保证你一定写对。这个办法就是: ;; 1. 先使用 M-x global-set-key RET 交互式的绑定你的键。 ;; 2. 然后 C-x Esc Esc 调出上一条“复杂命令”。 ;; 好了,你现在就能在 minibuffer 里看到你应该写在 .emacs 的东西了 |
![]() |
| 书签 |
| 主题工具 | |
| 显示模式 | |
| |
相似的主题 | ||||
| 主题 | 主题作者 | 版面 | 回复 | 最后发表 |
| Windows启动过程介绍 | zweily | 技术杂烩 | 6 | 2006-03-12 10:45 PM |
| [BMP]文件格式 | codinggirl | 技术杂烩 | 3 | 2004-07-01 09:40 PM |