- 浏览: 695802 次
- 性别:
- 来自: 北京
文章分类
最新评论
-
qgm168:
...
Ruby中HmacMD5加密 -
lucky_god:
感谢楼主,写的很详细!
Redhat安装gem包报错“no such file to load — zlib”以及ruby的openssl扩展等错误的修正 -
liaozhaijk:
$("某一个dom").change() ...
jquery绑定input 文本域(text),检测值的变化 -
avalonzst:
...
Mysql启动失败Can’t connect to local MySQL server through socket ‘/var/lib/mysql/mysq -
zdz8207:
非常感谢,我的也是磁盘满了导致的问题,顺便分享下查看磁盘的命令 ...
Mysql启动失败Can’t connect to local MySQL server through socket ‘/var/lib/mysql/mysq
commnad-t是一个很好的vim插件
安装的步骤似乎很简单,下载最新版本的commnad-t,进入到.vim目录
一次执行:
但是我这里编译出现了问题
问题一
问题原因是编译中依赖的一些c库,有问题,在网上查了很多资料,最后升级ruby版本解决
问题二
通过 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:
(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:
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:
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:
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:
(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:
Alright, let’s see if this worked.
Before we check the binary as we did before, let’s see if we linked to the correct ruby libraries:
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:
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:
Assuming your PATH is setup to correctly find the new Vim binary, you should be all set.
http://nerderati.com/2010/07/compiling-vim-with-ruby-integration-on-snow-leopard/
安装的步骤似乎很简单,下载最新版本的commnad-t,进入到.vim目录
一次执行:
vim command-t-1.4.vba :so % cd ~/.vim/ruby/command-t ruby extconf.rb make
但是我这里编译出现了问题
问题一
/usr/include/ruby/intern.h:412:1: error: unknown type name ‘fd_set’ DEPRECATED(int rb_thread_select(int, fd_set *, fd_set *, fd_set *, struct timeval *)); ^ make: *** [ext.o] Error 1
问题原因是编译中依赖的一些c库,有问题,在网上查了很多资料,最后升级ruby版本解决
rvm upgrade 1.9.2-p136 1.9.2-p180
问题二
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:
$ hg clone https://vim.googlecode.com/hg/ vim $ 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:
$ ./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:
$ ./configure --prefix=/my/install/prefix --enable-rubyinterp --enable-gui=no --disable-gpm $ 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:
$ ./src/vim --version | grep ruby # you should see a `+ruby` line entry $ ./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:
RUBY = /usr/local/bin/ruby RUBY_SRC = if_ruby.c RUBY_OBJ = objects/if_ruby.o RUBY_PRO = if_ruby.pro 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 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:
RUBY = /usr/bin/ruby RUBY_SRC = if_ruby.c RUBY_OBJ = objects/if_ruby.o RUBY_PRO = if_ruby.pro RUBY_CFLAGS = -I/System/Library/Frameworks/Ruby.framework/Versions/1.8 -I/usr/lib/ruby/1.8/universal-darwin10.0 RUBY_LIBS = -framework Ruby
Alright, let’s see if this worked.
$ make clean && make
Before we check the binary as we did before, let’s see if we linked to the correct ruby libraries:
$ otool -L src/vim src/vim: /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.2.0) /usr/lib/libncurses.5.4.dylib (compatibility version 5.4.0, current version 5.4.0) /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/libruby.1.dylib (compatibility version 1.8.0, current version 1.8.7) /System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices (compatibility version 1.0.0, current version 44.0.0) /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:
$ ./src/vim --version | grep ruby # you should see a `+ruby` line entry $ ./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:
$ make install
Assuming your PATH is setup to correctly find the new Vim binary, you should be all set.
http://nerderati.com/2010/07/compiling-vim-with-ruby-integration-on-snow-leopard/
发表评论
-
反向代理的nginx日志设置显示源ip
2018-12-03 14:35 2343外层代理A设置为 location /*** { ... -
ubuntu下中文文件乱码
2015-12-01 13:36 1434从windows上传上去的文件名如果是中文会有乱码的情况出现, ... -
Redhat远程sftp连接失败
2015-11-23 09:40 2833服务器设置ssh之后,远程sftp连接失败 引用 Connec ... -
Ubuntu下rails程序链接oracle数据库
2015-09-17 15:32 2505rails支持oracle数据库连接 一、下载安装(解压)依 ... -
ubuntu设置为unity 2D
2015-01-29 17:06 1113vbox安装完ubuntu之后,unity 3d支持不好 编 ... -
ubuntu中ruby使用文字生成图片以及汉字不显示(或者乱码)的问题
2014-12-23 10:29 2330ruby中使用IMGKit这个gem可以完成文字以及html生 ... -
alias在bashrc中设置后无效的问题
2014-09-02 09:32 2194在用户目录的.bashrc中添加一一堆alias命令,但是每次 ... -
linux系统性能监控
2014-06-03 16:18 1015linux服务器在运转过程中,总要监控一些性能方面的东西,比如 ... -
Ubuntu的crontab日志
2013-10-12 12:36 1258Ubuntu的crontab日志是关闭的 打开crontab日 ... -
vim安装airline插件
2013-09-02 17:58 7871https://github.com/bling/vim-ai ... -
vim安装FuzzyFinder 插件
2013-09-02 14:29 2419FuzzyFinder 是一个非常强大的Vim插件 安装Fuz ... -
使用Linux的logrotate拆分rails、nginx的log日志
2013-08-30 10:43 1988使用Linux的logrotate拆分rails、nginx的 ... -
libiconv.so.2 cannot open shared object file: No such file or directory
2013-08-02 17:04 4205libiconv.so.2: cannot open shar ... -
(转)Centos安装Git
2013-03-07 14:37 4283centos安装git 下载源代码安装后,git clo ... -
Curl和Wget访问HTTPS连接出现Unable to establish SSl connection错误
2013-03-07 11:22 34615问题如题: 解决方案: 他们都可以跳过这个验证 wget 使用 ... -
wkhtmltopdf 说明文档
2015-08-17 16:56 3614wkhtmltopdf 0.9.6 Manual This ... -
wkhtmltopdf专成pdf文件之后的页码显示问题
2012-08-29 11:06 3279在页面header或者footer上面添加page(当前页数) ... -
linux的一些命令 -查看cc攻击-网口ip统计等
2014-08-14 09:44 12818Linux判断CC攻击命令详解 2011年12月23日 ⁄ 安 ... -
vim使用笔记
2011-10-28 10:54 23151 首先 安装vim 安装vim很简单的命令 sudo ... -
闲的蛋疼之mplayer的编译安装
2011-10-24 23:02 12633虽说安装mplayer都是装过N次的东西,不过都是用现成的de ...
相关推荐
Command-T Command-T是Vim插件,为以下应用程序提供了非常快速的“模糊”机制: 打开文件和缓冲区跳转到标签和帮助运行命令或先前的搜索和命令只需最少的击键次数。 通过键入出现在文件路径中的字符来选择文件,...
您只需要Command-t插件的ruby支持。 因此,您可以删除+ ruby以在不支持ruby的情况下安装它: 然后添加配置文件: git clone git://github.com/framallo/Vim-for-Rails.git〜/ .vim cd ~/.vimgit
4. **command-t**:Command-T是Vim的一个非常受欢迎的插件,它通过模糊匹配快速打开文件。只需输入文件名的一部分,就可以迅速定位并打开文件,极大地提高了文件查找的效率。 5. **nerdtree**:NerdTree是Vim中的...
$ cd ~ /.vim/bundle-available/command-t/ruby/command-t $ ruby extconf.rb $ make 空格与制表符 默认情况下启用制表符间距。 如果您想在项目上切换到空格,请在项目的根路径上创建一个.lvimrc文件,其内容如下: ...
vcscommand.zip 是 vim 的版本控制 (咱们用的是 svn) 插件, 提供一些方便的辅助功能. 在 gvim 中它会提供一项菜单, 另外也提供快捷键来直接访问 安装与使用请参考它的说明文件 另外建议安装 ctags 与 cscope, 通过...
基于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. ...
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的行为,还能够利用预装的Command-T、NerdTree和vim-powerline插件提高工作效率。对于初学者,这是一份很好的学习资源,可以帮助...
vim中~/.vim 插件打包 ./vimrc文件内容为 "允许鼠标的使用,防止linux终端下无法拷贝 if has('mouse') set mouse=a endif au GUIEnter * simalt ~x "字体的设置 set guifont=Bitstream_Vera_Sans_Mono:h9:cANSI...
Linux下vim集成环境,集成了常用插件.直接解压到宿主目录即可用. 以下是插件列表 acp a bufexplorer command-t c DoxygenToolkit fuf JavascriptLint jsbeautify minibufexpl mru NERD_commenter NERD_tree peepopen ...
要在Vim中使用Python调试器,首先需要确保您的系统已安装Python,并且Vim支持Python插件。以下是在`.vimrc`文件中添加配置代码来启用Python调试功能的具体步骤: 1. **打开Vim配置文件**:在命令行输入 `vim ~/....
沉涵飞的dotvim文件安装 git clone https://github.com/qqshfox/dotvim.git ~/.vimcd ~/.vimmake install依赖关系维姆 7.3 支持 ruby 的 Ruby 和 Vim 7.3 (+ruby)(可选):Command-T 和 Lusty 需要这些更新中 ...
VIM的配置和扩展性极强,用户可以根据个人习惯定制快捷键,安装插件,实现更多功能。例如,通过安装插件可以实现代码高亮、自动补全、语法检查等。VIM的命令帮助系统也非常完善,用户只需输入`:help`加命令名称即可...
- 安装如fugitive.vim这样的插件以获得更好的Git集成。 #### Vim的其他用途 ##### 浏览目录 - 使用`:e <directory>`浏览目录。 - 使用`:ls`列出当前目录中的文件。 ##### 使用Vim作为文件管理器 - 使用`:cd ...
Vim拥有多模式工作方式,主要包含普通模式(Normal mode)、插入模式(Insert mode)、可视模式(Visual mode)、命令行模式(Command-line mode)等。下面,我们就按照给定文件中的内容,总结一些Vim的基本功能和...
接着,个人vim配置往往包括插件管理器的安装,如Vundle或Pathogen,它们简化了插件的安装和更新。这里假设使用Vundle,我们需要在.vimrc中添加`Plugin 'VundleVim/Vundle.vim'`来安装Vundle。然后,可以列出想要安装...
- **丰富的插件生态**:大量的插件支持让vim的功能几乎可以无限扩展,无论是代码高亮、语法检查还是版本控制集成,都能找到相应的解决方案。 - **跨平台兼容性**:vim可以在多种操作系统上运行,包括Linux、macOS和...