sponsor Vim development Vim logo Vim Book Ad

Command-T : Fast file navigation for VIM

 script karma  Rating 862/554, Downloaded by 24685    Comments, bugs, improvements  Vim wiki

created by
Greg Hurrell
script type
The Command-T plug-in provides 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.

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

For more details see the project Git repository:

install details
The preferred installation method is via Pathogen or some other plug-in management system, but if you really want to install from Vimball, open the vimball archive in Vim:

  vim command-t.vba

Then source it:

  :so %

The C extension must also be then compiled; for instance, if Vimball installs your plugin files in ~/.vim, then you would do this:

  cd ~/.vim/ruby/command-t
  ruby extconf.rb

Note that Command-T requires a version of VIM with Ruby support enabled, and it must be compiled using the same version of Ruby that Vim itself links against. For more details see the documentation.

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
command-t-5.0.zip 5.0 2017-06-07 7.0 Greg Hurrell - Command-T now uses |:map-<nowait>|, when available, when setting up mappings.
- 'wildignore' filtering is now always performed by producing an equivalent
  regular expression and applying that; previously this only happened with
  the "watchman" file scanner (includes a bug fix from Henric Trotzig).
- Fixed mis-memoization of |:CommandTHelp| and |:CommandTJump| finders
  (whichever one you used first would be used for both).
- Added mapping (<C-d>) to delete a buffer from the buffer list (patch from
  Max Timkovich).
- Added |g:CommandTGitIncludeUntracked| option (patch from Steven Stallion).
- Added |:CommandTOpen|, which implements smart "goto or open" functionality,
  and adjust |g:CommandTAcceptSelectionCommand|,
  |g:CommandTAcceptSelectionSplitCommand|, and
  |g:CommandTAcceptSelectionVSplitCommand| to use it by default. Their default
  values have been changed from "e", "tabe", "sp" and "vs" to "CommandTOpen
  e", "CommandTOpen tabe", "CommandTOpen sp" and "CommandTOpen vs",
  respectively. Use with |'switchbuf'| set to "usetab" for maximum effect.
- Added |g:CommandTWindowFilter| for customizing the filtering expression that
  is used to determine which windows Command-T should not open selected
  files in.
command-t-4.0.zip 4.0 2016-05-17 7.0 Greg Hurrell - A non-leading dot in the search query can now match against dot-files and
  "dot-directories" in non-leading path components.
- Matching algorithm sped up by about 17x (with help from Hanson Wang).
- |g:CommandTInputDebounce| now defaults to 0, as the recent optimizations
  make debouncing largely unnecessary.
- Added |:CommandTHelp| for jumping to locations in the help, and an
  accompanying mapping, |<Plug>(CommandTHelp)|.
- Added |:CommandTLine| for jumping to lines within the current buffer, and a
  corresponding mapping, |<Plug>(CommandTLine)|.
- Added |:CommandTHistory| for jumping to previously entered commands, and a
  corresponding mapping, |<Plug>(CommandTHistory)|.
- Added |:CommandTSearch| for jumping to previously entered searches, and a
  corresponding mapping, |<Plug>(CommandTSearch)|.
- Added |:CommandTCommand| for finding commands, and a corresponding mapping,
- Added |<Plug>(CommandTMRU)| and |<Plug>(CommandTTag)| mappings.
- The "ruby" and "find" scanners now show numerical progress in the prompt
  area during their scans.
- Removed functionality that was previously deprecated in 2.0.
- Fix inability to type "^" and "|" at the prompt.
- Make it possible to completely disable |'wildignore'|-based filtering by
  setting |g:CommandTWildIgnore| to an empty string.
- The "watchman" file scanner now respects |'wildignore'| and
  |g:CommandTWildIgnore| by construcing an equivalent regular expression and
  using that for filtering.
- Show a warning when hitting |g:CommandTMaxFiles|, and add a corresponding
  |g:CommandTSuppressMaxFilesWarning| setting to suppress the warning.
command-t-3.0.2.zip 3.0.2 2016-02-09 7.0 Greg Hurrell - Minimize flicker on opening and closing the match listing in MacVim.
- Add |CommandTWillShowMatchListing| and |CommandTDidHideMatchListing| "User"
command-t-3.0.1.zip 3.0.1 2016-01-25 7.0 Greg Hurrell - restore compatiblity with Ruby 1.8.7.
command-t-3.0.zip 3.0 2016-01-19 7.0 Greg Hurrell - change |g:CommandTIgnoreSpaces| default value to 1.
- change |g:CommandTMatchWindowReverse| default value to 1.
- change |g:CommandTMaxHeight| default value to 15.
- try harder to avoid scrolling other buffer when showing or hiding the match
command-t-2.0.zip 2.0 2015-12-28 7.0 Greg Hurrell - add |:CommandTIgnoreSpaces| option (patch from KJ Tsanaktsidis)
- make Command-T resilient to people deleting its hidden, unlisted buffer
- the match listing buffer now has filetype "command-t", which may be useful
  for detectability/extensibility
- Command-T now sets the name of the match listing buffer according to how it
  was invoked (ie. for the file finder, the name is "Command-T [Files]", for
  the buffer finder, the name is "Command-T [Buffers]", and so on);
  previously the name was a fixed as "GoToFile" regardless of the active
  finder type
- Many internal function names have changed, so if you or your plug-ins are
  calling those internals they will need to be updated:
  - `commandt#CommandTFlush()` is now `commandt#Flush()`
  - `commandt#CommandTLoad()` is now `commandt#Load()`
  - `commandt#CommandTShowBufferFinder()` is now `commandt#BufferFinder()`
  - `commandt#CommandTShowFileFinder()` is now `commandt#FileFinder()`
  - `commandt#CommandTShowJumpFinder()` is now `commandt#JumpFinder()`
  - `commandt#CommandTShowMRUFinder()` is now `commandt#MRUFinder()`
  - `commandt#CommandTShowTagFinder()` is now `commandt#TagFinder()`
- A number of functions have been turned into "private" autoloaded functions,
  to make it clear that they are intended only for internal use:
  - `CommandTAcceptSelection()` is now `commandt#private#AcceptSelection()`
  - `CommandTAcceptSelectionSplit()` is now `commandt#private#AcceptSelectionSplit()`
  - `CommandTAcceptSelectionTab()` is now `commandt#private#AcceptSelectionTab()`
  - `CommandTAcceptSelectionVSplit()` is now `commandt#private#AcceptSelectionVSplit()`
  - `CommandTBackspace()` is now `commandt#private#Backspace()`
  - `CommandTCancel()` is now `commandt#private#Cancel()`
  - `CommandTClear()` is now `commandt#private#Clear()`
  - `CommandTClearPrevWord()` is now `commandt#private#ClearPrevWord()`
  - `CommandTCursorEnd()` is now `commandt#private#CursorEnd()`
  - `CommandTCursorLeft()` is now `commandt#private#CursorLeft()`
  - `CommandTCursorRight()` is now `commandt#private#CursorRight()`
  - `CommandTCursorStart()` is now `commandt#private#CursorStart()`
  - `CommandTDelete()` is now `commandt#private#Delete()`
  - `CommandTHandleKey()` is now `commandt#private#HandleKey()`
  - `CommandTListMatches()` is now `commandt#private#ListMatches()`
  - `CommandTQuickfix()` is now `commandt#private#Quickfix()`
  - `CommandTRefresh()` is now `commandt#private#Refresh()`
  - `CommandTSelectNext()` is now `commandt#private#SelectNext()`
  - `CommandTSelectPrev()` is now `commandt#private#SelectPrev()`
  - `CommandTToggleFocus()` is now `commandt#private#ToggleFocus()`
- add |g:CommandTRecursiveMatch| option
- stop distribution as a vimball in favor of a zip archive
- don't clobber |alternate-file| name when opening Command-T match listing
  (patch from Jerome Castaneda)
- add |g:CommandTCursorColor| option
- expose mappings for |:CommandT| and |:CommandTBuffer| using `<Plug>`
  mappings |<Plug>(CommandT)| and |<Plug>(CommandT)|
- add `<Leader>j` mapping to |:CommandTJump|, via |<Plug>(CommandTJump)|
  (defined only if no pre-existing mapping exists)
command-t-1.13.vba 1.13 2015-04-29 7.0 Greg Hurrell - avoid "W10: Warning: Changing a readonly file" when starting Vim in
  read-only mode (ie. as `view` or with the `-R` option)
- fix infinite loop on |<Tab>| (regression introduced in 1.12)
command-t-1.12.vba 1.12 2015-04-10 7.0 Greg Hurrell - add |:CommandTLoad| command
- fix rare failure to restore cursor color after closing Command-T (patch from
  Vlad Seghete)
- doc fixes and updates (patches from Daniel Hahler and Nicholas T.)
- make it possible to force reloading of the plug-in (patch from Daniel
- add |g:CommandTEncoding| option, to work around rare encoding compatibility
- fix error restoring cursor highlights involving some configurations (patch
  from Daniel Hahler)
- skip set-up of |<Esc>| key mapping on rxvt terminals (patch from Daniel
- add |g:CommandTGitScanSubmodules| option, which can be used to recursively
  scan submodules when the "git" file scanner is used (patch from Ben Boeckel)
- fix for not falling back to "find"-based scanner when a Watchman-related
  error occurs
command-t-1.11.4.vba 1.11.4 2014-11-04 7.0 Greg Hurrell - fix infinite loop on Windows when |g:CommandTTraverseSCM| is set to a value
  other than "pwd" (bug present since 1.11)
- handle unwanted split edgecase when |'hidden'| is set, the current buffer is
  modified, and it is visible in more than one window
command-t-1.11.3.vba 1.11.3 2014-10-11 7.0 Greg Hurrell - ignore impromperly encoded filenames (patch from Sherzod Gapirov)
- fix failure to update path when using |:cd| in conjunction with
  |g:CommandTTraverseSCM| set to "pwd" (bug present since 1.11.2)
command-t-1.11.2.vba 1.11.2 2014-09-01 7.0 Greg Hurrell - fix error while using Command-T outside of an SCM repo (bug present since
command-t-1.11.1.vba 1.11.1 2014-08-29 7.0 Greg Hurrell - compatibility fixes with Ruby 1.8.6 (patch from Emily Strickland)
- compatibility fixes with Ruby 1.8.5
- fix 'wildignore' being ignored (bug present since 1.11)
- fix current working directory being ignored when |g:CommandTTraverseSCM| is
  set to "pwd" (bug present since 1.11)
- performance improvements
command-t-1.11.vba 1.11 2014-08-15 7.0 Greg Hurrell - improve edge-case handling in match results window code (patches from
  Richard Feldman)
- add "git" file scanner (patch from Patrick Hayes)
- speed-up when 'wildignore' is unset (patch from Patrick Hayes)
- add |g:CommandTTraverseSCM| setting which anchors Command-T's file finder to
  the nearest SCM directory (based on patches from David Szotten and Ben
- add AppStream metadata (patch from Vít Ondruch)
command-t-1.10.vba 1.10 2014-07-16 7.0 Greg Hurrell - improve tag finder performance by caching tag lists (patch from Artem
- consider the |'autowriteall'| option when deciding whether to open a file in
  a split
- make selection acceptance commands configurable (patch from Ole Petter Bang)
- add <C-w> mapping to delete previous word of the match prompt (patch from
  Kevin Webster)
- try harder to always clear status line after closing the match listing
  (patch from Ton van den Heuvel)
- don't allow MRU autocommands to produce errors when the extension has not
  been compiled
- add |g:CommandTIgnoreCase| and |g:CommandTSmartCase| options, providing
  support for case-sensitive matching (based on patch from Jacek Wysocki)
command-t-1.9.1.vba 1.9.1 2014-05-30 7.0 Greg Hurrell - include the file in the release vimball archive that was missing from the
  1.9 release
command-t-1.9.vba 1.9 2014-05-25 7.0 Greg Hurrell - improved startup time using Vim's autload mechanism (patch from Ross
- added MRU (most-recently-used) buffer finder (patch from Ton van den Heuvel)
- fixed edge case in matching algorithm which could cause spurious matches
  with queries containing repeated characters
- fixed slight positive bias in the match scoring algorithm's weighting of
  matching characters based on distance from last match
- tune memoization in match scoring algorithm, yield a more than 10% speed
command-t-1.8.vba 1.8 2014-04-01 7.0 Greg Hurrell - taught Watchman file scanner to use the binary protocol instead of JSON,
  roughly doubling its speed
- build changes to accommodate MinGW (patch from Roland Puntaier)
command-t-1.7.vba 1.7 2014-03-10 7.0 Greg Hurrell - added |g:CommandTInputDebounce|, which can be used to improve responsiveness
  in large file hierarchies (based on patch from Yiding Jia)
- added a potentially faster file scanner which uses the `find` executable
  (based on patch from Yiding Jia)
- added a file scanner that knows how to talk to Watchman
- added |g:CommandTFileScanner|, which can be used to switch file scanners
- fix processor count detection on some platforms (patch from Pavel Sergeev)
command-t-1.6.1.vba 1.6.1 2013-12-23 7.0 Greg Hurrell - defer processor count detection until runtime (makes it possible to sensibly
  build Command-T on one machine and use it on another)
command-t-1.6.vba 1.6 2013-12-16 7.0 Greg Hurrell - on systems with POSIX threads (such as OS X and Linux), Command-T will use
  threads to compute match results in parallel, resulting in a large speed
  boost that is especially noticeable when navigating large projects
command-t-1.5.1.vba 1.5.1 2013-09-24 7.0 Greg Hurrell - exclude large benchmark fixture file from source exports (patch from Vít
command-t-1.5.vba 1.5 2013-09-18 7.0 Greg Hurrell - don't scan "pathological" filesystem structures (ie. circular or
  self-referential symlinks; patch from Marcus Brito)
- gracefully handle files starting with "+" (patch from Ivan Ukhov)
- switch default selection highlight color for better readability (suggestion
  from André Arko), but make it possible to configure via the
  |g:CommandTHighlightColor| setting
- added a mapping to take the current matches and put then in the quickfix
- performance improvements, particularly noticeable with large file
- added |g:CommandTWildIgnore| setting (patch from Paul Jolly)
command-t-1.4.vba 1.4 2012-06-20 7.0 Greg Hurrell - added |:CommandTTag| command (patches from Noon Silk)
- turn off |'colorcolumn'| and |'relativenumber'| in the match window (patch
  from Jeff Kreeftmeijer)
- documentation update (patch from Nicholas Alpi)
- added |:CommandTMinHeight| option (patch from Nate Kane)
- highlight (by underlining) matched characters in the match listing (requires
  Vim to have been compiled with the +conceal feature, which is available in
  Vim 7.3 or later; patch from Steven Moazami)
- added the ability to flush the cache while the match window is open using
command-t-1.3.1.vba 1.3.1 2011-12-18 7.0 Greg Hurrell - fix jumplist navigation under Ruby 1.9.x (patch from Woody Peterson)
command-t-1.3.vba 1.3 2011-11-28 7.0 Greg Hurrell - added the option to maintain multiple caches when changing among
  directories; see the accompanying |g:CommandTMaxCachedDirectories| setting
- added the ability to navigate using the Vim jumplist (patch from Marian
command-t-1.2.1.vba 1.2.1 2011-05-01 7.0 Greg Hurrell - Remove duplicate copy of the documentation that was causing "Duplicate tag"
- Mitigate issue with distracting blinking cursor in non-GUI versions of Vim
  (patch from Steven Moazami)
command-t-1.2.vba 1.2 2011-04-30 7.0 Greg Hurrell - added |g:CommandTMatchWindowReverse| option, to reverse the order of items
  in the match listing (patch from Steven Moazami)
command-t-1.1b2.vba 1.1b2 2011-03-27 7.0 Greg Hurrell - fix a glitch in the release process; the plugin itself is unchanged since 1.1b
command-t-1.1b.vba 1.1b 2011-03-27 7.0 Greg Hurrell - add |:CommandTBuffer| command for quickly selecting among open buffers
command-t-1.0.1.vba 1.0.1 2011-01-05 7.2 Greg Hurrell - work around bug when mapping |:CommandTFlush|, wherein the default mapping
  for |:CommandT| would not be set up
- clean up when leaving the Command-T buffer via unexpected means (such as
  with <C-W k> or similar)
command-t-1.0.vba 1.0 2010-11-26 7.2 Greg Hurrell - make relative path simplification work on Windows
command-t-1.0b.vba 1.0b 2010-11-05 7.2 Greg Hurrell - work around platform-specific Vim 7.3 bug seen by some users (wherein
  Vim always falsely reports to Ruby that the buffer numbers is 0)
- re-use the buffer that is used to show the match listing, rather than
  throwing it away and recreating it each time Command-T is shown; this
  stops the buffer numbers from creeping up needlessly
command-t-0.8.1.vba 0.8.1 2010-09-14 7.2 Greg Hurrell - fix mapping issues for users who have set |'notimeout'| (patch from Sung Pae)
command-t-0.8.vba 0.8 2010-08-19 7.2 Greg Hurrell - overrides for the default mappings can now be lists of strings, allowing multiple mappings to be defined for any given action
- <Leader>t mapping only set up if no other map for |:CommandT| exists (patch from Scott Bronson)
- prevent folds from appearing in the match listing
- tweaks to avoid the likelihood of "Not enough room" errors when trying to open files
- watch out for "nil" windows when restoring window dimensions
- optimizations (avoid some repeated downcasing)
- move all Ruby files under the "command-t" subdirectory and avoid polluting the "Vim" module namespace
command-t-0.8b.vba 0.8b 2010-07-11 7.0 Greg Hurrell - large overhaul if the scoring algorithm to make the ordering of returned results more intuitive; given the scope of the changes and room for optimization of the new algorithm, this release is labelled as "beta"
command-t-0.7.vba 0.7 2010-06-10 7.0 Greg Hurrell - handle more |'wildignore'| patterns by delegating to VIM's own |expand()| function; with this change it is now viable to exclude patterns such as 'vendor/rails/**' in addition to filename-only patterns like '*.o' and '.git' (patch from Mike Lundy)
- always sort results alphabetically for empty search strings; this eliminates filesystem-specific variations (patch from Mike Lundy)
command-t-0.6.vba 0.6 2010-04-29 7.0 Greg Hurrell - |:CommandT| now accepts an optional parameter to specify the starting directory, temporarily overriding the usual default of VIM's |:pwd|
- fix truncated paths when operating from root directory
command-t-0.5.1.vba 0.5.1 2010-04-11 7.0 Greg Hurrell - fix for Ruby 1.9 compatibility regression introduced in 0.5
- documentation enhancements, specifically targetted at Windows users
command-t.vba 0.5 2010-04-03 7.0 Greg Hurrell - |:CommandTFlush| now re-evaluates settings, allowing changes made via |:let| to be picked up without having to restart VIM
- fix premature abort when scanning very deep directory hierarchies
- remove broken |<Esc>| key mapping on vt100 and xterm terminals
- provide settings for overriding default mappings
- minor performance optimization
command-t.vba 0.4 2010-03-27 7.0 Greg Hurrell - add |g:CommandTMatchWindowAtTop| setting (patch from Zak Johnson)
- documentation fixes and enhancements
- internal refactoring and simplification
command-t.vba 0.3 2010-03-24 7.0 Greg Hurrell - add |g:CommandTMaxHeight| setting for controlling the maximum height of the match window (patch from Lucas de Vries)
- fix bug where |'list'| setting might be inappropriately set after dismissing Command-T
- compatibility fix for different behaviour of "autoload" under Ruby 1.9.1
- avoid "highlight group not found" warning when run under a version of VIM that does not have syntax highlighting support
- open in split when opening normally would fail due to |'hidden'| and |'modified'| values
command-t.vba 0.2 2010-03-23 7.0 Greg Hurrell - compatibility fixes for compilation under Ruby 1.9 series
- compatibility fixes for compilation under Ruby 1.8.5
- compatibility fixes for Windows and other non-UNIX platforms
- suppress "mapping already exists" message if <Leader>t mapping is already defined when plug-in is loaded
- exclude paths based on |'wildignore'| setting rather than a hardcoded regular expression
command-t.vba 0.1 2010-03-22 7.2 Greg Hurrell Initial upload
ip used for rating:

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
SourceForge.net Logo