vim on mac
vim 是一个跨平台的编辑器,号称世界第2(第一是Emacs).但是俺没有用过,不敢妄加评论。最近学习python,看mac上也有python支持,我索性就在想在mac上搭建开发环境,其实也没啥开发环境。。。就是装个新版的python和一个vim。如果习惯了 gvim的话 这里有更快的选择就是MacVim 。下载安装就行了,很简单。但是我偏偏有点怪癖,喜欢cmdline,所以就想找个好用的命令行的vim。mac自带的vim版本低不说把,还不好用有好多选项都没有打开,比如python就没有支持,索性自己动手丰衣足食。
首先呢,macports这个东西是必不可少的,他就是mac上面的yum,apt-get.当然 port这个程序就是在BSD上流行的软件包管理程序。具体安装和使用我就不多说了,看guide.macports.org讲得很清楚。等把ports设置好了以后,下面的事情就是很简单了。
在终端中输入
sudo port install vim +python +cscope +porfile +clientserver \ +emacs_tags +rightleft +dnd +profile +xim +tcl
剩下的就只有等待了。等到装好以后,可以这样看看vim是不是支持python了
vim --version可以看见这样的打印
VIM - Vi IMproved 7.2 (2008 Aug 9, compiled Jun 17 2009 23:32:44) MacOS X (unix) version Included patches: 1-182 Compiled by cyher@icyhex-pro.local Normal version without GUI. Features included (+) or not (-): -arabic +autocmd -balloon_eval -browse +builtin_terms +byte_offset +cindent -clientserver -clipboard +cmdline_compl +cmdline_hist +cmdline_info +comments +cryptv +cscope +cursorshape +dialog_con +diff +digraphs -dnd -ebcdic -emacs_tags +eval +ex_extra +extra_search -farsi +file_in_path +find_in_path +float +folding -footer +fork() -gettext -hangul_input +iconv +insert_expand +jumplist -keymap -langmap +libcall +linebreak +lispindent +listcmds +localmap +menu +mksession +modify_fname +mouse -mouseshape -mouse_dec -mouse_gpm -mouse_jsbterm -mouse_netterm -mouse_sysmouse +mouse_xterm +multi_byte +multi_lang -mzscheme -netbeans_intg -osfiletype +path_extra -perl +postscript +printer -profile +python +quickfix +reltime -rightleft -ruby +scrollbind -signs +smartindent -sniff +statusline -sun_workshop +syntax +tag_binary +tag_old_static -tag_any_white +tcl +terminfo +termresponse +textobjects +title -toolbar +user_commands +vertsplit +virtualedit +visual +visualextra +viminfo +vreplace +wildignore +wildmenu +windows +writebackup -X11 -xfontset -xim -xsmp -xterm_clipboard -xterm_save system vimrc file: "/opt/local/etc/vimrc" user vimrc file: "$HOME/.vimrc" user exrc file: "$HOME/.exrc" fall-back for $VIM: "/opt/local/share/vim"
里面有 +python这样的字样就对了,里面还有许多默认是设置没有的如:+cscope等选项吧,这样的vim就比较好用了和fedora中的vim-enhance包的vim基本上一样了。vim的最佳伴侣是什么我想应该是ctags了,但是mac默认安装的确是很老的版本大家也可以version一下看看。下面就装一下ctags。同样的道理
sudo port install ctags
装好以后,基本的vim编程环境已经搭建完毕,反正知道有ports这个软件了,觉得什么不爽,安装就是了,嘿嘿。感谢开源!
Pretty cool post. I just came by your site and wanted to say
that I’ve really liked reading your blog posts. Any way
I’ll be subscribing to your blog and I hope you post again soon!
回来可以试试。。呵呵
还有 fink..更 apt-get