optwin.vim 59 KB

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