`
dcj3sjt126com
  • 浏览: 1826706 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

vim安装command-t插件

vim 
阅读更多

commnad-t是一个很好的vim插件 

安装的步骤似乎很简单,下载最新版本的commnad-t,进入到.vim目录 
一次执行: 

Shell代码   收藏代码
  1. vim command-t-1.4.vba  
  2. :so %  
  3. cd ~/.vim/ruby/command-t   
  4. ruby extconf.rb   
  5. make   



但是我这里编译出现了问题 

问题一 

Shell代码   收藏代码
  1. /usr/include/ruby/intern.h:412:1: error: unknown type name ‘fd_set’  
  2.  DEPRECATED(int rb_thread_select(int, fd_set *, fd_set *, fd_set *, struct timeval *));  
  3.  ^  
  4. make: *** [ext.o] Error 1  



问题原因是编译中依赖的一些c库,有问题,在网上查了很多资料,最后升级ruby版本解决 

Shell代码   收藏代码
  1. rvm upgrade 1.9.2-p136 1.9.2-p180  




问题二 

Shell代码   收藏代码
  1. command-t.vim requires Vim to be compiled with Ruby support  



通过 vim --version 
可以看到 字符串中赫然显示着 -ruby 这说明vim没有ruby的安装依赖 

引用

One of my favourite plugins for Vim is Command-T: 
an extremely fast, intuitive mechanism for opening files with a minimal number of keystrokes. It’s named “Command-T” because it is inspired by the “Go to File” window bound to Command-T in TextMate. 
Sadly, the default installation of Vim on Snow Leopard does not have support for the ruby interpreter compiled in, which is a pre-requisite for using the plugin. Luckily, that’s easy enough to remedy, and in the process we’ll learn a thing or two about compiling your own custom Vim binary. 

Let’s start off by getting the source code from the official Mercurial repository: 

Java代码   收藏代码
  1. $ hg clone https://vim.googlecode.com/hg/ vim  
  2. $ cd vim  

(Note: You don’t need to use the Mercurial repository – there are mirror sources for Subversion, CVS, as well as good ol’ tarballs with patches.) 

The default branch for the mercurial repository contains the code for Vim 7.2 at the time of this writing. There is also a vim73 branch available for those feeling a bit more adventurous and wishing to compile the beta release of the next version. For this article, we’ll be sticking to the stable 7.2 release in the default branch. 

Now, let’s take a look at the possible configuration options: 

Java代码   收藏代码
  1. $ ./configure --help  

There are quite a few, and I suggest that you take the time to read through them – most are quite self-explanatory. For Command-T, the one that we are interested in is the 

--enable-rubyinterp 
option. 

So let’s take a shot at the simplest installation for terminal-based Vim usage, one without the GUI interface and (Linux) mouse daemon support: 

Java代码   收藏代码
  1. $ ./configure --prefix=/my/install/prefix --enable-rubyinterp --enable-gui=no --disable-gpm  
  2. $ make  

After the compilation process finishes (presumably with no errors), the first thing you’ll want to do is ensure that the binary you just built functions as expected: 

Java代码   收藏代码
  1. $ ./src/vim --version | grep ruby  
  2. # you should see a `+ruby` line entry  
  3. $ ./src/vim  

If you see the +ruby entry in the –version output and the binary launches without any errors, rejoice in your own awesomeness. That’s all there is to it. 

If, however, you see something similar to this: 

Vim: Caught deadly signal SEGV 
Vim: Finished. 
zsh: segmentation fault  ./src/vim 
you’ve probably fallen prey to a (currently) not very well documented issue: Vim 7.2 does not support the integration of Ruby 1.9.x on Snow Leopard. 

This means that if you’ve used a package manager such as Homebrew, MacPorts or Fink (shudder) to install the latest version of Ruby, Vim will link to that latest version instead of the system default installation of ruby 1.8.7. 

Let’s fix that. 

We’re going to edit the src/auto/config.mk generated by configure that was run earlier. Note that if you re-run configure at a later time, your changes to config.mk will be lost. 

Find the lines that look like this: 

Java代码   收藏代码
  1. RUBY            = /usr/local/bin/ruby  
  2. RUBY_SRC        = if_ruby.c  
  3. RUBY_OBJ        = objects/if_ruby.o  
  4. RUBY_PRO        = if_ruby.pro  
  5. RUBY_CFLAGS     = -I/usr/local/Cellar/ruby/1.9.1-p378/include/ruby-1.9.1 -I/usr/local/Cellar/ruby/1.9.1-p378/include/ruby-1.9.1/i386-darwin10.4.0 -DRUBY_VERSION=19  
  6. RUBY_LIBS       = -lruby -lpthread -ldl -lobjc  

(Note: Your specific paths and/or versions may differ depending on the package manager that you are using. The above paths are actually not important, however, since we actually want to reset them to the system defaults.) 

and replace them with the following: 

Java代码   收藏代码
  1. RUBY            = /usr/bin/ruby  
  2. RUBY_SRC        = if_ruby.c  
  3. RUBY_OBJ        = objects/if_ruby.o  
  4. RUBY_PRO        = if_ruby.pro  
  5. RUBY_CFLAGS     = -I/System/Library/Frameworks/Ruby.framework/Versions/1.8 -I/usr/lib/ruby/1.8/universal-darwin10.0  
  6. RUBY_LIBS       = -framework Ruby  

Alright, let’s see if this worked. 

Java代码   收藏代码
  1. $ make clean && make  

Before we check the binary as we did before, let’s see if we linked to the correct ruby libraries: 

Java代码   收藏代码
  1. $ otool -L src/vim  
  2. src/vim:  
  3.     /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.2.0)  
  4.     /usr/lib/libncurses.5.4.dylib (compatibility version 5.4.0, current version 5.4.0)  
  5.     /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/libruby.1.dylib (compatibility version 1.8.0, current version 1.8.7)  
  6.     /System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices (compatibility version 1.0.0, current version 44.0.0)  
  7.     /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 550.29.0)  

Looking good so far – the binary is linked to the framework version of Ruby that comes as a default on Snow Leopard. 

Let’s do a version check: 

Java代码   收藏代码
  1. $ ./src/vim --version | grep ruby  
  2. # you should see a `+ruby` line entry  
  3. $ ./src/vim  

And voilà: A custom-built Vim with ruby integration that will happily run the Command-T plugin. 

All that’s left is to install it: 

Java代码   收藏代码
  1. $ make install  

Assuming your PATH is setup to correctly find the new Vim binary, you should be all set. 
分享到:
评论

相关推荐

    完美版vim配置,内含经典插件,用着绝对舒适。

    解压,将.vimrc和.vim放进家目录。 .vim含有c-support command-t nerdtree vim-powerline taglist.vim经典插件。 一般人我不给他。

    command-t::keyboard_selector:VIM的快速文件导航

    Command-T Command-T是Vim插件,为以下应用程序提供了非常快速的“模糊”机制: 打开文件和缓冲区跳转到标签和帮助运行命令或先前的搜索和命​​令只需最少的击键次数。 通过键入出现在文件路径中的字符来选择文件,...

    Vim-for-Rails:这是使用vim开发Ruby on Rails的出色配置文件

    您只需要Command-t插件的ruby支持。 因此,您可以删除+ ruby​​以在不支持ruby的情况下安装它: 然后添加配置文件: git clone git://github.com/framallo/Vim-for-Rails.git〜/ .vim cd ~/.vimgit

    dot-vim:我的 VIM 配置和插件

    $ cd ~ /.vim/bundle-available/command-t/ruby/command-t $ ruby extconf.rb $ make 空格与制表符 默认情况下启用制表符间距。 如果您想在项目上切换到空格,请在项目的根路径上创建一个.lvimrc文件,其内容如下: ...

    vim配置,包含自己写的说明,很全,很好用

    vcscommand.zip 是 vim 的版本控制 (咱们用的是 svn) 插件, 提供一些方便的辅助功能. 在 gvim 中它会提供一项菜单, 另外也提供快捷键来直接访问 安装与使用请参考它的说明文件 另外建议安装 ctags 与 cscope, 通过...

    基于amix.dk的Vimrc VIM插件包

    基于amix.dk/vim/vimrc.txt制作的插件包,包括以下插件。 1. vimwiki 2. snipMate 3. vimgtd 4. taglist 5. nerdcommenter 6. DoxygenToolkit 7. mark 8. omnicppcomplete 9. authorinfo 10. a 11. pyflakes 12. ...

    vim-ginkgo-runner:一个简单的银杏测试跑步者

    map <Leader>t :call RunCurrentGinkgoFile() map <Leader>s :call RunNearestGinkgo() map <Leader>l :call RunLastGinkgo() map <Leader>a :call RunAllGinkgo() 自定义命令 覆盖g:ginkgo_command变量以...

    vim插件打包

    vim中~/.vim 插件打包 ./vimrc文件内容为 "允许鼠标的使用,防止linux终端下无法拷贝 if has('mouse') set mouse=a endif au GUIEnter * simalt ~x "字体的设置 set guifont=Bitstream_Vera_Sans_Mono:h9:cANSI...

    vim_runtime包

    Linux下vim集成环境,集成了常用插件.直接解压到宿主目录即可用. 以下是插件列表 acp a bufexplorer command-t c DoxygenToolkit fuf JavascriptLint jsbeautify minibufexpl mru NERD_commenter NERD_tree peepopen ...

    dotvim-legacy:Hanfei Shen's dotvim files

    沉涵飞的dotvim文件安装 git clone https://github.com/qqshfox/dotvim.git ~/.vimcd ~/.vimmake install依赖关系维姆 7.3 支持 ruby​​ 的 Ruby 和 Vim 7.3 (+ruby)(可选):Command-T 和 Lusty 需要这些更新中 ...

    jyn_vim_config2:下一代 vim_config

    删除 Command-T - 改用 CTRL-P 不需要编译。 也支持 MRU 和其他选项。 支持256色终端 配置适用于 VIM 和 MacVim 安装 确保你已经安装了 rvm(我们用它来切换到系统 ruby​​ 以便可以自动重新编译 com

    dotfiles:色んな方から拝借したりしてます。とりあえず,あげておく

    点文件curl -sSL“ ” | 重击#ちなみにrbenvの自动インストールがうまくいかないっぽい。... :BundleInstall 编译Command-T插件。 如果使用RVM,请运行“ rvm use system”。 cd ~/.vim/bundle/Co

    Hacking Vim

    安装后使用:Tlist 3.3 A 实现头文件跳转。ctags不能查找头文件 3.4 NERDtree 目录浏览功能。可以用o命令打开目录或文件,非常好用 3.5 MiniBuffer 打开多个文件时,生成一个类似标签页的导航菜单,可以用Ctrl+w w...

    dotfiles_linux

    达蒙·摩根(Damon Morgan)点文件(受Ryan Bates点文件影响很大) ...cd ~/.vim/bundle/command-t rake make 字体 首选的编程字体是Inconsolata http :/ / www . levien . com / type / myfonts / inconsolata

    vim_test_runner

    VIM TestRunner插件 这个插件可以在不使用命名管道离开vim的情况下运行您的测试。 推荐的设置是将tmux与vim结合使用,这样您就可以在...以使用定制的vim命令添加按键绑定: command tt :execute TriggerTest()command t

    RootIgnore:从git repo根设置wildignore

    此插件旨在通过根据项目中的.gitignore和全局~/.gitignore自动过滤搜索结果来补充CtrlP和Command-T。 Adam Bellaire有一个,但是当您位于项目的子文件夹中时,它不尊重.gitignore 。 安装 旺德尔 plugin ' octref/...

    Sublime Text2.1 可添加windows8

    Sublime Text 2 插件下载请点击这里~Sublime Text 2 插件安装方法:将下载的安装包解压缩至 Sublime Text 2 安装目录下的 Packages 中,而后在 preferences——packages 进行具体设置~ Sublime Text 2.0.1 更新内容...

Global site tag (gtag.js) - Google Analytics