vim有个vundle插件,非常不错,https://github.com/gmarik/vundle:
先git clone http://github.com/gmarik/vundle.git ~/.vim/bundle/vundle
然后修改.vimrc
代码: 全选
set nocompatible " be iMproved
filetype off " required!
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
"下面这个一定要加
Bundle 'gmarik/vundle'
“要安装的插件,这里是github的 :用户名/插件名
Bundle 'tpope/vim-fugitive'
好吧,vim的解决了,而且非常轻松,很干净,那么emacs呢?
找到2个package(emacs24里默认的包管理)和el-get
前者虽然好用,但是源里包太少,被我pass了,以后再说吧
el-get:https://github.com/dimitri/el-get ,或者按此文:http://emacser.com/el-get.htm
也很方便,(第一次用,做测试,最好把.emacs, .emacs.d都移走备份,然后放心的做吧),启动emacs,切换到scratch的buffer,在里面写上
代码: 全选
;; So the idea is that you copy/paste this code into your *scratch* buffer,
;; hit C-j, and you have a working el-get.
(url-retrieve
"https://github.com/dimitri/el-get/raw/master/el-get-install.el"
(lambda (s)
(end-of-buffer)
(eval-print-last-sexp)))
好了,el-get插件算装好了,现在我可要装些别的插件,比如yasnippet,auto-complete啊,按此作者的写法,修改.emacs内容如下
代码: 全选
(add-to-list 'load-path "~/.emacs.d/el-get/el-get")
(require 'el-get)
;; local sources
(setq el-get-sources
'((:name magit
:after (lambda () (global-set-key (kbd "C-x C-z") 'magit-status)))
(:name asciidoc
:type elpa
:after (lambda ()
(autoload 'doc-mode "doc-mode" nil t)
(add-to-list 'auto-mode-alist '("\\.adoc$" . doc-mode))
(add-hook 'doc-mode-hook '(lambda ()
(turn-on-auto-fill)
(require 'asciidoc)))))
(:name lisppaste :type elpa)
(:name dictionary-el :type apt-get)
(:name emacs-goodies-el :type apt-get)))
(setq my-packages
(append
'(cssh el-get switch-window vkill google-maps nxhtml xcscope yasnippet)
(mapcar 'el-get-source-name el-get-sources)))
(el-get 'sync my-packages)
这下我要请教下大家了
--------------------------------------
可是yasnippet偏偏不能用,错误如图 这是我没对yasnippet进行配置,好吧,再对yasinippet配置:在.emacs里加
代码: 全选
(add-to-list 'load-path
"~/.emacs.d/el-get/yasnippet")
(require 'yasnippet) ;; not yasnippet-bundle
(yas/initialize)
(yas/load-directory "~/.emacs.d/el-get/yasnippet/snippets");