Command-T for Vim, an awesome plugin

ultimative vim configuration

Command-T makes it fast and intuitive to find and open files with a minimal number of keystrokes. It's named Command-T because it is inspired by the "Go to File" window in TextMate. It should work on Mac, Windows and Linux.

fuzzyfinder.vim offers similar functionality to Command-T, but Command-T seems to be a much better implementation.

Some useful links:

Video Preview

Installing Command-T

It should be really easy to install Command-T, granted that your vim is built with Ruby support and that you have a C compiler:

1) Download command-t.vba 
2) In a terminal run:
    $ vim command-t.vba 
3) Then run source the vimball to install it:
    :source % 
4) Afterwards build the C extension:
    $ cd ~/.vim/ruby/command-t 
    $ ruby extconf.rb 
    $ make 

Once installed, restart Vim and read the documentation on how to use Command-T:

:help command-t

Troubleshooting

Be sure that your vim has support for ruby. You can find out by running:

:version

In the :version output be sure that you can see +ruby.

I also had a weird error when trying to compile the C extension:

error: ‘for’ loop initial declaration used outside C99 mode

I solved this by adding -std=c99 to CFLAGS in the Makefile, e.g.:

CFLAGS += -std=c99

Try Command-T out

Just wanted to share this little plugin with you. If you enjoy this plugin remember to make a donation and support the developer.

Check also my ultimate Vim configuration (vimrc).

Code · Tips · VIM Editor 8. May
5 comments so far

Thanks for the nice post.

As for the warning, I wonder what C compiler and version you're using. (The standard Makefile actually should already include the '-std=gnu99' flag, but I might change that to '-std=c99' if it gives me broader compatibility with more compilers and compiler versions.)

Wincet:
Here is my gcc version:

$ gcc -v
Using built-in specs.
Target: i686-apple-darwin10
Configured with: /var/tmp/gcc/gcc-5646~6/src/configure --disable-checking --enable-werror --prefix=/usr --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-transform-name=/^[cg][^.-]$/s/$/-4.2/ --with-slibdir=/usr/lib --build=i686-apple-darwin10 --with-gxx-include-dir=/include/c++/4.2.1 --program-prefix=i686-apple-darwin10- --host=x86_64-apple-darwin10 --target=i686-apple-darwin10
Thread model: posix
gcc version 4.2.1 (Apple Inc. build 5646)

And once again, thanks a lot for the nice plugin :-)

Very odd, looks to be very close to the version I'm using here, gcc version 4.2.1 (Apple Inc. build 5659).

Like I said, the generated Makefile should already have '-std=gnu99' in it, pulled in from ~/.vim/ruby/command-t/depend when you run "ruby extconf.rb", and that should do the trick for you.

Maybe it's just a sunspot or some other freakish anomaly... I guess I'll change the depend file setting from gnu99 to c99 and see if that makes any difference for you in the next release.

Thanks! I ran into the same c99 error in the Makefile; as a relatively new programmer I really appreciate the help :)

For those that come after me, if running 'ruby extconf.rb' gives you:

extconf.rb:24:in `require': no such file to load -- mkmf (LoadError)
from extconf.rb:24

you need the ruby development libraries. In Ubuntu / Debian:

sudo apt-get install ruby-dev

Very useful plugin, thanks for highlighting it.

Post a comment
Commenting on this post has expired.
© 2000-2009 amix. Powered by Skeletonz.