1 *cvscommand.txt* CVSCommand |
1 *hgcommand.txt* HGCommand |
2 |
2 |
3 For instructions on installing this file, type |
3 For instructions on installing this file, type |
4 :help add-local-help |
4 :help add-local-help |
5 inside Vim. |
5 inside Vim. |
6 |
6 |
7 Author: Bob Hiestand <bob.hiestand@gmail.com> |
7 Author: Mathieu Clabaut <mathieu.clabaut@gmail.com> |
8 Credits: Benji Fisher's excellent MatchIt documentation |
8 Credits: Bob Hiestand <bob.hiestand@gmail.com> |
9 |
9 |
10 ============================================================================== |
10 ============================================================================== |
11 1. Contents *cvscommand-contents* |
11 1. Contents *hgcommand-contents* |
12 |
12 |
13 Installation : |cvscommand-install| |
13 Installation : |hgcommand-install| |
14 CVSCommand Intro : |cvscommand| |
14 HGCommand Intro : |hgcommand| |
15 CVSCommand Manual : |cvscommand-manual| |
15 HGCommand Manual : |hgcommand-manual| |
16 Customization : |cvscommand-customize| |
16 Customization : |hgcommand-customize| |
17 SSH "integration" : |cvscommand-ssh| |
17 SSH "integration" : |hgcommand-ssh| |
18 Bugs : |cvscommand-bugs| |
18 Bugs : |hgcommand-bugs| |
19 |
19 |
20 ============================================================================== |
20 ============================================================================== |
21 |
21 |
22 2. CVSCommand Installation *cvscommand-install* |
22 2. HGCommand Installation *hgcommand-install* |
23 |
23 |
24 The CVSCommand plugin comprises two files, cvscommand.vim and cvscommand.txt |
24 The HGCommand plugin comprises two files, hgcommand.vim and hgcommand.txt |
25 (this file). In order to install the plugin, place the cvscommand.vim file |
25 (this file). In order to install the plugin, place the hgcommand.vim file |
26 into a plugin' directory in your runtime path (please see |add-global-plugin| |
26 into a plugin' directory in your runtime path (please see |add-global-plugin| |
27 and |'runtimepath'|. |
27 and |'runtimepath'|. |
28 |
28 |
29 CVSCommand may be customized by setting variables, creating maps, and |
29 HGCommand may be customized by setting variables, creating maps, and |
30 specifying event handlers. Please see |cvscommand-customize| for more |
30 specifying event handlers. Please see |hgcommand-customize| for more |
31 details. |
31 details. |
32 |
32 |
33 This help file can be included in the VIM help system by copying it into a |
33 This help file can be included in the VIM help system by copying it into a |
34 'doc' directory in your runtime path and then executing the |:helptags| |
34 'doc' directory in your runtime path and then executing the |:helptags| |
35 command, specifying the full path of the 'doc' directory. Please see |
35 command, specifying the full path of the 'doc' directory. Please see |
36 |add-local-help| for more details. |
36 |add-local-help| for more details. |
37 |
37 |
38 ============================================================================== |
38 ============================================================================== |
39 |
39 |
40 3. CVSCommand Intro *cvscommand* |
40 3. HGCommand Intro *hgcommand* |
41 *cvscommand-intro* |
41 *hgcommand-intro* |
42 |
42 |
43 The CVSCommand plugin provides global ex commands for manipulating |
43 The HGCommand plugin provides global ex commands for manipulating |
44 CVS-controlled source files. In general, each command operates on the current |
44 HG-controlled source files. In general, each command operates on the current |
45 buffer and accomplishes a separate cvs function, such as update, commit, log, |
45 buffer and accomplishes a separate hg function, such as update, commit, log, |
46 and others (please see |cvscommand-commands| for a list of all available |
46 and others (please see |hgcommand-commands| for a list of all available |
47 commands). The results of each operation are displayed in a scratch buffer. |
47 commands). The results of each operation are displayed in a scratch buffer. |
48 Several buffer variables are defined for those scratch buffers (please see |
48 Several buffer variables are defined for those scratch buffers (please see |
49 |cvscommand-buffer-variables|). |
49 |hgcommand-buffer-variables|). |
50 |
50 |
51 The notion of "current file" means either the current buffer, or, in the case |
51 The notion of "current file" means either the current buffer, or, in the case |
52 of a directory buffer, the file on the current line within the buffer. |
52 of a directory buffer, the file on the current line within the buffer. |
53 |
53 |
54 For convenience, any CVSCommand invoked on a CVSCommand scratch buffer acts as |
54 For convenience, any HGCommand invoked on a HGCommand scratch buffer acts as |
55 though it was invoked on the original file and splits the screen so that the |
55 though it was invoked on the original file and splits the screen so that the |
56 output appears in a new window. |
56 output appears in a new window. |
57 |
57 |
58 Many of the commands accept revisions as arguments. By default, most operate |
58 Many of the commands accept revisions as arguments. By default, most operate |
59 on the most recent revision on the current branch if no revision is specified |
59 on the most recent revision on the current branch if no revision is specified |
60 (though see |CVSCommandInteractive| to prompt instead). |
60 (though see |HGCommandInteractive| to prompt instead). |
61 |
61 |
62 Each CVSCommand is mapped to a key sequence starting with the <Leader> |
62 Each HGCommand is mapped to a key sequence starting with the <Leader> |
63 keystroke. The default mappings may be overridden by supplying different |
63 keystroke. The default mappings may be overridden by supplying different |
64 mappings before the plugin is loaded, such as in the vimrc, in the standard |
64 mappings before the plugin is loaded, such as in the vimrc, in the standard |
65 fashion for plugin mappings. For examples, please see |
65 fashion for plugin mappings. For examples, please see |
66 |cvscommand-mappings-override|. |
66 |hgcommand-mappings-override|. |
67 |
67 |
68 The CVSCommand plugin may be configured in several ways. For more details, |
68 The HGCommand plugin may be configured in several ways. For more details, |
69 please see |cvscommand-customize|. |
69 please see |hgcommand-customize|. |
70 |
70 |
71 ============================================================================== |
71 ============================================================================== |
72 |
72 |
73 4. CVSCommand Manual *cvscommand-manual* |
73 4. HGCommand Manual *hgcommand-manual* |
74 |
74 |
75 4.1 CVSCommand commands *cvscommand-commands* |
75 4.1 HGCommand commands *hgcommand-commands* |
76 |
76 |
77 CVSCommand defines the following commands: |
77 HGCommand defines the following commands: |
78 |
78 |
79 |:CVSAdd| |
79 |:HGAdd| |
80 |:CVSAnnotate| |
80 |:HGAnnotate| |
81 |:CVSCommit| |
81 |:HGCommit| |
82 |:CVSDiff| |
82 |:HGDiff| |
83 |:CVSEdit| |
83 |:HGGotoOriginal| |
84 |:CVSEditors| |
84 |:HGLog| |
85 |:CVSGotoOriginal| |
85 |:HGRevert| |
86 |:CVSLog| |
86 |:HGReview| |
87 |:CVSRevert| |
87 |:HGStatus| |
88 |:CVSReview| |
88 |:HGUnedit| |
89 |:CVSStatus| |
89 |:HGUpdate| |
90 |:CVSUnedit| |
90 |:HGVimDiff| |
91 |:CVSUpdate| |
91 |
92 |:CVSVimDiff| |
92 :HGAdd *:HGAdd* |
93 |:CVSWatch| |
93 |
94 |:CVSWatchAdd| |
94 This command performs "hg add" on the current file. Please note, this does |
95 |:CVSWatchOn| |
|
96 |:CVSWatchOff| |
|
97 |:CVSWatchRemove| |
|
98 |:CVSWatchers| |
|
99 |
|
100 :CVSAdd *:CVSAdd* |
|
101 |
|
102 This command performs "cvs add" on the current file. Please note, this does |
|
103 not commit the newly-added file. |
95 not commit the newly-added file. |
104 |
96 |
105 :CVSAnnotate *:CVSAnnotate* |
97 :HGAnnotate *:HGAnnotate* |
106 |
98 |
107 This command performs "cvs annotate" on the current file. If an argument is |
99 This command performs "hg annotate" on the current file. If an argument is |
108 given, the argument is used as a revision number to display. If not given an |
100 given, the argument is used as a revision number to display. If not given an |
109 argument, it uses the most recent version of the file on the current branch. |
101 argument, it uses the most recent version of the file on the current branch. |
110 Additionally, if the current buffer is a CVSAnnotate buffer already, the |
102 Additionally, if the current buffer is a HGAnnotate buffer already, the |
111 version number on the current line is used. |
103 version number on the current line is used. |
112 |
104 |
113 If the |CVSCommandAnnotateParent| variable is set to a non-zero value, the |
105 If the |HGCommandAnnotateParent| variable is set to a non-zero value, the |
114 version previous to the one on the current line is used instead. This allows |
106 version previous to the one on the current line is used instead. This allows |
115 one to navigate back to examine the previous version of a line. |
107 one to navigate back to examine the previous version of a line. |
116 |
108 |
117 The filetype of the CVSCommand scratch buffer is set to 'CVSAnnotate', to take |
109 The filetype of the HGCommand scratch buffer is set to 'HGAnnotate', to take |
118 advantage of the bundled syntax file. |
110 advantage of the bundled syntax file. |
119 |
111 |
120 |
112 |
121 :CVSCommit[!] *:CVSCommit* |
113 :HGCommit[!] *:HGCommit* |
122 |
114 |
123 If called with arguments, this performs "cvs commit" using the arguments as |
115 If called with arguments, this performs "hg commit" using the arguments as |
124 the log message. |
116 the log message. |
125 |
117 |
126 If '!' is used with no arguments, an empty log message is committed. |
118 If '!' is used with no arguments, an empty log message is committed. |
127 |
119 |
128 If called with no arguments, this is a two-step command. The first step opens |
120 If called with no arguments, this is a two-step command. The first step opens |
129 a buffer to accept a log message. When that buffer is written, it is |
121 a buffer to accept a log message. When that buffer is written, it is |
130 automatically closed and the file is committed using the information from that |
122 automatically closed and the file is committed using the information from that |
131 log message. The commit can be abandoned if the log message buffer is deleted |
123 log message. The commit can be abandoned if the log message buffer is deleted |
132 or wiped before being written. |
124 or wiped before being written. |
133 |
125 |
134 Alternatively, the mapping that is used to invoke :CVSCommit (by default |
126 Alternatively, the mapping that is used to invoke :HGCommit (by default |
135 <Leader>cc) can be used in the log message buffer to immediately commit. This |
127 <Leader>hgc) can be used in the log message buffer to immediately commit. |
136 is useful if the |CVSCommandCommitOnWrite| variable is set to 0 to disable the |
128 This |
|
129 is useful if the |HGCommandCommitOnWrite| variable is set to 0 to disable the |
137 normal commit-on-write behavior. |
130 normal commit-on-write behavior. |
138 |
131 |
139 :CVSDiff *:CVSDiff* |
132 :HGDiff *:HGDiff* |
140 |
133 |
141 With no arguments, this performs "cvs diff" on the current file against the |
134 With no arguments, this performs "hg diff" on the current file against the |
142 current repository version. |
135 current repository version. |
143 |
136 |
144 With one argument, "cvs diff" is performed on the current file against the |
137 With one argument, "hg diff" is performed on the current file against the |
145 specified revision. |
138 specified revision. |
146 |
139 |
147 With two arguments, cvs diff is performed between the specified |
140 With two arguments, hg diff is performed between the specified |
148 revisions of the current file. |
141 revisions of the current file. |
149 |
142 |
150 This command uses the 'CVSCommandDiffOpt' variable to specify diff options. |
143 This command uses the 'HGCommandDiffOpt' variable to specify diff options. |
151 If that variable does not exist, then 'wbBc' is assumed. If you wish to have |
144 If that variable does not exist, then 'wbBc' is assumed. If you wish to have |
152 no options, then set it to the empty string. |
145 no options, then set it to the empty string. |
153 |
146 |
154 :CVSEdit *:CVSEdit* |
147 |
155 |
148 This command performs "hg edit" on the current file. |
156 This command performs "cvs edit" on the current file. Yes, the output buffer |
149 |
157 in this case is almost completely useless. |
150 :HGGotoOriginal *:HGGotoOriginal* |
158 |
|
159 :CVSEditors *:CVSEditors* |
|
160 |
|
161 This command performs "cvs edit" on the current file. |
|
162 |
|
163 :CVSGotoOriginal *:CVSGotoOriginal* |
|
164 |
151 |
165 This command returns the current window to the source buffer, if the current |
152 This command returns the current window to the source buffer, if the current |
166 buffer is a CVS command output buffer. |
153 buffer is a HG command output buffer. |
167 |
154 |
168 :CVSGotoOriginal! |
155 :HGGotoOriginal! |
169 |
156 |
170 Like ":CVSGotoOriginal" but also executes :bufwipeout on all CVS command |
157 Like ":HGGotoOriginal" but also executes :bufwipeout on all HG command |
171 output buffers for the source buffer. |
158 output buffers for the source buffer. |
172 |
159 |
173 :CVSLog *:CVSLog* |
160 :HGLog *:HGLog* |
174 |
161 |
175 Performs "cvs log" on the current file. |
162 Performs "hg log" on the current file. |
176 |
163 |
177 If an argument is given, it is passed as an argument to the "-r" option of |
164 If an argument is given, it is passed as an argument to the "-r" option of |
178 "cvs log". |
165 "hg log". |
179 |
166 |
180 :CVSRevert *:CVSRevert* |
167 :HGRevert *:HGRevert* |
181 |
168 |
182 Replaces the current file with the most recent version from the repository in |
169 Replaces the current file with the most recent version from the repository in |
183 order to wipe out any undesired changes. |
170 order to wipe out any undesired changes. |
184 |
171 |
185 :CVSReview *:CVSReview* |
172 :HGReview *:HGReview* |
186 |
173 |
187 Retrieves a particular version of the current file. If no argument is given, |
174 Retrieves a particular version of the current file. If no argument is given, |
188 the most recent version of the file on the current branch is retrieved. |
175 the most recent version of the file on the current branch is retrieved. |
189 Otherwise, the specified version is retrieved. |
176 Otherwise, the specified version is retrieved. |
190 |
177 |
191 :CVSStatus *:CVSStatus* |
178 :HGStatus *:HGStatus* |
192 |
179 |
193 Performs "cvs status" on the current file. |
180 Performs "hg status" on the current file. |
194 |
181 |
195 :CVSUnedit *:CVSUnedit* |
182 :HGUnedit *:HGUnedit* |
196 |
183 |
197 Performs "cvs unedit" on the current file. Again, yes, the output buffer here |
184 Performs "hg unedit" on the current file. Again, yes, the output buffer here |
198 is basically useless. |
185 is basically useless. |
199 |
186 |
200 :CVSUpdate *:CVSUpdate* |
187 :HGUpdate *:HGUpdate* |
201 |
188 |
202 Performs "cvs update" on the current file. This intentionally does not |
189 Performs "hg update" on the current file. This intentionally does not |
203 automatically reload the current buffer, though vim should prompt the user to |
190 automatically reload the current buffer, though vim should prompt the user to |
204 do so if the underlying file is altered by this command. |
191 do so if the underlying file is altered by this command. |
205 |
192 |
206 :CVSVimDiff *:CVSVimDiff* |
193 :HGVimDiff *:HGVimDiff* |
207 |
194 |
208 With no arguments, this prompts the user for a revision and then uses vimdiff |
195 With no arguments, this prompts the user for a revision and then uses vimdiff |
209 to display the differences between the current file and the specified |
196 to display the differences between the current file and the specified |
210 revision. If no revision is specified, the most recent version of the file on |
197 revision. If no revision is specified, the most recent version of the file on |
211 the current branch is used. |
198 the current branch is used. |
224 |
211 |
225 Using the 2-argument form of the command resets the vimdiff to only those 2 |
212 Using the 2-argument form of the command resets the vimdiff to only those 2 |
226 versions. Additionally, invoking the command on a different file will close |
213 versions. Additionally, invoking the command on a different file will close |
227 the previous vimdiff buffers. |
214 the previous vimdiff buffers. |
228 |
215 |
229 :CVSWatch *:CVSWatch* |
216 |
230 |
217 4.2 Mappings *hgcommand-mappings* |
231 This command takes an argument which must be one of [on|off|add|remove]. The |
|
232 command performs "cvs watch" with the given argument on the current file. |
|
233 |
|
234 :CVSWatchAdd *:CVSWatchAdd* |
|
235 |
|
236 This command is an alias for ":CVSWatch add" |
|
237 |
|
238 :CVSWatchOn *:CVSWatchOn* |
|
239 |
|
240 This command is an alias for ":CVSWatch on" |
|
241 |
|
242 :CVSWatchOff *:CVSWatchOff* |
|
243 |
|
244 This command is an alias for ":CVSWatch off" |
|
245 |
|
246 :CVSWatchRemove *:CVSWatchRemove* |
|
247 |
|
248 This command is an alias for ":CVSWatch remove" |
|
249 |
|
250 :CVSWatchers *:CVSWatchers* |
|
251 |
|
252 This command performs "cvs watchers" on the current file. |
|
253 |
|
254 4.2 Mappings *cvscommand-mappings* |
|
255 |
218 |
256 By default, a mapping is defined for each command. These mappings execute the |
219 By default, a mapping is defined for each command. These mappings execute the |
257 default (no-argument) form of each command. |
220 default (no-argument) form of each command. |
258 |
221 |
259 <Leader>ca CVSAdd |
222 <Leader>hga HGAdd |
260 <Leader>cn CVSAnnotate |
223 <Leader>hgn HGAnnotate |
261 <Leader>cc CVSCommit |
224 <Leader>hgc HGCommit |
262 <Leader>cd CVSDiff |
225 <Leader>hgd HGDiff |
263 <Leader>ce CVSEdit |
226 <Leader>hgg HGGotoOriginal |
264 <Leader>ci CVSEditors |
227 <Leader>hgG HGGotoOriginal! |
265 <Leader>cg CVSGotoOriginal |
228 <Leader>hgl HGLog |
266 <Leader>cG CVSGotoOriginal! |
229 <Leader>hgr HGReview |
267 <Leader>cl CVSLog |
230 <Leader>hgs HGStatus |
268 <Leader>cr CVSReview |
231 <Leader>hgt HGUnedit |
269 <Leader>cs CVSStatus |
232 <Leader>hgu HGUpdate |
270 <Leader>ct CVSUnedit |
233 <Leader>hgv HGVimDiff |
271 <Leader>cu CVSUpdate |
234 |
272 <Leader>cv CVSVimDiff |
235 *hgcommand-mappings-override* |
273 <Leader>cwv CVSWatchers |
|
274 <Leader>cwa CVSWatchAdd |
|
275 <Leader>cwn CVSWatchOn |
|
276 <Leader>cwf CVSWatchOff |
|
277 <Leader>cwf CVSWatchRemove |
|
278 |
|
279 *cvscommand-mappings-override* |
|
280 |
236 |
281 The default mappings can be overriden by user-provided instead by mapping to |
237 The default mappings can be overriden by user-provided instead by mapping to |
282 <Plug>CommandName. This is especially useful when these mappings collide with |
238 <Plug>CommandName. This is especially useful when these mappings collide with |
283 other existing mappings (vim will warn of this during plugin initialization, |
239 other existing mappings (vim will warn of this during plugin initialization, |
284 but will not clobber the existing mappings). |
240 but will not clobber the existing mappings). |
285 |
241 |
286 For instance, to override the default mapping for :CVSAdd to set it to '\add', |
242 For instance, to override the default mapping for :HGAdd to set it to '\add', |
287 add the following to the vimrc: |
243 add the following to the vimrc: |
288 |
244 |
289 nmap \add <Plug>CVSAdd |
245 nmap \add <Plug>HGAdd |
290 |
246 |
291 4.3 Automatic buffer variables *cvscommand-buffer-variables* |
247 4.3 Automatic buffer variables *hgcommand-buffer-variables* |
292 |
248 |
293 Several buffer variables are defined in each CVSCommand result buffer. These |
249 Several buffer variables are defined in each HGCommand result buffer. These |
294 may be useful for additional customization in callbacks defined in the event |
250 may be useful for additional customization in callbacks defined in the event |
295 handlers (please see |cvscommand-events|). |
251 handlers (please see |hgcommand-events|). |
296 |
252 |
297 The following variables are automatically defined: |
253 The following variables are automatically defined: |
298 |
254 |
299 b:cvsOrigBuffNR *b:cvsOrigBuffNR* |
255 b:hgOrigBuffNR *b:hgOrigBuffNR* |
300 |
256 |
301 This variable is set to the buffer number of the source file. |
257 This variable is set to the buffer number of the source file. |
302 |
258 |
303 b:cvscmd *b:cvscmd* |
259 b:hgcmd *b:hgcmd* |
304 |
260 |
305 This variable is set to the name of the cvs command that created the result |
261 This variable is set to the name of the hg command that created the result |
306 buffer. |
262 buffer. |
307 ============================================================================== |
263 ============================================================================== |
308 |
264 |
309 5. Configuration and customization *cvscommand-customize* |
265 5. Configuration and customization *hgcommand-customize* |
310 *cvscommand-config* |
266 *hgcommand-config* |
311 |
267 |
312 The CVSCommand plugin can be configured in two ways: by setting configuration |
268 The HGCommand plugin can be configured in two ways: by setting configuration |
313 variables (see |cvscommand-options|) or by defining CVSCommand event handlers |
269 variables (see |hgcommand-options|) or by defining HGCommand event handlers |
314 (see |cvscommand-events|). Additionally, the CVSCommand plugin provides |
270 (see |hgcommand-events|). Additionally, the HGCommand plugin provides |
315 several option for naming the CVS result buffers (see |cvscommand-naming|) and |
271 several option for naming the HG result buffers (see |hgcommand-naming|) and |
316 supported a customized status line (see |cvscommand-statusline| and |
272 supported a customized status line (see |hgcommand-statusline| and |
317 |cvscommand-buffer-management|). |
273 |hgcommand-buffer-management|). |
318 |
274 |
319 5.1 CVSCommand configuration variables *cvscommand-options* |
275 5.1 HGCommand configuration variables *hgcommand-options* |
320 |
276 |
321 Several variables affect the plugin's behavior. These variables are checked |
277 Several variables affect the plugin's behavior. These variables are checked |
322 at time of execution, and may be defined at the window, buffer, or global |
278 at time of execution, and may be defined at the window, buffer, or global |
323 level and are checked in that order of precedence. |
279 level and are checked in that order of precedence. |
324 |
280 |
325 |
281 |
326 The following variables are available: |
282 The following variables are available: |
327 |
283 |
328 |CVSCommandAnnotateParent| |
284 |HGCommandAnnotateParent| |
329 |CVSCommandCommitOnWrite| |
285 |HGCommandCommitOnWrite| |
330 |CVSCommandCVSExec| |
286 |HGCommandHGExec| |
331 |CVSCommandDeleteOnHide| |
287 |HGCommandDeleteOnHide| |
332 |CVSCommandDiffOpt| |
288 |HGCommandDiffOpt| |
333 |CVSCommandDiffSplit| |
289 |HGCommandDiffSplit| |
334 |CVSCommandEdit| |
290 |HGCommandEdit| |
335 |CVSCommandEnableBufferSetup| |
291 |HGCommandEnableBufferSetup| |
336 |CVSCommandInteractive| |
292 |HGCommandInteractive| |
337 |CVSCommandNameMarker| |
293 |HGCommandNameMarker| |
338 |CVSCommandNameResultBuffers| |
294 |HGCommandNameResultBuffers| |
339 |CVSCommandSplit| |
295 |HGCommandSplit| |
340 |
296 |
341 CVSCommandAnnotateParent *CVSCommandAnnotateParent* |
297 HGCommandAnnotateParent *HGCommandAnnotateParent* |
342 |
298 |
343 This variable, if set to a non-zero value, causes the zero-argument form of |
299 This variable, if set to a non-zero value, causes the zero-argument form of |
344 CVSAnnotate when invoked on a CVSAnnotate buffer to go to the version previous |
300 HGAnnotate when invoked on a HGAnnotate buffer to go to the version previous |
345 to that displayed on the current line. If not set, it defaults to 0. |
301 to that displayed on the current line. If not set, it defaults to 0. |
346 |
302 |
347 CVSCommandCommitOnWrite *CVSCommandCommitOnWrite* |
303 HGCommandCommitOnWrite *HGCommandCommitOnWrite* |
348 |
304 |
349 This variable, if set to a non-zero value, causes the pending cvs commit |
305 This variable, if set to a non-zero value, causes the pending hg commit |
350 to take place immediately as soon as the log message buffer is written. |
306 to take place immediately as soon as the log message buffer is written. |
351 If set to zero, only the CVSCommit mapping will cause the pending commit to |
307 If set to zero, only the HGCommit mapping will cause the pending commit to |
352 occur. If not set, it defaults to 1. |
308 occur. If not set, it defaults to 1. |
353 |
309 |
354 CVSCommandCVSExec *CVSCommandCVSExec* |
310 HGCommandHGExec *HGCommandHGExec* |
355 |
311 |
356 This variable controls the executable used for all CVS commands If not set, |
312 This variable controls the executable used for all HG commands If not set, |
357 it defaults to "cvs". |
313 it defaults to "hg". |
358 |
314 |
359 CVSCommandDeleteOnHide *CVSCommandDeleteOnHide* |
315 HGCommandDeleteOnHide *HGCommandDeleteOnHide* |
360 |
316 |
361 This variable, if set to a non-zero value, causes the temporary CVS result |
317 This variable, if set to a non-zero value, causes the temporary HG result |
362 buffers to automatically delete themselves when hidden. |
318 buffers to automatically delete themselves when hidden. |
363 |
319 |
364 CVSCommandDiffOpt *CVSCommandDiffOpt* |
320 HGCommandDiffOpt *HGCommandDiffOpt* |
365 |
321 |
366 This variable, if set, determines the options passed to the diff command of |
322 This variable, if set, determines the options passed to the diff command of |
367 CVS. If not set, it defaults to 'wbBc'. |
323 HG. If not set, it defaults to 'wbBc'. |
368 |
324 |
369 CVSCommandDiffSplit *CVSCommandDiffSplit* |
325 HGCommandDiffSplit *HGCommandDiffSplit* |
370 |
326 |
371 This variable overrides the |CVSCommandSplit| variable, but only for buffers |
327 This variable overrides the |HGCommandSplit| variable, but only for buffers |
372 created with |:CVSVimDiff|. |
328 created with |:HGVimDiff|. |
373 |
329 |
374 CVSCommandEdit *CVSCommandEdit* |
330 HGCommandEdit *HGCommandEdit* |
375 |
331 |
376 This variable controls whether the original buffer is replaced ('edit') or |
332 This variable controls whether the original buffer is replaced ('edit') or |
377 split ('split'). If not set, it defaults to 'edit'. |
333 split ('split'). If not set, it defaults to 'edit'. |
378 |
334 |
379 CVSCommandEnableBufferSetup *CVSCommandEnableBufferSetup* |
335 HGCommandEnableBufferSetup *HGCommandEnableBufferSetup* |
380 |
336 |
381 This variable, if set to a non-zero value, activates CVS buffer management |
337 This variable, if set to a non-zero value, activates HG buffer management |
382 mode see (|cvscommand-buffer-management|). This mode means that two buffer |
338 mode see (|hgcommand-buffer-management|). This mode means that two buffer |
383 variables, 'CVSRevision' and 'CVSBranch', are set if the file is |
339 variables, 'HGRevision' and 'HGBranch', are set if the file is |
384 CVS-controlled. This is useful for displaying version information in the |
340 HG-controlled. This is useful for displaying version information in the |
385 status bar. |
341 status bar. |
386 |
342 |
387 CVSCommandInteractive *CVSCommandInteractive* |
343 HGCommandInteractive *HGCommandInteractive* |
388 |
344 |
389 This variable, if set to a non-zero value, causes appropriate commands (for |
345 This variable, if set to a non-zero value, causes appropriate commands (for |
390 the moment, only |:CVSReview|) to query the user for a revision to use instead |
346 the moment, only |:HGReview|) to query the user for a revision to use instead |
391 of the current revision if none is specified. |
347 of the current revision if none is specified. |
392 |
348 |
393 CVSCommandNameMarker *CVSCommandNameMarker* |
349 HGCommandNameMarker *HGCommandNameMarker* |
394 |
350 |
395 This variable, if set, configures the special attention-getting characters |
351 This variable, if set, configures the special attention-getting characters |
396 that appear on either side of the cvs buffer type in the buffer name. This |
352 that appear on either side of the hg buffer type in the buffer name. This |
397 has no effect unless |CVSCommandNameResultBuffers| is set to a true value. If |
353 has no effect unless |HGCommandNameResultBuffers| is set to a true value. If |
398 not set, it defaults to '_'. |
354 not set, it defaults to '_'. |
399 |
355 |
400 CVSCommandNameResultBuffers *CVSCommandNameResultBuffers* |
356 HGCommandNameResultBuffers *HGCommandNameResultBuffers* |
401 |
357 |
402 This variable, if set to a true value, causes the cvs result buffers to be |
358 This variable, if set to a true value, causes the hg result buffers to be |
403 named in the old way ('<source file name> _<cvs command>_'). If not set |
359 named in the old way ('<source file name> _<hg command>_'). If not set |
404 or set to a false value, the result buffer is nameless. |
360 or set to a false value, the result buffer is nameless. |
405 |
361 |
406 CVSCommandSplit *CVSCommandSplit* |
362 HGCommandSplit *HGCommandSplit* |
407 |
363 |
408 This variable controls the orientation of the various window splits that |
364 This variable controls the orientation of the various window splits that |
409 may occur (such as with CVSVimDiff, when using a CVS command on a CVS |
365 may occur (such as with HGVimDiff, when using a HG command on a HG |
410 command buffer, or when the |CVSCommandEdit| variable is set to 'split'. |
366 command buffer, or when the |HGCommandEdit| variable is set to 'split'. |
411 If set to 'horizontal', the resulting windows will be on stacked on top of |
367 If set to 'horizontal', the resulting windows will be on stacked on top of |
412 one another. If set to 'vertical', the resulting windows will be |
368 one another. If set to 'vertical', the resulting windows will be |
413 side-by-side. If not set, it defaults to 'horizontal' for all but |
369 side-by-side. If not set, it defaults to 'horizontal' for all but |
414 CVSVimDiff windows. |
370 HGVimDiff windows. |
415 |
371 |
416 5.2 CVSCommand events *cvscommand-events* |
372 5.2 HGCommand events *hgcommand-events* |
417 |
373 |
418 For additional customization, CVSCommand can trigger user-defined events. |
374 For additional customization, HGCommand can trigger user-defined events. |
419 Event handlers are provided by defining User event autocommands (see |
375 Event handlers are provided by defining User event autocommands (see |
420 |autocommand|, |User|) in the CVSCommand group with patterns matching the |
376 |autocommand|, |User|) in the HGCommand group with patterns matching the |
421 event name. |
377 event name. |
422 |
378 |
423 For instance, the following could be added to the vimrc to provide a 'q' |
379 For instance, the following could be added to the vimrc to provide a 'q' |
424 mapping to quit a CVSCommand scratch buffer: |
380 mapping to quit a HGCommand scratch buffer: |
425 |
381 |
426 augroup CVSCommand |
382 augroup HGCommand |
427 au CVSCommand User CVSBufferCreated silent! nmap <unique> <buffer> q: bwipeout<cr> |
383 au HGCommand User HGBufferCreated silent! nmap <unique> <buffer> q: bwipeout<cr> |
428 augroup END |
384 augroup END |
429 |
385 |
430 The following hooks are available: |
386 The following hooks are available: |
431 |
387 |
432 CVSBufferCreated This event is fired just after a cvs command |
388 HGBufferCreated This event is fired just after a hg command |
433 result buffer is created and filled with the |
389 result buffer is created and filled with the |
434 result of a cvs command. It is executed within |
390 result of a hg command. It is executed within |
435 the context of the CVS command buffer. The |
391 the context of the HG command buffer. The |
436 CVSCommand buffer variables may be useful for |
392 HGCommand buffer variables may be useful for |
437 handlers of this event (please see |
393 handlers of this event (please see |
438 |cvscommand-buffer-variables|). |
394 |hgcommand-buffer-variables|). |
439 |
395 |
440 CVSBufferSetup This event is fired just after CVS buffer setup |
396 HGBufferSetup This event is fired just after HG buffer setup |
441 occurs, if enabled. |
397 occurs, if enabled. |
442 |
398 |
443 CVSPluginInit This event is fired when the CVSCommand plugin |
399 HGPluginInit This event is fired when the HGCommand plugin |
444 first loads. |
400 first loads. |
445 |
401 |
446 CVSPluginFinish This event is fired just after the CVSCommand |
402 HGPluginFinish This event is fired just after the HGCommand |
447 plugin loads. |
403 plugin loads. |
448 |
404 |
449 CVSVimDiffFinish This event is fired just after the CVSVimDiff |
405 HGVimDiffFinish This event is fired just after the HGVimDiff |
450 command executes to allow customization of, |
406 command executes to allow customization of, |
451 for instance, window placement and focus. |
407 for instance, window placement and focus. |
452 |
408 |
453 5.3 CVSCommand buffer naming *cvscommand-naming* |
409 5.3 HGCommand buffer naming *hgcommand-naming* |
454 |
410 |
455 By default, the buffers containing the result of CVS commands are nameless |
411 By default, the buffers containing the result of HG commands are nameless |
456 scratch buffers. It is intended that buffer variables of those buffers be |
412 scratch buffers. It is intended that buffer variables of those buffers be |
457 used to customize the statusline option so that the user may fully control the |
413 used to customize the statusline option so that the user may fully control the |
458 display of result buffers. |
414 display of result buffers. |
459 |
415 |
460 If the old-style naming is desired, please enable the |
416 If the old-style naming is desired, please enable the |
461 |CVSCommandNameResultBuffers| variable. Then, each result buffer will receive |
417 |HGCommandNameResultBuffers| variable. Then, each result buffer will receive |
462 a unique name that includes the source file name, the CVS command, and any |
418 a unique name that includes the source file name, the HG command, and any |
463 extra data (such as revision numbers) that were part of the command. |
419 extra data (such as revision numbers) that were part of the command. |
464 |
420 |
465 5.4 CVSCommand status line support *cvscommand-statusline* |
421 5.4 HGCommand status line support *hgcommand-statusline* |
466 |
422 |
467 It is intended that the user will customize the |'statusline'| option to |
423 It is intended that the user will customize the |'statusline'| option to |
468 include CVS result buffer attributes. A sample function that may be used in |
424 include HG result buffer attributes. A sample function that may be used in |
469 the |'statusline'| option is provided by the plugin, CVSGetStatusLine(). In |
425 the |'statusline'| option is provided by the plugin, HGGetStatusLine(). In |
470 order to use that function in the status line, do something like the |
426 order to use that function in the status line, do something like the |
471 following: |
427 following: |
472 |
428 |
473 set statusline=%<%f\ %{CVSGetStatusLine()}\ %h%m%r%=%l,%c%V\ %P |
429 set statusline=%<%f\ %{HGGetStatusLine()}\ %h%m%r%=%l,%c%V\ %P |
474 |
430 |
475 of which %{CVSGetStatusLine()} is the relevant portion. |
431 of which %{HGGetStatusLine()} is the relevant portion. |
476 |
432 |
477 The sample CVSGetStatusLine() function handles both CVS result buffers and |
433 The sample HGGetStatusLine() function handles both HG result buffers and |
478 CVS-managed files if CVSCommand buffer management is enabled (please see |
434 HG-managed files if HGCommand buffer management is enabled (please see |
479 |cvscommand-buffer-management|). |
435 |hgcommand-buffer-management|). |
480 |
436 |
481 5.5 CVSCommand buffer management *cvscommand-buffer-management* |
437 5.5 HGCommand buffer management *hgcommand-buffer-management* |
482 |
438 |
483 The CVSCommand plugin can operate in buffer management mode, which means that |
439 The HGCommand plugin can operate in buffer management mode, which means that |
484 it attempts to set two buffer variables ('CVSRevision' and 'CVSBranch') upon |
440 it attempts to set two buffer variables ('HGRevision' and 'HGBranch') upon |
485 entry into a buffer. This is rather slow because it means that 'cvs status' |
441 entry into a buffer. This is rather slow because it means that 'hg status' |
486 will be invoked at each entry into a buffer (during the |BufEnter| |
442 will be invoked at each entry into a buffer (during the |BufEnter| |
487 autocommand). |
443 autocommand). |
488 |
444 |
489 This mode is disabled by default. In order to enable it, set the |
445 This mode is disabled by default. In order to enable it, set the |
490 |CVSCommandEnableBufferSetup| variable to a true (non-zero) value. Enabling |
446 |HGCommandEnableBufferSetup| variable to a true (non-zero) value. Enabling |
491 this mode simply provides the buffer variables mentioned above. The user must |
447 this mode simply provides the buffer variables mentioned above. The user must |
492 explicitly include those in the |'statusline'| option if they are to appear in |
448 explicitly include those in the |'statusline'| option if they are to appear in |
493 the status line (but see |cvscommand-statusline| for a simple way to do that). |
449 the status line (but see |hgcommand-statusline| for a simple way to do that). |
494 |
450 |
495 ============================================================================== |
451 ============================================================================== |
496 |
452 |
497 6. SSH "integration" *cvscommand-ssh* |
453 6. SSH "integration" *hgcommand-ssh* |
498 |
454 |
499 The following instructions are intended for use in integrating the |
455 The following instructions are intended for use in integrating the |
500 cvscommand.vim plugin with an SSH-based CVS environment. |
456 hgcommand.vim plugin with an SSH-based HG environment. |
501 |
457 |
502 Familiarity with SSH and CVS are assumed. |
458 Familiarity with SSH and HG are assumed. |
503 |
459 |
504 These instructions assume that the intent is to have a message box pop up in |
460 These instructions assume that the intent is to have a message box pop up in |
505 order to allow the user to enter a passphrase. If, instead, the user is |
461 order to allow the user to enter a passphrase. If, instead, the user is |
506 comfortable using certificate-based authentication, then only instructions |
462 comfortable using certificate-based authentication, then only instructions |
507 6.1.1 and 6.1.2 (and optionally 6.1.4) need to be followed; ssh should then |
463 6.1.1 and 6.1.2 (and optionally 6.1.4) need to be followed; ssh should then |
508 work transparently. |
464 work transparently. |
509 |
465 |
510 6.1 Environment settings *cvscommand-ssh-env* |
466 6.1 Environment settings *hgcommand-ssh-env* |
511 |
467 |
512 6.1.1 CVSROOT should be set to something like: |
468 6.1.1 HGROOT should be set to something like: |
513 |
469 |
514 :ext:user@host:/path_to_repository |
470 :ext:user@host:/path_to_repository |
515 |
471 |
516 6.1.2 CVS_RSH should be set to: |
472 6.1.2 HG_RSH should be set to: |
517 |
473 |
518 ssh |
474 ssh |
519 |
475 |
520 Together, those settings tell CVS to use ssh as the transport when |
476 Together, those settings tell HG to use ssh as the transport when |
521 performing CVS calls. |
477 performing HG calls. |
522 |
478 |
523 6.1.3 SSH_ASKPASS should be set to the password-dialog program. In my case, |
479 6.1.3 SSH_ASKPASS should be set to the password-dialog program. In my case, |
524 running gnome, it's set to: |
480 running gnome, it's set to: |
525 |
481 |
526 /usr/libexec/openssh/gnome-ssh-askpass |
482 /usr/libexec/openssh/gnome-ssh-askpass |
527 |
483 |
528 This tells SSH how to get passwords if no input is available. |
484 This tells SSH how to get passwords if no input is available. |
529 |
485 |
530 6.1.4 OPTIONAL. You may need to set SSH_SERVER to the location of the cvs |
486 6.1.4 OPTIONAL. You may need to set SSH_SERVER to the location of the hg |
531 executable on the remote (server) machine. |
487 executable on the remote (server) machine. |
532 |
488 |
533 6.2 CVS wrapper program *cvscommand-ssh-wrapper* |
489 6.2 HG wrapper program *hgcommand-ssh-wrapper* |
534 |
490 |
535 Now you need to convince SSH to use the password-dialog program. This means |
491 Now you need to convince SSH to use the password-dialog program. This means |
536 you need to execute SSH (and therefore CVS) without standard input. The |
492 you need to execute SSH (and therefore HG) without standard input. The |
537 following script is a simple perl wrapper that dissasociates the CVS command |
493 following script is a simple perl wrapper that dissasociates the HG command |
538 from the current terminal. Specific steps to do this may vary from system to |
494 from the current terminal. Specific steps to do this may vary from system to |
539 system; the following example works for me on linux. |
495 system; the following example works for me on linux. |
540 |
496 |
541 #!/usr/bin/perl -w |
497 #!/usr/bin/perl -w |
542 use strict; |
498 use strict; |
543 use POSIX qw(setsid); |
499 use POSIX qw(setsid); |
544 open STDIN, '/dev/null'; |
500 open STDIN, '/dev/null'; |
545 fork and do {wait; exit;}; |
501 fork and do {wait; exit;}; |
546 setsid; |
502 setsid; |
547 exec('cvs', @ARGV); |
503 exec('hg', @ARGV); |
548 |
504 |
549 6.3 Configuring cvscommand.vim *cvscommand-ssh-config* |
505 6.3 Configuring hgcommand.vim *hgcommand-ssh-config* |
550 |
506 |
551 At this point, you should be able to use your wrapper script to invoke CVS with |
507 At this point, you should be able to use your wrapper script to invoke HG with |
552 various commands, and get the password dialog. All that's left is to make CVS |
508 various commands, and get the password dialog. All that's left is to make HG |
553 use your newly-created wrapper script. |
509 use your newly-created wrapper script. |
554 |
510 |
555 6.3.1 Tell cvscommand.vim what CVS executable to use. The easiest way to do this |
511 6.3.1 Tell hgcommand.vim what HG executable to use. The easiest way to do this |
556 is globally, by putting the following in your .vimrc: |
512 is globally, by putting the following in your .vimrc: |
557 |
513 |
558 let CVSCommandCVSExec=/path/to/cvs/wrapper/script |
514 let HGCommandHGExec=/path/to/hg/wrapper/script |
559 |
515 |
560 6.4 Where to go from here *cvscommand-ssh-other* |
516 6.4 Where to go from here *hgcommand-ssh-other* |
561 |
517 |
562 The script given above works even when non-SSH CVS connections are used, |
518 The script given above works even when non-SSH HG connections are used, |
563 except possibly when interactively entering the message for CVS commit log |
519 except possibly when interactively entering the message for HG commit log |
564 (depending on the editor you use... VIM works fine). Since the cvscommand.vim |
520 (depending on the editor you use... VIM works fine). Since the hgcommand.vim |
565 plugin handles that message without a terminal, the wrapper script can be used |
521 plugin handles that message without a terminal, the wrapper script can be used |
566 all the time. |
522 all the time. |
567 |
523 |
568 This allows mixed-mode operation, where some work is done with SSH-based CVS |
524 This allows mixed-mode operation, where some work is done with SSH-based HG |
569 repositories, and others with pserver or local access. |
525 repositories, and others with pserver or local access. |
570 |
526 |
571 It is possible, though beyond the scope of the plugin, to dynamically set the |
527 It is possible, though beyond the scope of the plugin, to dynamically set the |
572 CVS executable based on the CVSROOT for the file being edited. The user |
528 HG executable based on the HGROOT for the file being edited. The user |
573 events provided (such as CVSBufferCreated and CVSBufferSetup) can be used to |
529 events provided (such as HGBufferCreated and HGBufferSetup) can be used to |
574 set a buffer-local value (b:CVSCommandCVSExec) to override the CVS executable |
530 set a buffer-local value (b:HGCommandHGExec) to override the HG executable |
575 on a file-by-file basis. Alternatively, much the same can be done (less |
531 on a file-by-file basis. Alternatively, much the same can be done (less |
576 automatically) by the various project-oriented plugins out there. |
532 automatically) by the various project-oriented plugins out there. |
577 |
533 |
578 It is highly recommended for ease-of-use that certificates with no passphrase |
534 It is highly recommended for ease-of-use that certificates with no passphrase |
579 or ssh-agent are employed so that the user is not given the password prompt |
535 or ssh-agent are employed so that the user is not given the password prompt |
580 too often. |
536 too often. |
581 |
537 |
582 ============================================================================== |
538 ============================================================================== |
583 9. Tips *cvscommand-tips* |
539 9. Tips *hgcommand-tips* |
584 |
540 |
585 9.1 Split window annotation, by Michael Anderson |
541 9.1 Split window annotation, by Michael Anderson |
586 |
542 |
587 :nmap <Leader>cN :vs<CR><C-w>h<Leader>cn:vertical res 40<CR> |
543 :nmap <Leader>hgN :vs<CR><C-w>h<Leader>hgn:vertical res 40<CR> |
588 \ggdddd:set scb<CR>:set nowrap<CR><C-w>lgg:set scb<CR> |
544 \ggdddd:set scb<CR>:set nowrap<CR><C-w>lgg:set scb<CR> |
589 \:set nowrap<CR> |
545 \:set nowrap<CR> |
590 |
546 |
591 This splits the buffer vertically, puts an annotation on the left (minus the |
547 This splits the buffer vertically, puts an annotation on the left (minus the |
592 header) with the width set to 40. An editable/normal copy is placed on the |
548 header) with the width set to 40. An editable/normal copy is placed on the |