加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

vim – Windows上的CommandT安装问题

发布时间:2020-12-15 21:08:12 所属栏目:安全 来源:网络整理
导读:完成CommandT插件的所有安装步骤后,我得到错误命令-t. vim在启动时无法加载C扩展. ComamndT故障排除部分提供了以下建议: If a problem occurs the first thing you should do is inspect the output of: ruby extconf.rb makeDuring the installation,and:
完成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年没有更新,但它可能仍然有效.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读