Added 'VCSCommandDisableMappings' and 'VCSCommandDisableExtensionMappings' options.
[vcscommand.git] / doc / vcscommand.txt
blob30113ce943f5be93652d45ccadb50123022dcd15
1 *vcscommand.txt*        vcscommand
2 Copyright (c) 2007 Bob Hiestand
4 Permission is hereby granted, free of charge, to any person obtaining a copy
5 of this software and associated documentation files (the "Software"), to
6 deal in the Software without restriction, including without limitation the
7 rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
8 sell copies of the Software, and to permit persons to whom the Software is
9 furnished to do so, subject to the following conditions:
11 The above copyright notice and this permission notice shall be included in
12 all copies or substantial portions of the Software.
14 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
20 IN THE SOFTWARE.
22 For instructions on installing this file, type
23         :help add-local-help
24 inside Vim.
26 Author:  Bob Hiestand <bob.hiestand@gmail.com>
27 Credits:  Benji Fisher's excellent MatchIt documentation
29 ==============================================================================
30 1. Contents                                             *vcscommand-contents*
32         Installation            : |vcscommand-install|
33         vcscommand Intro        : |vcscommand|
34         vcscommand Manual       : |vcscommand-manual|
35         Customization           : |vcscommand-customize|
36         SSH "integration"       : |vcscommand-ssh|
37         Bugs                    : |vcscommand-bugs|
39 ==============================================================================
41 2. vcscommand Installation                              *vcscommand-install*
43 The vcscommand plugin comprises five files: vcscommand.vim, vcssvn.vim,
44 vcscvs.vim, vcssvk.vim and vcscommand.txt (this file).  In order to install
45 the plugin, place the vcscommand.vim, vcssvn.vim, vcssvk.vim, and vcscvs.vim
46 files into a plugin directory in your runtime path (please see
47 |add-global-plugin| and |'runtimepath'|. 
49 This help file can be included in the VIM help system by copying it into a
50 'doc' directory in your runtime path and then executing the |:helptags|
51 command, specifying the full path of the 'doc' directory.  Please see
52 |add-local-help| for more details.
54 vcscommand may be customized by setting variables, creating maps, and
55 specifying event handlers.  Please see |vcscommand-customize| for more
56 details.
58 ==============================================================================
60 3. vcscommand Intro                                     *vcscommand*
61                                                         *vcscommand-intro*
63 The vcscommand plugin provides global ex commands for manipulating
64 version-controlled source files, currently those controlled either by CVS or
65 Subversion.  In general, each command operates on the current buffer and
66 accomplishes a separate source control function, such as update, commit, log,
67 and others (please see |vcscommand-commands| for a list of all available
68 commands).  The results of each operation are displayed in a scratch buffer.
69 Several buffer variables are defined for those scratch buffers (please see
70 |vcscommand-buffer-variables|).
72 The notion of "current file" means either the current buffer, or, in the case
73 of a directory buffer (such as Explorer or netrw buffers), the directory (and
74 all subdirectories) represented by the the buffer.
76 For convenience, any vcscommand invoked on a vcscommand scratch buffer acts as
77 though it was invoked on the original file and splits the screen so that the
78 output appears in a new window.
80 Many of the commands accept revisions as arguments.  By default, most operate
81 on the most recent revision on the current branch if no revision is specified.
83 Each vcscommand is mapped to a key sequence starting with the <Leader>
84 keystroke.  The default mappings may be overridden by supplying different
85 mappings before the plugin is loaded, such as in the vimrc, in the standard
86 fashion for plugin mappings.  For examples, please see
87 |vcscommand-mappings-override|.
89 The vcscommand plugin may be configured in several ways.  For more details,
90 please see |vcscommand-customize|.
92 ==============================================================================
94 4. vcscommand Manual                                    *vcscommand-manual*
96 4.1 vcscommand commands                                 *vcscommand-commands*
98 vcscommand defines the following commands:
100 |:VCSAdd|
101 |:VCSAnnotate|
102 |:VCSCommit|
103 |:VCSDelete|
104 |:VCSDiff|
105 |:VCSGotoOriginal|
106 |:VCSLog|
107 |:VCSRevert|
108 |:VCSReview|
109 |:VCSStatus|
110 |:VCSUpdate|
111 |:VCSVimDiff|
113 The following commands are specific to CVS files:
115 |:CVSEdit|
116 |:CVSEditors|
117 |:CVSUnedit|
118 |:CVSWatch|
119 |:CVSWatchAdd|
120 |:CVSWatchOn|
121 |:CVSWatchOff|
122 |:CVSWatchRemove|
123 |:CVSWatchers|
125 :VCSAdd                                                 *:VCSAdd*
127 This command adds the current file to source control.  Please note, this does
128 not commit the newly-added file.  All parameters to the command are passed to
129 the underlying VCS.
131 :VCSAnnotate                                            *:VCSAnnotate*
133 This command displays the current file with each line annotated with the
134 version in which it was most recently changed.  If an argument is given, the
135 argument is used as a revision number to display.  If not given an argument,
136 it uses the most recent version of the file (on the current branch, if under
137 CVS control).  Additionally, if the current buffer is a VCSAnnotate buffer
138 already, the version number on the current line is used.
140 For CVS buffers, the 'VCSCommandCVSAnnotateParent' option, if set to non-zero,
141 will cause the above behavior to change.  Instead of annotating the version on
142 the current line, the parent revision is used instead, crossing branches if
143 necessary.
145 The filetype of the vcscommand scratch buffer is set to one of 'CVSAnnotate',
146 'SVNAnnotate', or 'SVKAnnotate' as appropriate, to take advantage of the
147 bundled syntax files.
149 :VCSCommit[!]                                           *:VCSCommit*
151 This command commits changes to the current file to source control.
153 If called with arguments, the arguments are the log message.
155 If '!' is used, an empty log message is committed.
157 If called with no arguments, this is a two-step command.  The first step opens
158 a buffer to accept a log message.  When that buffer is written, it is
159 automatically closed and the file is committed using the information from that
160 log message.  The commit can be abandoned if the log message buffer is deleted
161 or wiped before being written.
163 Alternatively, the mapping that is used to invoke :VCSCommit (by default
164 <Leader>cc) can be used in the log message buffer to immediately commit.  This
165 is useful if the |VCSCommandCommitOnWrite| variable is set to 0 to disable the
166 normal commit-on-write behavior.
168 :VCSDelete                                              *:VCSDelete*
170 Deletes the current file and removes it from source control.  All parameters
171 to the command are passed to the underlying VCS.
173 :VCSDiff                                                *:VCSDiff*
175 With no arguments, this displays the differences between the current file and
176 its parent version under source control in a new scratch buffer.
178 With one argument, the diff is performed on the current file against the
179 specified revision.
181 With two arguments, the diff is performed between the specified revisions of
182 the current file.
184 For CVS, this command uses the |VCSCommandCVSDiffOpt| variable to specify diff
185 options.  If that variable does not exist, a plugin-specific default is used.
186 If you wish to have no options, then set it to the empty string.
188 For SVN, this command uses the |VCSCommandSVNDiffOpt| variable to specify diff
189 options.  If that variable does not exist, the SVN default is used.
190 Additionally, |VCSCommandSVNDiffExt| can be used to select an external diff
191 application.
193 :VCSGotoOriginal                                        *:VCSGotoOriginal*
195 This command jumps to the source buffer if the current buffer is a VCS scratch
196 buffer.
198 :VCSGotoOriginal!
200 Like ":VCSGotoOriginal" but also executes :bufwipeout on all VCS scrach
201 buffers associated with the original file.
203 :VCSInfo                                                *:VCSInfo*
205 This command displays extended information about the current file in a new
206 scratch buffer. 
208 :VCSLock                                                *:VCSLock*
210 This command locks the current file in order to prevent other users from
211 concurrently modifying it.  The exact semantics of this command depend on the
212 underlying VCS.  This does nothing in CVS.  All parameters are passed to the
213 underlying VCS.
215 :VCSLog                                                 *:VCSLog*
217 Displays the version history of the current file in a new scratch buffer.  If
218 there is one parameter supplied, it is taken as as a revision parameters to be
219 passed through to the underlying VCS.  Otherwise, all parameters are passed to
220 the underlying VCS.
222 :VCSRevert                                              *:VCSRevert*
224 This command replaces the current file with the most recent version from the
225 repository in order to wipe out any undesired changes.
227 :VCSReview                                              *:VCSReview*
229 Displays a particular version of the current file in a new scratch buffer.  If
230 no argument is given, the most recent version of the file on the current
231 branch is retrieved.
233 :VCSStatus                                              *:VCSStatus*
235 Displays versioning information about the current file in a new scratch
236 buffer.  All parameters are passed to the underlying VCS.
239 :VCSUnlock                                              *:VCSUnlock*
241 Unlocks the current file in order to allow other users from concurrently
242 modifying it.  The exact semantics of this command depend on the underlying
243 VCS.  All parameters are passed to the underlying VCS.
245 :VCSUpdate                                              *:VCSUpdate*
247 Updates the current file with any relevant changes from the repository.  This
248 intentionally does not automatically reload the current buffer, though vim
249 should prompt the user to do so if the underlying file is altered by this
250 command.
252 :VCSVimDiff                                             *:VCSVimDiff*
254 Uses vimdiff to display differences between versions of the current file.
256 If no revision is specified, the most recent version of the file on the
257 current branch is used.  With one argument, that argument is used as the
258 revision as above.  With two arguments, the differences between the two
259 revisions is displayed using vimdiff.
260                                                             
261 With either zero or one argument, the original buffer is used to perform the
262 vimdiff.  When the scratch buffer is closed, the original buffer will be
263 returned to normal mode.
264                                                             
265 Once vimdiff mode is started using the above methods, additional vimdiff
266 buffers may be added by passing a single version argument to the command.
267 There may be up to 4 vimdiff buffers total.
268                                                             
269 Using the 2-argument form of the command resets the vimdiff to only those 2
270 versions.  Additionally, invoking the command on a different file will close
271 the previous vimdiff buffers.
273 :CVSEdit                                                *:CVSEdit*
275 This command performs "cvs edit" on the current file.  Yes, the output buffer
276 in this case is almost completely useless.
278 :CVSEditors                                             *:CVSEditors*
280 This command performs "cvs edit" on the current file.
282 :CVSUnedit                                              *:CVSUnedit*
284 Performs "cvs unedit" on the current file.  Again, yes, the output buffer here
285 is basically useless.
287 :CVSWatch                                               *:CVSWatch*
289 This command takes an argument which must be one of [on|off|add|remove].  The
290 command performs "cvs watch" with the given argument on the current file.
292 :CVSWatchAdd                                            *:CVSWatchAdd*
294 This command is an alias for ":CVSWatch add"
296 :CVSWatchOn                                             *:CVSWatchOn*
298 This command is an alias for ":CVSWatch on"
300 :CVSWatchOff                                            *:CVSWatchOff*
302 This command is an alias for ":CVSWatch off"
304 :CVSWatchRemove                                         *:CVSWatchRemove*
306 This command is an alias for ":CVSWatch remove"
308 :CVSWatchers                                            *:CVSWatchers*
310 This command performs "cvs watchers" on the current file.
312 4.2 Mappings                                            *vcscommand-mappings*
314 By default, a mapping is defined for each command.  These mappings execute the
315 default (no-argument) form of each command.
317 <Leader>ca VCSAdd
318 <Leader>cn VCSAnnotate
319 <Leader>cc VCSCommit
320 <Leader>cd VCSDiff
321 <Leader>cg VCSGotoOriginal
322 <Leader>cG VCSGotoOriginal!
323 <Leader>ci VCSInfo
324 <Leader>cl VCSLog
325 <Leader>cr VCSReview
326 <Leader>cs VCSStatus
327 <Leader>cu VCSUpdate
328 <Leader>cv VCSVimDiff
330 Only for CVS buffers:
332 <Leader>ce CVSEdit
333 <Leader>cE CVSEditors
334 <Leader>ct CVSUnedit
335 <Leader>cwv CVSWatchers
336 <Leader>cwa CVSWatchAdd
337 <Leader>cwn CVSWatchOn
338 <Leader>cwf CVSWatchOff
339 <Leader>cwf CVSWatchRemove
341                                                 *vcscommand-mappings-override*
343 The default mappings can be overriden by user-provided instead by mapping to
344 <Plug>CommandName.  This is especially useful when these mappings collide with
345 other existing mappings (vim will warn of this during plugin initialization,
346 but will not clobber the existing mappings).
348 For instance, to override the default mapping for :VCSAdd to set it to '\add',
349 add the following to the vimrc:
351 nmap \add <Plug>VCSAdd
353 4.3 Automatic buffer variables                  *vcscommand-buffer-variables*
355 Several buffer variables are defined in each vcscommand result buffer.  These
356 may be useful for additional customization in callbacks defined in the event
357 handlers (please see |vcscommand-events|).
359 The following variables are automatically defined:
361 b:VCSCommandOriginalBuffer                      *b:VCSCommandOriginalBuffer*
363 This variable is set to the buffer number of the source file.
365 b:VCSCommandCommand                             *b:VCSCommandCommand*
367 This variable is set to the name of the vcscommand that created the result
368 buffer.
370 b:VCSCommandSourceFile                          *b:VCSCommandSourceFile*
372 This variable is set to the name of the original file under source control.
374 b:VCSCommandVCSType                             *b:VCSCommandVCSType*
376 This variable is set to the type of the source control.  This variable is also
377 set on the original file itself.
378 ==============================================================================
380 5. Configuration and customization                      *vcscommand-customize*
381                                                         *vcscommand-config*
383 The vcscommand plugin can be configured in several ways:  by setting
384 configuration variables (see |vcscommand-options|) or by defining vcscommand
385 event handlers (see |vcscommand-events|).  Additionally, the vcscommand plugin
386 supports a customized status line (see |vcscommand-statusline| and
387 |vcscommand-buffer-management|).
389 5.1 vcscommand configuration variables                  *vcscommand-options*
391 Several variables affect the plugin's behavior.  These variables are checked
392 at time of execution, and may be defined at the window, buffer, or global
393 level and are checked in that order of precedence.
396 The following variables are available:
398 |VCSCommandCommitOnWrite|
399 |VCSCommandCVSDiffOpt|
400 |VCSCommandCVSExec|
401 |VCSCommandDeleteOnHide|
402 |VCSCommandDiffSplit|
403 |VCSCommandDisableMappings|
404 |VCSCommandDisableExtensionMappings|
405 |VCSCommandEdit|
406 |VCSCommandEnableBufferSetup|
407 |VCSCommandResultBufferNameExtension|
408 |VCSCommandResultBufferNameFunction|
409 |VCSCommandSplit|
410 |VCSCommandSVKExec|
411 |VCSCommandSVNDiffExt|
412 |VCSCommandSVNDiffOpt|
413 |VCSCommandSVNExec|
415 VCSCommandCommitOnWrite                         *VCSCommandCommitOnWrite*
417 This variable, if set to a non-zero value, causes the pending commit
418 to take place immediately as soon as the log message buffer is written.
419 If set to zero, only the VCSCommit mapping will cause the pending commit to
420 occur.  If not set, it defaults to 1.
422 VCSCommandCVSExec                               *VCSCommandCVSExec*
424 This variable controls the executable used for all CVS commands  If not set,
425 it defaults to "cvs".
427 VCSCommandDeleteOnHide                          *VCSCommandDeleteOnHide*
429 This variable, if set to a non-zero value, causes the temporary result buffers
430 to automatically delete themselves when hidden.
432 VCSCommandCVSDiffOpt                            *VCSCommandCVSDiffOpt*
434 This variable, if set, determines the options passed to the diff command of
435 CVS.  If not set, it defaults to 'u'.
437 VCSCommandDiffSplit                             *VCSCommandDiffSplit*
439 This variable overrides the |VCSCommandSplit| variable, but only for buffers
440 created with |:VCSVimDiff|.
442 VCSCommandDisableMappings                       *VCSCommandDisableMappings*
444 This variable, if set to a non-zero value, prevents the default command
445 mappings from being set.  This supercedes 
446 |VCSCommandDisableExtensionMappings|.
448 VCSCommandDisableExtensionMappings      *VCSCommandDisableExtensionMappings*
450 This variable, if set to a non-zero value, prevents the default command
451 mappings from being set for commands specific to an individual VCS.
453 VCSCommandEdit                                  *VCSCommandEdit*
455 This variable controls whether the original buffer is replaced ('edit') or
456 split ('split').  If not set, it defaults to 'split'.
458 VCSCommandEnableBufferSetup                     *VCSCommandEnableBufferSetup*
460 This variable, if set to a non-zero value, activates VCS buffer management
461 mode see (|vcscommand-buffer-management|).  This mode means that the
462 'VCSCommandBufferInfo' variable is filled with version information if the file
463 is VCS-controlled.  This is useful for displaying version information in the
464 status bar.
466 VCSCommandResultBufferNameExtension     *VCSCommandResultBufferNameExtension*
468 This variable, if set to a non-blank value, is appended to the name of the VCS
469 command output buffers.  For example, '.vcs'.  Using this option may help
470 avoid problems caused by autocommands dependent on file extension.
472 VCSCommandResultBufferNameFunction      *VCSCommandResultBufferNameFunction*
474 This variable, if set, specifies a custom function for naming VCS command
475 output buffers.  This function is expected to return the new buffer name, and
476 will be passed the following arguments:
478   command - name of the VCS command being executed (such as 'Log' or
479   'Diff').
480   
481   originalBuffer - buffer number of the source file.
482   
483   vcsType - type of VCS controlling this file (such as 'CVS' or 'SVN').
484   
485   statusText - extra text associated with the VCS action (such as version
486   numbers).
488 VCSCommandSplit                                 *VCSCommandSplit*
490 This variable controls the orientation of the various window splits that
491 may occur.
493 If set to 'horizontal', the resulting windows will be on stacked on top of
494 one another.  If set to 'vertical', the resulting windows will be
495 side-by-side.  If not set, it defaults to 'horizontal' for all but
496 VCSVimDiff windows.
498 VCSCommandSVKExec                               *VCSCommandSVKExec*
500 This variable controls the executable used for all SVK commands  If not set,
501 it defaults to "svk".
503 VCSCommandSVNDiffExt                            *VCSCommandSVNDiffExt*
505 This variable, if set, is passed to SVN via the --diff-cmd command to select
506 an external application for performing the diff.
508 VCSCommandSVNDiffOpt                            *VCSCommandSVNDiffOpt*
510 This variable, if set, determines the options passed with the '-x' parameter
511 to the SVN diff command.  If not set, no options are passed.
513 VCSCommandSVNExec                               *VCSCommandSVNExec*
515 This variable controls the executable used for all SVN commands  If not set,
516 it defaults to "svn".
518 5.2 VCSCommand events                           *vcscommand-events*
520 For additional customization, vcscommand can trigger user-defined events.
521 Event handlers are provided by defining User event autocommands (see
522 |autocommand|, |User|) in the vcscommand group with patterns matching the
523 event name.
525 For instance, the following could be added to the vimrc to provide a 'q'
526 mapping to quit a vcscommand scratch buffer:
528 augroup VCSCommand
529   au User VCSBufferCreated silent! nmap <unique> <buffer> q: bwipeout<cr>
530 augroup END
532 The following hooks are available:
534 VCSBufferCreated                This event is fired just after a vcscommand
535                                 result buffer is created and populated.  It is
536                                 executed within the context of the vcscommand
537                                 buffer.  The vcscommand buffer variables may
538                                 be useful for handlers of this event (please
539                                 see |vcscommand-buffer-variables|).
541 VCSBufferSetup                  This event is fired just after vcscommand buffer
542                                 setup occurs, if enabled.
544 VCSPluginInit                   This event is fired when the vcscommand plugin
545                                 first loads.
547 VCSPluginFinish                 This event is fired just after the vcscommand
548                                 plugin loads.
550 VCSVimDiffFinish                This event is fired just after the VCSVimDiff
551                                 command executes to allow customization of,
552                                 for instance, window placement and focus.
554 Additionally, there is another hook which is used internally to handle loading
555 the multiple scripts in order.  This hook should probably not be used by an
556 end user without a good idea of how it works.  Among other things, any events
557 associated with this hook are cleared after they are executed (during
558 vcscommand.vim script initialization).
560 VCSLoadExtensions               This event is fired just before the
561                                 VCSPluginFinish.  It is used internally to
562                                 execute any commands from the VCS
563                                 implementation plugins that needs to be
564                                 deferred until the primary plugin is
565                                 initialized.
567 5.3 vcscommand buffer naming                            *vcscommand-naming*
569 vcscommand result buffers use the following naming convention:
570 [{VCS type} {VCS command} {Source file name}]
572 If additional buffers are created that would otherwise conflict, a
573 distinguishing number is added:
575 [{VCS type} {VCS command} {Source file name}] (1,2, etc)
577 5.4 vcscommand status line support                      *vcscommand-statusline*
579 It is intended that the user will customize the |'statusline'| option to
580 include vcscommand result buffer attributes.  A sample function that may be
581 used in the |'statusline'| option is provided by the plugin,
582 VCSCommandGetStatusLine().  In order to use that function in the status line, do
583 something like the following:
585 set statusline=%<%f\ %{VCSCommandGetStatusLine()}\ %h%m%r%=%l,%c%V\ %P
587 of which %{VCSCommandGetStatusLine()} is the relevant portion.
589 The sample VCSCommandGetStatusLine() function handles both vcscommand result
590 buffers and VCS-managed files if vcscommand buffer management is enabled
591 (please see |vcscommand-buffer-management|).
593 5.5 vcscommand buffer management                *vcscommand-buffer-management*
595 The vcscommand plugin can operate in buffer management mode, which means that
596 it attempts to set a buffer variable ('VCSCommandBufferInfo') upon entry into
597 a buffer.  This is rather slow because it means that the VCS will be invoked
598 at each entry into a buffer (during the |BufEnter| autocommand).
600 This mode is disabled by default.  In order to enable it, set the
601 |VCSCommandEnableBufferSetup| variable to a true (non-zero) value.  Enabling
602 this mode simply provides the buffer variable mentioned above.  The user must
603 explicitly include information from the variable in the |'statusline'| option
604 if they are to appear in the status line (but see |vcscommand-statusline| for
605 a simple way to do that).
607 The 'VCSCommandBufferInfo' variable is a list which contains, in order, the
608 revision of the current file, the latest revision of the file in the
609 repository, and (for CVS) the name of the branch.  If those values cannot be
610 determined, the list is a single element:  'Unknown'.
612 ==============================================================================
614 6. SSH "integration"                                    *vcscommand-ssh*
616 The following instructions are intended for use in integrating the
617 vcscommand.vim plugin with an SSH-based CVS environment.
619 Familiarity with SSH and CVS are assumed.
621 These instructions assume that the intent is to have a message box pop up in
622 order to allow the user to enter a passphrase.  If, instead, the user is
623 comfortable using certificate-based authentication, then only instructions
624 6.1.1 and 6.1.2 (and optionally 6.1.4) need to be followed; ssh should then
625 work transparently.
627 6.1 Environment settings                                *vcscommand-ssh-env*
629 6.1.1 CVSROOT should be set to something like:
631         :ext:user@host:/path_to_repository
633 6.1.2 CVS_RSH should be set to:
635         ssh
637         Together, those settings tell CVS to use ssh as the transport when
638         performing CVS calls.
640 6.1.3 SSH_ASKPASS should be set to the password-dialog program.  In my case,
641         running gnome, it's set to:
643         /usr/libexec/openssh/gnome-ssh-askpass
645         This tells SSH how to get passwords if no input is available.
647 6.1.4 OPTIONAL.  You may need to set SSH_SERVER to the location of the cvs
648         executable on the remote (server) machine.
650 6.2 CVS wrapper program                         *vcscommand-ssh-wrapper*
652 Now you need to convince SSH to use the password-dialog program.  This means
653 you need to execute SSH (and therefore CVS) without standard input.  The
654 following script is a simple perl wrapper that dissasociates the CVS command
655 from the current terminal.  Specific steps to do this may vary from system to
656 system; the following example works for me on linux.
658 #!/usr/bin/perl -w
659 use strict;
660 use POSIX qw(setsid);
661 open STDIN, '/dev/null';
662 fork and do {wait; exit;};
663 setsid;
664 exec('cvs', @ARGV);
666 6.3 Configuring vcscommand.vim                  *vcscommand-ssh-config*
668 At this point, you should be able to use your wrapper script to invoke CVS with
669 various commands, and get the password dialog.  All that's left is to make CVS
670 use your newly-created wrapper script.
672 6.3.1 Tell vcscommand.vim what CVS executable to use.  The easiest way to do this
673         is globally, by putting the following in your .vimrc:
675         let VCSCommandCVSExec=/path/to/cvs/wrapper/script
677 6.4 Where to go from here                       *vcscommand-ssh-other*
679 The script given above works even when non-SSH CVS connections are used,
680 except possibly when interactively entering the message for CVS commit log
681 (depending on the editor you use... VIM works fine).  Since the vcscommand.vim
682 plugin handles that message without a terminal, the wrapper script can be used
683 all the time.
685 This allows mixed-mode operation, where some work is done with SSH-based CVS
686 repositories, and others with pserver or local access.
688 It is possible, though beyond the scope of the plugin, to dynamically set the
689 CVS executable based on the CVSROOT for the file being edited.  The user
690 events provided (such as VCSBufferCreated and VCSBufferSetup) can be used to
691 set a buffer-local value (b:VCSCommandCVSExec) to override the CVS executable
692 on a file-by-file basis.  Alternatively, much the same can be done (less
693 automatically) by the various project-oriented plugins out there.
695 It is highly recommended for ease-of-use that certificates with no passphrase
696 or ssh-agent are employed so that the user is not given the password prompt
697 too often.
699 ==============================================================================
701 7. Known bugs                                           *vcscommand-bugs*
703 Please let me know if you run across any.
705 CVSUnedit may, if a file is changed from the repository, provide prompt text
706 to determine whether the changes should be thrown away.  Currently, that text
707 shows up in the CVS result buffer as information; there is no way for the user
708 to actually respond to the prompt and the CVS unedit command does nothing.  If
709 this really bothers anyone, please let me know.
711 VCSVimDiff, when using the original (real) source buffer as one of the diff
712 buffers, uses some hacks to try to restore the state of the original buffer
713 when the scratch buffer containing the other version is destroyed.  There may
714 still be bugs in here, depending on many configuration details.
716 vim:tw=78:ts=8:ft=help