xref: /vim-8.2.3635/runtime/optwin.vim (revision 113cb513)
1" These commands create the option window.
2"
3" Maintainer:	Bram Moolenaar <[email protected]>
4" Last Change:	2021 Oct 28
5
6" If there already is an option window, jump to that one.
7let buf = bufnr('option-window')
8if buf >= 0
9  let winids = win_findbuf(buf)
10  if len(winids) > 0
11    if win_gotoid(winids[0]) == 1
12      finish
13    endif
14  endif
15endif
16
17" Make sure the '<' flag is not included in 'cpoptions', otherwise <CR> would
18" not be recognized.  See ":help 'cpoptions'".
19let s:cpo_save = &cpo
20set cpo&vim
21
22" function to be called when <CR> is hit in the option-window
23func <SID>CR()
24
25  " If on a continued comment line, go back to the first comment line
26  let lnum = search("^[^\t]", 'bWcn')
27  let line = getline(lnum)
28
29  " <CR> on a "set" line executes the option line
30  if match(line, "^ \tset ") >= 0
31
32    " For a local option: go to the previous window
33    " If this is a help window, go to the window below it
34    let thiswin = winnr()
35    let local = <SID>Find(lnum)
36    if local >= 0
37      exe line
38      call <SID>Update(lnum, line, local, thiswin)
39    endif
40
41  " <CR> on a "option" line shows help for that option
42  elseif match(line, "^[a-z]") >= 0
43    let name = substitute(line, '\([^\t]*\).*', '\1', "")
44    exe "help '" . name . "'"
45
46  " <CR> on an index line jumps to the group
47  elseif match(line, '^ \=[0-9]') >= 0
48    exe "norm! /" . line . "\<CR>zt"
49  endif
50endfunc
51
52" function to be called when <Space> is hit in the option-window
53func <SID>Space()
54
55  let lnum = line(".")
56  let line = getline(lnum)
57
58  " <Space> on a "set" line refreshes the option line
59  if match(line, "^ \tset ") >= 0
60
61    " For a local option: go to the previous window
62    " If this is a help window, go to the window below it
63    let thiswin = winnr()
64    let local = <SID>Find(lnum)
65    if local >= 0
66      call <SID>Update(lnum, line, local, thiswin)
67    endif
68
69  endif
70endfunc
71
72let s:local_to_window = gettext('(local to window)')
73let s:local_to_buffer = gettext('(local to buffer)')
74let s:global_or_local = gettext('(global or local to buffer)')
75
76" find the window in which the option applies
77" returns 0 for global option, 1 for local option, -1 for error
78func <SID>Find(lnum)
79    let line = getline(a:lnum - 1)
80    if line =~ s:local_to_window || line =~ s:local_to_buffer
81      let local = 1
82      let thiswin = winnr()
83      wincmd p
84      if exists("b:current_syntax") && b:current_syntax == "help"
85	wincmd j
86	if winnr() == thiswin
87	  wincmd j
88	endif
89      endif
90    else
91      let local = 0
92    endif
93    if local && (winnr() == thiswin || (exists("b:current_syntax")
94	\ && b:current_syntax == "help"))
95      echo "Don't know in which window"
96      let local = -1
97    endif
98    return local
99endfunc
100
101" Update a "set" line in the option window
102func <SID>Update(lnum, line, local, thiswin)
103  " get the new value of the option and update the option window line
104  if match(a:line, "=") >= 0
105    let name = substitute(a:line, '^ \tset \([^=]*\)=.*', '\1', "")
106  else
107    let name = substitute(a:line, '^ \tset \(no\)\=\([a-z]*\).*', '\2', "")
108  endif
109  if name == "pt" && &pt =~ "\x80"
110    let val = <SID>PTvalue()
111  else
112    let val = escape(eval('&' . name), " \t\\\"|")
113  endif
114  if a:local
115    exe a:thiswin . "wincmd w"
116  endif
117  if match(a:line, "=") >= 0 || (val != "0" && val != "1")
118    call setline(a:lnum, " \tset " . name . "=" . val)
119  else
120    if val
121      call setline(a:lnum, " \tset " . name . "\tno" . name)
122    else
123      call setline(a:lnum, " \tset no" . name . "\t" . name)
124    endif
125  endif
126  set nomodified
127endfunc
128
129" Reset 'title' and 'icon' to make it work faster.
130" Reset 'undolevels' to avoid undo'ing until the buffer is empty.
131let s:old_title = &title
132let s:old_icon = &icon
133let s:old_sc = &sc
134let s:old_ru = &ru
135let s:old_ul = &ul
136set notitle noicon nosc noru ul=-1
137
138" If the current window is a help window, try finding a non-help window.
139" Relies on syntax highlighting to be switched on.
140let s:thiswin = winnr()
141while exists("b:current_syntax") && b:current_syntax == "help"
142  wincmd w
143  if s:thiswin == winnr()
144    break
145  endif
146endwhile
147
148" Open the window.  $OPTWIN_CMD is set to "tab" for ":tab options".
149exe $OPTWIN_CMD . ' new option-window'
150setlocal ts=15 tw=0 noro buftype=nofile
151
152" Insert help and a "set" command for each option.
153call append(0, gettext('" Each "set" line shows the current value of an option (on the left).'))
154call append(1, gettext('" Hit <Enter> on a "set" line to execute it.'))
155call append(2, gettext('"            A boolean option will be toggled.'))
156call append(3, gettext('"            For other options you can edit the value before hitting <Enter>.'))
157call append(4, gettext('" Hit <Enter> on a help line to open a help window on this option.'))
158call append(5, gettext('" Hit <Enter> on an index line to jump there.'))
159call append(6, gettext('" Hit <Space> on a "set" line to refresh it.'))
160
161" These functions are called often below.  Keep them fast!
162
163" Add an option name and explanation.  The text can contain "\n" characters
164" where a line break is to be inserted.
165func <SID>AddOption(name, text)
166  let lines = split(a:text, "\n")
167  call append("$", a:name .. "\t" .. lines[0])
168  for line in lines[1:]
169    call append("$", "\t" .. line)
170  endfor
171endfunc
172
173" Init a local binary option
174func <SID>BinOptionL(name)
175  let val = getwinvar(winnr('#'), '&' . a:name)
176  call append("$", substitute(substitute(" \tset " . val . a:name . "\t" .
177	\!val . a:name, "0", "no", ""), "1", "", ""))
178endfunc
179
180" Init a global binary option
181func <SID>BinOptionG(name, val)
182  call append("$", substitute(substitute(" \tset " . a:val . a:name . "\t" .
183	\!a:val . a:name, "0", "no", ""), "1", "", ""))
184endfunc
185
186" Init a local string option
187func <SID>OptionL(name)
188  let val = escape(getwinvar(winnr('#'), '&' . a:name), " \t\\\"|")
189  call append("$", " \tset " . a:name . "=" . val)
190endfunc
191
192" Init a global string option
193func <SID>OptionG(name, val)
194  call append("$", " \tset " . a:name . "=" . escape(a:val, " \t\\\"|"))
195endfunc
196
197let s:idx = 1
198let s:lnum = line("$")
199call append("$", "")
200
201func <SID>Header(text)
202  let line = s:idx . " " . a:text
203  if s:idx < 10
204    let line = " " . line
205  endif
206  call append("$", "")
207  call append("$", line)
208  call append("$", "")
209  call append(s:lnum, line)
210  let s:idx = s:idx + 1
211  let s:lnum = s:lnum + 1
212endfunc
213
214" Get the value of 'pastetoggle'.  It could be a special key.
215func <SID>PTvalue()
216  redir @a
217  silent set pt
218  redir END
219  return substitute(@a, '[^=]*=\(.*\)', '\1', "")
220endfunc
221
222" Restore the previous value of 'cpoptions' here, it's used below.
223let &cpo = s:cpo_save
224
225" List of all options, organized by function.
226" The text should be sufficient to know what the option is used for.
227
228call <SID>Header(gettext("important"))
229call <SID>AddOption("compatible", gettext("behave very Vi compatible (not advisable)"))
230call <SID>BinOptionG("cp", &cp)
231call <SID>AddOption("cpoptions", gettext("list of flags to specify Vi compatibility"))
232call <SID>OptionG("cpo", &cpo)
233call <SID>AddOption("insertmode", gettext("use Insert mode as the default mode"))
234call <SID>BinOptionG("im", &im)
235call <SID>AddOption("paste", gettext("paste mode, insert typed text literally"))
236call <SID>BinOptionG("paste", &paste)
237call <SID>AddOption("pastetoggle", gettext("key sequence to toggle paste mode"))
238if &pt =~ "\x80"
239  call append("$", " \tset pt=" . <SID>PTvalue())
240else
241  call <SID>OptionG("pt", &pt)
242endif
243call <SID>AddOption("runtimepath", gettext("list of directories used for runtime files and plugins"))
244call <SID>OptionG("rtp", &rtp)
245call <SID>AddOption("packpath", gettext("list of directories used for plugin packages"))
246call <SID>OptionG("pp", &pp)
247call <SID>AddOption("helpfile", gettext("name of the main help file"))
248call <SID>OptionG("hf", &hf)
249
250
251call <SID>Header(gettext("moving around, searching and patterns"))
252call <SID>AddOption("whichwrap", gettext("list of flags specifying which commands wrap to another line"))
253call <SID>OptionG("ww", &ww)
254call <SID>AddOption("startofline", gettext("many jump commands move the cursor to the first non-blank\ncharacter of a line"))
255call <SID>BinOptionG("sol", &sol)
256call <SID>AddOption("paragraphs", gettext("nroff macro names that separate paragraphs"))
257call <SID>OptionG("para", &para)
258call <SID>AddOption("sections", gettext("nroff macro names that separate sections"))
259call <SID>OptionG("sect", &sect)
260call <SID>AddOption("path", gettext("list of directory names used for file searching"))
261call append("$", "\t" .. s:global_or_local)
262call <SID>OptionG("pa", &pa)
263call <SID>AddOption("cdpath", gettext("list of directory names used for :cd"))
264call <SID>OptionG("cd", &cd)
265if exists("+autochdir")
266  call <SID>AddOption("autochdir", gettext("change to directory of file in buffer"))
267  call <SID>BinOptionG("acd", &acd)
268endif
269call <SID>AddOption("autoshelldir", gettext("change to pwd of shell in terminal buffer"))
270call <SID>BinOptionG("asd", &asd)
271call <SID>AddOption("wrapscan", gettext("search commands wrap around the end of the buffer"))
272call <SID>BinOptionG("ws", &ws)
273call <SID>AddOption("incsearch", gettext("show match for partly typed search command"))
274call <SID>BinOptionG("is", &is)
275call <SID>AddOption("magic", gettext("change the way backslashes are used in search patterns"))
276call <SID>BinOptionG("magic", &magic)
277call <SID>AddOption("regexpengine", gettext("select the default regexp engine used"))
278call <SID>OptionG("re", &re)
279call <SID>AddOption("ignorecase", gettext("ignore case when using a search pattern"))
280call <SID>BinOptionG("ic", &ic)
281call <SID>AddOption("smartcase", gettext("override 'ignorecase' when pattern has upper case characters"))
282call <SID>BinOptionG("scs", &scs)
283call <SID>AddOption("casemap", gettext("what method to use for changing case of letters"))
284call <SID>OptionG("cmp", &cmp)
285call <SID>AddOption("maxmempattern", gettext("maximum amount of memory in Kbyte used for pattern matching"))
286call append("$", " \tset mmp=" . &mmp)
287call <SID>AddOption("define", gettext("pattern for a macro definition line"))
288call append("$", "\t" .. s:global_or_local)
289call <SID>OptionG("def", &def)
290if has("find_in_path")
291  call <SID>AddOption("include", gettext("pattern for an include-file line"))
292  call append("$", "\t" .. s:local_to_buffer)
293  call <SID>OptionL("inc")
294  call <SID>AddOption("includeexpr", gettext("expression used to transform an include line to a file name"))
295  call append("$", "\t" .. s:local_to_buffer)
296  call <SID>OptionL("inex")
297endif
298
299
300call <SID>Header(gettext("tags"))
301call <SID>AddOption("tagbsearch", gettext("use binary searching in tags files"))
302call <SID>BinOptionG("tbs", &tbs)
303call <SID>AddOption("taglength", gettext("number of significant characters in a tag name or zero"))
304call append("$", " \tset tl=" . &tl)
305call <SID>AddOption("tags", gettext("list of file names to search for tags"))
306call append("$", "\t" .. s:global_or_local)
307call <SID>OptionG("tag", &tag)
308call <SID>AddOption("tagcase", gettext("how to handle case when searching in tags files:\n\"followic\" to follow 'ignorecase', \"ignore\" or \"match\""))
309call append("$", "\t" .. s:global_or_local)
310call <SID>OptionG("tc", &tc)
311call <SID>AddOption("tagrelative", gettext("file names in a tags file are relative to the tags file"))
312call <SID>BinOptionG("tr", &tr)
313call <SID>AddOption("tagstack", gettext("a :tag command will use the tagstack"))
314call <SID>BinOptionG("tgst", &tgst)
315call <SID>AddOption("showfulltag", gettext("when completing tags in Insert mode show more info"))
316call <SID>BinOptionG("sft", &sft)
317if has("eval")
318  call <SID>AddOption("tagfunc", gettext("a function to be used to perform tag searches"))
319  call append("$", "\t" .. s:local_to_buffer)
320  call <SID>OptionL("tfu")
321endif
322if has("cscope")
323  call <SID>AddOption("cscopeprg", gettext("command for executing cscope"))
324  call <SID>OptionG("csprg", &csprg)
325  call <SID>AddOption("cscopetag", gettext("use cscope for tag commands"))
326  call <SID>BinOptionG("cst", &cst)
327  call <SID>AddOption("cscopetagorder", gettext("0 or 1; the order in which \":cstag\" performs a search"))
328  call append("$", " \tset csto=" . &csto)
329  call <SID>AddOption("cscopeverbose", gettext("give messages when adding a cscope database"))
330  call <SID>BinOptionG("csverb", &csverb)
331  call <SID>AddOption("cscopepathcomp", gettext("how many components of the path to show"))
332  call append("$", " \tset cspc=" . &cspc)
333  call <SID>AddOption("cscopequickfix", gettext("when to open a quickfix window for cscope"))
334  call <SID>OptionG("csqf", &csqf)
335  call <SID>AddOption("cscoperelative", gettext("file names in a cscope file are relative to that file"))
336  call <SID>BinOptionG("csre", &csre)
337endif
338
339
340call <SID>Header(gettext("displaying text"))
341call <SID>AddOption("scroll", gettext("number of lines to scroll for CTRL-U and CTRL-D"))
342call append("$", "\t" .. s:local_to_window)
343call <SID>OptionL("scr")
344call <SID>AddOption("scrolloff", gettext("number of screen lines to show around the cursor"))
345call append("$", " \tset so=" . &so)
346call <SID>AddOption("wrap", gettext("long lines wrap"))
347call append("$", "\t" .. s:local_to_window)
348call <SID>BinOptionL("wrap")
349call <SID>AddOption("linebreak", gettext("wrap long lines at a character in 'breakat'"))
350call append("$", "\t" .. s:local_to_window)
351call <SID>BinOptionL("lbr")
352call <SID>AddOption("breakindent", gettext("preserve indentation in wrapped text"))
353call append("$", "\t" .. s:local_to_window)
354call <SID>BinOptionL("bri")
355call <SID>AddOption("breakindentopt", gettext("adjust breakindent behaviour"))
356call append("$", "\t" .. s:local_to_window)
357call <SID>OptionL("briopt")
358call <SID>AddOption("breakat", gettext("which characters might cause a line break"))
359call <SID>OptionG("brk", &brk)
360call <SID>AddOption("showbreak", gettext("string to put before wrapped screen lines"))
361call <SID>OptionG("sbr", &sbr)
362call <SID>AddOption("sidescroll", gettext("minimal number of columns to scroll horizontally"))
363call append("$", " \tset ss=" . &ss)
364call <SID>AddOption("sidescrolloff", gettext("minimal number of columns to keep left and right of the cursor"))
365call append("$", " \tset siso=" . &siso)
366call <SID>AddOption("display", gettext("include \"lastline\" to show the last line even if it doesn't fit\ninclude \"uhex\" to show unprintable characters as a hex number"))
367call <SID>OptionG("dy", &dy)
368call <SID>AddOption("fillchars", gettext("characters to use for the status line, folds and filler lines"))
369call <SID>OptionG("fcs", &fcs)
370call <SID>AddOption("cmdheight", gettext("number of lines used for the command-line"))
371call append("$", " \tset ch=" . &ch)
372call <SID>AddOption("columns", gettext("width of the display"))
373call append("$", " \tset co=" . &co)
374call <SID>AddOption("lines", gettext("number of lines in the display"))
375call append("$", " \tset lines=" . &lines)
376call <SID>AddOption("window", gettext("number of lines to scroll for CTRL-F and CTRL-B"))
377call append("$", " \tset window=" . &window)
378call <SID>AddOption("lazyredraw", gettext("don't redraw while executing macros"))
379call <SID>BinOptionG("lz", &lz)
380if has("reltime")
381  call <SID>AddOption("redrawtime", gettext("timeout for 'hlsearch' and :match highlighting in msec"))
382  call append("$", " \tset rdt=" . &rdt)
383endif
384call <SID>AddOption("writedelay", gettext("delay in msec for each char written to the display\n(for debugging)"))
385call append("$", " \tset wd=" . &wd)
386call <SID>AddOption("list", gettext("show <Tab> as ^I and end-of-line as $"))
387call append("$", "\t" .. s:local_to_window)
388call <SID>BinOptionL("list")
389call <SID>AddOption("listchars", gettext("list of strings used for list mode"))
390call <SID>OptionG("lcs", &lcs)
391call <SID>AddOption("number", gettext("show the line number for each line"))
392call append("$", "\t" .. s:local_to_window)
393call <SID>BinOptionL("nu")
394call <SID>AddOption("relativenumber", gettext("show the relative line number for each line"))
395call append("$", "\t" .. s:local_to_window)
396call <SID>BinOptionL("rnu")
397if has("linebreak")
398  call <SID>AddOption("numberwidth", gettext("number of columns to use for the line number"))
399  call append("$", "\t" .. s:local_to_window)
400  call <SID>OptionL("nuw")
401endif
402if has("conceal")
403  call <SID>AddOption("conceallevel", gettext("controls whether concealable text is hidden"))
404  call append("$", "\t" .. s:local_to_window)
405  call <SID>OptionL("cole")
406  call <SID>AddOption("concealcursor", gettext("modes in which text in the cursor line can be concealed"))
407  call append("$", "\t" .. s:local_to_window)
408  call <SID>OptionL("cocu")
409endif
410
411
412call <SID>Header(gettext("syntax, highlighting and spelling"))
413call <SID>AddOption("background", gettext("\"dark\" or \"light\"; the background color brightness"))
414call <SID>OptionG("bg", &bg)
415call <SID>AddOption("filetype", gettext("type of file; triggers the FileType event when set"))
416call append("$", "\t" .. s:local_to_buffer)
417call <SID>OptionL("ft")
418if has("syntax")
419  call <SID>AddOption("syntax", gettext("name of syntax highlighting used"))
420  call append("$", "\t" .. s:local_to_buffer)
421  call <SID>OptionL("syn")
422  call <SID>AddOption("synmaxcol", gettext("maximum column to look for syntax items"))
423  call append("$", "\t" .. s:local_to_buffer)
424  call <SID>OptionL("smc")
425endif
426call <SID>AddOption("highlight", gettext("which highlighting to use for various occasions"))
427call <SID>OptionG("hl", &hl)
428call <SID>AddOption("hlsearch", gettext("highlight all matches for the last used search pattern"))
429call <SID>BinOptionG("hls", &hls)
430call <SID>AddOption("wincolor", gettext("highlight group to use for the window"))
431call append("$", "\t" .. s:local_to_window)
432call <SID>OptionL("wcr")
433if has("termguicolors")
434  call <SID>AddOption("termguicolors", gettext("use GUI colors for the terminal"))
435  call <SID>BinOptionG("tgc", &tgc)
436endif
437if has("syntax")
438  call <SID>AddOption("cursorcolumn", gettext("highlight the screen column of the cursor"))
439  call append("$", "\t" .. s:local_to_window)
440  call <SID>BinOptionL("cuc")
441  call <SID>AddOption("cursorline", gettext("highlight the screen line of the cursor"))
442  call append("$", "\t" .. s:local_to_window)
443  call <SID>BinOptionL("cul")
444  call <SID>AddOption("cursorlineopt", gettext("specifies which area 'cursorline' highlights"))
445  call append("$", "\t" .. s:local_to_window)
446  call <SID>OptionL("culopt")
447  call <SID>AddOption("colorcolumn", gettext("columns to highlight"))
448  call append("$", "\t" .. s:local_to_window)
449  call <SID>OptionL("cc")
450  call <SID>AddOption("spell", gettext("highlight spelling mistakes"))
451  call append("$", "\t" .. s:local_to_window)
452  call <SID>BinOptionL("spell")
453  call <SID>AddOption("spelllang", gettext("list of accepted languages"))
454  call append("$", "\t" .. s:local_to_buffer)
455  call <SID>OptionL("spl")
456  call <SID>AddOption("spellfile", gettext("file that \"zg\" adds good words to"))
457  call append("$", "\t" .. s:local_to_buffer)
458  call <SID>OptionL("spf")
459  call <SID>AddOption("spellcapcheck", gettext("pattern to locate the end of a sentence"))
460  call append("$", "\t" .. s:local_to_buffer)
461  call <SID>OptionL("spc")
462  call <SID>AddOption("spelloptions", gettext("flags to change how spell checking works"))
463  call append("$", "\t" .. s:local_to_buffer)
464  call <SID>OptionL("spo")
465  call <SID>AddOption("spellsuggest", gettext("methods used to suggest corrections"))
466  call <SID>OptionG("sps", &sps)
467  call <SID>AddOption("mkspellmem", gettext("amount of memory used by :mkspell before compressing"))
468  call <SID>OptionG("msm", &msm)
469endif
470
471
472call <SID>Header(gettext("multiple windows"))
473call <SID>AddOption("laststatus", gettext("0, 1 or 2; when to use a status line for the last window"))
474call append("$", " \tset ls=" . &ls)
475if has("statusline")
476  call <SID>AddOption("statusline", gettext("alternate format to be used for a status line"))
477  call <SID>OptionG("stl", &stl)
478endif
479call <SID>AddOption("equalalways", gettext("make all windows the same size when adding/removing windows"))
480call <SID>BinOptionG("ea", &ea)
481call <SID>AddOption("eadirection", gettext("in which direction 'equalalways' works: \"ver\", \"hor\" or \"both\""))
482call <SID>OptionG("ead", &ead)
483call <SID>AddOption("winheight", gettext("minimal number of lines used for the current window"))
484call append("$", " \tset wh=" . &wh)
485call <SID>AddOption("winminheight", gettext("minimal number of lines used for any window"))
486call append("$", " \tset wmh=" . &wmh)
487call <SID>AddOption("winfixheight", gettext("keep the height of the window"))
488call append("$", "\t" .. s:local_to_window)
489call <SID>BinOptionL("wfh")
490call <SID>AddOption("winfixwidth", gettext("keep the width of the window"))
491call append("$", "\t" .. s:local_to_window)
492call <SID>BinOptionL("wfw")
493call <SID>AddOption("winwidth", gettext("minimal number of columns used for the current window"))
494call append("$", " \tset wiw=" . &wiw)
495call <SID>AddOption("winminwidth", gettext("minimal number of columns used for any window"))
496call append("$", " \tset wmw=" . &wmw)
497call <SID>AddOption("helpheight", gettext("initial height of the help window"))
498call append("$", " \tset hh=" . &hh)
499if has("quickfix")
500  call <SID>AddOption("previewpopup", gettext("use a popup window for preview"))
501  call append("$", " \tset pvp=" . &pvp)
502  call <SID>AddOption("previewheight", gettext("default height for the preview window"))
503  call append("$", " \tset pvh=" . &pvh)
504  call <SID>AddOption("previewwindow", gettext("identifies the preview window"))
505  call append("$", "\t" .. s:local_to_window)
506  call <SID>BinOptionL("pvw")
507endif
508call <SID>AddOption("hidden", gettext("don't unload a buffer when no longer shown in a window"))
509call <SID>BinOptionG("hid", &hid)
510call <SID>AddOption("switchbuf", gettext("\"useopen\" and/or \"split\"; which window to use when jumping\nto a buffer"))
511call <SID>OptionG("swb", &swb)
512call <SID>AddOption("splitbelow", gettext("a new window is put below the current one"))
513call <SID>BinOptionG("sb", &sb)
514call <SID>AddOption("splitright", gettext("a new window is put right of the current one"))
515call <SID>BinOptionG("spr", &spr)
516call <SID>AddOption("scrollbind", gettext("this window scrolls together with other bound windows"))
517call append("$", "\t" .. s:local_to_window)
518call <SID>BinOptionL("scb")
519call <SID>AddOption("scrollopt", gettext("\"ver\", \"hor\" and/or \"jump\"; list of options for 'scrollbind'"))
520call <SID>OptionG("sbo", &sbo)
521call <SID>AddOption("cursorbind", gettext("this window's cursor moves together with other bound windows"))
522call append("$", "\t" .. s:local_to_window)
523call <SID>BinOptionL("crb")
524if has("terminal")
525  call <SID>AddOption("termwinsize", gettext("size of a terminal window"))
526  call append("$", "\t" .. s:local_to_window)
527  call <SID>OptionL("tws")
528  call <SID>AddOption("termwinkey", gettext("key that precedes Vim commands in a terminal window"))
529  call append("$", "\t" .. s:local_to_window)
530  call <SID>OptionL("twk")
531  call <SID>AddOption("termwinscroll", gettext("max number of lines to keep for scrollback in a terminal window"))
532  call append("$", "\t" .. s:local_to_window)
533  call <SID>OptionL("twsl")
534  if has('win32')
535    call <SID>AddOption("termwintype", gettext("type of pty to use for a terminal window"))
536    call <SID>OptionG("twt", &twt)
537  endif
538  if exists("&winptydll")
539    call <SID>AddOption("winptydll", gettext("name of the winpty dynamic library"))
540    call <SID>OptionG("winptydll", &winptydll)
541  endif
542endif
543
544
545call <SID>Header(gettext("multiple tab pages"))
546call <SID>AddOption("showtabline", gettext("0, 1 or 2; when to use a tab pages line"))
547call append("$", " \tset stal=" . &stal)
548call <SID>AddOption("tabpagemax", gettext("maximum number of tab pages to open for -p and \"tab all\""))
549call append("$", " \tset tpm=" . &tpm)
550call <SID>AddOption("tabline", gettext("custom tab pages line"))
551call <SID>OptionG("tal", &tal)
552if has("gui")
553  call <SID>AddOption("guitablabel", gettext("custom tab page label for the GUI"))
554  call <SID>OptionG("gtl", &gtl)
555  call <SID>AddOption("guitabtooltip", gettext("custom tab page tooltip for the GUI"))
556  call <SID>OptionG("gtt", &gtt)
557endif
558
559
560call <SID>Header(gettext("terminal"))
561call <SID>AddOption("term", gettext("name of the used terminal"))
562call <SID>OptionG("term", &term)
563call <SID>AddOption("ttytype", gettext("alias for 'term'"))
564call <SID>OptionG("tty", &tty)
565call <SID>AddOption("ttybuiltin", gettext("check built-in termcaps first"))
566call <SID>BinOptionG("tbi", &tbi)
567call <SID>AddOption("ttyfast", gettext("terminal connection is fast"))
568call <SID>BinOptionG("tf", &tf)
569call <SID>AddOption("weirdinvert", gettext("terminal that requires extra redrawing"))
570call <SID>BinOptionG("wiv", &wiv)
571call <SID>AddOption("esckeys", gettext("recognize keys that start with <Esc> in Insert mode"))
572call <SID>BinOptionG("ek", &ek)
573call <SID>AddOption("scrolljump", gettext("minimal number of lines to scroll at a time"))
574call append("$", " \tset sj=" . &sj)
575call <SID>AddOption("ttyscroll", gettext("maximum number of lines to use scrolling instead of redrawing"))
576call append("$", " \tset tsl=" . &tsl)
577if has("gui") || has("win32")
578  call <SID>AddOption("guicursor", gettext("specifies what the cursor looks like in different modes"))
579  call <SID>OptionG("gcr", &gcr)
580endif
581if has("title")
582  let &title = s:old_title
583  call <SID>AddOption("title", gettext("show info in the window title"))
584  call <SID>BinOptionG("title", &title)
585  set notitle
586  call <SID>AddOption("titlelen", gettext("percentage of 'columns' used for the window title"))
587  call append("$", " \tset titlelen=" . &titlelen)
588  call <SID>AddOption("titlestring", gettext("when not empty, string to be used for the window title"))
589  call <SID>OptionG("titlestring", &titlestring)
590  call <SID>AddOption("titleold", gettext("string to restore the title to when exiting Vim"))
591  call <SID>OptionG("titleold", &titleold)
592  let &icon = s:old_icon
593  call <SID>AddOption("icon", gettext("set the text of the icon for this window"))
594  call <SID>BinOptionG("icon", &icon)
595  set noicon
596  call <SID>AddOption("iconstring", gettext("when not empty, text for the icon of this window"))
597  call <SID>OptionG("iconstring", &iconstring)
598endif
599if has("win32")
600  call <SID>AddOption("restorescreen", gettext("restore the screen contents when exiting Vim"))
601  call <SID>BinOptionG("rs", &rs)
602endif
603
604
605call <SID>Header(gettext("using the mouse"))
606call <SID>AddOption("mouse", gettext("list of flags for using the mouse"))
607call <SID>OptionG("mouse", &mouse)
608if has("gui")
609  call <SID>AddOption("mousefocus", gettext("the window with the mouse pointer becomes the current one"))
610  call <SID>BinOptionG("mousef", &mousef)
611endif
612call <SID>AddOption("scrollfocus", gettext("the window with the mouse pointer scrolls with the mouse wheel"))
613call <SID>BinOptionG("scf", &scf)
614if has("gui")
615  call <SID>AddOption("mousehide", gettext("hide the mouse pointer while typing"))
616  call <SID>BinOptionG("mh", &mh)
617endif
618call <SID>AddOption("mousemodel", gettext("\"extend\", \"popup\" or \"popup_setpos\"; what the right\nmouse button is used for"))
619call <SID>OptionG("mousem", &mousem)
620call <SID>AddOption("mousetime", gettext("maximum time in msec to recognize a double-click"))
621call append("$", " \tset mouset=" . &mouset)
622call <SID>AddOption("ttymouse", gettext("\"xterm\", \"xterm2\", \"sgr\", etc.; type of mouse"))
623call <SID>OptionG("ttym", &ttym)
624if has("mouseshape")
625  call <SID>AddOption("mouseshape", gettext("what the mouse pointer looks like in different modes"))
626  call <SID>OptionG("mouses", &mouses)
627endif
628
629
630if has("gui")
631  call <SID>Header(gettext("GUI"))
632  call <SID>AddOption("guifont", gettext("list of font names to be used in the GUI"))
633  call <SID>OptionG("gfn", &gfn)
634  if has("xfontset")
635    call <SID>AddOption("guifontset", gettext("pair of fonts to be used, for multibyte editing"))
636    call <SID>OptionG("gfs", &gfs)
637  endif
638  call <SID>AddOption("guifontwide", gettext("list of font names to be used for double-wide characters"))
639  call <SID>OptionG("gfw", &gfw)
640  if has("mac")
641    call <SID>AddOption("antialias", gettext("use smooth, antialiased fonts"))
642    call <SID>BinOptionG("anti", &anti)
643  endif
644  call <SID>AddOption("guioptions", gettext("list of flags that specify how the GUI works"))
645  call <SID>OptionG("go", &go)
646  if has("gui_gtk")
647    call <SID>AddOption("toolbar", gettext("\"icons\", \"text\" and/or \"tooltips\"; how to show the toolbar"))
648    call <SID>OptionG("tb", &tb)
649    if has("gui_gtk2")
650      call <SID>AddOption("toolbariconsize", gettext("size of toolbar icons"))
651      call <SID>OptionG("tbis", &tbis)
652    endif
653    call <SID>AddOption("guiheadroom", gettext("room (in pixels) left above/below the window"))
654    call append("$", " \tset ghr=" . &ghr)
655    call <SID>AddOption("guiligatures", gettext("list of ASCII characters that can be combined into complex shapes"))
656    call <SID>OptionG("gli", &gli)
657  endif
658  if has("directx")
659    call <SID>AddOption("renderoptions", gettext("options for text rendering"))
660    call <SID>OptionG("rop", &rop)
661  endif
662  call <SID>AddOption("guipty", gettext("use a pseudo-tty for I/O to external commands"))
663  call <SID>BinOptionG("guipty", &guipty)
664  if has("browse")
665    call <SID>AddOption("browsedir", gettext("\"last\", \"buffer\" or \"current\": which directory used for the file browser"))
666    call <SID>OptionG("bsdir", &bsdir)
667  endif
668  if has("multi_lang")
669    call <SID>AddOption("langmenu", gettext("language to be used for the menus"))
670    call <SID>OptionG("langmenu", &lm)
671  endif
672  call <SID>AddOption("menuitems", gettext("maximum number of items in one menu"))
673  call append("$", " \tset mis=" . &mis)
674  if has("winaltkeys")
675    call <SID>AddOption("winaltkeys", gettext("\"no\", \"yes\" or \"menu\"; how to use the ALT key"))
676    call <SID>OptionG("wak", &wak)
677  endif
678  call <SID>AddOption("linespace", gettext("number of pixel lines to use between characters"))
679  call append("$", " \tset lsp=" . &lsp)
680  if has("balloon_eval") || has("balloon_eval_term")
681    call <SID>AddOption("balloondelay", gettext("delay in milliseconds before a balloon may pop up"))
682    call append("$", " \tset bdlay=" . &bdlay)
683    if has("balloon_eval")
684      call <SID>AddOption("ballooneval", gettext("use balloon evaluation in the GUI"))
685      call <SID>BinOptionG("beval", &beval)
686    endif
687    if has("balloon_eval_term")
688      call <SID>AddOption("balloonevalterm", gettext("use balloon evaluation in the terminal"))
689      call <SID>BinOptionG("bevalterm", &beval)
690    endif
691    if has("eval")
692      call <SID>AddOption("balloonexpr", gettext("expression to show in balloon eval"))
693      call append("$", " \tset bexpr=" . &bexpr)
694    endif
695  endif
696endif
697
698if has("printer")
699  call <SID>Header(gettext("printing"))
700  call <SID>AddOption("printoptions", gettext("list of items that control the format of :hardcopy output"))
701  call <SID>OptionG("popt", &popt)
702  call <SID>AddOption("printdevice", gettext("name of the printer to be used for :hardcopy"))
703  call <SID>OptionG("pdev", &pdev)
704  if has("postscript")
705    call <SID>AddOption("printexpr", gettext("expression used to print the PostScript file for :hardcopy"))
706    call <SID>OptionG("pexpr", &pexpr)
707  endif
708  call <SID>AddOption("printfont", gettext("name of the font to be used for :hardcopy"))
709  call <SID>OptionG("pfn", &pfn)
710  call <SID>AddOption("printheader", gettext("format of the header used for :hardcopy"))
711  call <SID>OptionG("pheader", &pheader)
712  if has("postscript")
713    call <SID>AddOption("printencoding", gettext("encoding used to print the PostScript file for :hardcopy"))
714    call <SID>OptionG("penc", &penc)
715  endif
716  call <SID>AddOption("printmbcharset", gettext("the CJK character set to be used for CJK output from :hardcopy"))
717  call <SID>OptionG("pmbcs", &pmbcs)
718  call <SID>AddOption("printmbfont", gettext("list of font names to be used for CJK output from :hardcopy"))
719  call <SID>OptionG("pmbfn", &pmbfn)
720endif
721
722call <SID>Header(gettext("messages and info"))
723call <SID>AddOption("terse", gettext("add 's' flag in 'shortmess' (don't show search message)"))
724call <SID>BinOptionG("terse", &terse)
725call <SID>AddOption("shortmess", gettext("list of flags to make messages shorter"))
726call <SID>OptionG("shm", &shm)
727call <SID>AddOption("showcmd", gettext("show (partial) command keys in the status line"))
728let &sc = s:old_sc
729call <SID>BinOptionG("sc", &sc)
730set nosc
731call <SID>AddOption("showmode", gettext("display the current mode in the status line"))
732call <SID>BinOptionG("smd", &smd)
733call <SID>AddOption("ruler", gettext("show cursor position below each window"))
734let &ru = s:old_ru
735call <SID>BinOptionG("ru", &ru)
736set noru
737if has("statusline")
738  call <SID>AddOption("rulerformat", gettext("alternate format to be used for the ruler"))
739  call <SID>OptionG("ruf", &ruf)
740endif
741call <SID>AddOption("report", gettext("threshold for reporting number of changed lines"))
742call append("$", " \tset report=" . &report)
743call <SID>AddOption("verbose", gettext("the higher the more messages are given"))
744call append("$", " \tset vbs=" . &vbs)
745call <SID>AddOption("verbosefile", gettext("file to write messages in"))
746call <SID>OptionG("vfile", &vfile)
747call <SID>AddOption("more", gettext("pause listings when the screen is full"))
748call <SID>BinOptionG("more", &more)
749if has("dialog_con") || has("dialog_gui")
750  call <SID>AddOption("confirm", gettext("start a dialog when a command fails"))
751  call <SID>BinOptionG("cf", &cf)
752endif
753call <SID>AddOption("errorbells", gettext("ring the bell for error messages"))
754call <SID>BinOptionG("eb", &eb)
755call <SID>AddOption("visualbell", gettext("use a visual bell instead of beeping"))
756call <SID>BinOptionG("vb", &vb)
757call <SID>AddOption("belloff", gettext("do not ring the bell for these reasons"))
758call <SID>OptionG("belloff", &belloff)
759if has("multi_lang")
760  call <SID>AddOption("helplang", gettext("list of preferred languages for finding help"))
761  call <SID>OptionG("hlg", &hlg)
762endif
763
764
765call <SID>Header(gettext("selecting text"))
766call <SID>AddOption("selection", gettext("\"old\", \"inclusive\" or \"exclusive\"; how selecting text behaves"))
767call <SID>OptionG("sel", &sel)
768call <SID>AddOption("selectmode", gettext("\"mouse\", \"key\" and/or \"cmd\"; when to start Select mode\ninstead of Visual mode"))
769call <SID>OptionG("slm", &slm)
770if has("clipboard")
771  call <SID>AddOption("clipboard", gettext("\"unnamed\" to use the * register like unnamed register\n\"autoselect\" to always put selected text on the clipboard"))
772  call <SID>OptionG("cb", &cb)
773endif
774call <SID>AddOption("keymodel", gettext("\"startsel\" and/or \"stopsel\"; what special keys can do"))
775call <SID>OptionG("km", &km)
776
777
778call <SID>Header(gettext("editing text"))
779call <SID>AddOption("undolevels", gettext("maximum number of changes that can be undone"))
780call append("$", "\t" .. s:global_or_local)
781call append("$", " \tset ul=" . s:old_ul)
782call <SID>AddOption("undofile", gettext("automatically save and restore undo history"))
783call <SID>BinOptionG("udf", &udf)
784call <SID>AddOption("undodir", gettext("list of directories for undo files"))
785call <SID>OptionG("udir", &udir)
786call <SID>AddOption("undoreload", gettext("maximum number lines to save for undo on a buffer reload"))
787call append("$", " \tset ur=" . &ur)
788call <SID>AddOption("modified", gettext("changes have been made and not written to a file"))
789call append("$", "\t" .. s:local_to_buffer)
790call <SID>BinOptionL("mod")
791call <SID>AddOption("readonly", gettext("buffer is not to be written"))
792call append("$", "\t" .. s:local_to_buffer)
793call <SID>BinOptionL("ro")
794call <SID>AddOption("modifiable", gettext("changes to the text are possible"))
795call append("$", "\t" .. s:local_to_buffer)
796call <SID>BinOptionL("ma")
797call <SID>AddOption("textwidth", gettext("line length above which to break a line"))
798call append("$", "\t" .. s:local_to_buffer)
799call <SID>OptionL("tw")
800call <SID>AddOption("wrapmargin", gettext("margin from the right in which to break a line"))
801call append("$", "\t" .. s:local_to_buffer)
802call <SID>OptionL("wm")
803call <SID>AddOption("backspace", gettext("specifies what <BS>, CTRL-W, etc. can do in Insert mode"))
804call append("$", " \tset bs=" . &bs)
805call <SID>AddOption("comments", gettext("definition of what comment lines look like"))
806call append("$", "\t" .. s:local_to_buffer)
807call <SID>OptionL("com")
808call <SID>AddOption("formatoptions", gettext("list of flags that tell how automatic formatting works"))
809call append("$", "\t" .. s:local_to_buffer)
810call <SID>OptionL("fo")
811call <SID>AddOption("formatlistpat", gettext("pattern to recognize a numbered list"))
812call append("$", "\t" .. s:local_to_buffer)
813call <SID>OptionL("flp")
814if has("eval")
815  call <SID>AddOption("formatexpr", gettext("expression used for \"gq\" to format lines"))
816  call append("$", "\t" .. s:local_to_buffer)
817  call <SID>OptionL("fex")
818endif
819if has("insert_expand")
820  call <SID>AddOption("complete", gettext("specifies how Insert mode completion works for CTRL-N and CTRL-P"))
821  call append("$", "\t" .. s:local_to_buffer)
822  call <SID>OptionL("cpt")
823  call <SID>AddOption("completeopt", gettext("whether to use a popup menu for Insert mode completion"))
824  call <SID>OptionG("cot", &cot)
825  if exists("+completepopup")
826    call <SID>AddOption("completepopup", gettext("options for the Insert mode completion info popup"))
827    call <SID>OptionG("cpp", &cpp)
828  endif
829  call <SID>AddOption("pumheight", gettext("maximum height of the popup menu"))
830  call <SID>OptionG("ph", &ph)
831  call <SID>AddOption("pumwidth", gettext("minimum width of the popup menu"))
832  call <SID>OptionG("pw", &pw)
833  call <SID>AddOption("completefunc", gettext("user defined function for Insert mode completion"))
834  call append("$", "\t" .. s:local_to_buffer)
835  call <SID>OptionL("cfu")
836  call <SID>AddOption("omnifunc", gettext("function for filetype-specific Insert mode completion"))
837  call append("$", "\t" .. s:local_to_buffer)
838  call <SID>OptionL("ofu")
839  call <SID>AddOption("dictionary", gettext("list of dictionary files for keyword completion"))
840  call append("$", "\t" .. s:global_or_local)
841  call <SID>OptionG("dict", &dict)
842  call <SID>AddOption("thesaurus", gettext("list of thesaurus files for keyword completion"))
843  call append("$", "\t" .. s:global_or_local)
844  call <SID>OptionG("tsr", &tsr)
845  call <SID>AddOption("thesaurusfunc", gettext("function used for thesaurus completion"))
846  call append("$", "\t" .. s:global_or_local)
847  call <SID>OptionG("tsrfu", &tsrfu)
848endif
849call <SID>AddOption("infercase", gettext("adjust case of a keyword completion match"))
850call append("$", "\t" .. s:local_to_buffer)
851call <SID>BinOptionL("inf")
852if has("digraphs")
853  call <SID>AddOption("digraph", gettext("enable entering digraphs with c1 <BS> c2"))
854  call <SID>BinOptionG("dg", &dg)
855endif
856call <SID>AddOption("tildeop", gettext("the \"~\" command behaves like an operator"))
857call <SID>BinOptionG("top", &top)
858call <SID>AddOption("operatorfunc", gettext("function called for the \"g@\" operator"))
859call <SID>OptionG("opfunc", &opfunc)
860call <SID>AddOption("showmatch", gettext("when inserting a bracket, briefly jump to its match"))
861call <SID>BinOptionG("sm", &sm)
862call <SID>AddOption("matchtime", gettext("tenth of a second to show a match for 'showmatch'"))
863call append("$", " \tset mat=" . &mat)
864call <SID>AddOption("matchpairs", gettext("list of pairs that match for the \"%\" command"))
865call append("$", "\t" .. s:local_to_buffer)
866call <SID>OptionL("mps")
867call <SID>AddOption("joinspaces", gettext("use two spaces after '.' when joining a line"))
868call <SID>BinOptionG("js", &js)
869call <SID>AddOption("nrformats", gettext("\"alpha\", \"octal\", \"hex\", \"bin\" and/or \"unsigned\"; number formats\nrecognized for CTRL-A and CTRL-X commands"))
870call append("$", "\t" .. s:local_to_buffer)
871call <SID>OptionL("nf")
872
873
874call <SID>Header(gettext("tabs and indenting"))
875call <SID>AddOption("tabstop", gettext("number of spaces a <Tab> in the text stands for"))
876call append("$", "\t" .. s:local_to_buffer)
877call <SID>OptionL("ts")
878call <SID>AddOption("shiftwidth", gettext("number of spaces used for each step of (auto)indent"))
879call append("$", "\t" .. s:local_to_buffer)
880call <SID>OptionL("sw")
881if has("vartabs")
882  call <SID>AddOption("vartabstop", gettext("list of number of spaces a tab counts for"))
883  call append("$", "\t" .. s:local_to_buffer)
884  call <SID>OptionL("vts")
885  call <SID>AddOption("varsofttabstop", gettext("list of number of spaces a soft tabsstop counts for"))
886  call append("$", "\t" .. s:local_to_buffer)
887  call <SID>OptionL("vsts")
888endif
889call <SID>AddOption("smarttab", gettext("a <Tab> in an indent inserts 'shiftwidth' spaces"))
890call <SID>BinOptionG("sta", &sta)
891call <SID>AddOption("softtabstop", gettext("if non-zero, number of spaces to insert for a <Tab>"))
892call append("$", "\t" .. s:local_to_buffer)
893call <SID>OptionL("sts")
894call <SID>AddOption("shiftround", gettext("round to 'shiftwidth' for \"<<\" and \">>\""))
895call <SID>BinOptionG("sr", &sr)
896call <SID>AddOption("expandtab", gettext("expand <Tab> to spaces in Insert mode"))
897call append("$", "\t" .. s:local_to_buffer)
898call <SID>BinOptionL("et")
899call <SID>AddOption("autoindent", gettext("automatically set the indent of a new line"))
900call append("$", "\t" .. s:local_to_buffer)
901call <SID>BinOptionL("ai")
902if has("smartindent")
903  call <SID>AddOption("smartindent", gettext("do clever autoindenting"))
904  call append("$", "\t" .. s:local_to_buffer)
905  call <SID>BinOptionL("si")
906endif
907if has("cindent")
908  call <SID>AddOption("cindent", gettext("enable specific indenting for C code"))
909  call append("$", "\t" .. s:local_to_buffer)
910  call <SID>BinOptionL("cin")
911  call <SID>AddOption("cinoptions", gettext("options for C-indenting"))
912  call append("$", "\t" .. s:local_to_buffer)
913  call <SID>OptionL("cino")
914  call <SID>AddOption("cinkeys", gettext("keys that trigger C-indenting in Insert mode"))
915  call append("$", "\t" .. s:local_to_buffer)
916  call <SID>OptionL("cink")
917  call <SID>AddOption("cinwords", gettext("list of words that cause more C-indent"))
918  call append("$", "\t" .. s:local_to_buffer)
919  call <SID>OptionL("cinw")
920  call <SID>AddOption("indentexpr", gettext("expression used to obtain the indent of a line"))
921  call append("$", "\t" .. s:local_to_buffer)
922  call <SID>OptionL("inde")
923  call <SID>AddOption("indentkeys", gettext("keys that trigger indenting with 'indentexpr' in Insert mode"))
924  call append("$", "\t" .. s:local_to_buffer)
925  call <SID>OptionL("indk")
926endif
927call <SID>AddOption("copyindent", gettext("copy whitespace for indenting from previous line"))
928call append("$", "\t" .. s:local_to_buffer)
929call <SID>BinOptionL("ci")
930call <SID>AddOption("preserveindent", gettext("preserve kind of whitespace when changing indent"))
931call append("$", "\t" .. s:local_to_buffer)
932call <SID>BinOptionL("pi")
933if has("lispindent")
934  call <SID>AddOption("lisp", gettext("enable lisp mode"))
935  call append("$", "\t" .. s:local_to_buffer)
936  call <SID>BinOptionL("lisp")
937  call <SID>AddOption("lispwords", gettext("words that change how lisp indenting works"))
938  call <SID>OptionL("lw")
939endif
940
941
942if has("folding")
943  call <SID>Header(gettext("folding"))
944  call <SID>AddOption("foldenable", gettext("unset to display all folds open"))
945  call append("$", "\t" .. s:local_to_window)
946  call <SID>BinOptionL("fen")
947  call <SID>AddOption("foldlevel", gettext("folds with a level higher than this number will be closed"))
948  call append("$", "\t" .. s:local_to_window)
949  call <SID>OptionL("fdl")
950  call <SID>AddOption("foldlevelstart", gettext("value for 'foldlevel' when starting to edit a file"))
951  call append("$", " \tset fdls=" . &fdls)
952  call <SID>AddOption("foldcolumn", gettext("width of the column used to indicate folds"))
953  call append("$", "\t" .. s:local_to_window)
954  call <SID>OptionL("fdc")
955  call <SID>AddOption("foldtext", gettext("expression used to display the text of a closed fold"))
956  call append("$", "\t" .. s:local_to_window)
957  call <SID>OptionL("fdt")
958  call <SID>AddOption("foldclose", gettext("set to \"all\" to close a fold when the cursor leaves it"))
959  call <SID>OptionG("fcl", &fcl)
960  call <SID>AddOption("foldopen", gettext("specifies for which commands a fold will be opened"))
961  call <SID>OptionG("fdo", &fdo)
962  call <SID>AddOption("foldminlines", gettext("minimum number of screen lines for a fold to be closed"))
963  call append("$", "\t" .. s:local_to_window)
964  call <SID>OptionL("fml")
965  call <SID>AddOption("commentstring", gettext("template for comments; used to put the marker in"))
966  call <SID>OptionL("cms")
967  call <SID>AddOption("foldmethod", gettext("folding type: \"manual\", \"indent\", \"expr\", \"marker\",\n\"syntax\" or \"diff\""))
968  call append("$", "\t" .. s:local_to_window)
969  call <SID>OptionL("fdm")
970  call <SID>AddOption("foldexpr", gettext("expression used when 'foldmethod' is \"expr\""))
971  call append("$", "\t" .. s:local_to_window)
972  call <SID>OptionL("fde")
973  call <SID>AddOption("foldignore", gettext("used to ignore lines when 'foldmethod' is \"indent\""))
974  call append("$", "\t" .. s:local_to_window)
975  call <SID>OptionL("fdi")
976  call <SID>AddOption("foldmarker", gettext("markers used when 'foldmethod' is \"marker\""))
977  call append("$", "\t" .. s:local_to_window)
978  call <SID>OptionL("fmr")
979  call <SID>AddOption("foldnestmax", gettext("maximum fold depth for when 'foldmethod' is \"indent\" or \"syntax\""))
980  call append("$", "\t" .. s:local_to_window)
981  call <SID>OptionL("fdn")
982endif
983
984
985if has("diff")
986  call <SID>Header(gettext("diff mode"))
987  call <SID>AddOption("diff", gettext("use diff mode for the current window"))
988  call append("$", "\t" .. s:local_to_window)
989  call <SID>BinOptionL("diff")
990  call <SID>AddOption("diffopt", gettext("options for using diff mode"))
991  call <SID>OptionG("dip", &dip)
992  call <SID>AddOption("diffexpr", gettext("expression used to obtain a diff file"))
993  call <SID>OptionG("dex", &dex)
994  call <SID>AddOption("patchexpr", gettext("expression used to patch a file"))
995  call <SID>OptionG("pex", &pex)
996endif
997
998
999call <SID>Header(gettext("mapping"))
1000call <SID>AddOption("maxmapdepth", gettext("maximum depth of mapping"))
1001call append("$", " \tset mmd=" . &mmd)
1002call <SID>AddOption("remap", gettext("recognize mappings in mapped keys"))
1003call <SID>BinOptionG("remap", &remap)
1004call <SID>AddOption("timeout", gettext("allow timing out halfway into a mapping"))
1005call <SID>BinOptionG("to", &to)
1006call <SID>AddOption("ttimeout", gettext("allow timing out halfway into a key code"))
1007call <SID>BinOptionG("ttimeout", &ttimeout)
1008call <SID>AddOption("timeoutlen", gettext("time in msec for 'timeout'"))
1009call append("$", " \tset tm=" . &tm)
1010call <SID>AddOption("ttimeoutlen", gettext("time in msec for 'ttimeout'"))
1011call append("$", " \tset ttm=" . &ttm)
1012
1013
1014call <SID>Header(gettext("reading and writing files"))
1015call <SID>AddOption("modeline", gettext("enable using settings from modelines when reading a file"))
1016call append("$", "\t" .. s:local_to_buffer)
1017call <SID>BinOptionL("ml")
1018call <SID>AddOption("modelineexpr", gettext("allow setting expression options from a modeline"))
1019call <SID>BinOptionG("mle", &mle)
1020call <SID>AddOption("modelines", gettext("number of lines to check for modelines"))
1021call append("$", " \tset mls=" . &mls)
1022call <SID>AddOption("binary", gettext("binary file editing"))
1023call append("$", "\t" .. s:local_to_buffer)
1024call <SID>BinOptionL("bin")
1025call <SID>AddOption("endofline", gettext("last line in the file has an end-of-line"))
1026call append("$", "\t" .. s:local_to_buffer)
1027call <SID>BinOptionL("eol")
1028call <SID>AddOption("fixendofline", gettext("fixes missing end-of-line at end of text file"))
1029call append("$", "\t" .. s:local_to_buffer)
1030call <SID>BinOptionL("fixeol")
1031call <SID>AddOption("bomb", gettext("prepend a Byte Order Mark to the file"))
1032call append("$", "\t" .. s:local_to_buffer)
1033call <SID>BinOptionL("bomb")
1034call <SID>AddOption("fileformat", gettext("end-of-line format: \"dos\", \"unix\" or \"mac\""))
1035call append("$", "\t" .. s:local_to_buffer)
1036call <SID>OptionL("ff")
1037call <SID>AddOption("fileformats", gettext("list of file formats to look for when editing a file"))
1038call <SID>OptionG("ffs", &ffs)
1039call <SID>AddOption("textmode", gettext("obsolete, use 'fileformat'"))
1040call append("$", "\t" .. s:local_to_buffer)
1041call <SID>BinOptionL("tx")
1042call <SID>AddOption("textauto", gettext("obsolete, use 'fileformats'"))
1043call <SID>BinOptionG("ta", &ta)
1044call <SID>AddOption("write", gettext("writing files is allowed"))
1045call <SID>BinOptionG("write", &write)
1046call <SID>AddOption("writebackup", gettext("write a backup file before overwriting a file"))
1047call <SID>BinOptionG("wb", &wb)
1048call <SID>AddOption("backup", gettext("keep a backup after overwriting a file"))
1049call <SID>BinOptionG("bk", &bk)
1050call <SID>AddOption("backupskip", gettext("patterns that specify for which files a backup is not made"))
1051call append("$", " \tset bsk=" . &bsk)
1052call <SID>AddOption("backupcopy", gettext("whether to make the backup as a copy or rename the existing file"))
1053call append("$", "\t" .. s:global_or_local)
1054call append("$", " \tset bkc=" . &bkc)
1055call <SID>AddOption("backupdir", gettext("list of directories to put backup files in"))
1056call <SID>OptionG("bdir", &bdir)
1057call <SID>AddOption("backupext", gettext("file name extension for the backup file"))
1058call <SID>OptionG("bex", &bex)
1059call <SID>AddOption("autowrite", gettext("automatically write a file when leaving a modified buffer"))
1060call <SID>BinOptionG("aw", &aw)
1061call <SID>AddOption("autowriteall", gettext("as 'autowrite', but works with more commands"))
1062call <SID>BinOptionG("awa", &awa)
1063call <SID>AddOption("writeany", gettext("always write without asking for confirmation"))
1064call <SID>BinOptionG("wa", &wa)
1065call <SID>AddOption("autoread", gettext("automatically read a file when it was modified outside of Vim"))
1066call append("$", "\t" .. s:global_or_local)
1067call <SID>BinOptionG("ar", &ar)
1068call <SID>AddOption("patchmode", gettext("keep oldest version of a file; specifies file name extension"))
1069call <SID>OptionG("pm", &pm)
1070call <SID>AddOption("fsync", gettext("forcibly sync the file to disk after writing it"))
1071call <SID>BinOptionG("fs", &fs)
1072call <SID>AddOption("shortname", gettext("use 8.3 file names"))
1073call append("$", "\t" .. s:local_to_buffer)
1074call <SID>BinOptionL("sn")
1075call <SID>AddOption("cryptmethod", gettext("encryption method for file writing: zip, blowfish or blowfish2"))
1076call append("$", "\t" .. s:local_to_buffer)
1077call <SID>OptionL("cm")
1078
1079
1080call <SID>Header(gettext("the swap file"))
1081call <SID>AddOption("directory", gettext("list of directories for the swap file"))
1082call <SID>OptionG("dir", &dir)
1083call <SID>AddOption("swapfile", gettext("use a swap file for this buffer"))
1084call append("$", "\t" .. s:local_to_buffer)
1085call <SID>BinOptionL("swf")
1086call <SID>AddOption("swapsync", gettext("\"sync\", \"fsync\" or empty; how to flush a swap file to disk"))
1087call <SID>OptionG("sws", &sws)
1088call <SID>AddOption("updatecount", gettext("number of characters typed to cause a swap file update"))
1089call append("$", " \tset uc=" . &uc)
1090call <SID>AddOption("updatetime", gettext("time in msec after which the swap file will be updated"))
1091call append("$", " \tset ut=" . &ut)
1092call <SID>AddOption("maxmem", gettext("maximum amount of memory in Kbyte used for one buffer"))
1093call append("$", " \tset mm=" . &mm)
1094call <SID>AddOption("maxmemtot", gettext("maximum amount of memory in Kbyte used for all buffers"))
1095call append("$", " \tset mmt=" . &mmt)
1096
1097
1098call <SID>Header(gettext("command line editing"))
1099call <SID>AddOption("history", gettext("how many command lines are remembered"))
1100call append("$", " \tset hi=" . &hi)
1101call <SID>AddOption("wildchar", gettext("key that triggers command-line expansion"))
1102call append("$", " \tset wc=" . &wc)
1103call <SID>AddOption("wildcharm", gettext("like 'wildchar' but can also be used in a mapping"))
1104call append("$", " \tset wcm=" . &wcm)
1105call <SID>AddOption("wildmode", gettext("specifies how command line completion works"))
1106call <SID>OptionG("wim", &wim)
1107if has("wildoptions")
1108  call <SID>AddOption("wildoptions", gettext("empty or \"tagfile\" to list file name of matching tags"))
1109  call <SID>OptionG("wop", &wop)
1110endif
1111call <SID>AddOption("suffixes", gettext("list of file name extensions that have a lower priority"))
1112call <SID>OptionG("su", &su)
1113if has("file_in_path")
1114  call <SID>AddOption("suffixesadd", gettext("list of file name extensions added when searching for a file"))
1115  call append("$", "\t" .. s:local_to_buffer)
1116  call <SID>OptionL("sua")
1117endif
1118if has("wildignore")
1119  call <SID>AddOption("wildignore", gettext("list of patterns to ignore files for file name completion"))
1120  call <SID>OptionG("wig", &wig)
1121endif
1122call <SID>AddOption("fileignorecase", gettext("ignore case when using file names"))
1123call <SID>BinOptionG("fic", &fic)
1124call <SID>AddOption("wildignorecase", gettext("ignore case when completing file names"))
1125call <SID>BinOptionG("wic", &wic)
1126if has("wildmenu")
1127  call <SID>AddOption("wildmenu", gettext("command-line completion shows a list of matches"))
1128  call <SID>BinOptionG("wmnu", &wmnu)
1129endif
1130call <SID>AddOption("cedit", gettext("key used to open the command-line window"))
1131call <SID>OptionG("cedit", &cedit)
1132call <SID>AddOption("cmdwinheight", gettext("height of the command-line window"))
1133call <SID>OptionG("cwh", &cwh)
1134
1135
1136call <SID>Header(gettext("executing external commands"))
1137call <SID>AddOption("shell", gettext("name of the shell program used for external commands"))
1138call <SID>OptionG("sh", &sh)
1139if has("amiga")
1140  call <SID>AddOption("shelltype", gettext("when to use the shell or directly execute a command"))
1141  call append("$", " \tset st=" . &st)
1142endif
1143call <SID>AddOption("shellquote", gettext("character(s) to enclose a shell command in"))
1144call <SID>OptionG("shq", &shq)
1145call <SID>AddOption("shellxquote", gettext("like 'shellquote' but include the redirection"))
1146call <SID>OptionG("sxq", &sxq)
1147call <SID>AddOption("shellxescape", gettext("characters to escape when 'shellxquote' is ("))
1148call <SID>OptionG("sxe", &sxe)
1149call <SID>AddOption("shellcmdflag", gettext("argument for 'shell' to execute a command"))
1150call <SID>OptionG("shcf", &shcf)
1151call <SID>AddOption("shellredir", gettext("used to redirect command output to a file"))
1152call <SID>OptionG("srr", &srr)
1153call <SID>AddOption("shelltemp", gettext("use a temp file for shell commands instead of using a pipe"))
1154call <SID>BinOptionG("stmp", &stmp)
1155call <SID>AddOption("equalprg", gettext("program used for \"=\" command"))
1156call append("$", "\t" .. s:global_or_local)
1157call <SID>OptionG("ep", &ep)
1158call <SID>AddOption("formatprg", gettext("program used to format lines with \"gq\" command"))
1159call <SID>OptionG("fp", &fp)
1160call <SID>AddOption("keywordprg", gettext("program used for the \"K\" command"))
1161call <SID>OptionG("kp", &kp)
1162call <SID>AddOption("warn", gettext("warn when using a shell command and a buffer has changes"))
1163call <SID>BinOptionG("warn", &warn)
1164
1165
1166if has("quickfix")
1167  call <SID>Header(gettext("running make and jumping to errors (quickfix)"))
1168  call <SID>AddOption("errorfile", gettext("name of the file that contains error messages"))
1169  call <SID>OptionG("ef", &ef)
1170  call <SID>AddOption("errorformat", gettext("list of formats for error messages"))
1171  call append("$", "\t" .. s:global_or_local)
1172  call <SID>OptionG("efm", &efm)
1173  call <SID>AddOption("makeprg", gettext("program used for the \":make\" command"))
1174  call append("$", "\t" .. s:global_or_local)
1175  call <SID>OptionG("mp", &mp)
1176  call <SID>AddOption("shellpipe", gettext("string used to put the output of \":make\" in the error file"))
1177  call <SID>OptionG("sp", &sp)
1178  call <SID>AddOption("makeef", gettext("name of the errorfile for the 'makeprg' command"))
1179  call <SID>OptionG("mef", &mef)
1180  call <SID>AddOption("grepprg", gettext("program used for the \":grep\" command"))
1181  call append("$", "\t" .. s:global_or_local)
1182  call <SID>OptionG("gp", &gp)
1183  call <SID>AddOption("grepformat", gettext("list of formats for output of 'grepprg'"))
1184  call <SID>OptionG("gfm", &gfm)
1185  call <SID>AddOption("makeencoding", gettext("encoding of the \":make\" and \":grep\" output"))
1186  call append("$", "\t" .. s:global_or_local)
1187  call <SID>OptionG("menc", &menc)
1188  call <SID>AddOption("quickfixtextfunc", gettext("function to display text in the quickfix window"))
1189  call <SID>OptionG("qftf", &qftf)
1190endif
1191
1192
1193if has("win32")
1194  call <SID>Header(gettext("system specific"))
1195  call <SID>AddOption("shellslash", gettext("use forward slashes in file names; for Unix-like shells"))
1196  call <SID>BinOptionG("ssl", &ssl)
1197  call <SID>AddOption("completeslash", gettext("specifies slash/backslash used for completion"))
1198  call <SID>OptionG("csl", &csl)
1199endif
1200
1201
1202call <SID>Header(gettext("language specific"))
1203call <SID>AddOption("isfname", gettext("specifies the characters in a file name"))
1204call <SID>OptionG("isf", &isf)
1205call <SID>AddOption("isident", gettext("specifies the characters in an identifier"))
1206call <SID>OptionG("isi", &isi)
1207call <SID>AddOption("iskeyword", gettext("specifies the characters in a keyword"))
1208call append("$", "\t" .. s:local_to_buffer)
1209call <SID>OptionL("isk")
1210call <SID>AddOption("isprint", gettext("specifies printable characters"))
1211call <SID>OptionG("isp", &isp)
1212if has("textobjects")
1213  call <SID>AddOption("quoteescape", gettext("specifies escape characters in a string"))
1214  call append("$", "\t" .. s:local_to_buffer)
1215  call <SID>OptionL("qe")
1216endif
1217if has("rightleft")
1218  call <SID>AddOption("rightleft", gettext("display the buffer right-to-left"))
1219  call append("$", "\t" .. s:local_to_window)
1220  call <SID>BinOptionL("rl")
1221  call <SID>AddOption("rightleftcmd", gettext("when to edit the command-line right-to-left"))
1222  call append("$", "\t" .. s:local_to_window)
1223  call <SID>OptionL("rlc")
1224  call <SID>AddOption("revins", gettext("insert characters backwards"))
1225  call <SID>BinOptionG("ri", &ri)
1226  call <SID>AddOption("allowrevins", gettext("allow CTRL-_ in Insert and Command-line mode to toggle 'revins'"))
1227  call <SID>BinOptionG("ari", &ari)
1228  call <SID>AddOption("aleph", gettext("the ASCII code for the first letter of the Hebrew alphabet"))
1229  call append("$", " \tset al=" . &al)
1230  call <SID>AddOption("hkmap", gettext("use Hebrew keyboard mapping"))
1231  call <SID>BinOptionG("hk", &hk)
1232  call <SID>AddOption("hkmapp", gettext("use phonetic Hebrew keyboard mapping"))
1233  call <SID>BinOptionG("hkp", &hkp)
1234endif
1235if has("arabic")
1236  call <SID>AddOption("arabic", gettext("prepare for editing Arabic text"))
1237  call append("$", "\t" .. s:local_to_window)
1238  call <SID>BinOptionL("arab")
1239  call <SID>AddOption("arabicshape", gettext("perform shaping of Arabic characters"))
1240  call <SID>BinOptionG("arshape", &arshape)
1241  call <SID>AddOption("termbidi", gettext("terminal will perform bidi handling"))
1242  call <SID>BinOptionG("tbidi", &tbidi)
1243endif
1244if has("keymap")
1245  call <SID>AddOption("keymap", gettext("name of a keyboard mapping"))
1246  call <SID>OptionL("kmp")
1247endif
1248if has("langmap")
1249  call <SID>AddOption("langmap", gettext("list of characters that are translated in Normal mode"))
1250  call <SID>OptionG("lmap", &lmap)
1251  call <SID>AddOption("langremap", gettext("apply 'langmap' to mapped characters"))
1252  call <SID>BinOptionG("lrm", &lrm)
1253endif
1254if has("xim")
1255  call <SID>AddOption("imdisable", gettext("when set never use IM; overrules following IM options"))
1256  call <SID>BinOptionG("imd", &imd)
1257endif
1258call <SID>AddOption("iminsert", gettext("in Insert mode: 1: use :lmap; 2: use IM; 0: neither"))
1259call append("$", "\t" .. s:local_to_window)
1260call <SID>OptionL("imi")
1261call <SID>AddOption("imstyle", gettext("input method style, 0: on-the-spot, 1: over-the-spot"))
1262call <SID>OptionG("imst", &imst)
1263call <SID>AddOption("imsearch", gettext("entering a search pattern: 1: use :lmap; 2: use IM; 0: neither"))
1264call append("$", "\t" .. s:local_to_window)
1265call <SID>OptionL("ims")
1266if has("xim")
1267  call <SID>AddOption("imcmdline", gettext("when set always use IM when starting to edit a command line"))
1268  call <SID>BinOptionG("imc", &imc)
1269  call <SID>AddOption("imstatusfunc", gettext("function to obtain IME status"))
1270  call <SID>OptionG("imsf", &imsf)
1271  call <SID>AddOption("imactivatefunc", gettext("function to enable/disable IME"))
1272  call <SID>OptionG("imaf", &imaf)
1273endif
1274
1275
1276call <SID>Header(gettext("multi-byte characters"))
1277call <SID>AddOption("encoding", gettext("character encoding used in Vim: \"latin1\", \"utf-8\",\n\"euc-jp\", \"big5\", etc."))
1278call <SID>OptionG("enc", &enc)
1279call <SID>AddOption("fileencoding", gettext("character encoding for the current file"))
1280call append("$", "\t" .. s:local_to_buffer)
1281call <SID>OptionL("fenc")
1282call <SID>AddOption("fileencodings", gettext("automatically detected character encodings"))
1283call <SID>OptionG("fencs", &fencs)
1284call <SID>AddOption("termencoding", gettext("character encoding used by the terminal"))
1285call <SID>OptionG("tenc", &tenc)
1286call <SID>AddOption("charconvert", gettext("expression used for character encoding conversion"))
1287call <SID>OptionG("ccv", &ccv)
1288call <SID>AddOption("delcombine", gettext("delete combining (composing) characters on their own"))
1289call <SID>BinOptionG("deco", &deco)
1290call <SID>AddOption("maxcombine", gettext("maximum number of combining (composing) characters displayed"))
1291call <SID>OptionG("mco", &mco)
1292if has("xim") && has("gui_gtk")
1293  call <SID>AddOption("imactivatekey", gettext("key that activates the X input method"))
1294  call <SID>OptionG("imak", &imak)
1295endif
1296call <SID>AddOption("ambiwidth", gettext("width of ambiguous width characters"))
1297call <SID>OptionG("ambw", &ambw)
1298call <SID>AddOption("emoji", gettext("emoji characters are full width"))
1299call <SID>BinOptionG("emo", &emo)
1300
1301
1302call <SID>Header(gettext("various"))
1303call <SID>AddOption("virtualedit", gettext("when to use virtual editing: \"block\", \"insert\", \"all\"\nand/or \"onemore\""))
1304call <SID>OptionG("ve", &ve)
1305call <SID>AddOption("eventignore", gettext("list of autocommand events which are to be ignored"))
1306call <SID>OptionG("ei", &ei)
1307call <SID>AddOption("loadplugins", gettext("load plugin scripts when starting up"))
1308call <SID>BinOptionG("lpl", &lpl)
1309call <SID>AddOption("exrc", gettext("enable reading .vimrc/.exrc/.gvimrc in the current directory"))
1310call <SID>BinOptionG("ex", &ex)
1311call <SID>AddOption("secure", gettext("safer working with script files in the current directory"))
1312call <SID>BinOptionG("secure", &secure)
1313call <SID>AddOption("gdefault", gettext("use the 'g' flag for \":substitute\""))
1314call <SID>BinOptionG("gd", &gd)
1315call <SID>AddOption("edcompatible", gettext("'g' and 'c' flags of \":substitute\" toggle"))
1316call <SID>BinOptionG("ed", &ed)
1317if exists("+opendevice")
1318  call <SID>AddOption("opendevice", gettext("allow reading/writing devices"))
1319  call <SID>BinOptionG("odev", &odev)
1320endif
1321if exists("+maxfuncdepth")
1322  call <SID>AddOption("maxfuncdepth", gettext("maximum depth of function calls"))
1323  call append("$", " \tset mfd=" . &mfd)
1324endif
1325if has("mksession")
1326  call <SID>AddOption("sessionoptions", gettext("list of words that specifies what to put in a session file"))
1327  call <SID>OptionG("ssop", &ssop)
1328  call <SID>AddOption("viewoptions", gettext("list of words that specifies what to save for :mkview"))
1329  call <SID>OptionG("vop", &vop)
1330  call <SID>AddOption("viewdir", gettext("directory where to store files with :mkview"))
1331  call <SID>OptionG("vdir", &vdir)
1332endif
1333if has("viminfo")
1334  call <SID>AddOption("viminfo", gettext("list that specifies what to write in the viminfo file"))
1335  call <SID>OptionG("vi", &vi)
1336  call <SID>AddOption("viminfofile", gettext("file name used for the viminfo file"))
1337  call <SID>OptionG("vif", &vif)
1338endif
1339if has("quickfix")
1340  call <SID>AddOption("bufhidden", gettext("what happens with a buffer when it's no longer in a window"))
1341  call append("$", "\t" .. s:local_to_buffer)
1342  call <SID>OptionL("bh")
1343  call <SID>AddOption("buftype", gettext("empty, \"nofile\", \"nowrite\", \"quickfix\", etc.: type of buffer"))
1344  call append("$", "\t" .. s:local_to_buffer)
1345  call <SID>OptionL("bt")
1346endif
1347call <SID>AddOption("buflisted", gettext("whether the buffer shows up in the buffer list"))
1348call append("$", "\t" .. s:local_to_buffer)
1349call <SID>BinOptionL("bl")
1350call <SID>AddOption("debug", gettext("set to \"msg\" to see all error messages"))
1351call append("$", " \tset debug=" . &debug)
1352if has("signs")
1353  call <SID>AddOption("signcolumn", gettext("whether to show the signcolumn"))
1354  call append("$", "\t" .. s:local_to_window)
1355  call <SID>OptionL("scl")
1356endif
1357if has("mzscheme")
1358  call <SID>AddOption("mzquantum", gettext("interval in milliseconds between polls for MzScheme threads"))
1359  call append("$", " \tset mzq=" . &mzq)
1360endif
1361if exists("&luadll")
1362  call <SID>AddOption("luadll", gettext("name of the Lua dynamic library"))
1363  call <SID>OptionG("luadll", &luadll)
1364endif
1365if exists("&perldll")
1366  call <SID>AddOption("perldll", gettext("name of the Perl dynamic library"))
1367  call <SID>OptionG("perldll", &perldll)
1368endif
1369if has('pythonx')
1370  call <SID>AddOption("pyxversion", gettext("whether to use Python 2 or 3"))
1371  call append("$", " \tset pyx=" . &wd)
1372endif
1373if exists("&pythondll")
1374  call <SID>AddOption("pythondll", gettext("name of the Python 2 dynamic library"))
1375  call <SID>OptionG("pythondll", &pythondll)
1376endif
1377if exists("&pythonhome")
1378  call <SID>AddOption("pythonhome", gettext("name of the Python 2 home directory"))
1379  call <SID>OptionG("pythonhome", &pythonhome)
1380endif
1381if exists("&pythonthreedll")
1382  call <SID>AddOption("pythonthreedll", gettext("name of the Python 3 dynamic library"))
1383  call <SID>OptionG("pythonthreedll", &pythonthreedll)
1384endif
1385if exists("&pythonthreehome")
1386  call <SID>AddOption("pythonthreehome", gettext("name of the Python 3 home directory"))
1387  call <SID>OptionG("pythonthreehome", &pythonthreehome)
1388endif
1389if exists("&rubydll")
1390  call <SID>AddOption("rubydll", gettext("name of the Ruby dynamic library"))
1391  call <SID>OptionG("rubydll", &rubydll)
1392endif
1393if exists("&tcldll")
1394  call <SID>AddOption("tcldll", gettext("name of the Tcl dynamic library"))
1395  call <SID>OptionG("tcldll", &tcldll)
1396endif
1397if exists("&mzschemedll")
1398  call <SID>AddOption("mzschemedll", gettext("name of the MzScheme dynamic library"))
1399  call <SID>OptionG("mzschemedll", &mzschemedll)
1400  call <SID>AddOption("mzschemegcdll", gettext("name of the MzScheme GC dynamic library"))
1401  call <SID>OptionG("mzschemegcdll", &mzschemegcdll)
1402endif
1403
1404set cpo&vim
1405
1406" go to first line
14071
1408
1409" reset 'modified', so that ":q" can be used to close the window
1410setlocal nomodified
1411
1412if has("syntax")
1413  " Use Vim highlighting, with some additional stuff
1414  setlocal ft=vim
1415  syn match optwinHeader "^ \=[0-9].*"
1416  syn match optwinName "^[a-z]*\t" nextgroup=optwinComment
1417  syn match optwinComment ".*" contained
1418  syn match optwinComment "^\t.*"
1419  if !exists("did_optwin_syntax_inits")
1420    let did_optwin_syntax_inits = 1
1421    hi link optwinHeader Title
1422    hi link optwinName Identifier
1423    hi link optwinComment Comment
1424  endif
1425endif
1426
1427" Install autocommands to enable mappings in option-window
1428noremap <silent> <buffer> <CR> <C-\><C-N>:call <SID>CR()<CR>
1429inoremap <silent> <buffer> <CR> <Esc>:call <SID>CR()<CR>
1430noremap <silent> <buffer> <Space> :call <SID>Space()<CR>
1431
1432" Make the buffer be deleted when the window is closed.
1433setlocal buftype=nofile bufhidden=delete noswapfile
1434
1435augroup optwin
1436  au! BufUnload,BufHidden option-window nested
1437	\ call <SID>unload() | delfun <SID>unload
1438augroup END
1439
1440func <SID>unload()
1441  delfun <SID>CR
1442  delfun <SID>Space
1443  delfun <SID>Find
1444  delfun <SID>Update
1445  delfun <SID>OptionL
1446  delfun <SID>OptionG
1447  delfun <SID>BinOptionL
1448  delfun <SID>BinOptionG
1449  delfun <SID>Header
1450  au! optwin
1451endfunc
1452
1453" Restore the previous value of 'title' and 'icon'.
1454let &title = s:old_title
1455let &icon = s:old_icon
1456let &ru = s:old_ru
1457let &sc = s:old_sc
1458let &cpo = s:cpo_save
1459let &ul = s:old_ul
1460unlet s:old_title s:old_icon s:old_ru s:old_sc s:cpo_save s:idx s:lnum s:old_ul
1461
1462" vim: ts=8 sw=2 sts=2
1463