command-t 1.6.1 → 1.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/LICENSE +1 -1
- data/README.txt +169 -21
- data/Rakefile +0 -12
- data/doc/command-t.txt +169 -21
- data/doc/tags +57 -0
- data/plugin/command-t.vim +5 -1
- data/ruby/command-t/Makefile +40 -39
- data/ruby/command-t/controller.rb +40 -22
- data/ruby/command-t/ext.bundle +0 -0
- data/ruby/command-t/extconf.rb +5 -3
- data/ruby/command-t/finder/file_finder.rb +17 -5
- data/ruby/command-t/match_window.rb +37 -37
- data/ruby/command-t/scanner/file_scanner.rb +10 -45
- data/ruby/command-t/scanner/file_scanner/find_file_scanner.rb +77 -0
- data/ruby/command-t/scanner/file_scanner/ruby_file_scanner.rb +78 -0
- data/ruby/command-t/scanner/file_scanner/watchman_file_scanner.rb +79 -0
- data/ruby/command-t/settings.rb +83 -32
- data/ruby/command-t/util.rb +3 -1
- metadata +17 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c3fc62a23bf7b551669e54df491df3d955b9dfbc
|
4
|
+
data.tar.gz: 73fe14c5464d0f9ec9d6683213e677f590158696
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 400b58429a528348f88392a42c3effa7f90cd11db22e0559f442139d3776a54664a71766edc33fac5f27dc869e77950baa943873aad2ab1d3905f6a7d8aa6c08
|
7
|
+
data.tar.gz: 02b9a4a5ea7d6633ca3ef38adbc5af87a8dae0eeda3dfc828b69af4c6ccb2dcac9e64dc1363f6be8197cb52342cd9b345bdb82887e00373d7bbdc2cded408d69
|
data/Gemfile
CHANGED
data/LICENSE
CHANGED
data/README.txt
CHANGED
@@ -11,12 +11,13 @@ CONTENTS *command-t-contents*
|
|
11
11
|
6. Commands |command-t-commands|
|
12
12
|
7. Mappings |command-t-mappings|
|
13
13
|
8. Options |command-t-options|
|
14
|
-
9.
|
15
|
-
10.
|
16
|
-
11.
|
17
|
-
12.
|
18
|
-
13.
|
19
|
-
14.
|
14
|
+
9. Tips |command-t-tips|
|
15
|
+
10. Authors |command-t-authors|
|
16
|
+
11. Development |command-t-development|
|
17
|
+
12. Website |command-t-website|
|
18
|
+
13. Donations |command-t-donations|
|
19
|
+
14. License |command-t-license|
|
20
|
+
15. History |command-t-history|
|
20
21
|
|
21
22
|
|
22
23
|
INTRODUCTION *command-t-intro*
|
@@ -50,7 +51,7 @@ installation at the operating system level, and a C compiler to build
|
|
50
51
|
the Ruby extension.
|
51
52
|
|
52
53
|
|
53
|
-
1. Vim compiled with Ruby support
|
54
|
+
1. Vim compiled with Ruby support ~
|
54
55
|
|
55
56
|
You can check for Ruby support by launching Vim with the --version switch:
|
56
57
|
|
@@ -81,7 +82,7 @@ include Ruby support, and is recommended over version 7.3 (which links against
|
|
81
82
|
Ruby 1.9, but apparently has some bugs that need to be resolved).
|
82
83
|
|
83
84
|
|
84
|
-
2. Ruby
|
85
|
+
2. Ruby ~
|
85
86
|
|
86
87
|
In addition to having Ruby support in Vim, your system itself must have a
|
87
88
|
compatible Ruby install. "Compatible" means the same version as Vim itself
|
@@ -114,7 +115,7 @@ If using RubyInstaller be sure to download the installer executable, not the
|
|
114
115
|
PATH" so that Vim can find them.
|
115
116
|
|
116
117
|
|
117
|
-
3. C compiler
|
118
|
+
3. C compiler ~
|
118
119
|
|
119
120
|
Part of Command-T is implemented in C as a Ruby extension for speed, allowing
|
120
121
|
it to work responsively even on directory hierarchies containing enormous
|
@@ -477,6 +478,36 @@ Following is a list of all available options:
|
|
477
478
|
If set to 0, the window will occupy as much of the available space as
|
478
479
|
needed to show matching entries.
|
479
480
|
|
481
|
+
*g:CommandTInputDebounce*
|
482
|
+
|g:CommandTInputDebounce| number (default: 50)
|
483
|
+
|
484
|
+
The number of milliseconds to wait before updating the match listing
|
485
|
+
following a key-press. This can be used to avoid wasteful recomputation
|
486
|
+
when making a rapid series of key-presses in a directory with many tens
|
487
|
+
(or hundreds) of thousands of files.
|
488
|
+
|
489
|
+
*g:CommandTFileScanner*
|
490
|
+
|g:CommandTFileScanner| string (default: 'ruby')
|
491
|
+
|
492
|
+
The underlying scanner implementation that should be used to explore the
|
493
|
+
filesystem. Possible values are:
|
494
|
+
|
495
|
+
- "ruby": uses built-in Ruby and should work everywhere, albeit slowly
|
496
|
+
on large (many tens of thousands of files) hierarchies.
|
497
|
+
|
498
|
+
- "find": uses the command-line tool of the same name, which can be much
|
499
|
+
faster on large projects because it is written in pure C, but may not
|
500
|
+
work on systems without the tool or with an incompatible version of
|
501
|
+
the tool.
|
502
|
+
|
503
|
+
- "watchman": uses Watchman (https://github.com/facebook/watchman) if
|
504
|
+
available; otherwise falls back to "find". Note that this scanner is
|
505
|
+
intended for use with very large hierarchies (hundreds of thousands of
|
506
|
+
files) and so the task of deciding which files should be included is
|
507
|
+
entirely delegated to Watchman; this means that settings which
|
508
|
+
Command-T would usually consult, such as 'wildignore' and
|
509
|
+
|g:CommandTScanDotDirectories| are ignored.
|
510
|
+
|
480
511
|
*g:CommandTMinHeight*
|
481
512
|
|g:CommandTMinHeight| number (default: 0)
|
482
513
|
|
@@ -564,7 +595,7 @@ Following is a list of all available options:
|
|
564
595
|
|g:CommandTWildIgnore| string (default: none)
|
565
596
|
|
566
597
|
Optionally override Vim's global |'wildignore'| setting during Command-T
|
567
|
-
|
598
|
+
searches. If you wish to supplement rather than replace the global
|
568
599
|
setting, you can use a syntax like:
|
569
600
|
|
570
601
|
let g:CommandTWildIgnore=&wildignore . ",**/bower_components/*"
|
@@ -671,22 +702,128 @@ settings can be used to control behavior:
|
|
671
702
|
only during Command-T searches.
|
672
703
|
|
673
704
|
|
705
|
+
TIPS *command-t-tips*
|
706
|
+
|
707
|
+
Working with very large repositories ~
|
708
|
+
|
709
|
+
One of the primary motivations for writing Command-T was to get fast, robust
|
710
|
+
high-quality matches even on large hierarchies. The larger the hierarchy, the
|
711
|
+
more important having good file navigation becomes. This is why Command-T's
|
712
|
+
performance-critical sections are written in C. This requires a compilation
|
713
|
+
step and makes Command-T harder to install than similar plug-ins which are
|
714
|
+
written in pure Vimscript, and can be a disincentive against use. This is a
|
715
|
+
conscious trade-off; the goal isn't to have as many users as possible, but
|
716
|
+
rather to provide the best performance at the highest quality.
|
717
|
+
|
718
|
+
The speed of the core is high enough that Command-T can afford to burn a bunch
|
719
|
+
of extra cycles -- using its recursive matching algorithm -- looking for a
|
720
|
+
higher-quality, more intuitive ranking of search results. Again, the larger
|
721
|
+
the hierarchy, the more important the quality of result ranking becomes.
|
722
|
+
|
723
|
+
Nevertheless, for extremely large hierarchies (of the order of 500,000 files)
|
724
|
+
some tuning is required in order to get useful and usable performance levels.
|
725
|
+
Here are some useful example settings:
|
726
|
+
|
727
|
+
let g:CommandTMaxHeight = 30
|
728
|
+
|
729
|
+
You want the match listing window to be large enough that you can get useful
|
730
|
+
feedback about how your search query is going; in large hierarchies there may
|
731
|
+
be many, many matches for a given query. At the same time, you don't want Vim
|
732
|
+
wasting valuable cycles repainting a large portion of the screen area,
|
733
|
+
especially on a large display. Setting the limit to 30 or similar is a
|
734
|
+
reasonable compromise.
|
735
|
+
|
736
|
+
let g:CommandTMaxFiles = 500000
|
737
|
+
|
738
|
+
The default limit of 30,000 files prevents Command-T from "seeing" many of the
|
739
|
+
files in a large directory hierarchy so you need to increase this limit.
|
740
|
+
|
741
|
+
let g:CommandTInputDebounce = 200
|
742
|
+
|
743
|
+
Wait for 200ms of keyboard inactivity before computing search results. For
|
744
|
+
example, if you are enter "foobar" quickly (ie. within 1 second), there is
|
745
|
+
little sense in fetching the results for "f", "fo", "foo", "foob", "fooba" and
|
746
|
+
finally "foobar". Instead, we can just fetch the results for "foobar". This
|
747
|
+
setting trades off some immediate responsiveness at the micro level for a
|
748
|
+
better search experience overall.
|
749
|
+
|
750
|
+
let g:CommandTFileScanner = 'watchman'
|
751
|
+
|
752
|
+
On a large hierarchy with of the order of 500,000 files, scanning a directory
|
753
|
+
tree with a tool like the `find` executable may take literally minutes with a
|
754
|
+
cold cache. Once the cache is warm, the same `find` run may take only a second
|
755
|
+
or two. Command-T provides a "find" scanner to leverage this performance, but
|
756
|
+
there is still massive overhead in passing the results through Vim internal
|
757
|
+
functions that apply 'wildignore' settings and such, so for truly immense
|
758
|
+
repos the "watchman" scanner is the tool of choice.
|
759
|
+
|
760
|
+
This scanner delegates the task of finding files to Facebook's `watchman` tool
|
761
|
+
(https://github.com/facebook/watchman), which can return results for a 500,000
|
762
|
+
file hierarchy within about 10 seconds.
|
763
|
+
|
764
|
+
Note that Watchman has a range of configuration options that can be applied by
|
765
|
+
files such as `/etc/watchman.json` or per-direcory `.watchmanconfig` files and
|
766
|
+
which may affect how Command-T works. For example, if your configuration has a
|
767
|
+
`root_restrict_files` setting that makes Watchman only work with roots that
|
768
|
+
look like Git or Mercurial repos, then Command-T will fall back to using the
|
769
|
+
"find" scanner any time you invoke it on a non-repo directory. For
|
770
|
+
simplicity's sake, it is probably a good idea to use Vim and Command-T
|
771
|
+
anchored at the root level of your repository in any case.
|
772
|
+
|
773
|
+
let g:CommandTMaxCachedDirectories = 10
|
774
|
+
|
775
|
+
Command-T will internally cache up to 10 different directories, so even if you
|
776
|
+
|cd| repeatedly, it should only need to scan each directory once.
|
777
|
+
|
778
|
+
It's advisable to keep a long-running Vim instance in place and let it cache
|
779
|
+
the directory listings rather than repeatedly closing and re-opening Vim in
|
780
|
+
order to edit every file. On those occasions when you do need to flush the
|
781
|
+
cache (ie. with |CommandTFlush| or <C-f> in the match listing window), use of
|
782
|
+
the Watchman scanner should make the delay tolerable.
|
783
|
+
|
784
|
+
As noted in the introduction, Command-T works best when you adopt a
|
785
|
+
"path-centric" mentality. This is especially true on very large hierarchies.
|
786
|
+
For example, if you're looking for a file at:
|
787
|
+
|
788
|
+
lib/third-party/adapters/restful-services/foobar/foobar-manager.js
|
789
|
+
|
790
|
+
you'll be able to narrow your search results down more narrowly if you search
|
791
|
+
with a query like "librestfoofooman" than "foobar-manager.js". This evidently
|
792
|
+
requires that you know where the file you're wanting to open exists, but
|
793
|
+
again, this is a concious design decision: Command-T is made to enable people
|
794
|
+
who know what they want to open and where it is to open it as quickly as
|
795
|
+
possible; other tools such as NERDTree exist for visually exploring an unknown
|
796
|
+
hierarchy.
|
797
|
+
|
798
|
+
Finally, it is important to be on a relatively recent version of Command-T to
|
799
|
+
fully benefit from the available performance enhancements:
|
800
|
+
|
801
|
+
- version 1.7 (February 2014) added the |g:CommandTInputDebounce| and
|
802
|
+
|g:CommandTFileScanner| settings, along with support for the Watchman file
|
803
|
+
scanner
|
804
|
+
- version 1.6 (December 2013) added parallelized search
|
805
|
+
- version 1.5 (September 2013) added memoization to the matching algorithm,
|
806
|
+
improving general performance on large hierarchies, but delivering
|
807
|
+
spectacular gains on hierarchies with "pathological" characteristics that
|
808
|
+
lead the algorithm to exhibit degenerate behavior
|
809
|
+
|
674
810
|
AUTHORS *command-t-authors*
|
675
811
|
|
676
812
|
Command-T is written and maintained by Wincent Colaiuta <win@wincent.com>.
|
677
813
|
Other contributors that have submitted patches include (in alphabetical
|
678
814
|
order):
|
679
815
|
|
680
|
-
Andy Waite
|
681
|
-
Anthony Panozzo
|
682
|
-
Daniel Hahler
|
683
|
-
Felix Tjandrawibawa
|
684
|
-
Gary Bernhardt
|
685
|
-
Ivan Ukhov
|
686
|
-
Jeff Kreeftmeijer
|
687
|
-
Lucas de Vries
|
688
|
-
Marcus Brito
|
689
|
-
Marian Schubert
|
816
|
+
Andy Waite Mike Lundy Shlomi Fish
|
817
|
+
Anthony Panozzo Nadav Samet Steven Moazami
|
818
|
+
Daniel Hahler Nate Kane Sung Pae
|
819
|
+
Felix Tjandrawibawa Nicholas Alpi Thomas Pelletier
|
820
|
+
Gary Bernhardt Noon Silk Victor Hugo Borja
|
821
|
+
Ivan Ukhov Paul Jolly Vít Ondruch
|
822
|
+
Jeff Kreeftmeijer Pavel Sergeev Woody Peterson
|
823
|
+
Lucas de Vries Rainux Luo Yan Pritzker
|
824
|
+
Marcus Brito Scott Bronson Yiding Jia
|
825
|
+
Marian Schubert Seth Fowler Zak Johnson
|
826
|
+
Matthew Todd
|
690
827
|
|
691
828
|
As this was the first Vim plug-in I had ever written I was heavily influenced
|
692
829
|
by the design of the LustyExplorer plug-in by Stephen Bach, which I understand
|
@@ -764,7 +901,7 @@ PayPal to win@wincent.com:
|
|
764
901
|
|
765
902
|
LICENSE *command-t-license*
|
766
903
|
|
767
|
-
Copyright 2010-
|
904
|
+
Copyright 2010-2014 Wincent Colaiuta. All rights reserved.
|
768
905
|
|
769
906
|
Redistribution and use in source and binary forms, with or without
|
770
907
|
modification, are permitted provided that the following conditions are met:
|
@@ -789,6 +926,17 @@ POSSIBILITY OF SUCH DAMAGE.
|
|
789
926
|
|
790
927
|
HISTORY *command-t-history*
|
791
928
|
|
929
|
+
1.7 (9 March 2014)
|
930
|
+
|
931
|
+
- added |g:CommandTInputDebounce|, which can be used to improve responsiveness
|
932
|
+
in large file hierarchies (based on patch from Yiding Jia)
|
933
|
+
- added a potentially faster file scanner which uses the `find` executable
|
934
|
+
(based on patch from Yiding Jia)
|
935
|
+
- added a file scanner that knows how to talk to Watchman
|
936
|
+
(https://github.com/facebook/watchman)
|
937
|
+
- added |g:CommandTFileScanner|, which can be used to switch file scanners
|
938
|
+
- fix processor count detection on some platforms (patch from Pavel Sergeev)
|
939
|
+
|
792
940
|
1.6.1 (22 December 2013)
|
793
941
|
|
794
942
|
- defer processor count detection until runtime (makes it possible to sensibly
|
data/Rakefile
CHANGED
@@ -87,7 +87,6 @@ The general release sequence is:
|
|
87
87
|
rake gem
|
88
88
|
rake push
|
89
89
|
bundle exec rake upload:all
|
90
|
-
rake archive
|
91
90
|
|
92
91
|
Most of the Rake tasks run fine without Bundler, and in fact, we
|
93
92
|
don't want Bundler in the prerelease task because it will tamper
|
@@ -195,17 +194,6 @@ namespace :upload do
|
|
195
194
|
task :all => [ :s3, :vim ]
|
196
195
|
end
|
197
196
|
|
198
|
-
desc 'Add current vimball to releases branch'
|
199
|
-
task :archive => :vimball do
|
200
|
-
v = version # store version before switching branches
|
201
|
-
sh 'git stash && ' +
|
202
|
-
'git checkout releases && ' +
|
203
|
-
"git add command-t-#{v}.vba && " +
|
204
|
-
"git commit -s -m 'Add #{v} release vimball' && " +
|
205
|
-
'git checkout @{-1} && ' +
|
206
|
-
'git stash pop || true'
|
207
|
-
end
|
208
|
-
|
209
197
|
desc 'Create the ruby gem package'
|
210
198
|
task :gem => :check_tag do
|
211
199
|
sh "gem build command-t.gemspec"
|
data/doc/command-t.txt
CHANGED
@@ -11,12 +11,13 @@ CONTENTS *command-t-contents*
|
|
11
11
|
6. Commands |command-t-commands|
|
12
12
|
7. Mappings |command-t-mappings|
|
13
13
|
8. Options |command-t-options|
|
14
|
-
9.
|
15
|
-
10.
|
16
|
-
11.
|
17
|
-
12.
|
18
|
-
13.
|
19
|
-
14.
|
14
|
+
9. Tips |command-t-tips|
|
15
|
+
10. Authors |command-t-authors|
|
16
|
+
11. Development |command-t-development|
|
17
|
+
12. Website |command-t-website|
|
18
|
+
13. Donations |command-t-donations|
|
19
|
+
14. License |command-t-license|
|
20
|
+
15. History |command-t-history|
|
20
21
|
|
21
22
|
|
22
23
|
INTRODUCTION *command-t-intro*
|
@@ -50,7 +51,7 @@ installation at the operating system level, and a C compiler to build
|
|
50
51
|
the Ruby extension.
|
51
52
|
|
52
53
|
|
53
|
-
1. Vim compiled with Ruby support
|
54
|
+
1. Vim compiled with Ruby support ~
|
54
55
|
|
55
56
|
You can check for Ruby support by launching Vim with the --version switch:
|
56
57
|
|
@@ -81,7 +82,7 @@ include Ruby support, and is recommended over version 7.3 (which links against
|
|
81
82
|
Ruby 1.9, but apparently has some bugs that need to be resolved).
|
82
83
|
|
83
84
|
|
84
|
-
2. Ruby
|
85
|
+
2. Ruby ~
|
85
86
|
|
86
87
|
In addition to having Ruby support in Vim, your system itself must have a
|
87
88
|
compatible Ruby install. "Compatible" means the same version as Vim itself
|
@@ -114,7 +115,7 @@ If using RubyInstaller be sure to download the installer executable, not the
|
|
114
115
|
PATH" so that Vim can find them.
|
115
116
|
|
116
117
|
|
117
|
-
3. C compiler
|
118
|
+
3. C compiler ~
|
118
119
|
|
119
120
|
Part of Command-T is implemented in C as a Ruby extension for speed, allowing
|
120
121
|
it to work responsively even on directory hierarchies containing enormous
|
@@ -477,6 +478,36 @@ Following is a list of all available options:
|
|
477
478
|
If set to 0, the window will occupy as much of the available space as
|
478
479
|
needed to show matching entries.
|
479
480
|
|
481
|
+
*g:CommandTInputDebounce*
|
482
|
+
|g:CommandTInputDebounce| number (default: 50)
|
483
|
+
|
484
|
+
The number of milliseconds to wait before updating the match listing
|
485
|
+
following a key-press. This can be used to avoid wasteful recomputation
|
486
|
+
when making a rapid series of key-presses in a directory with many tens
|
487
|
+
(or hundreds) of thousands of files.
|
488
|
+
|
489
|
+
*g:CommandTFileScanner*
|
490
|
+
|g:CommandTFileScanner| string (default: 'ruby')
|
491
|
+
|
492
|
+
The underlying scanner implementation that should be used to explore the
|
493
|
+
filesystem. Possible values are:
|
494
|
+
|
495
|
+
- "ruby": uses built-in Ruby and should work everywhere, albeit slowly
|
496
|
+
on large (many tens of thousands of files) hierarchies.
|
497
|
+
|
498
|
+
- "find": uses the command-line tool of the same name, which can be much
|
499
|
+
faster on large projects because it is written in pure C, but may not
|
500
|
+
work on systems without the tool or with an incompatible version of
|
501
|
+
the tool.
|
502
|
+
|
503
|
+
- "watchman": uses Watchman (https://github.com/facebook/watchman) if
|
504
|
+
available; otherwise falls back to "find". Note that this scanner is
|
505
|
+
intended for use with very large hierarchies (hundreds of thousands of
|
506
|
+
files) and so the task of deciding which files should be included is
|
507
|
+
entirely delegated to Watchman; this means that settings which
|
508
|
+
Command-T would usually consult, such as 'wildignore' and
|
509
|
+
|g:CommandTScanDotDirectories| are ignored.
|
510
|
+
|
480
511
|
*g:CommandTMinHeight*
|
481
512
|
|g:CommandTMinHeight| number (default: 0)
|
482
513
|
|
@@ -564,7 +595,7 @@ Following is a list of all available options:
|
|
564
595
|
|g:CommandTWildIgnore| string (default: none)
|
565
596
|
|
566
597
|
Optionally override Vim's global |'wildignore'| setting during Command-T
|
567
|
-
|
598
|
+
searches. If you wish to supplement rather than replace the global
|
568
599
|
setting, you can use a syntax like:
|
569
600
|
|
570
601
|
let g:CommandTWildIgnore=&wildignore . ",**/bower_components/*"
|
@@ -671,22 +702,128 @@ settings can be used to control behavior:
|
|
671
702
|
only during Command-T searches.
|
672
703
|
|
673
704
|
|
705
|
+
TIPS *command-t-tips*
|
706
|
+
|
707
|
+
Working with very large repositories ~
|
708
|
+
|
709
|
+
One of the primary motivations for writing Command-T was to get fast, robust
|
710
|
+
high-quality matches even on large hierarchies. The larger the hierarchy, the
|
711
|
+
more important having good file navigation becomes. This is why Command-T's
|
712
|
+
performance-critical sections are written in C. This requires a compilation
|
713
|
+
step and makes Command-T harder to install than similar plug-ins which are
|
714
|
+
written in pure Vimscript, and can be a disincentive against use. This is a
|
715
|
+
conscious trade-off; the goal isn't to have as many users as possible, but
|
716
|
+
rather to provide the best performance at the highest quality.
|
717
|
+
|
718
|
+
The speed of the core is high enough that Command-T can afford to burn a bunch
|
719
|
+
of extra cycles -- using its recursive matching algorithm -- looking for a
|
720
|
+
higher-quality, more intuitive ranking of search results. Again, the larger
|
721
|
+
the hierarchy, the more important the quality of result ranking becomes.
|
722
|
+
|
723
|
+
Nevertheless, for extremely large hierarchies (of the order of 500,000 files)
|
724
|
+
some tuning is required in order to get useful and usable performance levels.
|
725
|
+
Here are some useful example settings:
|
726
|
+
|
727
|
+
let g:CommandTMaxHeight = 30
|
728
|
+
|
729
|
+
You want the match listing window to be large enough that you can get useful
|
730
|
+
feedback about how your search query is going; in large hierarchies there may
|
731
|
+
be many, many matches for a given query. At the same time, you don't want Vim
|
732
|
+
wasting valuable cycles repainting a large portion of the screen area,
|
733
|
+
especially on a large display. Setting the limit to 30 or similar is a
|
734
|
+
reasonable compromise.
|
735
|
+
|
736
|
+
let g:CommandTMaxFiles = 500000
|
737
|
+
|
738
|
+
The default limit of 30,000 files prevents Command-T from "seeing" many of the
|
739
|
+
files in a large directory hierarchy so you need to increase this limit.
|
740
|
+
|
741
|
+
let g:CommandTInputDebounce = 200
|
742
|
+
|
743
|
+
Wait for 200ms of keyboard inactivity before computing search results. For
|
744
|
+
example, if you are enter "foobar" quickly (ie. within 1 second), there is
|
745
|
+
little sense in fetching the results for "f", "fo", "foo", "foob", "fooba" and
|
746
|
+
finally "foobar". Instead, we can just fetch the results for "foobar". This
|
747
|
+
setting trades off some immediate responsiveness at the micro level for a
|
748
|
+
better search experience overall.
|
749
|
+
|
750
|
+
let g:CommandTFileScanner = 'watchman'
|
751
|
+
|
752
|
+
On a large hierarchy with of the order of 500,000 files, scanning a directory
|
753
|
+
tree with a tool like the `find` executable may take literally minutes with a
|
754
|
+
cold cache. Once the cache is warm, the same `find` run may take only a second
|
755
|
+
or two. Command-T provides a "find" scanner to leverage this performance, but
|
756
|
+
there is still massive overhead in passing the results through Vim internal
|
757
|
+
functions that apply 'wildignore' settings and such, so for truly immense
|
758
|
+
repos the "watchman" scanner is the tool of choice.
|
759
|
+
|
760
|
+
This scanner delegates the task of finding files to Facebook's `watchman` tool
|
761
|
+
(https://github.com/facebook/watchman), which can return results for a 500,000
|
762
|
+
file hierarchy within about 10 seconds.
|
763
|
+
|
764
|
+
Note that Watchman has a range of configuration options that can be applied by
|
765
|
+
files such as `/etc/watchman.json` or per-direcory `.watchmanconfig` files and
|
766
|
+
which may affect how Command-T works. For example, if your configuration has a
|
767
|
+
`root_restrict_files` setting that makes Watchman only work with roots that
|
768
|
+
look like Git or Mercurial repos, then Command-T will fall back to using the
|
769
|
+
"find" scanner any time you invoke it on a non-repo directory. For
|
770
|
+
simplicity's sake, it is probably a good idea to use Vim and Command-T
|
771
|
+
anchored at the root level of your repository in any case.
|
772
|
+
|
773
|
+
let g:CommandTMaxCachedDirectories = 10
|
774
|
+
|
775
|
+
Command-T will internally cache up to 10 different directories, so even if you
|
776
|
+
|cd| repeatedly, it should only need to scan each directory once.
|
777
|
+
|
778
|
+
It's advisable to keep a long-running Vim instance in place and let it cache
|
779
|
+
the directory listings rather than repeatedly closing and re-opening Vim in
|
780
|
+
order to edit every file. On those occasions when you do need to flush the
|
781
|
+
cache (ie. with |CommandTFlush| or <C-f> in the match listing window), use of
|
782
|
+
the Watchman scanner should make the delay tolerable.
|
783
|
+
|
784
|
+
As noted in the introduction, Command-T works best when you adopt a
|
785
|
+
"path-centric" mentality. This is especially true on very large hierarchies.
|
786
|
+
For example, if you're looking for a file at:
|
787
|
+
|
788
|
+
lib/third-party/adapters/restful-services/foobar/foobar-manager.js
|
789
|
+
|
790
|
+
you'll be able to narrow your search results down more narrowly if you search
|
791
|
+
with a query like "librestfoofooman" than "foobar-manager.js". This evidently
|
792
|
+
requires that you know where the file you're wanting to open exists, but
|
793
|
+
again, this is a concious design decision: Command-T is made to enable people
|
794
|
+
who know what they want to open and where it is to open it as quickly as
|
795
|
+
possible; other tools such as NERDTree exist for visually exploring an unknown
|
796
|
+
hierarchy.
|
797
|
+
|
798
|
+
Finally, it is important to be on a relatively recent version of Command-T to
|
799
|
+
fully benefit from the available performance enhancements:
|
800
|
+
|
801
|
+
- version 1.7 (February 2014) added the |g:CommandTInputDebounce| and
|
802
|
+
|g:CommandTFileScanner| settings, along with support for the Watchman file
|
803
|
+
scanner
|
804
|
+
- version 1.6 (December 2013) added parallelized search
|
805
|
+
- version 1.5 (September 2013) added memoization to the matching algorithm,
|
806
|
+
improving general performance on large hierarchies, but delivering
|
807
|
+
spectacular gains on hierarchies with "pathological" characteristics that
|
808
|
+
lead the algorithm to exhibit degenerate behavior
|
809
|
+
|
674
810
|
AUTHORS *command-t-authors*
|
675
811
|
|
676
812
|
Command-T is written and maintained by Wincent Colaiuta <win@wincent.com>.
|
677
813
|
Other contributors that have submitted patches include (in alphabetical
|
678
814
|
order):
|
679
815
|
|
680
|
-
Andy Waite
|
681
|
-
Anthony Panozzo
|
682
|
-
Daniel Hahler
|
683
|
-
Felix Tjandrawibawa
|
684
|
-
Gary Bernhardt
|
685
|
-
Ivan Ukhov
|
686
|
-
Jeff Kreeftmeijer
|
687
|
-
Lucas de Vries
|
688
|
-
Marcus Brito
|
689
|
-
Marian Schubert
|
816
|
+
Andy Waite Mike Lundy Shlomi Fish
|
817
|
+
Anthony Panozzo Nadav Samet Steven Moazami
|
818
|
+
Daniel Hahler Nate Kane Sung Pae
|
819
|
+
Felix Tjandrawibawa Nicholas Alpi Thomas Pelletier
|
820
|
+
Gary Bernhardt Noon Silk Victor Hugo Borja
|
821
|
+
Ivan Ukhov Paul Jolly Vít Ondruch
|
822
|
+
Jeff Kreeftmeijer Pavel Sergeev Woody Peterson
|
823
|
+
Lucas de Vries Rainux Luo Yan Pritzker
|
824
|
+
Marcus Brito Scott Bronson Yiding Jia
|
825
|
+
Marian Schubert Seth Fowler Zak Johnson
|
826
|
+
Matthew Todd
|
690
827
|
|
691
828
|
As this was the first Vim plug-in I had ever written I was heavily influenced
|
692
829
|
by the design of the LustyExplorer plug-in by Stephen Bach, which I understand
|
@@ -764,7 +901,7 @@ PayPal to win@wincent.com:
|
|
764
901
|
|
765
902
|
LICENSE *command-t-license*
|
766
903
|
|
767
|
-
Copyright 2010-
|
904
|
+
Copyright 2010-2014 Wincent Colaiuta. All rights reserved.
|
768
905
|
|
769
906
|
Redistribution and use in source and binary forms, with or without
|
770
907
|
modification, are permitted provided that the following conditions are met:
|
@@ -789,6 +926,17 @@ POSSIBILITY OF SUCH DAMAGE.
|
|
789
926
|
|
790
927
|
HISTORY *command-t-history*
|
791
928
|
|
929
|
+
1.7 (9 March 2014)
|
930
|
+
|
931
|
+
- added |g:CommandTInputDebounce|, which can be used to improve responsiveness
|
932
|
+
in large file hierarchies (based on patch from Yiding Jia)
|
933
|
+
- added a potentially faster file scanner which uses the `find` executable
|
934
|
+
(based on patch from Yiding Jia)
|
935
|
+
- added a file scanner that knows how to talk to Watchman
|
936
|
+
(https://github.com/facebook/watchman)
|
937
|
+
- added |g:CommandTFileScanner|, which can be used to switch file scanners
|
938
|
+
- fix processor count detection on some platforms (patch from Pavel Sergeev)
|
939
|
+
|
792
940
|
1.6.1 (22 December 2013)
|
793
941
|
|
794
942
|
- defer processor count detection until runtime (makes it possible to sensibly
|