配置emacs的msf-abbrev功能

來源:互聯網
上載者:User

原文地址:http://coon.blogbus.com/logs/2039658.html

下面這張gif就是emacs的msf-abbrev的功能示範,很強吧?呵呵
這是作者的首頁。
要配置出這樣的效果可以按照以下幾步來做:
下載msf-abbrev.el
下載glibc-abbrevs.tar.gz
在你的主目錄下建立一個emacs檔案夾
將上述兩個檔案放到~/emacs中,然後將glibc-abbrevs.tar.gz解壓縮。
在~/.emacs中加入以下內容:

(add-to-list 'load-path "~/emacs")

;; ensure abbrev mode is always on
(setq-default abbrev-mode t)

;; do not bug me about saving my abbreviations
(setq save-abbrevs nil)

;; load up modes I use
(require 'cc-mode)
;(require 'perl-mode)
;(require 'cperl-mode)
;(require 'sh-script)
;(require 'shell)
;(require 'tex-site) ;; I use AUCTeX
;(require 'latex) ;; needed to define LaTeX-mode-hook under AUCTeX
;(require 'tex) ;; needed to define TeX-mode-hook under AUCTeX
; (require 'python) ;; I use python.el from Emacs CVS, uncomment if you do also

;; load up abbrevs for these modes
(require 'msf-abbrev)
(setq msf-abbrev-verbose t) ;; optional
(setq msf-abbrev-root "~/emacs/mode-abbrevs")
(global-set-key (kbd "C-c l") 'msf-abbrev-goto-root)
(global-set-key (kbd "C-c a") 'msf-abbrev-define-new-abbrev-this-mode)
(msf-abbrev-load)
;font
(create-fontset-from-fontset-spec
"-*-courier-medium-r-normal-*-14-*-*-*-*-*-fontset-14")
(set-fontset-font
"fontset-default" nil
"-*-hei-*-*-*-*-14-*-*-*-*-*-gb2312.1980-*" nil 'prepend)
(set-fontset-font
"fontset-14" 'kana
"-*-hei-*-*-*-*-14-*-*-*-*-*-gbk-0" nil 'prepend)
(set-fontset-font
"fontset-14" 'han
"-*-hei-*-*-*-*-14-*-*-*-*-*-gbk-0" nil 'prepend)
(set-fontset-font
"fontset-14" 'cjk-misc
"-*-hei-*-*-*-*-14-*-*-*-*-*-gbk-0" nil 'prepend)

現在就可以開啟emacs體驗一下msf-abbrev的強大功能了!
試試輸入includec,然後按空格或者斷行符號,是不是很爽?呵呵
再來一個mainx,空格,偶也!


聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.