Vim - command - T

1.3k Views Asked by At

I have made the move from TextMate to VIM. I can not use macvim, policy at work does not allow me to install it. I have tried installing command-t to give me "go to file" functionality. However as I am using VIM with the osx terminal, when I press command-t it opens a new tab.

I have now decided to try FuzzyFinder but can not figure out how to search across a directory recursively for a file with it, could anyone show me how to go to a file like command-t but using FuzzyFinder. :-/

3

There are 3 best solutions below

1
On BEST ANSWER

Command-T describes its intended use inside MacVim. If you want to use it inside terminal Vim, use the default binding <Leader>t (by default, <Leader> is the backslash key). You can remap this in your Vim config if you'd rather use a modifier key binding.

0
On

You could map it to ctrl or shift easily, which won't conflict with your OS like command, via:

nmap <C-t> :CommandT<CR>

# or

nmap T :CommandT<CR>

In normal fuzzyfinder to search through a directory you can use file globs, like **, e.g., at the fuzzyfinder prompt:

>File>**/yourpattern

Will search all directories under the current directory for your pattern. Just be wary not to try to do that on large filesystems, or you're going to be waiting a while and/or running out of memory. It will index the tree in memory after the first search though, and will be faster afterwards.

1
On

Fuzzy finder is not under active development. You're way better off with the awesome Command-t. The problem is terminal Vim does support it because terminal Vim needs to be built with Ruby support. It's fairly straightforward to build Vim from source to enable this.

http://brilliantcorners.org/2011/02/building-vim-on-osx-snow-leopard/

Guide for Snow Leopard but works for Lion too. You'll need to have XCode installed, not just the GCC compiler.