微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

vim – Windows上的CommandT安装问题

完成CommandT插件的所有安装步骤后,我得到错误命令-t. vim在启动时无法加载C扩展. ComamndT故障排除部分提供了以下建议:

If a problem occurs the first thing you should do is inspect the output of:

  ruby extconf.rb
  make

During the installation,and:

  vim --version

And compare the compilation and linker flags that were passed to the
extension and to Vim itself when they were built. If the Ruby-related
flags or architecture flags are different then it is likely that something
has changed in your Ruby environment and the extension may not work until
you eliminate the discrepancy.

确实看起来确实存在差异.

make的输出表明cygwin的gcc正在使用ruby 1.8:

gcc -I. -I/usr/lib/ruby/1.8/i386-cygwin -I/usr/lib/ruby/1.8/i386-cygwin -I. -DHA
VE_RUBY_H    -g -O2    -std=c99 -Wall -Wextra -Wno-unused-parameter -c ext.c
gcc -I. -I/usr/lib/ruby/1.8/i386-cygwin -I/usr/lib/ruby/1.8/i386-cygwin -I. -DHA
VE_RUBY_H    -g -O2    -std=c99 -Wall -Wextra -Wno-unused-parameter -c match.c
gcc -I. -I/usr/lib/ruby/1.8/i386-cygwin -I/usr/lib/ruby/1.8/i386-cygwin -I. -DHA
VE_RUBY_H    -g -O2    -std=c99 -Wall -Wextra -Wno-unused-parameter -c matcher.c

gcc -shared -s -o ext.so ext.o match.o matcher.o -L. -L/usr/lib -L.  -Wl,--enabl
e-auto-image-base,--enable-auto-import,--export-all   -lruby  -ldl -lcrypt

vim的输出:version包含此输出

-DDYNAMIC_RUBY_VER=191 -DDYNAMIC_RUBY_DLL=\"msvcrt-ruby191.dll\"

故障排除指南建议使用Vim 7.2,Ruby 1.8.7-p299和DevKit 3.4.5r3-20091110的组合.然而,由于多种原因,这对我来说不是一个好的解决方案:

>我正在使用Vim 7.3并希望继续这样做.
> Ruby 1.9.3安装在我的系统上,我需要在我的PATH中用于其他项目.

那么有什么方法可以让这个工作,同时保持最新版本的ruby和最新版本的vim?

UPDATE

按照AndrewMarshall的建议,我根据this tutorial安装了Ruby191和DevKit-4.5.0-20100819-1536-sfx.exe并通过该版本运行了ruby extconf.rb.使用此输出成功执行make cmd:

gcc -I. -IC:/Ruby191/include/ruby-1.9.1/i386-mingw32 -I/C/Ruby191/include/ruby-1
.9.1/ruby/backward -I/C/Ruby191/include/ruby-1.9.1 -I. -DHAVE_RUBY_H    -O2 -g -
Wall -Wno-parentheses   -std=c99 -Wall -Wextra -Wno-unused-parameter -o ext.o -c
 ext.c
gcc -I. -IC:/Ruby191/include/ruby-1.9.1/i386-mingw32 -I/C/Ruby191/include/ruby-1
.9.1/ruby/backward -I/C/Ruby191/include/ruby-1.9.1 -I. -DHAVE_RUBY_H    -O2 -g -
Wall -Wno-parentheses   -std=c99 -Wall -Wextra -Wno-unused-parameter -o match.o
-c match.c
gcc -I. -IC:/Ruby191/include/ruby-1.9.1/i386-mingw32 -I/C/Ruby191/include/ruby-1
.9.1/ruby/backward -I/C/Ruby191/include/ruby-1.9.1 -I. -DHAVE_RUBY_H    -O2 -g -
Wall -Wno-parentheses   -std=c99 -Wall -Wextra -Wno-unused-parameter -o matcher.
o -c matcher.c
gcc -shared -s -o ext.so ext.o match.o matcher.o -L. -LC:/Ruby191/lib -L.  -Wl,-
-enable-auto-image-base,--enable-auto-import   -lmsvcrt-ruby191  -lshell32 -lws2
_32

并运行:vim中的CommandT现在可以正常工作,但是一旦我开始键入搜索文件,然后按Enter键选择并打开它,我得到这个:

解决方法

不是一个真正的答案,但你可能想尝试 ctrlp.

>用vimscript编写(没有依赖,没有编译)
>和CommandT一样快(对我来说是主观的)
>可能有比CommandT更多的功能(CommandT有最新的文件吗?)

还有一个很好的旧FuzzyFinder,我还没试过.好像它已经大约2年没有更新,但它可能仍然有效.

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。

相关推荐