command-t 1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/Rakefile ADDED
@@ -0,0 +1,217 @@
1
+ require 'yaml'
2
+
3
+ def bail_on_failure
4
+ exitstatus = $?.exitstatus
5
+ if exitstatus != 0
6
+ err "last command failed with exit status #{exitstatus}"
7
+ exit 1
8
+ end
9
+ end
10
+
11
+ def version
12
+ `git describe`.chomp
13
+ end
14
+
15
+ def rubygems_version
16
+ # RubyGems will barf if we try to pass an intermediate version number
17
+ # like "1.1b2-10-g61a374a", so no choice but to abbreviate it
18
+ `git describe --abbrev=0`.chomp
19
+ end
20
+
21
+ def yellow
22
+ "\033[33m"
23
+ end
24
+
25
+ def red
26
+ "\033[31m"
27
+ end
28
+
29
+ def clear
30
+ "\033[0m"
31
+ end
32
+
33
+ def warn str
34
+ puts "#{yellow}warning: #{str}#{clear}"
35
+ end
36
+
37
+ def err str
38
+ puts "#{red}error: #{str}#{clear}"
39
+ end
40
+
41
+ def prepare_release_notes
42
+ # extract base release notes from README.txt HISTORY section
43
+ File.open('.release-notes.txt', 'w') do |out|
44
+ lines = File.readlines('README.txt').each { |line| line.chomp! }
45
+ while line = lines.shift do
46
+ next unless line =~ /^HISTORY +\*command-t-history\*$/
47
+ break unless lines.shift == '' &&
48
+ (line = lines.shift) && line =~ /^\d\.\d/ &&
49
+ lines.shift == ''
50
+ while line = lines.shift and line != ''
51
+ out.puts line
52
+ end
53
+ break
54
+ end
55
+ out.puts ''
56
+ out.puts '# Please edit the release notes to taste.'
57
+ out.puts '# Blank lines and lines beginning with a hash will be removed.'
58
+ out.puts '# To abort, exit your editor with a non-zero exit status (:cquit in Vim).'
59
+ end
60
+
61
+ unless system "$EDITOR .release-notes.txt"
62
+ err "editor exited with non-zero exit status; aborting"
63
+ exit 1
64
+ end
65
+
66
+ filtered = read_release_notes
67
+ File.open('.release-notes.txt', 'w') do |out|
68
+ out.print filtered
69
+ end
70
+ end
71
+
72
+ def read_release_notes
73
+ File.readlines('.release-notes.txt').reject do |line|
74
+ line =~ /^(#.*|\s*)$/ # filter comment lines and blank lines
75
+ end.join
76
+ end
77
+
78
+ task :default => :spec
79
+
80
+ desc 'Print help on preparing a release'
81
+ task :help do
82
+ puts <<-END
83
+
84
+ The general release sequence is:
85
+
86
+ rake prerelease
87
+ bin/rake upload:all
88
+ rake archive
89
+
90
+ Most of the Rake tasks run fine without Bundler, and in fact, we
91
+ don't want Bundler in the prerelease task because it will tamper
92
+ with the environment in a way that breaks multiruby.
93
+
94
+ We use Bundler for the upload task because the www.vim.org
95
+ uploader uses Bundler to ensure that the Mechanize gem is available.
96
+
97
+ END
98
+ end
99
+
100
+ task :check_bundler do
101
+ unless ENV.has_key? 'BUNDLE_GEMFILE'
102
+ warn 'warning: Bundler is not loaded; try running with bin/rake'
103
+ end
104
+ end
105
+
106
+ desc 'Run specs'
107
+ task :spec do
108
+ system 'bin/rspec spec'
109
+ bail_on_failure
110
+ end
111
+
112
+ desc 'Create vimball archive'
113
+ task :vimball => :check_tag do
114
+ system 'make'
115
+ bail_on_failure
116
+ FileUtils.cp 'command-t.vba', "command-t-#{version}.vba"
117
+ end
118
+
119
+ desc 'Clean compiled products'
120
+ task :clean do
121
+ Dir.chdir 'ruby/command-t' do
122
+ system 'make clean'
123
+ end
124
+ end
125
+
126
+ desc 'Clobber all generated files'
127
+ task :clobber => :clean do
128
+ system 'make clean'
129
+ end
130
+
131
+ desc 'Compile extension'
132
+ task :make do
133
+ Dir.chdir 'ruby/command-t' do
134
+ ruby 'extconf.rb'
135
+ system 'make clean && make'
136
+ bail_on_failure
137
+ end
138
+ end
139
+
140
+ namespace :make do
141
+ desc 'Compile under all multiruby versions'
142
+ task :all do
143
+ system './compile-test.sh'
144
+ bail_on_failure
145
+ end
146
+ end
147
+
148
+ namespace :spec do
149
+ desc 'Run specs under all multiruby versions'
150
+ task :all do
151
+ system './multi-spec.sh'
152
+ bail_on_failure
153
+ end
154
+ end
155
+
156
+ desc 'Check that the current HEAD is tagged'
157
+ task :check_tag do
158
+ unless system 'git describe --exact-match HEAD 2> /dev/null'
159
+ warn 'current HEAD is not tagged'
160
+ end
161
+ end
162
+
163
+ desc 'Run checks prior to release'
164
+ task :prerelease => ['make:all', 'spec:all', :vimball, :check_tag]
165
+
166
+ namespace :upload do
167
+ desc 'Upload current vimball to Amazon S3'
168
+ task :s3 => :vimball do
169
+ sh 'aws put ' +
170
+ "s3.wincent.com/command-t/releases/command-t-#{version}.vba " +
171
+ "command-t-#{version}.vba"
172
+ sh 'aws put ' +
173
+ "s3.wincent.com/command-t/releases/command-t-#{version}.vba?acl " +
174
+ '--public'
175
+ end
176
+
177
+ desc 'Upload current vimball to www.vim.org'
178
+ task :vim => [:check_bundler, :vimball] do
179
+ prepare_release_notes
180
+ sh "vendor/vimscriptuploader/vimscriptuploader.rb \
181
+ --id 3025 \
182
+ --file command-t-#{version}.vba \
183
+ --message-file .release-notes.txt \
184
+ --version #{version} \
185
+ --config ~/.vim_org.yml \
186
+ .vim_org.yml"
187
+ end
188
+
189
+ desc 'Upload current vimball everywhere'
190
+ task :all => [ :s3, :vim ]
191
+ end
192
+
193
+ desc 'Add current vimball to releases branch'
194
+ task :archive => :vimball do
195
+ v = version # store version before switching branches
196
+ sh 'git stash && ' +
197
+ 'git checkout releases && ' +
198
+ "git add command-t-#{v}.vba && " +
199
+ "git commit -s -m 'Add #{v} release vimball' && " +
200
+ 'git checkout @{-1} && ' +
201
+ 'git stash pop || true'
202
+ end
203
+
204
+ desc 'Create the ruby gem package'
205
+ task :gem => :check_tag do
206
+ sh "gem build command-t.gemspec"
207
+ end
208
+
209
+ desc 'Push gem to Gemcutter ("gem push")'
210
+ task :push => :gem do
211
+ sh "gem push command-t-#{rubygems_version}.gem"
212
+ end
213
+
214
+ desc 'Install the command-t ruby gem'
215
+ task :install => :gem do
216
+ sh "gem install command-t-#{rubygems_version}.gem"
217
+ end
data/doc/README.txt ADDED
@@ -0,0 +1,779 @@
1
+ *command-t.txt* Command-T plug-in for Vim *command-t*
2
+
3
+ CONTENTS *command-t-contents*
4
+
5
+ 1. Introduction |command-t-intro|
6
+ 2. Requirements |command-t-requirements|
7
+ 3. Installation |command-t-installation|
8
+ 3. Managing using Pathogen |command-t-pathogen|
9
+ 4. Trouble-shooting |command-t-trouble-shooting|
10
+ 5. Usage |command-t-usage|
11
+ 6. Commands |command-t-commands|
12
+ 7. Mappings |command-t-mappings|
13
+ 8. Options |command-t-options|
14
+ 9. Authors |command-t-authors|
15
+ 10. Website |command-t-website|
16
+ 11. Donations |command-t-donations|
17
+ 12. License |command-t-license|
18
+ 13. History |command-t-history|
19
+
20
+
21
+ INTRODUCTION *command-t-intro*
22
+
23
+ The Command-T plug-in provides an extremely fast, intuitive mechanism for
24
+ opening files and buffers with a minimal number of keystrokes. It's named
25
+ "Command-T" because it is inspired by the "Go to File" window bound to
26
+ Command-T in TextMate.
27
+
28
+ Files are selected by typing characters that appear in their paths, and are
29
+ ordered by an algorithm which knows that characters that appear in certain
30
+ locations (for example, immediately after a path separator) should be given
31
+ more weight.
32
+
33
+ To search efficiently, especially in large projects, you should adopt a
34
+ "path-centric" rather than a "filename-centric" mentality. That is you should
35
+ think more about where the desired file is found rather than what it is
36
+ called. This means narrowing your search down by including some characters
37
+ from the upper path components rather than just entering characters from the
38
+ filename itself.
39
+
40
+ Screencasts demonstrating the plug-in can be viewed at:
41
+
42
+ https://wincent.com/products/command-t
43
+
44
+
45
+ REQUIREMENTS *command-t-requirements*
46
+
47
+ The plug-in requires Vim compiled with Ruby support, a compatible Ruby
48
+ installation at the operating system level, and a C compiler to build
49
+ the Ruby extension.
50
+
51
+
52
+ 1. Vim compiled with Ruby support
53
+
54
+ You can check for Ruby support by launching Vim with the --version switch:
55
+
56
+ vim --version
57
+
58
+ If "+ruby" appears in the version information then your version of Vim has
59
+ Ruby support.
60
+
61
+ Another way to check is to simply try using the :ruby command from within Vim
62
+ itself:
63
+
64
+ :ruby 1
65
+
66
+ If your Vim lacks support you'll see an error message like this:
67
+
68
+ E319: Sorry, the command is not available in this version
69
+
70
+ The version of Vim distributed with Mac OS X does not include Ruby support,
71
+ while MacVim does; it is available from:
72
+
73
+ http://github.com/b4winckler/macvim/downloads
74
+
75
+ For Windows users, the Vim 7.2 executable available from www.vim.org does
76
+ include Ruby support, and is recommended over version 7.3 (which links against
77
+ Ruby 1.9, but apparently has some bugs that need to be resolved).
78
+
79
+
80
+ 2. Ruby
81
+
82
+ In addition to having Ruby support in Vim, your system itself must have a
83
+ compatible Ruby install. "Compatible" means the same version as Vim itself
84
+ links against. If you use a different version then Command-T is unlikely
85
+ to work (see TROUBLE-SHOOTING below).
86
+
87
+ On Mac OS X Snow Leopard, the system comes with Ruby 1.8.7 and all recent
88
+ versions of MacVim (the 7.2 snapshots and 7.3) are linked against it.
89
+
90
+ On Linux and similar platforms, the linked version of Ruby will depend on
91
+ your distribution. You can usually find this out by examining the
92
+ compilation and linking flags displayed by the |:version| command in Vim, and
93
+ by looking at the output of:
94
+
95
+ :ruby puts RUBY_VERSION
96
+
97
+ A suitable Ruby environment for Windows can be installed using the Ruby
98
+ 1.8.7-p299 RubyInstaller available at:
99
+
100
+ http://rubyinstaller.org/downloads/archives
101
+
102
+ If using RubyInstaller be sure to download the installer executable, not the
103
+ 7-zip archive. When installing mark the checkbox "Add Ruby executables to your
104
+ PATH" so that Vim can find them.
105
+
106
+
107
+ 3. C compiler
108
+
109
+ Part of Command-T is implemented in C as a Ruby extension for speed, allowing
110
+ it to work responsively even on directory hierarchies containing enormous
111
+ numbers of files. As such, a C compiler is required in order to build the
112
+ extension and complete the installation.
113
+
114
+ On Mac OS X, this can be obtained by installing the Xcode Tools that come on
115
+ the Mac OS X install disc.
116
+
117
+ On Windows, the RubyInstaller Development Kit can be used to conveniently
118
+ install the necessary tool chain:
119
+
120
+ http://rubyinstaller.org/downloads/archives
121
+
122
+ At the time of writing, the appropriate development kit for use with Ruby
123
+ 1.8.7 is DevKit-3.4.5r3-20091110.
124
+
125
+ To use the Development Kit extract the archive contents to your C:\Ruby
126
+ folder.
127
+
128
+
129
+ INSTALLATION *command-t-installation*
130
+
131
+ Command-T is distributed as a "vimball" which means that it can be installed
132
+ by opening it in Vim and then sourcing it:
133
+
134
+ :e command-t.vba
135
+ :so %
136
+
137
+ The files will be installed in your |'runtimepath'|. To check where this is
138
+ you can issue:
139
+
140
+ :echo &rtp
141
+
142
+ The C extension must then be built, which can be done from the shell. If you
143
+ use a typical |'runtimepath'| then the files were installed inside ~/.vim and
144
+ you can build the extension with:
145
+
146
+ cd ~/.vim/ruby/command-t
147
+ ruby extconf.rb
148
+ make
149
+
150
+ Note: If you are an RVM user, you must perform the build using the same
151
+ version of Ruby that Vim itself is linked against. This will often be the
152
+ system Ruby, which can be selected before issuing the "make" command with:
153
+
154
+ rvm use system
155
+
156
+
157
+ MANAGING USING PATHOGEN *command-t-pathogen*
158
+
159
+ Pathogen is a plugin that allows you to maintain plugin installations in
160
+ separate, isolated subdirectories under the "bundle" directory in your
161
+ |'runtimepath'|. The following examples assume that you already have
162
+ Pathogen installed and configured, and that you are installing into
163
+ ~/.vim/bundle. For more information about Pathogen, see:
164
+
165
+ http://www.vim.org/scripts/script.php?script_id=2332
166
+
167
+ If you manage your entire ~/.vim folder using Git then you can add the
168
+ Command-T repository as a submodule:
169
+
170
+ cd ~/.vim
171
+ git submodule add git://git.wincent.com/command-t.git bundle/command-t
172
+ git submodule init
173
+
174
+ Or if you just wish to do a simple clone instead of using submodules:
175
+
176
+ cd ~/.vim
177
+ git clone git://git.wincent.com/command-t.git bundle/command-t
178
+
179
+ Once you have a local copy of the repository you can update it at any time
180
+ with:
181
+
182
+ cd ~/.vim/bundle/command-t
183
+ git pull
184
+
185
+ Or you can switch to a specific release with:
186
+
187
+ cd ~/.vim/bundle/command-t
188
+ git checkout 0.8b
189
+
190
+ After installing or updating you must build the extension:
191
+
192
+ cd ~/.vim/bundle/command-t
193
+ rake make
194
+
195
+ While the Vimball installation automatically generates the help tags, under
196
+ Pathogen it is necessary to do so explicitly from inside Vim:
197
+
198
+ :call pathogen#helptags()
199
+
200
+
201
+ TROUBLE-SHOOTING *command-t-trouble-shooting*
202
+
203
+ Most installation problems are caused by a mismatch between the version of
204
+ Ruby on the host operating system, and the version of Ruby that Vim itself
205
+ linked against at compile time. For example, if one is 32-bit and the other is
206
+ 64-bit, or one is from the Ruby 1.9 series and the other is from the 1.8
207
+ series, then the plug-in is not likely to work.
208
+
209
+ As such, on Mac OS X, I recommend using the standard Ruby that comes with the
210
+ system (currently 1.8.7) along with the latest version of MacVim (currently
211
+ version 7.3). If you wish to use custom builds of Ruby or of MacVim (not
212
+ recommmended) then you will have to take extra care to ensure that the exact
213
+ same Ruby environment is in effect when building Ruby, Vim and the Command-T
214
+ extension.
215
+
216
+ For Windows, the following combination is known to work:
217
+
218
+ - Vim 7.2 from http://www.vim.org/download.php:
219
+ ftp://ftp.vim.org/pub/vim/pc/gvim72.exe
220
+ - Ruby 1.8.7-p299 from http://rubyinstaller.org/downloads/archives:
221
+ http://rubyforge.org/frs/download.php/71492/rubyinstaller-1.8.7-p299.exe
222
+ - DevKit 3.4.5r3-20091110 from http://rubyinstaller.org/downloads/archives:
223
+ http://rubyforge.org/frs/download.php/66888/devkit-3.4.5r3-20091110.7z
224
+
225
+ If a problem occurs the first thing you should do is inspect the output of:
226
+
227
+ ruby extconf.rb
228
+ make
229
+
230
+ During the installation, and:
231
+
232
+ vim --version
233
+
234
+ And compare the compilation and linker flags that were passed to the
235
+ extension and to Vim itself when they were built. If the Ruby-related
236
+ flags or architecture flags are different then it is likely that something
237
+ has changed in your Ruby environment and the extension may not work until
238
+ you eliminate the discrepancy.
239
+
240
+
241
+ USAGE *command-t-usage*
242
+
243
+ Bring up the Command-T file window by typing:
244
+
245
+ <Leader>t
246
+
247
+ This mapping is set up automatically for you, provided you do not already have
248
+ a mapping for <Leader>t or |:CommandT|. You can also bring up the file window
249
+ by issuing the command:
250
+
251
+ :CommandT
252
+
253
+ A prompt will appear at the bottom of the screen along with a file window
254
+ showing all of the files in the current directory (as returned by the
255
+ |:pwd| command).
256
+
257
+ For the most efficient file navigation within a project it's recommended that
258
+ you |:cd| into the root directory of your project when starting to work on it.
259
+ If you wish to open a file from outside of the project folder you can pass in
260
+ an optional path argument (relative or absolute) to |:CommandT|:
261
+
262
+ :CommandT ../path/to/other/files
263
+
264
+ Type letters in the prompt to narrow down the selection, showing only the
265
+ files whose paths contain those letters in the specified order. Letters do not
266
+ need to appear consecutively in a path in order for it to be classified as a
267
+ match.
268
+
269
+ Once the desired file has been selected it can be opened by pressing <CR>.
270
+ (By default files are opened in the current window, but there are other
271
+ mappings that you can use to open in a vertical or horizontal split, or in
272
+ a new tab.) Note that if you have |'nohidden'| set and there are unsaved
273
+ changes in the current window when you press <CR> then opening in the current
274
+ window would fail; in this case Command-T will open the file in a new split.
275
+
276
+ The following mappings are active when the prompt has focus:
277
+
278
+ <BS> delete the character to the left of the cursor
279
+ <Del> delete the character at the cursor
280
+ <Left> move the cursor one character to the left
281
+ <C-h> move the cursor one character to the left
282
+ <Right> move the cursor one character to the right
283
+ <C-l> move the cursor one character to the right
284
+ <C-a> move the cursor to the start (left)
285
+ <C-e> move the cursor to the end (right)
286
+ <C-u> clear the contents of the prompt
287
+ <Tab> change focus to the file listing
288
+
289
+ The following mappings are active when the file listing has focus:
290
+
291
+ <Tab> change focus to the prompt
292
+
293
+ The following mappings are active when either the prompt or the file listing
294
+ has focus:
295
+
296
+ <CR> open the selected file
297
+ <C-CR> open the selected file in a new split window
298
+ <C-s> open the selected file in a new split window
299
+ <C-v> open the selected file in a new vertical split window
300
+ <C-t> open the selected file in a new tab
301
+ <C-j> select next file in the file listing
302
+ <C-n> select next file in the file listing
303
+ <Down> select next file in the file listing
304
+ <C-k> select previous file in the file listing
305
+ <C-p> select previous file in the file listing
306
+ <Up> select previous file in the file listing
307
+ <C-c> cancel (dismisses file listing)
308
+
309
+ The following is also available on terminals which support it:
310
+
311
+ <Esc> cancel (dismisses file listing)
312
+
313
+ Note that the default mappings can be overriden by setting options in your
314
+ ~/.vimrc file (see the OPTIONS section for a full list of available options).
315
+
316
+ In addition, when the file listing has focus, typing a character will cause
317
+ the selection to jump to the first path which begins with that character.
318
+ Typing multiple characters consecutively can be used to distinguish between
319
+ paths which begin with the same prefix.
320
+
321
+
322
+ COMMANDS *command-t-commands*
323
+
324
+ *:CommandT*
325
+ |:CommandT| Brings up the Command-T file window, starting in the
326
+ current working directory as returned by the|:pwd|
327
+ command.
328
+
329
+ *:CommandTBuffer*
330
+ |:CommandTBuffer|Brings up the Command-T buffer window.
331
+ This works exactly like the standard file window,
332
+ except that the selection is limited to files that
333
+ you already have open in buffers.
334
+
335
+ *:CommandTFlush*
336
+ |:CommandTFlush|Instructs the plug-in to flush its path cache, causing
337
+ the directory to be rescanned for new or deleted paths
338
+ the next time the file window is shown. In addition, all
339
+ configuration settings are re-evaluated, causing any
340
+ changes made to settings via the |:let| command to be picked
341
+ up.
342
+
343
+
344
+ MAPPINGS *command-t-mappings*
345
+
346
+ By default Command-T comes with only two mappings:
347
+
348
+ <Leader>t bring up the Command-T file window
349
+ <Leader>b bring up the Command-T buffer window
350
+
351
+ However, Command-T won't overwrite a pre-existing mapping so if you prefer
352
+ to define different mappings use lines like these in your ~/.vimrc:
353
+
354
+ nmap <silent> <Leader>t :CommandT<CR>
355
+ nmap <silent> <Leader>b :CommandTBuffer<CR>
356
+
357
+ Replacing "<Leader>t" or "<Leader>b" with your mapping of choice.
358
+
359
+ Note that in the case of MacVim you actually can map to Command-T (written
360
+ as <D-t> in Vim) in your ~/.gvimrc file if you first unmap the existing menu
361
+ binding of Command-T to "New Tab":
362
+
363
+ if has("gui_macvim")
364
+ macmenu &File.New\ Tab key=<nop>
365
+ map <D-t> :CommandT<CR>
366
+ endif
367
+
368
+ When the Command-T window is active a number of other additional mappings
369
+ become available for doing things like moving between and selecting matches.
370
+ These are fully described above in the USAGE section, and settings for
371
+ overriding the mappings are listed below under OPTIONS.
372
+
373
+
374
+ OPTIONS *command-t-options*
375
+
376
+ A number of options may be set in your ~/.vimrc to influence the behaviour of
377
+ the plug-in. To set an option, you include a line like this in your ~/.vimrc:
378
+
379
+ let g:CommandTMaxFiles=20000
380
+
381
+ To have Command-T pick up new settings immediately (that is, without having
382
+ to restart Vim) you can issue the |:CommandTFlush| command after making
383
+ changes via |:let|.
384
+
385
+ Following is a list of all available options:
386
+
387
+ *g:CommandTMaxFiles*
388
+ |g:CommandTMaxFiles| number (default 10000)
389
+
390
+ The maximum number of files that will be considered when scanning the
391
+ current directory. Upon reaching this number scanning stops. This
392
+ limit applies only to file listings and is ignored for buffer
393
+ listings.
394
+
395
+ *g:CommandTMaxDepth*
396
+ |g:CommandTMaxDepth| number (default 15)
397
+
398
+ The maximum depth (levels of recursion) to be explored when scanning the
399
+ current directory. Any directories at levels beyond this depth will be
400
+ skipped.
401
+
402
+ *g:CommandTMaxHeight*
403
+ |g:CommandTMaxHeight| number (default: 0)
404
+
405
+ The maximum height in lines the match window is allowed to expand to.
406
+ If set to 0, the window will occupy as much of the available space as
407
+ needed to show matching entries.
408
+
409
+ *g:CommandTAlwaysShowDotFiles*
410
+ |g:CommandTAlwaysShowDotFiles| boolean (default: 0)
411
+
412
+ When showing the file listing Command-T will by default show dot-files
413
+ only if the entered search string contains a dot that could cause a
414
+ dot-file to match. When set to a non-zero value, this setting instructs
415
+ Command-T to always include matching dot-files in the match list
416
+ regardless of whether the search string contains a dot. See also
417
+ |g:CommandTNeverShowDotFiles|. Note that this setting only influences
418
+ the file listing; the buffer listing treats dot-files like any other
419
+ file.
420
+
421
+ *g:CommandTNeverShowDotFiles*
422
+ |g:CommandTNeverShowDotFiles| boolean (default: 0)
423
+
424
+ In the file listing, Command-T will by default show dot-files if the
425
+ entered search string contains a dot that could cause a dot-file to
426
+ match. When set to a non-zero value, this setting instructs Command-T to
427
+ never show dot-files under any circumstances. Note that it is
428
+ contradictory to set both this setting and
429
+ |g:CommandTAlwaysShowDotFiles| to true, and if you do so Vim will suffer
430
+ from headaches, nervous twitches, and sudden mood swings. This setting
431
+ has no effect in buffer listings, where dot files are treated like any
432
+ other file.
433
+
434
+ *g:CommandTScanDotDirectories*
435
+ |g:CommandTScanDotDirectories| boolean (default: 0)
436
+
437
+ Normally Command-T will not recurse into "dot-directories" (directories
438
+ whose names begin with a dot) while performing its initial scan. Set
439
+ this setting to a non-zero value to override this behavior and recurse.
440
+ Note that this setting is completely independent of the
441
+ |g:CommandTAlwaysShowDotFiles| and |g:CommandTNeverShowDotFiles|
442
+ settings; those apply only to the selection and display of matches
443
+ (after scanning has been performed), whereas
444
+ |g:CommandTScanDotDirectories| affects the behaviour at scan-time.
445
+
446
+ Note also that even with this setting off you can still use Command-T to
447
+ open files inside a "dot-directory" such as ~/.vim, but you have to use
448
+ the |:cd| command to change into that directory first. For example:
449
+
450
+ :cd ~/.vim
451
+ :CommandT
452
+
453
+ *g:CommandTMatchWindowAtTop*
454
+ |g:CommandTMatchWindowAtTop| boolean (default: 0)
455
+
456
+ When this setting is off (the default) the match window will appear at
457
+ the bottom so as to keep it near to the prompt. Turning it on causes the
458
+ match window to appear at the top instead. This may be preferable if you
459
+ want the best match (usually the first one) to appear in a fixed location
460
+ on the screen rather than moving as the number of matches changes during
461
+ typing.
462
+
463
+ *g:CommandTMatchWindowReverse*
464
+ |g:CommandTMatchWindowReverse| boolean (default: 0)
465
+
466
+ When this setting is off (the default) the matches will appear from
467
+ top to bottom with the topmost being selected. Turning it on causes the
468
+ matches to be reversed so the best match is at the bottom and the
469
+ initially selected match is the bottom most. This may be preferable if
470
+ you want the best match to appear in a fixed location on the screen
471
+ but still be near the prompt at the bottom.
472
+
473
+ As well as the basic options listed above, there are a number of settings that
474
+ can be used to override the default key mappings used by Command-T. For
475
+ example, to set <C-x> as the mapping for cancelling (dismissing) the Command-T
476
+ window, you would add the following to your ~/.vimrc:
477
+
478
+ let g:CommandTCancelMap='<C-x>'
479
+
480
+ Multiple, alternative mappings may be specified using list syntax:
481
+
482
+ let g:CommandTCancelMap=['<C-x>', '<C-c>']
483
+
484
+ Following is a list of all map settings and their defaults:
485
+
486
+ Setting Default mapping(s)
487
+
488
+ *g:CommandTBackspaceMap*
489
+ |g:CommandTBackspaceMap| <BS>
490
+
491
+ *g:CommandTDeleteMap*
492
+ |g:CommandTDeleteMap| <Del>
493
+
494
+ *g:CommandTAcceptSelectionMap*
495
+ |g:CommandTAcceptSelectionMap| <CR>
496
+
497
+ *g:CommandTAcceptSelectionSplitMap*
498
+ |g:CommandTAcceptSelectionSplitMap| <C-CR>
499
+ <C-s>
500
+
501
+ *g:CommandTAcceptSelectionTabMap*
502
+ |g:CommandTAcceptSelectionTabMap| <C-t>
503
+
504
+ *g:CommandTAcceptSelectionVSplitMap*
505
+ |g:CommandTAcceptSelectionVSplitMap| <C-v>
506
+
507
+ *g:CommandTToggleFocusMap*
508
+ |g:CommandTToggleFocusMap| <Tab>
509
+
510
+ *g:CommandTCancelMap*
511
+ |g:CommandTCancelMap| <C-c>
512
+ <Esc> (not on all terminals)
513
+
514
+ *g:CommandTSelectNextMap*
515
+ |g:CommandTSelectNextMap| <C-n>
516
+ <C-j>
517
+ <Down>
518
+
519
+ *g:CommandTSelectPrevMap*
520
+ |g:CommandTSelectPrevMap| <C-p>
521
+ <C-k>
522
+ <Up>
523
+
524
+ *g:CommandTClearMap*
525
+ |g:CommandTClearMap| <C-u>
526
+
527
+ *g:CommandTCursorLeftMap*
528
+ |g:CommandTCursorLeftMap| <Left>
529
+ <C-h>
530
+
531
+ *g:CommandTCursorRightMap*
532
+ |g:CommandTCursorRightMap| <Right>
533
+ <C-l>
534
+
535
+ *g:CommandTCursorEndMap*
536
+ |g:CommandTCursorEndMap| <C-e>
537
+
538
+ *g:CommandTCursorStartMap*
539
+ |g:CommandTCursorStartMap| <C-a>
540
+
541
+ In addition to the options provided by Command-T itself, some of Vim's own
542
+ settings can be used to control behavior:
543
+
544
+ *command-t-wildignore*
545
+ |'wildignore'| string (default: '')
546
+
547
+ Vim's |'wildignore'| setting is used to determine which files should be
548
+ excluded from listings. This is a comma-separated list of glob patterns.
549
+ It defaults to the empty string, but common settings include "*.o,*.obj"
550
+ (to exclude object files) or ".git,.svn" (to exclude SCM metadata
551
+ directories). For example:
552
+
553
+ :set wildignore+=*.o,*.obj,.git
554
+
555
+ A pattern such as "vendor/rails/**" would exclude all files and
556
+ subdirectories inside the "vendor/rails" directory (relative to
557
+ directory Command-T starts in).
558
+
559
+ See the |'wildignore'| documentation for more information.
560
+
561
+
562
+ AUTHORS *command-t-authors*
563
+
564
+ Command-T is written and maintained by Wincent Colaiuta <win@wincent.com>.
565
+ Other contributors that have submitted patches include (in alphabetical
566
+ order):
567
+
568
+ Daniel Hahler
569
+ Lucas de Vries
570
+ Matthew Todd
571
+ Mike Lundy
572
+ Scott Bronson
573
+ Steven Moazami
574
+ Sung Pae
575
+ Victor Hugo Borja
576
+ Zak Johnson
577
+
578
+ As this was the first Vim plug-in I had ever written I was heavily influenced
579
+ by the design of the LustyExplorer plug-in by Stephen Bach, which I understand
580
+ is one of the largest Ruby-based Vim plug-ins to date.
581
+
582
+ While the Command-T codebase doesn't contain any code directly copied from
583
+ LustyExplorer, I did use it as a reference for answers to basic questions (like
584
+ "How do you do 'X' in a Ruby-based Vim plug-in?"), and also copied some basic
585
+ architectural decisions (like the division of the code into Prompt, Settings
586
+ and MatchWindow classes).
587
+
588
+ LustyExplorer is available from:
589
+
590
+ http://www.vim.org/scripts/script.php?script_id=1890
591
+
592
+
593
+ WEBSITE *command-t-website*
594
+
595
+ The official website for Command-T is:
596
+
597
+ https://wincent.com/products/command-t
598
+
599
+ The latest release will always be available from there.
600
+
601
+ Development in progress can be inspected via the project's Git repository
602
+ browser at:
603
+
604
+ https://wincent.com/repos/command-t
605
+
606
+ A copy of each release is also available from the official Vim scripts site
607
+ at:
608
+
609
+ http://www.vim.org/scripts/script.php?script_id=3025
610
+
611
+ Bug reports should be submitted to the issue tracker at:
612
+
613
+ https://wincent.com/issues
614
+
615
+
616
+ DONATIONS *command-t-donations*
617
+
618
+ Command-T itself is free software released under the terms of the BSD license.
619
+ If you would like to support further development you can make a donation via
620
+ PayPal to win@wincent.com:
621
+
622
+ https://wincent.com/products/command-t/donations
623
+
624
+
625
+ LICENSE *command-t-license*
626
+
627
+ Copyright 2010-2011 Wincent Colaiuta. All rights reserved.
628
+
629
+ Redistribution and use in source and binary forms, with or without
630
+ modification, are permitted provided that the following conditions are met:
631
+
632
+ 1. Redistributions of source code must retain the above copyright notice,
633
+ this list of conditions and the following disclaimer.
634
+ 2. Redistributions in binary form must reproduce the above copyright notice,
635
+ this list of conditions and the following disclaimer in the documentation
636
+ and/or other materials provided with the distribution.
637
+
638
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
639
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
640
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
641
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
642
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
643
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
644
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
645
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
646
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
647
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
648
+ POSSIBILITY OF SUCH DAMAGE.
649
+
650
+
651
+ HISTORY *command-t-history*
652
+
653
+ 1.2 (30 April 2011)
654
+
655
+ - added |g:CommandTMatchWindowReverse| option, to reverse the order of items
656
+ in the match listing (patch from Steven Moazami)
657
+
658
+ 1.1b2 (26 March 2011)
659
+
660
+ - fix a glitch in the release process; the plugin itself is unchanged since
661
+ 1.1b
662
+
663
+ 1.1b (26 March 2011)
664
+
665
+ - add |:CommandTBuffer| command for quickly selecting among open buffers
666
+
667
+ 1.0.1 (5 January 2011)
668
+
669
+ - work around bug when mapping |:CommandTFlush|, wherein the default mapping
670
+ for |:CommandT| would not be set up
671
+ - clean up when leaving the Command-T buffer via unexpected means (such as
672
+ with <C-W k> or similar)
673
+
674
+ 1.0 (26 November 2010)
675
+
676
+ - make relative path simplification work on Windows
677
+
678
+ 1.0b (5 November 2010)
679
+
680
+ - work around platform-specific Vim 7.3 bug seen by some users (wherein
681
+ Vim always falsely reports to Ruby that the buffer numbers is 0)
682
+ - re-use the buffer that is used to show the match listing, rather than
683
+ throwing it away and recreating it each time Command-T is shown; this
684
+ stops the buffer numbers from creeping up needlessly
685
+
686
+ 0.9 (8 October 2010)
687
+
688
+ - use relative paths when opening files inside the current working directory
689
+ in order to keep buffer listings as brief as possible (patch from Matthew
690
+ Todd)
691
+
692
+ 0.8.1 (14 September 2010)
693
+
694
+ - fix mapping issues for users who have set |'notimeout'| (patch from Sung
695
+ Pae)
696
+
697
+ 0.8 (19 August 2010)
698
+
699
+ - overrides for the default mappings can now be lists of strings, allowing
700
+ multiple mappings to be defined for any given action
701
+ - <Leader>t mapping only set up if no other map for |:CommandT| exists
702
+ (patch from Scott Bronson)
703
+ - prevent folds from appearing in the match listing
704
+ - tweaks to avoid the likelihood of "Not enough room" errors when trying to
705
+ open files
706
+ - watch out for "nil" windows when restoring window dimensions
707
+ - optimizations (avoid some repeated downcasing)
708
+ - move all Ruby files under the "command-t" subdirectory and avoid polluting
709
+ the "Vim" module namespace
710
+
711
+ 0.8b (11 July 2010)
712
+
713
+ - large overhaul of the scoring algorithm to make the ordering of returned
714
+ results more intuitive; given the scope of the changes and room for
715
+ optimization of the new algorithm, this release is labelled as "beta"
716
+
717
+ 0.7 (10 June 2010)
718
+
719
+ - handle more |'wildignore'| patterns by delegating to Vim's own |expand()|
720
+ function; with this change it is now viable to exclude patterns such as
721
+ 'vendor/rails/**' in addition to filename-only patterns like '*.o' and
722
+ '.git' (patch from Mike Lundy)
723
+ - always sort results alphabetically for empty search strings; this eliminates
724
+ filesystem-specific variations (patch from Mike Lundy)
725
+
726
+ 0.6 (28 April 2010)
727
+
728
+ - |:CommandT| now accepts an optional parameter to specify the starting
729
+ directory, temporarily overriding the usual default of Vim's |:pwd|
730
+ - fix truncated paths when operating from root directory
731
+
732
+ 0.5.1 (11 April 2010)
733
+
734
+ - fix for Ruby 1.9 compatibility regression introduced in 0.5
735
+ - documentation enhancements, specifically targetted at Windows users
736
+
737
+ 0.5 (3 April 2010)
738
+
739
+ - |:CommandTFlush| now re-evaluates settings, allowing changes made via |let|
740
+ to be picked up without having to restart Vim
741
+ - fix premature abort when scanning very deep directory hierarchies
742
+ - remove broken |<Esc>| key mapping on vt100 and xterm terminals
743
+ - provide settings for overriding default mappings
744
+ - minor performance optimization
745
+
746
+ 0.4 (27 March 2010)
747
+
748
+ - add |g:CommandTMatchWindowAtTop| setting (patch from Zak Johnson)
749
+ - documentation fixes and enhancements
750
+ - internal refactoring and simplification
751
+
752
+ 0.3 (24 March 2010)
753
+
754
+ - add |g:CommandTMaxHeight| setting for controlling the maximum height of the
755
+ match window (patch from Lucas de Vries)
756
+ - fix bug where |'list'| setting might be inappropriately set after dismissing
757
+ Command-T
758
+ - compatibility fix for different behaviour of "autoload" under Ruby 1.9.1
759
+ - avoid "highlight group not found" warning when run under a version of Vim
760
+ that does not have syntax highlighting support
761
+ - open in split when opening normally would fail due to |'hidden'| and
762
+ |'modified'| values
763
+
764
+ 0.2 (23 March 2010)
765
+
766
+ - compatibility fixes for compilation under Ruby 1.9 series
767
+ - compatibility fixes for compilation under Ruby 1.8.5
768
+ - compatibility fixes for Windows and other non-UNIX platforms
769
+ - suppress "mapping already exists" message if <Leader>t mapping is already
770
+ defined when plug-in is loaded
771
+ - exclude paths based on |'wildignore'| setting rather than a hardcoded
772
+ regular expression
773
+
774
+ 0.1 (22 March 2010)
775
+
776
+ - initial public release
777
+
778
+ ------------------------------------------------------------------------------
779
+ vim:tw=78:ft=help: