vim

Fork of vim, an acceptable text editor
git clone git://git.laack.co/vim.git
Log | Files | Refs | README | LICENSE

optwin.vim (73443B)


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