optwin.vim 54 KB

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