optwin.vim 58 KB

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