mac vim写wordpress

之前使用vim写过wordpress, 感觉不错.

现在换到mac系统下来了. 想起来之后打算也用一下.
下载地址:
http://www.vim.org/scripts/script.php?script_id=3510

结果使用过程中遇到了错误. (新版本不会这样了)
E319: Sorry, the command is not available in this version: python <<EOF
vim不支持python.
那就重新编译一个支持python的vim
1.下载安装macports
2.http://go2live.cn/?p=130
3.安装 sudo port install vim +python +ruby

自已编译(使用port装了下,实在太慢了.)
下载地址: http://www.vim.org/sources.php
下载下来之后 就是./configure && make && make install
三步曲安装了.
./configure –with-features=huge –enable-cscope –enable-pythoninterp=yes –enable-rubyinterp –enable-perlinterp –enable-tclinterp –enable-multibyte –enable-cscope –disable-gui –with-vim-name=vim
make
make install

现在打开vim
试试:python print “hello”
是不是正常了.
如果正常就说明支持python了.
好了.

定义snippets
以wordpress for sae为例:
使用的语法高亮代码是



那么我们可以在~/.vim/snippets 下新建一个blog.snippets文件
键入内容:

snippet co                                                                                                                                                

使用的时候,先设置文件类型:setf blog,键入co然后按下tab, 以上内容就会自动补出来, 并且光标自动定位到${1}处。

Tags:
4 Comments