annotate runtime/doc/if_tcl.txt @ 13479:67a7c0db66ff

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