blob: a7a61df4e5c7e61025ddf18411a98bad0c43a8cb [file] [log] [blame]
Bram Moolenaarfa735342016-01-03 22:14:44 +01001*if_tcl.txt* For Vim version 7.4. Last change: 2016 Jan 01
Bram Moolenaar071d4272004-06-13 20:20:40 +00002
3
4 VIM REFERENCE MANUAL by Ingo Wilken
5
6
7The Tcl Interface to Vim *tcl* *Tcl* *TCL*
8
91. Commands |tcl-ex-commands|
102. Tcl commands |tcl-commands|
113. Tcl variables |tcl-variables|
124. Tcl window commands |tcl-window-cmds|
135. Tcl buffer commands |tcl-buffer-cmds|
146. Miscellaneous; Output from Tcl |tcl-misc| |tcl-output|
157. Known bugs & problems |tcl-bugs|
168. Examples |tcl-examples|
Bram Moolenaara5792f52005-11-23 21:25:05 +0000179. Dynamic loading |tcl-dynamic|
Bram Moolenaar071d4272004-06-13 20:20:40 +000018
19{Vi does not have any of these commands} *E280* *E281*
20
21The Tcl interface only works when Vim was compiled with the |+tcl| feature.
22
23WARNING: There are probably still some bugs. Please send bug reports,
24comments, ideas etc to <Ingo.Wilken@informatik.uni-oldenburg.de>
25
26==============================================================================
271. Commands *tcl-ex-commands* *E571* *E572*
28
29 *:tcl* *:tc*
Bram Moolenaar9b451252012-08-15 17:43:31 +020030:tc[l] {cmd} Execute Tcl command {cmd}. A simple check if `:tcl`
31 is working: >
32 :tcl puts "Hello"
Bram Moolenaar071d4272004-06-13 20:20:40 +000033
34:[range]tc[l] << {endmarker}
35{script}
36{endmarker}
37 Execute Tcl script {script}.
38 Note: This command doesn't work when the Tcl feature
39 wasn't compiled in. To avoid errors, see
40 |script-here|.
41
Bram Moolenaar402d2fe2005-04-15 21:00:38 +000042{endmarker} must NOT be preceded by any white space. If {endmarker} is
Bram Moolenaar071d4272004-06-13 20:20:40 +000043omitted from after the "<<", a dot '.' must be used after {script}, like for
44the |:append| and |:insert| commands.
45This form of the |:tcl| command is mainly useful for including tcl code in Vim
46scripts.
47
48Example: >
49 function! DefineDate()
50 tcl << EOF
51 proc date {} {
52 return [clock format [clock seconds]]
53 }
54 EOF
55 endfunction
56<
57
58 *:tcldo* *:tcld*
59:[range]tcld[o] {cmd} Execute Tcl command {cmd} for each line in [range]
60 with the variable "line" being set to the text of each
61 line in turn, and "lnum" to the line number. Setting
62 "line" will change the text, but note that it is not
63 possible to add or delete lines using this command.
64 If {cmd} returns an error, the command is interrupted.
65 The default for [range] is the whole file: "1,$".
66 See |tcl-var-line| and |tcl-var-lnum|. {not in Vi}
67
68 *:tclfile* *:tclf*
69:tclf[ile] {file} Execute the Tcl script in {file}. This is the same as
70 ":tcl source {file}", but allows file name completion.
71 {not in Vi}
72
73
74Note that Tcl objects (like variables) persist from one command to the next,
75just as in the Tcl shell.
76
77Executing Tcl commands is not possible in the |sandbox|.
78
79==============================================================================
802. Tcl commands *tcl-commands*
81
82Tcl code gets all of its access to vim via commands in the "::vim" namespace.
83The following commands are implemented: >
84
85 ::vim::beep # Guess.
86 ::vim::buffer {n} # Create Tcl command for one buffer.
87 ::vim::buffer list # Create Tcl commands for all buffers.
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +010088 ::vim::command [-quiet] {cmd} # Execute an Ex command.
Bram Moolenaar071d4272004-06-13 20:20:40 +000089 ::vim::expr {expr} # Use Vim's expression evaluator.
90 ::vim::option {opt} # Get vim option.
91 ::vim::option {opt} {val} # Set vim option.
92 ::vim::window list # Create Tcl commands for all windows.
93
94Commands:
95 ::vim::beep *tcl-beep*
96 Honk. Does not return a result.
97
98 ::vim::buffer {n} *tcl-buffer*
99 ::vim::buffer exists {n}
100 ::vim::buffer list
101 Provides access to vim buffers. With an integer argument, creates a
102 buffer command (see |tcl-buffer-cmds|) for the buffer with that
103 number, and returns its name as the result. Invalid buffer numbers
104 result in a standard Tcl error. To test for valid buffer numbers,
105 vim's internal functions can be used: >
106 set nbufs [::vim::expr bufnr("$")]
107 set isvalid [::vim::expr "bufexists($n)"]
108< The "list" option creates a buffer command for each valid buffer, and
109 returns a list of the command names as the result.
110 Example: >
111 set bufs [::vim::buffer list]
112 foreach b $bufs { $b append end "The End!" }
113< The "exists" option checks if a buffer with the given number exists.
114 Example: >
115 if { [::vim::buffer exists $n] } { ::vim::command ":e #$n" }
116< This command might be replaced by a variable in future versions.
117 See also |tcl-var-current| for the current buffer.
118
119 ::vim::command {cmd} *tcl-command*
120 ::vim::command -quiet {cmd}
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +0100121 Execute the vim (ex-mode) command {cmd}. Any Ex command that affects
Bram Moolenaar071d4272004-06-13 20:20:40 +0000122 a buffer or window uses the current buffer/current window. Does not
123 return a result other than a standard Tcl error code. After this
124 command is completed, the "::vim::current" variable is updated.
125 The "-quiet" flag suppresses any error messages from vim.
126 Examples: >
127 ::vim::command "set ts=8"
128 ::vim::command "%s/foo/bar/g"
129< To execute normal-mode commands, use "normal" (see |:normal|): >
130 set cmd "jj"
131 ::vim::command "normal $cmd"
132< See also |tcl-window-command| and |tcl-buffer-command|.
133
134 ::vim::expr {expr} *tcl-expr*
135 Evaluates the expression {expr} using vim's internal expression
136 evaluator (see |expression|). Any expression that queries a buffer
137 or window property uses the current buffer/current window. Returns
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000138 the result as a string. A |List| is turned into a string by joining
139 the items and inserting line breaks.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000140 Examples: >
141 set perl_available [::vim::expr has("perl")]
142< See also |tcl-window-expr| and |tcl-buffer-expr|.
143
144 ::vim::option {opt} *tcl-option*
145 ::vim::option {opt} {value}
146 Without second argument, queries the value of a vim option. With this
147 argument, sets the vim option to {value}, and returns the previous
148 value as the result. Any options that are marked as 'local to buffer'
149 or 'local to window' affect the current buffer/current window. The
150 global value is not changed, use the ":set" command for that. For
151 boolean options, {value} should be "0" or "1", or any of the keywords
152 "on", "off" or "toggle". See |option-summary| for a list of options.
153 Example: >
154 ::vim::option ts 8
155< See also |tcl-window-option| and |tcl-buffer-option|.
156
157 ::vim::window {option} *tcl-window*
158 Provides access to vim windows. Currently only the "list" option is
Bram Moolenaar402d2fe2005-04-15 21:00:38 +0000159 implemented. This creates a window command (see |tcl-window-cmds|) for
Bram Moolenaar071d4272004-06-13 20:20:40 +0000160 each window, and returns a list of the command names as the result.
161 Example: >
162 set wins [::vim::window list]
163 foreach w $wins { $w height 4 }
164< This command might be replaced by a variable in future versions.
165 See also |tcl-var-current| for the current window.
166
167==============================================================================
1683. Tcl variables *tcl-variables*
169
170The ::vim namespace contains a few variables. These are created when the Tcl
171interpreter is called from vim and set to current values. >
172
173 ::vim::current # array containing "current" objects
174 ::vim::lbase # number of first line
175 ::vim::range # array containing current range numbers
176 line # current line as a string (:tcldo only)
177 lnum # current line number (:tcldo only)
178
179Variables:
180 ::vim::current *tcl-var-current*
181 This is an array providing access to various "current" objects
182 available in vim. The contents of this array are updated after
183 "::vim::command" is called, as this might change vim's current
184 settings (e.g., by deleting the current buffer).
185 The "buffer" element contains the name of the buffer command for the
186 current buffer. This can be used directly to invoke buffer commands
187 (see |tcl-buffer-cmds|). This element is read-only.
188 Example: >
189 $::vim::current(buffer) insert begin "Hello world"
190< The "window" element contains the name of the window command for the
191 current window. This can be used directly to invoke window commands
192 (see |tcl-window-cmds|). This element is read-only.
193 Example: >
194 $::vim::current(window) height 10
195<
196 ::vim::lbase *tcl-var-lbase*
197 This variable controls how Tcl treats line numbers. If it is set to
198 '1', then lines and columns start at 1. This way, line numbers from
199 Tcl commands and vim expressions are compatible. If this variable is
200 set to '0', then line numbers and columns start at 0 in Tcl. This is
201 useful if you want to treat a buffer as a Tcl list or a line as a Tcl
202 string and use standard Tcl commands that return an index ("lsort" or
203 "string first", for example). The default value is '1'. Currently,
204 any non-zero values is treated as '1', but your scripts should not
205 rely on this. See also |tcl-linenumbers|.
206
207 ::vim::range *tcl-var-range*
208 This is an array with three elements, "start", "begin" and "end". It
209 contains the line numbers of the start and end row of the current
210 range. "begin" is the same as "start". This variable is read-only.
211 See |tcl-examples|.
212
213 line *tcl-var-line*
214 lnum *tcl-var-lnum*
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +0100215 These global variables are only available if the ":tcldo" Ex command
Bram Moolenaar071d4272004-06-13 20:20:40 +0000216 is being executed. They contain the text and line number of the
217 current line. When the Tcl command invoked by ":tcldo" is completed,
218 the current line is set to the contents of the "line" variable, unless
219 the variable was unset by the Tcl command. The "lnum" variable is
220 read-only. These variables are not in the "::vim" namespace so they
221 can be used in ":tcldo" without much typing (this might be changed in
222 future versions). See also |tcl-linenumbers|.
223
224==============================================================================
2254. Tcl window commands *tcl-window-cmds*
226
227Window commands represent vim windows. They are created by several commands:
228 ::vim::window list |tcl-window|
229 "windows" option of a buffer command |tcl-buffer-windows|
230The ::vim::current(window) variable contains the name of the window command
231for the current window. A window command is automatically deleted when the
232corresponding vim window is closed.
233
Bram Moolenaar402d2fe2005-04-15 21:00:38 +0000234Let's assume the name of the window command is stored in the Tcl variable "win",
Bram Moolenaar071d4272004-06-13 20:20:40 +0000235i.e. "$win" calls the command. The following options are available: >
236
237 $win buffer # Create Tcl command for window's buffer.
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +0100238 $win command {cmd} # Execute Ex command in windows context.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000239 $win cursor # Get current cursor position.
240 $win cursor {var} # Set cursor position from array variable.
241 $win cursor {row} {col} # Set cursor position.
242 $win delcmd {cmd} # Call Tcl command when window is closed.
243 $win expr {expr} # Evaluate vim expression in windows context.
244 $win height # Report the window's height.
245 $win height {n} # Set the window's height.
246 $win option {opt} [val] # Get/Set vim option in windows context.
247
248Options:
249 $win buffer *tcl-window-buffer*
250 Creates a Tcl command for the window's buffer, and returns its name as
251 the result. The name should be stored in a variable: >
252 set buf [$win buffer]
253< $buf is now a valid Tcl command. See |tcl-buffer-cmds| for the
254 available options.
255
256 $win cursor *tcl-window-cursor*
257 $win cursor {var}
258 $win cursor {row} {col}
259 Without argument, reports the current cursor position as a string.
260 This can be converted to a Tcl array variable: >
261 array set here [$win cursor]
262< "here(row)" and "here(column)" now contain the cursor position.
263 With a single argument, the argument is interpreted as the name of a
264 Tcl array variable, which must contain two elements "row" and "column".
265 These are used to set the cursor to the new position: >
266 $win cursor here ;# not $here !
267< With two arguments, sets the cursor to the specified row and column: >
268 $win cursor $here(row) $here(column)
269< Invalid positions result in a standard Tcl error, which can be caught
270 with "catch". The row and column values depend on the "::vim::lbase"
271 variable. See |tcl-var-lbase|.
272
273 $win delcmd {cmd} *tcl-window-delcmd*
274 Registers the Tcl command {cmd} as a deletion callback for the window.
275 This command is executed (in the global scope) just before the window
276 is closed. Complex commands should be build with "list": >
277 $win delcmd [list puts vimerr "window deleted"]
278< See also |tcl-buffer-delcmd|.
279
280 $win height *tcl-window-height*
281 $win height {n}
282 Without argument, reports the window's current height. With an
283 argument, tries to set the window's height to {n}, then reports the
284 new height (which might be different from {n}).
285
286 $win command [-quiet] {cmd} *tcl-window-command*
287 $win expr {expr} *tcl-window-expr*
288 $win option {opt} [val] *tcl-window-option*
289 These are similar to "::vim::command" etc., except that everything is
290 done in the context of the window represented by $win, instead of the
291 current window. For example, setting an option that is marked 'local
292 to window' affects the window $win. Anything that affects or queries
293 a buffer uses the buffer displayed in this window (i.e. the buffer
294 that is represented by "$win buffer"). See |tcl-command|, |tcl-expr|
295 and |tcl-option| for more information.
296 Example: >
297 $win option number on
298
299==============================================================================
3005. Tcl buffer commands *tcl-buffer-cmds*
301
302Buffer commands represent vim buffers. They are created by several commands:
303 ::vim::buffer {N} |tcl-buffer|
304 ::vim::buffer list |tcl-buffer|
305 "buffer" option of a window command |tcl-window-buffer|
306The ::vim::current(buffer) variable contains the name of the buffer command
307for the current buffer. A buffer command is automatically deleted when the
308corresponding vim buffer is destroyed. Whenever the buffer's contents are
309changed, all marks in the buffer are automatically adjusted. Any changes to
310the buffer's contents made by Tcl commands can be undone with the "undo" vim
311command (see |undo|).
312
Bram Moolenaar402d2fe2005-04-15 21:00:38 +0000313Let's assume the name of the buffer command is stored in the Tcl variable "buf",
Bram Moolenaar071d4272004-06-13 20:20:40 +0000314i.e. "$buf" calls the command. The following options are available: >
315
316 $buf append {n} {str} # Append a line to buffer, after line {n}.
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +0100317 $buf command {cmd} # Execute Ex command in buffers context.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000318 $buf count # Report number of lines in buffer.
319 $buf delcmd {cmd} # Call Tcl command when buffer is deleted.
320 $buf delete {n} # Delete a single line.
321 $buf delete {n} {m} # Delete several lines.
322 $buf expr {expr} # Evaluate vim expression in buffers context.
323 $buf get {n} # Get a single line as a string.
324 $buf get {n} {m} # Get several lines as a list.
325 $buf insert {n} {str} # Insert a line in buffer, as line {n}.
326 $buf last # Report line number of last line in buffer.
327 $buf mark {mark} # Report position of buffer mark.
328 $buf name # Report name of file in buffer.
329 $buf number # Report number of this buffer.
330 $buf option {opt} [val] # Get/Set vim option in buffers context.
331 $buf set {n} {text} # Replace a single line.
332 $buf set {n} {m} {list} # Replace several lines.
333 $buf windows # Create Tcl commands for buffer's windows.
334<
335 *tcl-linenumbers*
336Most buffer commands take line numbers as arguments. How Tcl treats these
337numbers depends on the "::vim::lbase" variable (see |tcl-var-lbase|). Instead
338of line numbers, several keywords can be also used: "top", "start", "begin",
339"first", "bottom", "end" and "last".
340
341Options:
342 $buf append {n} {str} *tcl-buffer-append*
343 $buf insert {n} {str} *tcl-buffer-insert*
344 Add a line to the buffer. With the "insert" option, the string
345 becomes the new line {n}, with "append" it is inserted after line {n}.
346 Example: >
347 $buf insert top "This is the beginning."
348 $buf append end "This is the end."
349< To add a list of lines to the buffer, use a loop: >
350 foreach line $list { $buf append $num $line ; incr num }
351<
352 $buf count *tcl-buffer-count*
353 Reports the total number of lines in the buffer.
354
355 $buf delcmd {cmd} *tcl-buffer-delcmd*
356 Registers the Tcl command {cmd} as a deletion callback for the buffer.
357 This command is executed (in the global scope) just before the buffer
358 is deleted. Complex commands should be build with "list": >
359 $buf delcmd [list puts vimerr "buffer [$buf number] gone"]
360< See also |tcl-window-delcmd|.
361
362 $buf delete {n} *tcl-buffer-delete*
363 $buf delete {n} {m}
364 Deletes line {n} or lines {n} through {m} from the buffer.
365 This example deletes everything except the last line: >
366 $buf delete first [expr [$buf last] - 1]
367<
368 $buf get {n} *tcl-buffer-get*
369 $buf get {n} {m}
370 Gets one or more lines from the buffer. For a single line, the result
371 is a string; for several lines, a list of strings.
372 Example: >
373 set topline [$buf get top]
374<
375 $buf last *tcl-buffer-last*
376 Reports the line number of the last line. This value depends on the
377 "::vim::lbase" variable. See |tcl-var-lbase|.
378
379 $buf mark {mark} *tcl-buffer-mark*
380 Reports the position of the named mark as a string, similar to the
381 cursor position of the "cursor" option of a window command (see
382 |tcl-window-cursor|). This can be converted to a Tcl array variable: >
383 array set mpos [$buf mark "a"]
384< "mpos(column)" and "mpos(row)" now contain the position of the mark.
385 If the mark is not set, a standard Tcl error results.
386
387 $buf name
388 Reports the name of the file in the buffer. For a buffer without a
389 file, this is an empty string.
390
391 $buf number
392 Reports the number of this buffer. See |:buffers|.
393 This example deletes a buffer from vim: >
394 ::vim::command "bdelete [$buf number]"
395<
396 $buf set {n} {string} *tcl-buffer-set*
397 $buf set {n} {m} {list}
398 Replace one or several lines in the buffer. If the list contains more
399 elements than there are lines to replace, they are inserted into the
400 buffer. If the list contains fewer elements, any unreplaced line is
401 deleted from the buffer.
402
403 $buf windows *tcl-buffer-windows*
404 Creates a window command for each window that displays this buffer, and
405 returns a list of the command names as the result.
406 Example: >
407 set winlist [$buf windows]
408 foreach win $winlist { $win height 4 }
409< See |tcl-window-cmds| for the available options.
410
411 $buf command [-quiet] {cmd} *tcl-buffer-command*
Bram Moolenaarc236c162008-07-13 17:41:49 +0000412 $buf expr {expr} *tcl-buffer-expr*
Bram Moolenaar071d4272004-06-13 20:20:40 +0000413 $buf option {opt} [val] *tcl-buffer-option*
414 These are similar to "::vim::command" etc., except that everything is
415 done in the context of the buffer represented by $buf, instead of the
416 current buffer. For example, setting an option that is marked 'local
417 to buffer' affects the buffer $buf. Anything that affects or queries
418 a window uses the first window in vim's window list that displays this
419 buffer (i.e. the first entry in the list returned by "$buf windows").
420 See |tcl-command|, |tcl-expr| and |tcl-option| for more information.
421 Example: >
422 if { [$buf option modified] } { $buf command "w" }
423
424==============================================================================
4256. Miscellaneous; Output from Tcl *tcl-misc* *tcl-output*
426
427The standard Tcl commands "exit" and "catch" are replaced by custom versions.
428"exit" terminates the current Tcl script and returns to vim, which deletes the
429Tcl interpreter. Another call to ":tcl" then creates a new Tcl interpreter.
430"exit" does NOT terminate vim! "catch" works as before, except that it does
431not prevent script termination from "exit". An exit code != 0 causes the ex
432command that invoked the Tcl script to return an error.
433
434Two new I/O streams are available in Tcl, "vimout" and "vimerr". All output
435directed to them is displayed in the vim message area, as information messages
436and error messages, respectively. The standard Tcl output streams stdout and
437stderr are mapped to vimout and vimerr, so that a normal "puts" command can be
438used to display messages in vim.
439
440==============================================================================
4417. Known bugs & problems *tcl-bugs*
442
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +0100443Calling one of the Tcl Ex commands from inside Tcl (via "::vim::command") may
Bram Moolenaar071d4272004-06-13 20:20:40 +0000444have unexpected side effects. The command creates a new interpreter, which
445has the same abilities as the standard interpreter - making "::vim::command"
446available in a safe child interpreter therefore makes the child unsafe. (It
447would be trivial to block nested :tcl* calls or ensure that such calls from a
448safe interpreter create only new safe interpreters, but quite pointless -
449depending on vim's configuration, "::vim::command" may execute arbitrary code
450in any number of other scripting languages.) A call to "exit" within this new
451interpreter does not affect the old interpreter; it only terminates the new
452interpreter, then script processing continues normally in the old interpreter.
453
454Input from stdin is currently not supported.
455
456==============================================================================
4578. Examples: *tcl-examples*
458
459Here are a few small (and maybe useful) Tcl scripts.
460
461This script sorts the lines of the entire buffer (assume it contains a list
462of names or something similar):
463 set buf $::vim::current(buffer)
464 set lines [$buf get top bottom]
465 set lines [lsort -dictionary $lines]
466 $buf set top bottom $lines
467
468This script reverses the lines in the buffer. Note the use of "::vim::lbase"
469and "$buf last" to work with any line number setting.
470 set buf $::vim::current(buffer)
471 set t $::vim::lbase
472 set b [$buf last]
473 while { $t < $b } {
474 set tl [$buf get $t]
475 set bl [$buf get $b]
476 $buf set $t $bl
477 $buf set $b $tl
478 incr t
479 incr b -1
480 }
481
482This script adds a consecutive number to each line in the current range:
483 set buf $::vim::current(buffer)
484 set i $::vim::range(start)
485 set n 1
486 while { $i <= $::vim::range(end) } {
487 set line [$buf get $i]
488 $buf set $i "$n\t$line"
489 incr i ; incr n
490 }
491
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +0100492The same can also be done quickly with two Ex commands, using ":tcldo":
Bram Moolenaar071d4272004-06-13 20:20:40 +0000493 :tcl set n 1
494 :[range]tcldo set line "$n\t$line" ; incr n
495
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +0100496This procedure runs an Ex command on each buffer (idea stolen from Ron Aaron):
Bram Moolenaar071d4272004-06-13 20:20:40 +0000497 proc eachbuf { cmd } {
498 foreach b [::vim::buffer list] {
499 $b command $cmd
500 }
501 }
502Use it like this:
503 :tcl eachbuf %s/foo/bar/g
Bram Moolenaar402d2fe2005-04-15 21:00:38 +0000504Be careful with Tcl's string and backslash substitution, tough. If in doubt,
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +0100505surround the Ex command with curly braces.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000506
507
508If you want to add some Tcl procedures permanently to vim, just place them in
509a file (e.g. "~/.vimrc.tcl" on Unix machines), and add these lines to your
510startup file (usually "~/.vimrc" on Unix):
511 if has("tcl")
512 tclfile ~/.vimrc.tcl
513 endif
514
515==============================================================================
Bram Moolenaara5792f52005-11-23 21:25:05 +00005169. Dynamic loading *tcl-dynamic*
517
Bram Moolenaar8a5115c2016-01-09 19:41:11 +0100518On MS-Windows and Unix the Tcl library can be loaded dynamically. The
519|:version| output then includes |+tcl/dyn|.
Bram Moolenaara5792f52005-11-23 21:25:05 +0000520
Bram Moolenaar8a5115c2016-01-09 19:41:11 +0100521This means that Vim will search for the Tcl DLL or shared library file only
522when needed. When you don't use the Tcl interface you don't need it, thus you
523can use Vim without this file.
524
525
526MS-Windows ~
Bram Moolenaara5792f52005-11-23 21:25:05 +0000527
528To use the Tcl interface the Tcl DLL must be in your search path. In a
Bram Moolenaare18c0b32016-03-20 21:08:34 +0100529console window type "path" to see what directories are used. The 'tcldll'
530option can be also used to specify the Tcl DLL.
Bram Moolenaara5792f52005-11-23 21:25:05 +0000531
532The name of the DLL must match the Tcl version Vim was compiled with.
Bram Moolenaarfa735342016-01-03 22:14:44 +0100533Currently the name is "tcl86.dll". That is for Tcl 8.6. To know for sure
Bram Moolenaara5792f52005-11-23 21:25:05 +0000534edit "gvim.exe" and search for "tcl\d*.dll\c".
535
Bram Moolenaar8a5115c2016-01-09 19:41:11 +0100536
537Unix ~
538
539The 'tcldll' option can be used to specify the Tcl shared library file instead
540of DYNAMIC_TCL_DLL file what was specified at compile time. The version of
541the shared library must match the Tcl version Vim was compiled with.
542
Bram Moolenaara5792f52005-11-23 21:25:05 +0000543==============================================================================
Bram Moolenaar071d4272004-06-13 20:20:40 +0000544 vim:tw=78:ts=8:ft=help:norl: