macvim/babun+spf13-vim

mac:

macvim
brew install macvim --with-cscope --with-lua --with-override-system-vim
brew linkapps macvim    #将MacVim程序加入到Launchpad中

终端运行macvim:(位置:/usr/local/bin/mvim)
mvim     #会打开macvim新窗口
mvim -v  #会在当前终端中运行

spf13-vim
通过https://github.com/spf13/spf13-vim的脚本bootstrap.sh:
短链接:http://j.mp/spf13-vim3
用浏览器打开后,复制脚步文件内容,粘贴到终端中即可。
或者
curl http://j.mp/spf13-vim3 -L -o - | sh
更多的信息见官网:http://vim.spf13.com/

 

pc:

Babun - a windows shell you will love
http://babun.github.io/
http://projects.reficio.org/babun/download
http://github.com/babun/babun

解压Banbun安装包,用管理员模式运行install.bat,它会被自动安装到用户文件夹下面

启动Babun
"%userprofile%\.babun\cygwin\bin\mintty.exe"

安装apt-cyg - cygwin的包管理工具
方法一:能连接googlecode的情况
wget http://apt-cyg.googlecode.com/svn/trunk/apt-cyg
install apt-cyg /bin
方法二:
lynx -source rawgit.com/transcode-open/apt-cyg/master/apt-cyg > apt-cyg
install apt-cyg /bin
例如安装curl:apt-cyg install curl
配置vim 下载 spf13-vim https://github.com/spf13/spf13-vim 假设git到的文件在e:\spf13-vim文件夹 在Babun中输入命令: \e\spf13-vim ./bootstrap.sh 等待安装完成
运行vim,如果出现/etc/vimrc文件的主题载入错误,请删除/etc/vimrc文件

 

linux (Ubuntu Server 16.04 LTS)

VIM插件spf13-vim
因为spf13-vim 中的neocomplete.vim插件需要lua支持,所以要卸载vim,下载源代码,然后+lua编译vim
vim with lua:
$ cd ~
$ sudo apt-get remove vim
$ sudo apt-get --assume-yes install gcc python2.7 python2.7-dev python3.5 python3.5-dev lua5.3 liblua5.3-dev ruby ruby-dev perl libperl-dev
$ sudo ln -s /usr/include/lua5.3 /usr/include/lua    ; 使vim configure时候能识别lua、python2
$ sudo ln -s /usr/bin/lua5.3 /usr/bin/lua
$ sudo ln -s /usr/bin/python2.7 /usr/bin/python
$ git clone --depth 1  https://github.com/vim/vim.git
$ cd vim
$ sudo make distclean      ; 如果之前编译过
$ ./configure --with-features=huge --enable-rubyinterp=dynamic --enable-perlinterp --enable-cscope --enable-pythoninterp=dynamic --enable-python3interp=dynamic --with-python-config-dir=/usr/lib/python2.7/config-x86_64-linux-gnu --with-python3-config-dir=/usr/lib/python3.5/config-3.5m-x86_64-linux-gnu --enable-luainterp --enable-gui=no --enable-cscope --enable-multibyte --enable-xim --enable-fontset --prefix=/usr > config.log
$ less config.log          ; 查看config日志:python、lua、ruby、perl是否被正确识别
$ sudo make
$ sudo make install
$ whereis vim              ; 了解vim的位置,我们编译的vim应该是/usr/bin/vim,如果有其他的vim,可以删除之
$ vim --version | less     ; 查看vim版本信息:python、lua、ruby、perl是否被集成
$ sudo make clean          ; 可以不清理

$ vim ~/.zshrc             ; 如果vi没有指向我们编译的vim,可以将vi别名vim
在结尾加入:
alias vi=vim
$ source ~/.zshrc

安装spf13-vim(https://github.com/spf13/spf13-vim):
$ cd ~
$ sudo apt-get install curl
$ curl https://j.mp/spf13-vim3 -L > spf13-vim.sh && sh spf13-vim.sh
或者
  $ curl https://raw.githubusercontent.com/spf13/spf13-vim/3.0/bootstrap.sh -L > spf13-vim.sh && sh spf13-vim.sh
或者
  $ git clone https://github.com/spf13/spf13-vim.git
  $ mv spf13-vim ~/.spf13-vim-3
  $ ~/.spf13-vim-3/bootstrap.sh

等待插件安装完成。

 

 

例子:demo.c

启动iTerm(Terminal)或者babun,输入:

$ vim demo.c

输入下面的代码:

#include <stdio.h>

int main(void) {
    printf("Hello world!\n");
    return 0;
}

保存后用gcc编译:

$ gcc demo.c -o demo
$ ./demo
Hello world!
$ 

 

posted @ 2015-11-10 12:13  Bob-wei  阅读(1097)  评论(0编辑  收藏  举报