Skip to content
Browse files

Updated to the latest command t plugin (0.7)

  • Loading branch information...
1 parent 7573db3 commit 94d80400b9f0ac7643b9d280b41dbb99c4873bba @duff duff committed Jun 10, 2010
View
80 doc/command-t.txt
@@ -3,17 +3,18 @@
CONTENTS *command-t-contents*
1. Introduction |command-t|
- 2. Requirments |command-t-requirements|
+ 2. Requirements |command-t-requirements|
3. Installation |command-t-installation|
- 4. Usage |command-t-usage|
- 5. Commands |command-t-commands|
- 6. Mappings |command-t-mappings|
- 7. Options |command-t-options|
- 8. Author |command-t-author|
- 9. Website |command-t-website|
-10. Donations |command-t-donations|
-11. License |command-t-license|
-12. History |command-t-history|
+ 4. Trouble-shooting |command-t-trouble-shooting|
+ 5. Usage |command-t-usage|
+ 6. Commands |command-t-commands|
+ 7. Mappings |command-t-mappings|
+ 8. Options |command-t-options|
+ 9. Authors |command-t-authors|
+10. Website |command-t-website|
+11. Donations |command-t-donations|
+12. License |command-t-license|
+13. History |command-t-history|
INTRODUCTION *command-t*
@@ -28,9 +29,16 @@ 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.
-A preview screencast introducing the plug-in can be viewed at:
+To search efficiently, especially in large projects, you should adopt a
+"path-centric" rather than a "filename-centric" mentality. That is you should
+think more about where the desired file is found rather than what it is
+called. This means narrowing your search down by including some characters
+from the upper path components rather than just entering characters from the
+filename itself.
- https://wincent.com/blog/bringing-textmate-style-command-t-to-vim
+Screencasts demonstrating the plug-in can be viewed at:
+
+ https://wincent.com/products/command-t
REQUIREMENTS *command-t-requirements*
@@ -121,6 +129,9 @@ you can build the extension with:
ruby extconf.rb
make
+
+TROUBLE-SHOOTING *command-t-trouble-shooting*
+
Most installation problems are caused by a mismatch between the version of
Ruby on the host operating system, and the version of Ruby that VIM itself
linked against at compile time. For example, if one is 32-bit and the other is
@@ -152,6 +163,13 @@ A prompt will appear at the bottom of the screen along with a match window
showing all of the files in the current directory (as returned by the
|:pwd| command).
+For the most efficient file navigation within a project it's recommended that
+you |:cd| into the root directory of your project when starting to work on it.
+If you wish to open a file from outside of the project folder you can pass in
+an optional path argument (relative or absolute) to |:CommandT|:
+
+ :CommandT ../path/to/other/files
+
Type letters in the prompt to narrow down the selection, showing only the
files whose paths contain those letters in the specified order. Letters do not
need to appear consecutively in a path in order for it to be classified as a
@@ -261,6 +279,10 @@ the plug-in. To set an option, you include a line like this in your ~/.vimrc:
let g:CommandTMaxFiles=20000
+To have Command-T pick up new settings immediately (that is, without having
+to restart VIM) you can issue the |:CommandTFlush| command after making
+changes via |:let|.
+
Following is a list of all available options:
*g:CommandTMaxFiles*
@@ -402,19 +424,28 @@ settings can be used to control behavior:
|'wildignore'| string (default: '')
VIM's |'wildignore'| setting is used to determine which files should be
- excluded from listings. This is a comma-separated list of file glob
- patterns. It defaults to the empty string, but common settings include
- "*.o,*.obj" (to exclude object files) or ".git,.svn" (to exclude SCM
- metadata directories). For example:
+ excluded from listings. This is a comma-separated list of glob patterns.
+ It defaults to the empty string, but common settings include "*.o,*.obj"
+ (to exclude object files) or ".git,.svn" (to exclude SCM metadata
+ directories). For example:
:set wildignore+=*.o,*.obj,.git
+ A pattern such as "vendor/rails/**" would exclude all files and
+ subdirectories inside the "vendor/rails" directory (relative to
+ directory Command-T starts in).
+
See the |'wildignore'| documentation for more information.
-AUTHOR *command-t-author*
+AUTHORS *command-t-authors*
Command-T is written and maintained by Wincent Colaiuta <win@wincent.com>.
+Other contributors that have submitted patches include:
+
+ Lucas de Vries
+ Mike Lundy
+ Zak Johnson
As this was the first VIM plug-in I had ever written I was heavily influenced
by the design of the LustyExplorer plug-in by Stephen Bach, which I understand
@@ -491,6 +522,21 @@ POSSIBILITY OF SUCH DAMAGE.
HISTORY *command-t-history*
+0.7 (10 June 2010)
+
+- 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)
+
+0.6 (28 April 2010)
+
+- |: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
+
0.5.1 (11 April 2010)
- fix for Ruby 1.9 compatibility regression introduced in 0.5
View
143 doc/tags
@@ -1,30 +1,13 @@
:CommandT command-t.txt /*:CommandT*
:CommandTFlush command-t.txt /*:CommandTFlush*
-:FuzzyFinderAddBookmark fuzzyfinder.txt /*:FuzzyFinderAddBookmark*
-:FuzzyFinderAddBookmarkAsSelectedText fuzzyfinder.txt /*:FuzzyFinderAddBookmarkAsSelectedText*
-:FuzzyFinderBookmark fuzzyfinder.txt /*:FuzzyFinderBookmark*
-:FuzzyFinderBuffer fuzzyfinder.txt /*:FuzzyFinderBuffer*
-:FuzzyFinderDir fuzzyfinder.txt /*:FuzzyFinderDir*
-:FuzzyFinderDirWithCurrentBufferDir fuzzyfinder.txt /*:FuzzyFinderDirWithCurrentBufferDir*
-:FuzzyFinderDirWithFullCwd fuzzyfinder.txt /*:FuzzyFinderDirWithFullCwd*
-:FuzzyFinderEditInfo fuzzyfinder.txt /*:FuzzyFinderEditInfo*
-:FuzzyFinderFile fuzzyfinder.txt /*:FuzzyFinderFile*
-:FuzzyFinderFileWithCurrentBufferDir fuzzyfinder.txt /*:FuzzyFinderFileWithCurrentBufferDir*
-:FuzzyFinderFileWithFullCwd fuzzyfinder.txt /*:FuzzyFinderFileWithFullCwd*
-:FuzzyFinderMruCmd fuzzyfinder.txt /*:FuzzyFinderMruCmd*
-:FuzzyFinderMruFile fuzzyfinder.txt /*:FuzzyFinderMruFile*
-:FuzzyFinderRenewCache fuzzyfinder.txt /*:FuzzyFinderRenewCache*
-:FuzzyFinderTag fuzzyfinder.txt /*:FuzzyFinderTag*
-:FuzzyFinderTagWithCursorWord fuzzyfinder.txt /*:FuzzyFinderTagWithCursorWord*
-:FuzzyFinderTaggedFile fuzzyfinder.txt /*:FuzzyFinderTaggedFile*
:TComment tComment.txt /*:TComment*
:TCommentAs tComment.txt /*:TCommentAs*
:TCommentBlock tComment.txt /*:TCommentBlock*
:TCommentInline tComment.txt /*:TCommentInline*
:TCommentRight tComment.txt /*:TCommentRight*
TCommentDefineType() tComment.txt /*TCommentDefineType()*
command-t command-t.txt /*command-t*
-command-t-author command-t.txt /*command-t-author*
+command-t-authors command-t.txt /*command-t-authors*
command-t-commands command-t.txt /*command-t-commands*
command-t-contents command-t.txt /*command-t-contents*
command-t-donations command-t.txt /*command-t-donations*
@@ -34,53 +17,11 @@ command-t-license command-t.txt /*command-t-license*
command-t-mappings command-t.txt /*command-t-mappings*
command-t-options command-t.txt /*command-t-options*
command-t-requirements command-t.txt /*command-t-requirements*
+command-t-trouble-shooting command-t.txt /*command-t-trouble-shooting*
command-t-usage command-t.txt /*command-t-usage*
command-t-website command-t.txt /*command-t-website*
command-t-wildignore command-t.txt /*command-t-wildignore*
command-t.txt command-t.txt /*command-t.txt*
-fuzzyfinder fuzzyfinder.txt /*fuzzyfinder*
-fuzzyfinder-abbreviation fuzzyfinder.txt /*fuzzyfinder-abbreviation*
-fuzzyfinder-about fuzzyfinder.txt /*fuzzyfinder-about*
-fuzzyfinder-adding-bookmark fuzzyfinder.txt /*fuzzyfinder-adding-bookmark*
-fuzzyfinder-author fuzzyfinder.txt /*fuzzyfinder-author*
-fuzzyfinder-bookmark-mode fuzzyfinder.txt /*fuzzyfinder-bookmark-mode*
-fuzzyfinder-cache fuzzyfinder.txt /*fuzzyfinder-cache*
-fuzzyfinder-callbackfile-mode fuzzyfinder.txt /*fuzzyfinder-callbackfile-mode*
-fuzzyfinder-callbackitem-mode fuzzyfinder.txt /*fuzzyfinder-callbackitem-mode*
-fuzzyfinder-changelog fuzzyfinder.txt /*fuzzyfinder-changelog*
-fuzzyfinder-command-arg fuzzyfinder.txt /*fuzzyfinder-command-arg*
-fuzzyfinder-commands fuzzyfinder.txt /*fuzzyfinder-commands*
-fuzzyfinder-contact fuzzyfinder.txt /*fuzzyfinder-contact*
-fuzzyfinder-dot-sequence fuzzyfinder.txt /*fuzzyfinder-dot-sequence*
-fuzzyfinder-givencmd-mode fuzzyfinder.txt /*fuzzyfinder-givencmd-mode*
-fuzzyfinder-givendir-mode fuzzyfinder.txt /*fuzzyfinder-givendir-mode*
-fuzzyfinder-givenfile-mode fuzzyfinder.txt /*fuzzyfinder-givenfile-mode*
-fuzzyfinder-hiding-menu fuzzyfinder.txt /*fuzzyfinder-hiding-menu*
-fuzzyfinder-highlighting fuzzyfinder.txt /*fuzzyfinder-highlighting*
-fuzzyfinder-information-file fuzzyfinder.txt /*fuzzyfinder-information-file*
-fuzzyfinder-installation fuzzyfinder.txt /*fuzzyfinder-installation*
-fuzzyfinder-introduction fuzzyfinder.txt /*fuzzyfinder-introduction*
-fuzzyfinder-launch fuzzyfinder.txt /*fuzzyfinder-launch*
-fuzzyfinder-manipulation fuzzyfinder.txt /*fuzzyfinder-manipulation*
-fuzzyfinder-migemo fuzzyfinder.txt /*fuzzyfinder-migemo*
-fuzzyfinder-multiple-search fuzzyfinder.txt /*fuzzyfinder-multiple-search*
-fuzzyfinder-options fuzzyfinder.txt /*fuzzyfinder-options*
-fuzzyfinder-options-Bookmark-mode fuzzyfinder.txt /*fuzzyfinder-options-Bookmark-mode*
-fuzzyfinder-options-all-mode fuzzyfinder.txt /*fuzzyfinder-options-all-mode*
-fuzzyfinder-options-buffer-mode fuzzyfinder.txt /*fuzzyfinder-options-buffer-mode*
-fuzzyfinder-options-dir-mode fuzzyfinder.txt /*fuzzyfinder-options-dir-mode*
-fuzzyfinder-options-file-mode fuzzyfinder.txt /*fuzzyfinder-options-file-mode*
-fuzzyfinder-options-mrucmd-mode fuzzyfinder.txt /*fuzzyfinder-options-mrucmd-mode*
-fuzzyfinder-options-mrufile-mode fuzzyfinder.txt /*fuzzyfinder-options-mrufile-mode*
-fuzzyfinder-options-tag-mode fuzzyfinder.txt /*fuzzyfinder-options-tag-mode*
-fuzzyfinder-options-taggedfile-mode fuzzyfinder.txt /*fuzzyfinder-options-taggedfile-mode*
-fuzzyfinder-replace-tagjump fuzzyfinder.txt /*fuzzyfinder-replace-tagjump*
-fuzzyfinder-reusing-window fuzzyfinder.txt /*fuzzyfinder-reusing-window*
-fuzzyfinder-taggedfile-mode fuzzyfinder.txt /*fuzzyfinder-taggedfile-mode*
-fuzzyfinder-thanks fuzzyfinder.txt /*fuzzyfinder-thanks*
-fuzzyfinder-usage fuzzyfinder.txt /*fuzzyfinder-usage*
-fuzzyfinder-vimrc-sample fuzzyfinder.txt /*fuzzyfinder-vimrc-sample*
-fuzzyfinder.txt fuzzyfinder.txt /*fuzzyfinder.txt*
g:CommandTAcceptSelectionMap command-t.txt /*g:CommandTAcceptSelectionMap*
g:CommandTAcceptSelectionSplitMap command-t.txt /*g:CommandTAcceptSelectionSplitMap*
g:CommandTAcceptSelectionTabMap command-t.txt /*g:CommandTAcceptSelectionTabMap*
@@ -103,86 +44,6 @@ g:CommandTScanDotDirectories command-t.txt /*g:CommandTScanDotDirectories*
g:CommandTSelectNextMap command-t.txt /*g:CommandTSelectNextMap*
g:CommandTSelectPrevMap command-t.txt /*g:CommandTSelectPrevMap*
g:CommandTToggleFocusMap command-t.txt /*g:CommandTToggleFocusMap*
-g:FuzzyFinderOptions fuzzyfinder.txt /*g:FuzzyFinderOptions*
-g:FuzzyFinderOptions.Base fuzzyfinder.txt /*g:FuzzyFinderOptions.Base*
-g:FuzzyFinderOptions.Base.abbrev_map fuzzyfinder.txt /*g:FuzzyFinderOptions.Base.abbrev_map*
-g:FuzzyFinderOptions.Base.enumerating_limit fuzzyfinder.txt /*g:FuzzyFinderOptions.Base.enumerating_limit*
-g:FuzzyFinderOptions.Base.ignore_case fuzzyfinder.txt /*g:FuzzyFinderOptions.Base.ignore_case*
-g:FuzzyFinderOptions.Base.info_file fuzzyfinder.txt /*g:FuzzyFinderOptions.Base.info_file*
-g:FuzzyFinderOptions.Base.key_ignore_case fuzzyfinder.txt /*g:FuzzyFinderOptions.Base.key_ignore_case*
-g:FuzzyFinderOptions.Base.key_next_mode fuzzyfinder.txt /*g:FuzzyFinderOptions.Base.key_next_mode*
-g:FuzzyFinderOptions.Base.key_open fuzzyfinder.txt /*g:FuzzyFinderOptions.Base.key_open*
-g:FuzzyFinderOptions.Base.key_open_split fuzzyfinder.txt /*g:FuzzyFinderOptions.Base.key_open_split*
-g:FuzzyFinderOptions.Base.key_open_tab fuzzyfinder.txt /*g:FuzzyFinderOptions.Base.key_open_tab*
-g:FuzzyFinderOptions.Base.key_open_vsplit fuzzyfinder.txt /*g:FuzzyFinderOptions.Base.key_open_vsplit*
-g:FuzzyFinderOptions.Base.key_prev_mode fuzzyfinder.txt /*g:FuzzyFinderOptions.Base.key_prev_mode*
-g:FuzzyFinderOptions.Base.lasting_cache fuzzyfinder.txt /*g:FuzzyFinderOptions.Base.lasting_cache*
-g:FuzzyFinderOptions.Base.learning_limit fuzzyfinder.txt /*g:FuzzyFinderOptions.Base.learning_limit*
-g:FuzzyFinderOptions.Base.max_menu_width fuzzyfinder.txt /*g:FuzzyFinderOptions.Base.max_menu_width*
-g:FuzzyFinderOptions.Base.migemo_support fuzzyfinder.txt /*g:FuzzyFinderOptions.Base.migemo_support*
-g:FuzzyFinderOptions.Base.min_length fuzzyfinder.txt /*g:FuzzyFinderOptions.Base.min_length*
-g:FuzzyFinderOptions.Base.time_format fuzzyfinder.txt /*g:FuzzyFinderOptions.Base.time_format*
-g:FuzzyFinderOptions.Bookmark fuzzyfinder.txt /*g:FuzzyFinderOptions.Bookmark*
-g:FuzzyFinderOptions.Bookmark.mode_available fuzzyfinder.txt /*g:FuzzyFinderOptions.Bookmark.mode_available*
-g:FuzzyFinderOptions.Bookmark.prompt fuzzyfinder.txt /*g:FuzzyFinderOptions.Bookmark.prompt*
-g:FuzzyFinderOptions.Bookmark.prompt_highlight fuzzyfinder.txt /*g:FuzzyFinderOptions.Bookmark.prompt_highlight*
-g:FuzzyFinderOptions.Bookmark.reuse_window fuzzyfinder.txt /*g:FuzzyFinderOptions.Bookmark.reuse_window*
-g:FuzzyFinderOptions.Bookmark.searching_range fuzzyfinder.txt /*g:FuzzyFinderOptions.Bookmark.searching_range*
-g:FuzzyFinderOptions.Bookmark.smart_bs fuzzyfinder.txt /*g:FuzzyFinderOptions.Bookmark.smart_bs*
-g:FuzzyFinderOptions.Bookmark.switch_order fuzzyfinder.txt /*g:FuzzyFinderOptions.Bookmark.switch_order*
-g:FuzzyFinderOptions.Buffer fuzzyfinder.txt /*g:FuzzyFinderOptions.Buffer*
-g:FuzzyFinderOptions.Buffer.mode_available fuzzyfinder.txt /*g:FuzzyFinderOptions.Buffer.mode_available*
-g:FuzzyFinderOptions.Buffer.mru_order fuzzyfinder.txt /*g:FuzzyFinderOptions.Buffer.mru_order*
-g:FuzzyFinderOptions.Buffer.prompt fuzzyfinder.txt /*g:FuzzyFinderOptions.Buffer.prompt*
-g:FuzzyFinderOptions.Buffer.prompt_highlight fuzzyfinder.txt /*g:FuzzyFinderOptions.Buffer.prompt_highlight*
-g:FuzzyFinderOptions.Buffer.reuse_window fuzzyfinder.txt /*g:FuzzyFinderOptions.Buffer.reuse_window*
-g:FuzzyFinderOptions.Buffer.smart_bs fuzzyfinder.txt /*g:FuzzyFinderOptions.Buffer.smart_bs*
-g:FuzzyFinderOptions.Buffer.switch_order fuzzyfinder.txt /*g:FuzzyFinderOptions.Buffer.switch_order*
-g:FuzzyFinderOptions.Dir fuzzyfinder.txt /*g:FuzzyFinderOptions.Dir*
-g:FuzzyFinderOptions.Dir.excluded_path fuzzyfinder.txt /*g:FuzzyFinderOptions.Dir.excluded_path*
-g:FuzzyFinderOptions.Dir.mode_available fuzzyfinder.txt /*g:FuzzyFinderOptions.Dir.mode_available*
-g:FuzzyFinderOptions.Dir.prompt fuzzyfinder.txt /*g:FuzzyFinderOptions.Dir.prompt*
-g:FuzzyFinderOptions.Dir.prompt_highlight fuzzyfinder.txt /*g:FuzzyFinderOptions.Dir.prompt_highlight*
-g:FuzzyFinderOptions.Dir.smart_bs fuzzyfinder.txt /*g:FuzzyFinderOptions.Dir.smart_bs*
-g:FuzzyFinderOptions.Dir.switch_order fuzzyfinder.txt /*g:FuzzyFinderOptions.Dir.switch_order*
-g:FuzzyFinderOptions.File fuzzyfinder.txt /*g:FuzzyFinderOptions.File*
-g:FuzzyFinderOptions.File.excluded_path fuzzyfinder.txt /*g:FuzzyFinderOptions.File.excluded_path*
-g:FuzzyFinderOptions.File.mode_available fuzzyfinder.txt /*g:FuzzyFinderOptions.File.mode_available*
-g:FuzzyFinderOptions.File.prompt fuzzyfinder.txt /*g:FuzzyFinderOptions.File.prompt*
-g:FuzzyFinderOptions.File.prompt_highlight fuzzyfinder.txt /*g:FuzzyFinderOptions.File.prompt_highlight*
-g:FuzzyFinderOptions.File.reuse_window fuzzyfinder.txt /*g:FuzzyFinderOptions.File.reuse_window*
-g:FuzzyFinderOptions.File.smart_bs fuzzyfinder.txt /*g:FuzzyFinderOptions.File.smart_bs*
-g:FuzzyFinderOptions.File.switch_order fuzzyfinder.txt /*g:FuzzyFinderOptions.File.switch_order*
-g:FuzzyFinderOptions.MruCmd fuzzyfinder.txt /*g:FuzzyFinderOptions.MruCmd*
-g:FuzzyFinderOptions.MruCmd.excluded_command fuzzyfinder.txt /*g:FuzzyFinderOptions.MruCmd.excluded_command*
-g:FuzzyFinderOptions.MruCmd.max_item fuzzyfinder.txt /*g:FuzzyFinderOptions.MruCmd.max_item*
-g:FuzzyFinderOptions.MruCmd.mode_available fuzzyfinder.txt /*g:FuzzyFinderOptions.MruCmd.mode_available*
-g:FuzzyFinderOptions.MruCmd.prompt fuzzyfinder.txt /*g:FuzzyFinderOptions.MruCmd.prompt*
-g:FuzzyFinderOptions.MruCmd.prompt_highlight fuzzyfinder.txt /*g:FuzzyFinderOptions.MruCmd.prompt_highlight*
-g:FuzzyFinderOptions.MruCmd.smart_bs fuzzyfinder.txt /*g:FuzzyFinderOptions.MruCmd.smart_bs*
-g:FuzzyFinderOptions.MruCmd.switch_order fuzzyfinder.txt /*g:FuzzyFinderOptions.MruCmd.switch_order*
-g:FuzzyFinderOptions.MruFile fuzzyfinder.txt /*g:FuzzyFinderOptions.MruFile*
-g:FuzzyFinderOptions.MruFile.excluded_path fuzzyfinder.txt /*g:FuzzyFinderOptions.MruFile.excluded_path*
-g:FuzzyFinderOptions.MruFile.max_item fuzzyfinder.txt /*g:FuzzyFinderOptions.MruFile.max_item*
-g:FuzzyFinderOptions.MruFile.mode_available fuzzyfinder.txt /*g:FuzzyFinderOptions.MruFile.mode_available*
-g:FuzzyFinderOptions.MruFile.prompt fuzzyfinder.txt /*g:FuzzyFinderOptions.MruFile.prompt*
-g:FuzzyFinderOptions.MruFile.prompt_highlight fuzzyfinder.txt /*g:FuzzyFinderOptions.MruFile.prompt_highlight*
-g:FuzzyFinderOptions.MruFile.reuse_window fuzzyfinder.txt /*g:FuzzyFinderOptions.MruFile.reuse_window*
-g:FuzzyFinderOptions.MruFile.smart_bs fuzzyfinder.txt /*g:FuzzyFinderOptions.MruFile.smart_bs*
-g:FuzzyFinderOptions.MruFile.switch_order fuzzyfinder.txt /*g:FuzzyFinderOptions.MruFile.switch_order*
-g:FuzzyFinderOptions.Tag fuzzyfinder.txt /*g:FuzzyFinderOptions.Tag*
-g:FuzzyFinderOptions.Tag.mode_available fuzzyfinder.txt /*g:FuzzyFinderOptions.Tag.mode_available*
-g:FuzzyFinderOptions.Tag.prompt fuzzyfinder.txt /*g:FuzzyFinderOptions.Tag.prompt*
-g:FuzzyFinderOptions.Tag.prompt_highlight fuzzyfinder.txt /*g:FuzzyFinderOptions.Tag.prompt_highlight*
-g:FuzzyFinderOptions.Tag.smart_bs fuzzyfinder.txt /*g:FuzzyFinderOptions.Tag.smart_bs*
-g:FuzzyFinderOptions.Tag.switch_order fuzzyfinder.txt /*g:FuzzyFinderOptions.Tag.switch_order*
-g:FuzzyFinderOptions.TaggedFile fuzzyfinder.txt /*g:FuzzyFinderOptions.TaggedFile*
-g:FuzzyFinderOptions.TaggedFile.mode_available fuzzyfinder.txt /*g:FuzzyFinderOptions.TaggedFile.mode_available*
-g:FuzzyFinderOptions.TaggedFile.prompt fuzzyfinder.txt /*g:FuzzyFinderOptions.TaggedFile.prompt*
-g:FuzzyFinderOptions.TaggedFile.prompt_highlight fuzzyfinder.txt /*g:FuzzyFinderOptions.TaggedFile.prompt_highlight*
-g:FuzzyFinderOptions.TaggedFile.reuse_window fuzzyfinder.txt /*g:FuzzyFinderOptions.TaggedFile.reuse_window*
-g:FuzzyFinderOptions.TaggedFile.smart_bs fuzzyfinder.txt /*g:FuzzyFinderOptions.TaggedFile.smart_bs*
-g:FuzzyFinderOptions.TaggedFile.switch_order fuzzyfinder.txt /*g:FuzzyFinderOptions.TaggedFile.switch_order*
g:manpageview_K_EXT manpageview.txt /*g:manpageview_K_EXT*
g:manpageview_iconv manpageview.txt /*g:manpageview_iconv*
g:manpageview_init_EXT manpageview.txt /*g:manpageview_init_EXT*
View
10 plugin/command-t.vim
@@ -27,10 +27,10 @@ if exists("g:command_t_loaded")
endif
let g:command_t_loaded = 1
-command CommandT :call <SID>CommandTShow()
-command CommandTFlush :call <SID>CommandTFlush()
+command -nargs=? -complete=dir CommandT call <SID>CommandTShow(<q-args>)
+command CommandTFlush call <SID>CommandTFlush()
-" silent! nmap <unique> <silent> <Leader>t :CommandT<CR>
+silent! nmap <unique> <silent> <Leader>t :CommandT<CR>
function s:CommandTRubyWarning()
echohl WarningMsg
@@ -39,7 +39,7 @@ function s:CommandTRubyWarning()
echohl none
endfunction
-function s:CommandTShow()
+function s:CommandTShow(arg)
if has('ruby')
ruby $command_t.show
else
@@ -132,7 +132,7 @@ ruby << EOF
$command_t = CommandT::Controller.new
rescue LoadError
load_path_modified = false
- Vim::evaluate('&runtimepath').to_s.split(',').each do |path|
+ VIM::evaluate('&runtimepath').to_s.split(',').each do |path|
lib = "#{path}/ruby"
if !$LOAD_PATH.include?(lib) and File.exist?(lib)
$LOAD_PATH << lib
View
63 ruby/command-t/Makefile
@@ -4,65 +4,59 @@ SHELL = /bin/sh
#### Start of system configuration section. ####
srcdir = .
-topdir = /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin10.0
+topdir = /opt/ruby-enterprise-1.8.6-20090610/lib/ruby/1.8/i686-darwin10.0.0
hdrdir = $(topdir)
VPATH = $(srcdir):$(topdir):$(hdrdir)
+prefix = $(DESTDIR)/opt/ruby-enterprise-1.8.6-20090610
exec_prefix = $(prefix)
-prefix = $(DESTDIR)/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr
-sharedstatedir = $(prefix)/com
-mandir = $(DESTDIR)/usr/share/man
+sitedir = $(prefix)/lib/ruby/site_ruby
+rubylibdir = $(libdir)/ruby/$(ruby_version)
+docdir = $(datarootdir)/doc/$(PACKAGE)
+dvidir = $(docdir)
+datarootdir = $(prefix)/share
+archdir = $(rubylibdir)/$(arch)
+sbindir = $(exec_prefix)/sbin
psdir = $(docdir)
-oldincludedir = $(DESTDIR)/usr/include
localedir = $(datarootdir)/locale
-bindir = $(exec_prefix)/bin
-libexecdir = $(exec_prefix)/libexec
-sitedir = $(DESTDIR)/Library/Ruby/Site
htmldir = $(docdir)
-vendorarchdir = $(vendorlibdir)/$(sitearch)
+datadir = $(datarootdir)
includedir = $(prefix)/include
-infodir = $(DESTDIR)/usr/share/info
-vendorlibdir = $(vendordir)/$(ruby_version)
+infodir = $(datarootdir)/info
sysconfdir = $(prefix)/etc
+mandir = $(datarootdir)/man
libdir = $(exec_prefix)/lib
-sbindir = $(exec_prefix)/sbin
-rubylibdir = $(libdir)/ruby/$(ruby_version)
-docdir = $(datarootdir)/doc/$(PACKAGE)
-dvidir = $(docdir)
-vendordir = $(libdir)/ruby/vendor_ruby
-datarootdir = $(prefix)/share
+sharedstatedir = $(prefix)/com
+oldincludedir = $(DESTDIR)/usr/include
pdfdir = $(docdir)
-archdir = $(rubylibdir)/$(arch)
sitearchdir = $(sitelibdir)/$(sitearch)
-datadir = $(datarootdir)
+bindir = $(exec_prefix)/bin
localstatedir = $(prefix)/var
sitelibdir = $(sitedir)/$(ruby_version)
+libexecdir = $(exec_prefix)/libexec
CC = gcc
-LIBRUBY = $(LIBRUBY_SO)
+LIBRUBY = $(LIBRUBY_A)
LIBRUBY_A = lib$(RUBY_SO_NAME)-static.a
-LIBRUBYARG_SHARED = -l$(RUBY_SO_NAME)
-LIBRUBYARG_STATIC = -l$(RUBY_SO_NAME)
+LIBRUBYARG_SHARED =
+LIBRUBYARG_STATIC = -l$(RUBY_SO_NAME)-static
RUBY_EXTCONF_H =
-CFLAGS = -fno-common -arch i386 -arch x86_64 -g -Os -pipe -fno-common -DENABLE_DTRACE -fno-common -pipe -fno-common $(cflags)
+CFLAGS = -fno-common -g -O2 -pipe -fno-common
INCFLAGS = -I. -I$(topdir) -I$(hdrdir) -I$(srcdir)
DEFS =
-CPPFLAGS = -DHAVE_RUBY_H -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE $(DEFS) $(cppflags)
+CPPFLAGS = -DHAVE_RUBY_H $(DEFS)
CXXFLAGS = $(CFLAGS)
-ldflags = -L. -arch i386 -arch x86_64
-dldflags =
-archflag =
-DLDFLAGS = $(ldflags) $(dldflags) $(archflag)
-LDSHARED = cc -arch i386 -arch x86_64 -pipe -bundle -undefined dynamic_lookup
+DLDFLAGS = -L.
+LDSHARED = cc -dynamic -bundle -undefined suppress -flat_namespace
AR = ar
EXEEXT =
RUBY_INSTALL_NAME = ruby
RUBY_SO_NAME = ruby
-arch = universal-darwin10.0
-sitearch = universal-darwin10.0
+arch = i686-darwin10.0.0
+sitearch = i686-darwin10.0.0
ruby_version = 1.8
-ruby = /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
+ruby = /opt/ruby-enterprise-1.8.6-20090610/bin/ruby
RUBY = $(ruby)
RM = rm -f
MAKEDIRS = mkdir -p
@@ -86,15 +80,14 @@ extout =
extout_prefix =
target_prefix =
LOCAL_LIBS =
-LIBS = $(LIBRUBYARG_SHARED) -lpthread -ldl
+LIBS = -ldl -lobjc
SRCS = ext.c match.c matcher.c
OBJS = ext.o match.o matcher.o
TARGET = ext
DLLIB = $(TARGET).bundle
EXTSTATIC =
STATIC_LIB =
-BINDIR = $(bindir)
RUBYCOMMONDIR = $(sitedir)$(target_prefix)
RUBYLIBDIR = $(sitelibdir)$(target_prefix)
RUBYARCHDIR = $(sitearchdir)$(target_prefix)
@@ -178,4 +171,4 @@ $(DLLIB): $(OBJS)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
-CFLAGS += -std=gnu99 -Wall -Wextra -Wno-unused-parameter
+CFLAGS += -std=c99 -Wall -Wextra -Wno-unused-parameter
View
11 ruby/command-t/controller.rb
@@ -34,7 +34,9 @@ def initialize
end
def show
- @finder.path = VIM::pwd
+ # optional parameter will be desired starting directory, or ""
+ @path = File.expand_path(VIM::evaluate('a:arg'), VIM::pwd)
+ @finder.path = @path
@initial_window = $curwin
@initial_buffer = $curbuf
@match_window = MatchWindow.new \
@@ -44,6 +46,9 @@ def show
@prompt.focus
register_for_key_presses
clear # clears prompt and list matches
+ rescue Errno::ENOENT
+ # probably a problem with the optional parameter
+ @match_window.print_no_such_file_or_directory
end
def hide
@@ -143,8 +148,7 @@ def set_up_finder
:max_depth => get_number('g:CommandTMaxDepth'),
:always_show_dot_files => get_bool('g:CommandTAlwaysShowDotFiles'),
:never_show_dot_files => get_bool('g:CommandTNeverShowDotFiles'),
- :scan_dot_directories => get_bool('g:CommandTScanDotDirectories'),
- :excludes => get_string('&wildignore')
+ :scan_dot_directories => get_bool('g:CommandTScanDotDirectories')
end
def get_number name
@@ -179,6 +183,7 @@ def default_open_command
def open_selection selection, options = {}
command = options[:command] || default_open_command
+ selection = File.expand_path selection, @path
selection = sanitize_path_string selection
VIM::command "silent #{command} #{selection}"
end
View
2 ruby/command-t/depend
@@ -21,4 +21,4 @@
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
-CFLAGS += -std=gnu99 -Wall -Wextra -Wno-unused-parameter
+CFLAGS += -std=c99 -Wall -Wextra -Wno-unused-parameter
View
BIN ruby/command-t/ext.bundle
Binary file not shown.
View
BIN ruby/command-t/ext.o
Binary file not shown.
View
BIN ruby/command-t/match.o
Binary file not shown.
View
29 ruby/command-t/match_window.rb
@@ -77,6 +77,7 @@ def initialize options = {}
if VIM::has_syntax?
VIM::command "syntax match CommandTSelection \"^#{@@selection_marker}.\\+$\""
VIM::command 'syntax match CommandTNoEntries "^-- NO MATCHES --$"'
+ VIM::command 'syntax match CommandTNoEntries "^-- NO SUCH FILE OR DIRECTORY --$"'
VIM::command 'highlight link CommandTSelection Visual'
VIM::command 'highlight link CommandTNoEntries Error'
VIM::evaluate 'clearmatches()'
@@ -183,8 +184,21 @@ def selection
@matches[@selection]
end
+ def print_no_such_file_or_directory
+ print_error 'NO SUCH FILE OR DIRECTORY'
+ end
+
private
+ def print_error msg
+ return unless @window.select
+ unlock
+ clear
+ @window.height = 1
+ @buffer[1] = "-- #{msg} --"
+ lock
+ end
+
def restore_window_dimensions
# sort from tallest to shortest
@windows.sort! { |a, b| b.height <=> a.height }
@@ -219,16 +233,15 @@ def print_match idx
# Print all matches.
def print_matches
- return unless @window.select
- unlock
- clear
match_count = @matches.length
- actual_lines = 1
- @window_width = @window.width # update cached value
if match_count == 0
- @window.height = actual_lines
- @buffer[1] = '-- NO MATCHES --'
+ print_error 'NO MATCHES'
else
+ return unless @window.select
+ unlock
+ clear
+ actual_lines = 1
+ @window_width = @window.width # update cached value
max_lines = VIM::Screen.lines - 5
max_lines = 1 if max_lines < 0
actual_lines = match_count > max_lines ? max_lines : match_count
@@ -241,8 +254,8 @@ def print_matches
@buffer.append line - 1, match_text_for_idx(idx)
end
end
+ lock
end
- lock
end
# Prepare padding for match text (trailing spaces) so that selection
View
74 ruby/command-t/matcher.c
@@ -28,44 +28,50 @@
#include "ruby_compat.h"
// comparison function for use with qsort
-int comp(const void *a, const void *b)
+int comp_alpha(const void *a, const void *b)
{
VALUE a_val = *(VALUE *)a;
VALUE b_val = *(VALUE *)b;
- ID score = rb_intern("score");
ID to_s = rb_intern("to_s");
+
+ VALUE a_str = rb_funcall(a_val, to_s, 0);
+ VALUE b_str = rb_funcall(b_val, to_s, 0);
+ char *a_p = RSTRING_PTR(a_str);
+ long a_len = RSTRING_LEN(a_str);
+ char *b_p = RSTRING_PTR(b_str);
+ long b_len = RSTRING_LEN(b_str);
+ int order = 0;
+ if (a_len > b_len)
+ {
+ order = strncmp(a_p, b_p, b_len);
+ if (order == 0)
+ order = 1; // shorter string (b) wins
+ }
+ else if (a_len < b_len)
+ {
+ order = strncmp(a_p, b_p, a_len);
+ if (order == 0)
+ order = -1; // shorter string (a) wins
+ }
+ else
+ order = strncmp(a_p, b_p, a_len);
+ return order;
+}
+
+// comparison function for use with qsort
+int comp_score(const void *a, const void *b)
+{
+ VALUE a_val = *(VALUE *)a;
+ VALUE b_val = *(VALUE *)b;
+ ID score = rb_intern("score");
double a_score = RFLOAT_VALUE(rb_funcall(a_val, score, 0));
double b_score = RFLOAT_VALUE(rb_funcall(b_val, score, 0));
if (a_score > b_score)
return -1; // a scores higher, a should appear sooner
else if (a_score < b_score)
return 1; // b scores higher, a should appear later
else
- {
- // fall back to alphabetical ordering
- VALUE a_str = rb_funcall(a_val, to_s, 0);
- VALUE b_str = rb_funcall(b_val, to_s, 0);
- char *a_p = RSTRING_PTR(a_str);
- long a_len = RSTRING_LEN(a_str);
- char *b_p = RSTRING_PTR(b_str);
- long b_len = RSTRING_LEN(b_str);
- int order = 0;
- if (a_len > b_len)
- {
- order = strncmp(a_p, b_p, b_len);
- if (order == 0)
- order = 1; // shorter string (b) wins
- }
- else if (a_len < b_len)
- {
- order = strncmp(a_p, b_p, a_len);
- if (order == 0)
- order = -1; // shorter string (a) wins
- }
- else
- order = strncmp(a_p, b_p, a_len);
- return order;
- }
+ return comp_alpha(a, b);
}
VALUE CommandTMatcher_initialize(int argc, VALUE *argv, VALUE self)
@@ -95,15 +101,17 @@ VALUE CommandTMatcher_sorted_matchers_for(VALUE self, VALUE abbrev, VALUE option
// process optional options hash
VALUE limit_option = CommandT_option_from_hash("limit", options);
- // get matches in default (alphabetical) ordering
+ // get unsorted matches
VALUE matches = CommandTMatcher_matches_for(self, abbrev);
abbrev = StringValue(abbrev);
- if (RSTRING_LEN(abbrev) == 1 && RSTRING_PTR(abbrev)[0] == '.')
- ; // maintain alphabetic order if search string is only "."
- else if (RSTRING_LEN(abbrev) > 0)
- // we have a non-empty search string, so sort by score
- qsort(RARRAY_PTR(matches), RARRAY_LEN(matches), sizeof(VALUE), comp);
+ if (RSTRING_LEN(abbrev) == 0 ||
+ (RSTRING_LEN(abbrev) == 1 && RSTRING_PTR(abbrev)[0] == '.'))
+ // alphabetic order if search string is only "" or "."
+ qsort(RARRAY_PTR(matches), RARRAY_LEN(matches), sizeof(VALUE), comp_alpha);
+ else
+ // for all other non-empty search strings, sort by score
+ qsort(RARRAY_PTR(matches), RARRAY_LEN(matches), sizeof(VALUE), comp_score);
// apply optional limit option
long limit = NIL_P(limit_option) ? 0 : NUM2LONG(limit_option);
View
BIN ruby/command-t/matcher.o
Binary file not shown.
View
2 ruby/command-t/mkmf.log
@@ -1,6 +1,6 @@
have_header: checking for ruby.h... -------------------- yes
-"gcc -E -I. -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin10.0 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -g -Os -pipe -fno-common -DENABLE_DTRACE -fno-common -pipe -fno-common conftest.c -o conftest.i"
+"gcc -E -I. -I/opt/ruby-enterprise-1.8.6-20090610/lib/ruby/1.8/i686-darwin10.0.0 -I. -g -O2 -pipe -fno-common conftest.c -o conftest.i"
checked program was:
/* begin */
1: #include <ruby.h>
View
14 ruby/command-t/scanner.rb
@@ -21,6 +21,8 @@
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
+require 'vim'
+
module CommandT
# Reads the current directory recursively for the paths to all regular files.
class Scanner
@@ -31,7 +33,6 @@ def initialize path = Dir.pwd, options = {}
@max_depth = options[:max_depth] || 15
@max_files = options[:max_files] || 10_000
@scan_dot_directories = options[:scan_dot_directories] || false
- @excludes = (options[:excludes] || '*.o,*.obj,.git').split(',')
end
def paths
@@ -40,7 +41,7 @@ def paths
@paths = []
@depth = 0
@files = 0
- @prefix_len = @path.length
+ @prefix_len = @path.chomp('/').length
add_paths_for_directory @path, @paths
rescue FileLimitExceeded
end
@@ -61,16 +62,17 @@ def path= str
private
def path_excluded? path
- @excludes.any? do |pattern|
- File.fnmatch pattern, path, File::FNM_DOTMATCH
- end
+ # first strip common prefix (@path) from path to match VIM's behavior
+ path = path[(@prefix_len + 1)..-1]
+ path = VIM::escape_for_single_quotes path
+ VIM::evaluate("empty(expand(fnameescape('#{path}')))").to_i == 1
end
def add_paths_for_directory dir, accumulator
Dir.foreach(dir) do |entry|
next if ['.', '..'].include?(entry)
path = File.join(dir, entry)
- unless path_excluded?(entry)
+ unless path_excluded?(path)
if File.file?(path)
@files += 1
raise FileLimitExceeded if @files > @max_files
View
6 ruby/command-t/stub.rb
@@ -23,9 +23,9 @@
module CommandT
class Stub
- @@load_error = ['command-t.vim could not load the necessary modules',
- 'Please double-check the installation instructions',
- 'For more information type: :help command-t']
+ @@load_error = ['command-t.vim could not load the C extension',
+ 'Please see INSTALLATION and TROUBLE-SHOOTING in the help',
+ 'For more information type: :help command-t']
def show
warn *@@load_error
View
4 ruby/vim.rb
@@ -26,11 +26,11 @@
module VIM
def self.has_syntax?
- VIM.evaluate('has("syntax")').to_i != 0
+ VIM::evaluate('has("syntax")').to_i != 0
end
def self.pwd
- VIM.evaluate('getcwd()')
+ VIM::evaluate 'getcwd()'
end
# Escape a string for safe inclusion in a Vim single-quoted string
View
4 ruby/vim/screen.rb
@@ -24,11 +24,11 @@
module VIM
module Screen
def self.lines
- VIM.evaluate('&lines').to_i
+ VIM::evaluate('&lines').to_i
end
def self.columns
- VIM.evaluate('&columns').to_i
+ VIM::evaluate('&columns').to_i
end
end # module Screen
end # module VIM

0 comments on commit 94d8040

Please sign in to comment.
Something went wrong with that request. Please try again.