Convert Figma logo to code with AI

wincent logocommand-t

⌨️ Fast file navigation for Neovim and Vim

2,758
317
2,758
5

Top Related Projects

9,849

fzf :heart: vim

Find, Filter, Preview, Pick. All lua, all the time.

Fuzzy file, buffer, mru, tag, etc finder.

2,166

An efficient fuzzy finder that helps to locate files, buffers, mrus, gtags, etc. on the fly for both vim and neovim.

5,476

Fuzzy Finder in rust!

Quick Overview

Command-T is a fast and intuitive file navigation plugin for Vim. It allows users to quickly search and open files within their project directory using fuzzy matching, significantly speeding up workflow and file management in Vim.

Pros

  • Extremely fast file searching and opening capabilities
  • Intuitive fuzzy matching algorithm for efficient file navigation
  • Customizable settings to tailor the plugin to individual preferences
  • Supports both Vim and Neovim

Cons

  • Requires compilation of C extension for optimal performance
  • Learning curve for users new to fuzzy file navigation
  • May conflict with other file navigation plugins if not configured properly

Code Examples

  1. Basic usage to open Command-T:
:CommandT
  1. Searching for files in a specific directory:
:CommandT /path/to/directory
  1. Customizing Command-T settings in your vimrc:
let g:CommandTMaxFiles = 500000
let g:CommandTMaxDepth = 15
let g:CommandTFileScanner = 'git'

Getting Started

  1. Install Command-T using your preferred Vim plugin manager. For example, using vim-plug:
Plug 'wincent/command-t', {
    \   'do': 'cd ruby/command-t/ext/command-t && ruby extconf.rb && make'
    \ }
  1. Add the following to your vimrc to set up a key mapping for Command-T:
nnoremap <silent> <Leader>t :CommandT<CR>
  1. Restart Vim or source your vimrc, then run :PlugInstall to install the plugin.

  2. Compile the C extension by navigating to the plugin directory and running:

cd ~/.vim/plugged/command-t/ruby/command-t/ext/command-t
ruby extconf.rb
make
  1. You're now ready to use Command-T! Open Vim and use the key mapping or :CommandT to start navigating files.

Competitor Comparisons

9,849

fzf :heart: vim

Pros of fzf.vim

  • Faster performance, especially for large codebases
  • More flexible and extensible, with a wider range of fuzzy-finding capabilities
  • Better integration with external tools and plugins

Cons of fzf.vim

  • Requires external dependencies (fzf binary)
  • Slightly more complex setup and configuration
  • May have a steeper learning curve for new users

Code Comparison

command-t:

:CommandT
:CommandTBuffer
:CommandTJump

fzf.vim:

:Files
:Buffers
:Tags
:Rg
:History

Summary

fzf.vim offers superior performance and flexibility compared to command-t, making it a better choice for larger projects and users who need extensive fuzzy-finding capabilities. However, command-t has a simpler setup and may be more suitable for users who prefer a lightweight, built-in solution. Both plugins provide efficient file navigation in Vim, but fzf.vim's broader feature set and external tool integration give it an edge for power users.

Find, Filter, Preview, Pick. All lua, all the time.

Pros of Telescope.nvim

  • More extensible and customizable with a plugin ecosystem
  • Built-in support for various file types and search methods
  • Asynchronous operation for better performance with large codebases

Cons of Telescope.nvim

  • Steeper learning curve due to more complex configuration options
  • Requires Neovim 0.5+ and Lua knowledge for advanced customization
  • Potentially higher resource usage for some operations

Code Comparison

Command-t (Ruby):

def match_for(str)
  @matcher.match(str, @paths)
end

Telescope.nvim (Lua):

local finders = require('telescope.finders')
local pickers = require('telescope.pickers')
local conf = require('telescope.config').values

pickers.new(opts, {
  finder = finders.new_table({ results = my_list }),
  sorter = conf.generic_sorter(opts),
}):find()

Telescope.nvim offers a more modular and extensible approach, allowing for complex pickers and finders to be created. Command-t, while simpler, focuses on fast file matching using a Ruby-based matcher.

Fuzzy file, buffer, mru, tag, etc finder.

Pros of CtrlP

  • Written in pure Vimscript, making it more portable and easier to install
  • Offers more built-in search modes (e.g., buffers, tags, changes)
  • Provides a more extensive set of customization options out-of-the-box

Cons of CtrlP

  • Generally slower performance, especially on large codebases
  • Less accurate fuzzy matching algorithm compared to Command-T
  • May require more configuration to achieve optimal performance

Code Comparison

CtrlP configuration example:

let g:ctrlp_map = '<c-p>'
let g:ctrlp_cmd = 'CtrlP'
let g:ctrlp_working_path_mode = 'ra'
let g:ctrlp_user_command = ['.git', 'cd %s && git ls-files -co --exclude-standard']

Command-T configuration example:

let g:CommandTMaxFiles = 500000
let g:CommandTMaxDepth = 15
let g:CommandTFileScanner = "git"
let g:CommandTWildIgnore = &wildignore . ",*.git,*.hg,*.svn"

Both plugins aim to provide fast file navigation in Vim, but they differ in implementation and features. CtrlP offers more flexibility and built-in functionality, while Command-T focuses on performance and accuracy. The choice between them often depends on personal preference and specific project requirements.

2,166

An efficient fuzzy finder that helps to locate files, buffers, mrus, gtags, etc. on the fly for both vim and neovim.

Pros of LeaderF

  • Written in Python, making it easier to extend and customize
  • Supports fuzzy matching for file names, buffers, and more
  • Offers asynchronous searching for improved performance

Cons of LeaderF

  • May have a steeper learning curve due to more features and options
  • Requires Python support in Vim, which might not be available in all environments

Code Comparison

LeaderF:

" Basic usage
nnoremap <leader>f :Leaderf file<CR>
nnoremap <leader>b :Leaderf buffer<CR>
nnoremap <leader>m :Leaderf mru<CR>

Command-T:

" Basic usage
nnoremap <leader>t :CommandT<CR>
nnoremap <leader>b :CommandTBuffer<CR>
nnoremap <leader>j :CommandTJump<CR>

Both plugins offer similar functionality for quickly finding and opening files, buffers, and other resources in Vim. LeaderF provides more advanced features and customization options, while Command-T focuses on simplicity and speed. Command-T is written in Ruby and C, which can make it faster in some scenarios but potentially more challenging to modify. LeaderF's Python implementation offers greater flexibility and easier extensibility. Ultimately, the choice between the two depends on individual preferences and specific use cases.

5,476

Fuzzy Finder in rust!

Pros of skim

  • Written in Rust, offering better performance and memory safety
  • Supports multiple selection out of the box
  • Can be used as both a command-line tool and a library

Cons of skim

  • Requires Rust runtime, which may not be pre-installed on all systems
  • Less integrated with Vim ecosystem compared to Command-T

Code comparison

skim:

use skim::prelude::*;

let options = SkimOptionsBuilder::default()
    .height(Some("50%"))
    .multi(true)
    .build()
    .unwrap();

Command-T:

require 'command-t'

CommandT::Finder.new do |f|
  f.path = '~/projects'
  f.max_files = 100000
end

Key differences

  • Language: skim is written in Rust, while Command-T is primarily in Ruby with C extensions
  • Integration: Command-T is specifically designed for Vim, while skim is more versatile
  • Features: skim offers multi-selection by default, Command-T focuses on Vim-specific optimizations

Use cases

  • skim: General-purpose fuzzy finding in various environments
  • Command-T: Vim-centric file navigation and buffer management

Both tools provide efficient fuzzy finding capabilities, but their design philosophies and target audiences differ. Choose based on your specific needs and environment preferences.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

Command-T

Command-T is a Neovim and Vim plug-in that provides an extremely fast "fuzzy" mechanism for:

  • Opening files and buffers
  • Jumping to tags and help
  • Running commands, or previous searches and commands

with a minimum of keystrokes.

Files are selected by typing characters that appear in their paths, and are ranked by an algorithm which knows that characters that appear in certain locations (for example, immediately after a path separator) should be given more weight.

Files can be opened in the current window, or in splits or tabs. Many configuration options are provided.

Speed is the primary design goal, along with providing high-quality, intuitive match ordering. The hand-crafted matching algorithm, implemented in low-level C and combined with parallelized search, input debouncing, integration with Watchman and many other optimizations, mean that Command-T is the fastest fuzzy file finder bar none.


For more information, see the documentation.