optwin.vim 53 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319
  1. " These commands create the option window.
  2. "
  3. " Maintainer: Bram Moolenaar <Bram@vim.org>
  4. " Last Change: 2019 Jul 18
  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. call append("$", "filetype\ttype of file; triggers the FileType event when set")
  361. call append("$", "\t(local to buffer)")
  362. call <SID>OptionL("ft")
  363. if has("syntax")
  364. call append("$", "syntax\tname of syntax highlighting used")
  365. call append("$", "\t(local to buffer)")
  366. call <SID>OptionL("syn")
  367. call append("$", "synmaxcol\tmaximum column to look for syntax items")
  368. call append("$", "\t(local to buffer)")
  369. call <SID>OptionL("smc")
  370. endif
  371. call append("$", "highlight\twhich highlighting to use for various occasions")
  372. call <SID>OptionG("hl", &hl)
  373. call append("$", "hlsearch\thighlight all matches for the last used search pattern")
  374. call <SID>BinOptionG("hls", &hls)
  375. if has("termguicolors")
  376. call append("$", "termguicolors\tuse GUI colors for the terminal")
  377. call <SID>BinOptionG("tgc", &tgc)
  378. endif
  379. if has("syntax")
  380. call append("$", "cursorcolumn\thighlight the screen column of the cursor")
  381. call append("$", "\t(local to window)")
  382. call <SID>BinOptionL("cuc")
  383. call append("$", "cursorline\thighlight the screen line of the cursor")
  384. call append("$", "\t(local to window)")
  385. call <SID>BinOptionL("cul")
  386. call append("$", "colorcolumn\tcolumns to highlight")
  387. call append("$", "\t(local to window)")
  388. call <SID>OptionL("cc")
  389. call append("$", "spell\thighlight spelling mistakes")
  390. call append("$", "\t(local to window)")
  391. call <SID>BinOptionL("spell")
  392. call append("$", "spelllang\tlist of accepted languages")
  393. call append("$", "\t(local to buffer)")
  394. call <SID>OptionL("spl")
  395. call append("$", "spellfile\tfile that \"zg\" adds good words to")
  396. call append("$", "\t(local to buffer)")
  397. call <SID>OptionL("spf")
  398. call append("$", "spellcapcheck\tpattern to locate the end of a sentence")
  399. call append("$", "\t(local to buffer)")
  400. call <SID>OptionL("spc")
  401. call append("$", "spellsuggest\tmethods used to suggest corrections")
  402. call <SID>OptionG("sps", &sps)
  403. call append("$", "mkspellmem\tamount of memory used by :mkspell before compressing")
  404. call <SID>OptionG("msm", &msm)
  405. endif
  406. call <SID>Header("multiple windows")
  407. call append("$", "laststatus\t0, 1 or 2; when to use a status line for the last window")
  408. call append("$", " \tset ls=" . &ls)
  409. if has("statusline")
  410. call append("$", "statusline\talternate format to be used for a status line")
  411. call <SID>OptionG("stl", &stl)
  412. endif
  413. call append("$", "equalalways\tmake all windows the same size when adding/removing windows")
  414. call <SID>BinOptionG("ea", &ea)
  415. call append("$", "eadirection\tin which direction 'equalalways' works: \"ver\", \"hor\" or \"both\"")
  416. call <SID>OptionG("ead", &ead)
  417. call append("$", "winheight\tminimal number of lines used for the current window")
  418. call append("$", " \tset wh=" . &wh)
  419. call append("$", "winminheight\tminimal number of lines used for any window")
  420. call append("$", " \tset wmh=" . &wmh)
  421. call append("$", "winfixheight\tkeep the height of the window")
  422. call append("$", "\t(local to window)")
  423. call <SID>BinOptionL("wfh")
  424. call append("$", "winfixwidth\tkeep the width of the window")
  425. call append("$", "\t(local to window)")
  426. call <SID>BinOptionL("wfw")
  427. call append("$", "winwidth\tminimal number of columns used for the current window")
  428. call append("$", " \tset wiw=" . &wiw)
  429. call append("$", "winminwidth\tminimal number of columns used for any window")
  430. call append("$", " \tset wmw=" . &wmw)
  431. call append("$", "helpheight\tinitial height of the help window")
  432. call append("$", " \tset hh=" . &hh)
  433. if has("quickfix")
  434. " call append("$", "previewpopup\tuse a popup window for preview")
  435. " call append("$", " \tset pvp=" . &pvp)
  436. call append("$", "previewheight\tdefault height for the preview window")
  437. call append("$", " \tset pvh=" . &pvh)
  438. call append("$", "previewwindow\tidentifies the preview window")
  439. call append("$", "\t(local to window)")
  440. call <SID>BinOptionL("pvw")
  441. endif
  442. call append("$", "hidden\tdon't unload a buffer when no longer shown in a window")
  443. call <SID>BinOptionG("hid", &hid)
  444. call append("$", "switchbuf\t\"useopen\" and/or \"split\"; which window to use when jumping")
  445. call append("$", "\tto a buffer")
  446. call <SID>OptionG("swb", &swb)
  447. call append("$", "splitbelow\ta new window is put below the current one")
  448. call <SID>BinOptionG("sb", &sb)
  449. call append("$", "splitright\ta new window is put right of the current one")
  450. call <SID>BinOptionG("spr", &spr)
  451. call append("$", "scrollbind\tthis window scrolls together with other bound windows")
  452. call append("$", "\t(local to window)")
  453. call <SID>BinOptionL("scb")
  454. call append("$", "scrollopt\t\"ver\", \"hor\" and/or \"jump\"; list of options for 'scrollbind'")
  455. call <SID>OptionG("sbo", &sbo)
  456. call append("$", "cursorbind\tthis window's cursor moves together with other bound windows")
  457. call append("$", "\t(local to window)")
  458. call <SID>BinOptionL("crb")
  459. if has("terminal")
  460. call append("$", "termsize\tsize of a terminal window")
  461. call append("$", "\t(local to window)")
  462. call <SID>OptionL("tms")
  463. call append("$", "termkey\tkey that precedes Vim commands in a terminal window")
  464. call append("$", "\t(local to window)")
  465. call <SID>OptionL("tk")
  466. endif
  467. call <SID>Header("multiple tab pages")
  468. call append("$", "showtabline\t0, 1 or 2; when to use a tab pages line")
  469. call append("$", " \tset stal=" . &stal)
  470. call append("$", "tabpagemax\tmaximum number of tab pages to open for -p and \"tab all\"")
  471. call append("$", " \tset tpm=" . &tpm)
  472. call append("$", "tabline\tcustom tab pages line")
  473. call <SID>OptionG("tal", &tal)
  474. if has("gui")
  475. call append("$", "guitablabel\tcustom tab page label for the GUI")
  476. call <SID>OptionG("gtl", &gtl)
  477. call append("$", "guitabtooltip\tcustom tab page tooltip for the GUI")
  478. call <SID>OptionG("gtt", &gtt)
  479. endif
  480. call <SID>Header("terminal")
  481. call append("$", "scrolljump\tminimal number of lines to scroll at a time")
  482. call append("$", " \tset sj=" . &sj)
  483. if has("gui") || has("msdos") || has("win32")
  484. call append("$", "guicursor\tspecifies what the cursor looks like in different modes")
  485. call <SID>OptionG("gcr", &gcr)
  486. endif
  487. if has("title")
  488. let &title = s:old_title
  489. call append("$", "title\tshow info in the window title")
  490. call <SID>BinOptionG("title", &title)
  491. set notitle
  492. call append("$", "titlelen\tpercentage of 'columns' used for the window title")
  493. call append("$", " \tset titlelen=" . &titlelen)
  494. call append("$", "titlestring\twhen not empty, string to be used for the window title")
  495. call <SID>OptionG("titlestring", &titlestring)
  496. call append("$", "titleold\tstring to restore the title to when exiting Vim")
  497. call <SID>OptionG("titleold", &titleold)
  498. let &icon = s:old_icon
  499. call append("$", "icon\tset the text of the icon for this window")
  500. call <SID>BinOptionG("icon", &icon)
  501. set noicon
  502. call append("$", "iconstring\twhen not empty, text for the icon of this window")
  503. call <SID>OptionG("iconstring", &iconstring)
  504. endif
  505. call <SID>Header("using the mouse")
  506. call append("$", "mouse\tlist of flags for using the mouse")
  507. call <SID>OptionG("mouse", &mouse)
  508. if has("gui")
  509. call append("$", "mousefocus\tthe window with the mouse pointer becomes the current one")
  510. call <SID>BinOptionG("mousef", &mousef)
  511. call append("$", "mousehide\thide the mouse pointer while typing")
  512. call <SID>BinOptionG("mh", &mh)
  513. endif
  514. call append("$", "mousemodel\t\"extend\", \"popup\" or \"popup_setpos\"; what the right")
  515. call append("$", "\tmouse button is used for")
  516. call <SID>OptionG("mousem", &mousem)
  517. call append("$", "mousetime\tmaximum time in msec to recognize a double-click")
  518. call append("$", " \tset mouset=" . &mouset)
  519. if has("mouseshape")
  520. call append("$", "mouseshape\twhat the mouse pointer looks like in different modes")
  521. call <SID>OptionG("mouses", &mouses)
  522. endif
  523. if has("gui")
  524. call <SID>Header("GUI")
  525. call append("$", "guifont\tlist of font names to be used in the GUI")
  526. call <SID>OptionG("gfn", &gfn)
  527. if has("xfontset")
  528. call append("$", "guifontset\tpair of fonts to be used, for multibyte editing")
  529. call <SID>OptionG("gfs", &gfs)
  530. endif
  531. call append("$", "guifontwide\tlist of font names to be used for double-wide characters")
  532. call <SID>OptionG("gfw", &gfw)
  533. call append("$", "guioptions\tlist of flags that specify how the GUI works")
  534. call <SID>OptionG("go", &go)
  535. if has("gui_gtk")
  536. call append("$", "toolbar\t\"icons\", \"text\" and/or \"tooltips\"; how to show the toolbar")
  537. call <SID>OptionG("tb", &tb)
  538. if has("gui_gtk2")
  539. call append("$", "toolbariconsize\tsize of toolbar icons")
  540. call <SID>OptionG("tbis", &tbis)
  541. endif
  542. endif
  543. if has("browse")
  544. call append("$", "browsedir\t\"last\", \"buffer\" or \"current\": which directory used for the file browser")
  545. call <SID>OptionG("bsdir", &bsdir)
  546. endif
  547. if has("multi_lang")
  548. call append("$", "langmenu\tlanguage to be used for the menus")
  549. call <SID>OptionG("langmenu", &lm)
  550. endif
  551. call append("$", "menuitems\tmaximum number of items in one menu")
  552. call append("$", " \tset mis=" . &mis)
  553. if has("winaltkeys")
  554. call append("$", "winaltkeys\t\"no\", \"yes\" or \"menu\"; how to use the ALT key")
  555. call <SID>OptionG("wak", &wak)
  556. endif
  557. call append("$", "linespace\tnumber of pixel lines to use between characters")
  558. call append("$", " \tset lsp=" . &lsp)
  559. if has("balloon_eval") || has("balloon_eval_term")
  560. call append("$", "balloondelay\tdelay in milliseconds before a balloon may pop up")
  561. call append("$", " \tset bdlay=" . &bdlay)
  562. if has("balloon_eval")
  563. call append("$", "ballooneval\tuse balloon evaluation in the GUI")
  564. call <SID>BinOptionG("beval", &beval)
  565. endif
  566. if has("balloon_eval_term")
  567. call append("$", "balloonevalterm\tuse balloon evaluation in the terminal")
  568. call <SID>BinOptionG("bevalterm", &beval)
  569. endif
  570. if has("eval")
  571. call append("$", "balloonexpr\texpression to show in balloon eval")
  572. call append("$", " \tset bexpr=" . &bexpr)
  573. endif
  574. endif
  575. endif
  576. if has("printer")
  577. call <SID>Header("printing")
  578. call append("$", "printoptions\tlist of items that control the format of :hardcopy output")
  579. call <SID>OptionG("popt", &popt)
  580. call append("$", "printdevice\tname of the printer to be used for :hardcopy")
  581. call <SID>OptionG("pdev", &pdev)
  582. if has("postscript")
  583. call append("$", "printexpr\texpression used to print the PostScript file for :hardcopy")
  584. call <SID>OptionG("pexpr", &pexpr)
  585. endif
  586. call append("$", "printfont\tname of the font to be used for :hardcopy")
  587. call <SID>OptionG("pfn", &pfn)
  588. call append("$", "printheader\tformat of the header used for :hardcopy")
  589. call <SID>OptionG("pheader", &pheader)
  590. if has("postscript")
  591. call append("$", "printencoding\tencoding used to print the PostScript file for :hardcopy")
  592. call <SID>OptionG("penc", &penc)
  593. endif
  594. if has("multi_byte")
  595. call append("$", "printmbcharset\tthe CJK character set to be used for CJK output from :hardcopy")
  596. call <SID>OptionG("pmbcs", &pmbcs)
  597. call append("$", "printmbfont\tlist of font names to be used for CJK output from :hardcopy")
  598. call <SID>OptionG("pmbfn", &pmbfn)
  599. endif
  600. endif
  601. call <SID>Header("messages and info")
  602. call append("$", "terse\tadd 's' flag in 'shortmess' (don't show search message)")
  603. call <SID>BinOptionG("terse", &terse)
  604. call append("$", "shortmess\tlist of flags to make messages shorter")
  605. call <SID>OptionG("shm", &shm)
  606. call append("$", "showcmd\tshow (partial) command keys in the status line")
  607. let &sc = s:old_sc
  608. call <SID>BinOptionG("sc", &sc)
  609. set nosc
  610. call append("$", "showmode\tdisplay the current mode in the status line")
  611. call <SID>BinOptionG("smd", &smd)
  612. call append("$", "ruler\tshow cursor position below each window")
  613. let &ru = s:old_ru
  614. call <SID>BinOptionG("ru", &ru)
  615. set noru
  616. if has("statusline")
  617. call append("$", "rulerformat\talternate format to be used for the ruler")
  618. call <SID>OptionG("ruf", &ruf)
  619. endif
  620. call append("$", "report\tthreshold for reporting number of changed lines")
  621. call append("$", " \tset report=" . &report)
  622. call append("$", "verbose\tthe higher the more messages are given")
  623. call append("$", " \tset vbs=" . &vbs)
  624. call append("$", "verbosefile\tfile to write messages in")
  625. call <SID>OptionG("vfile", &vfile)
  626. call append("$", "more\tpause listings when the screen is full")
  627. call <SID>BinOptionG("more", &more)
  628. if has("dialog_con") || has("dialog_gui")
  629. call append("$", "confirm\tstart a dialog when a command fails")
  630. call <SID>BinOptionG("cf", &cf)
  631. endif
  632. call append("$", "errorbells\tring the bell for error messages")
  633. call <SID>BinOptionG("eb", &eb)
  634. call append("$", "visualbell\tuse a visual bell instead of beeping")
  635. call <SID>BinOptionG("vb", &vb)
  636. call append("$", "belloff\tdo not ring the bell for these reasons")
  637. call <SID>OptionG("belloff", &belloff)
  638. if has("multi_lang")
  639. call append("$", "helplang\tlist of preferred languages for finding help")
  640. call <SID>OptionG("hlg", &hlg)
  641. endif
  642. call <SID>Header("selecting text")
  643. call append("$", "selection\t\"old\", \"inclusive\" or \"exclusive\"; how selecting text behaves")
  644. call <SID>OptionG("sel", &sel)
  645. call append("$", "selectmode\t\"mouse\", \"key\" and/or \"cmd\"; when to start Select mode")
  646. call append("$", "\tinstead of Visual mode")
  647. call <SID>OptionG("slm", &slm)
  648. if has("clipboard")
  649. call append("$", "clipboard\t\"unnamed\" to use the * register like unnamed register")
  650. call append("$", "\t\"autoselect\" to always put selected text on the clipboard")
  651. call <SID>OptionG("cb", &cb)
  652. endif
  653. call append("$", "keymodel\t\"startsel\" and/or \"stopsel\"; what special keys can do")
  654. call <SID>OptionG("km", &km)
  655. call <SID>Header("editing text")
  656. call append("$", "undolevels\tmaximum number of changes that can be undone")
  657. call append("$", "\t(global or local to buffer)")
  658. call append("$", " \tset ul=" . s:old_ul)
  659. call append("$", "undofile\tautomatically save and restore undo history")
  660. call <SID>BinOptionG("udf", &udf)
  661. call append("$", "undodir\tlist of directories for undo files")
  662. call <SID>OptionG("udir", &udir)
  663. call append("$", "undoreload\tmaximum number lines to save for undo on a buffer reload")
  664. call append("$", " \tset ur=" . &ur)
  665. call append("$", "modified\tchanges have been made and not written to a file")
  666. call append("$", "\t(local to buffer)")
  667. call <SID>BinOptionL("mod")
  668. call append("$", "readonly\tbuffer is not to be written")
  669. call append("$", "\t(local to buffer)")
  670. call <SID>BinOptionL("ro")
  671. call append("$", "modifiable\tchanges to the text are not possible")
  672. call append("$", "\t(local to buffer)")
  673. call <SID>BinOptionL("ma")
  674. call append("$", "textwidth\tline length above which to break a line")
  675. call append("$", "\t(local to buffer)")
  676. call <SID>OptionL("tw")
  677. call append("$", "wrapmargin\tmargin from the right in which to break a line")
  678. call append("$", "\t(local to buffer)")
  679. call <SID>OptionL("wm")
  680. call append("$", "backspace\tspecifies what <BS>, CTRL-W, etc. can do in Insert mode")
  681. call append("$", " \tset bs=" . &bs)
  682. call append("$", "comments\tdefinition of what comment lines look like")
  683. call append("$", "\t(local to buffer)")
  684. call <SID>OptionL("com")
  685. call append("$", "formatoptions\tlist of flags that tell how automatic formatting works")
  686. call append("$", "\t(local to buffer)")
  687. call <SID>OptionL("fo")
  688. call append("$", "formatlistpat\tpattern to recognize a numbered list")
  689. call append("$", "\t(local to buffer)")
  690. call <SID>OptionL("flp")
  691. if has("eval")
  692. call append("$", "formatexpr\texpression used for \"gq\" to format lines")
  693. call append("$", "\t(local to buffer)")
  694. call <SID>OptionL("fex")
  695. endif
  696. if has("insert_expand")
  697. call append("$", "complete\tspecifies how Insert mode completion works for CTRL-N and CTRL-P")
  698. call append("$", "\t(local to buffer)")
  699. call <SID>OptionL("cpt")
  700. call append("$", "completeopt\twhether to use a popup menu for Insert mode completion")
  701. call <SID>OptionG("cot", &cot)
  702. call append("$", "pumheight\tmaximum height of the popup menu")
  703. call <SID>OptionG("ph", &ph)
  704. if exists("&pw")
  705. call append("$", "pumwidth\tminimum width of the popup menu")
  706. call <SID>OptionG("pw", &pw)
  707. endif
  708. call append("$", "completefunc\tuser defined function for Insert mode completion")
  709. call append("$", "\t(local to buffer)")
  710. call <SID>OptionL("cfu")
  711. call append("$", "omnifunc\tfunction for filetype-specific Insert mode completion")
  712. call append("$", "\t(local to buffer)")
  713. call <SID>OptionL("ofu")
  714. call append("$", "dictionary\tlist of dictionary files for keyword completion")
  715. call append("$", "\t(global or local to buffer)")
  716. call <SID>OptionG("dict", &dict)
  717. call append("$", "thesaurus\tlist of thesaurus files for keyword completion")
  718. call append("$", "\t(global or local to buffer)")
  719. call <SID>OptionG("tsr", &tsr)
  720. endif
  721. call append("$", "infercase\tadjust case of a keyword completion match")
  722. call append("$", "\t(local to buffer)")
  723. call <SID>BinOptionL("inf")
  724. if has("digraphs")
  725. call append("$", "digraph\tenable entering digraphs with c1 <BS> c2")
  726. call <SID>BinOptionG("dg", &dg)
  727. endif
  728. call append("$", "tildeop\tthe \"~\" command behaves like an operator")
  729. call <SID>BinOptionG("top", &top)
  730. call append("$", "operatorfunc\tfunction called for the\"g@\" operator")
  731. call <SID>OptionG("opfunc", &opfunc)
  732. call append("$", "showmatch\twhen inserting a bracket, briefly jump to its match")
  733. call <SID>BinOptionG("sm", &sm)
  734. call append("$", "matchtime\ttenth of a second to show a match for 'showmatch'")
  735. call append("$", " \tset mat=" . &mat)
  736. call append("$", "matchpairs\tlist of pairs that match for the \"%\" command")
  737. call append("$", "\t(local to buffer)")
  738. call <SID>OptionL("mps")
  739. call append("$", "joinspaces\tuse two spaces after '.' when joining a line")
  740. call <SID>BinOptionG("js", &js)
  741. call append("$", "nrformats\t\"alpha\", \"octal\" and/or \"hex\"; number formats recognized for")
  742. call append("$", "\tCTRL-A and CTRL-X commands")
  743. call append("$", "\t(local to buffer)")
  744. call <SID>OptionL("nf")
  745. call <SID>Header("tabs and indenting")
  746. call append("$", "tabstop\tnumber of spaces a <Tab> in the text stands for")
  747. call append("$", "\t(local to buffer)")
  748. call <SID>OptionL("ts")
  749. call append("$", "shiftwidth\tnumber of spaces used for each step of (auto)indent")
  750. call append("$", "\t(local to buffer)")
  751. call <SID>OptionL("sw")
  752. call append("$", "smarttab\ta <Tab> in an indent inserts 'shiftwidth' spaces")
  753. call <SID>BinOptionG("sta", &sta)
  754. call append("$", "softtabstop\tif non-zero, number of spaces to insert for a <Tab>")
  755. call append("$", "\t(local to buffer)")
  756. call <SID>OptionL("sts")
  757. call append("$", "shiftround\tround to 'shiftwidth' for \"<<\" and \">>\"")
  758. call <SID>BinOptionG("sr", &sr)
  759. call append("$", "expandtab\texpand <Tab> to spaces in Insert mode")
  760. call append("$", "\t(local to buffer)")
  761. call <SID>BinOptionL("et")
  762. call append("$", "autoindent\tautomatically set the indent of a new line")
  763. call append("$", "\t(local to buffer)")
  764. call <SID>BinOptionL("ai")
  765. if has("smartindent")
  766. call append("$", "smartindent\tdo clever autoindenting")
  767. call append("$", "\t(local to buffer)")
  768. call <SID>BinOptionL("si")
  769. endif
  770. if has("cindent")
  771. call append("$", "cindent\tenable specific indenting for C code")
  772. call append("$", "\t(local to buffer)")
  773. call <SID>BinOptionL("cin")
  774. call append("$", "cinoptions\toptions for C-indenting")
  775. call append("$", "\t(local to buffer)")
  776. call <SID>OptionL("cino")
  777. call append("$", "cinkeys\tkeys that trigger C-indenting in Insert mode")
  778. call append("$", "\t(local to buffer)")
  779. call <SID>OptionL("cink")
  780. call append("$", "cinwords\tlist of words that cause more C-indent")
  781. call append("$", "\t(local to buffer)")
  782. call <SID>OptionL("cinw")
  783. call append("$", "indentexpr\texpression used to obtain the indent of a line")
  784. call append("$", "\t(local to buffer)")
  785. call <SID>OptionL("inde")
  786. call append("$", "indentkeys\tkeys that trigger indenting with 'indentexpr' in Insert mode")
  787. call append("$", "\t(local to buffer)")
  788. call <SID>OptionL("indk")
  789. endif
  790. call append("$", "copyindent\tcopy whitespace for indenting from previous line")
  791. call append("$", "\t(local to buffer)")
  792. call <SID>BinOptionL("ci")
  793. call append("$", "preserveindent\tpreserve kind of whitespace when changing indent")
  794. call append("$", "\t(local to buffer)")
  795. call <SID>BinOptionL("pi")
  796. if has("lispindent")
  797. call append("$", "lisp\tenable lisp mode")
  798. call append("$", "\t(local to buffer)")
  799. call <SID>BinOptionL("lisp")
  800. call append("$", "lispwords\twords that change how lisp indenting works")
  801. call <SID>OptionL("lw")
  802. endif
  803. if has("folding")
  804. call <SID>Header("folding")
  805. call append("$", "foldenable\tset to display all folds open")
  806. call append("$", "\t(local to window)")
  807. call <SID>BinOptionL("fen")
  808. call append("$", "foldlevel\tfolds with a level higher than this number will be closed")
  809. call append("$", "\t(local to window)")
  810. call <SID>OptionL("fdl")
  811. call append("$", "foldlevelstart\tvalue for 'foldlevel' when starting to edit a file")
  812. call append("$", " \tset fdls=" . &fdls)
  813. call append("$", "foldcolumn\twidth of the column used to indicate folds")
  814. call append("$", "\t(local to window)")
  815. call <SID>OptionL("fdc")
  816. call append("$", "foldtext\texpression used to display the text of a closed fold")
  817. call append("$", "\t(local to window)")
  818. call <SID>OptionL("fdt")
  819. call append("$", "foldclose\tset to \"all\" to close a fold when the cursor leaves it")
  820. call <SID>OptionG("fcl", &fcl)
  821. call append("$", "foldopen\tspecifies for which commands a fold will be opened")
  822. call <SID>OptionG("fdo", &fdo)
  823. call append("$", "foldminlines\tminimum number of screen lines for a fold to be closed")
  824. call append("$", "\t(local to window)")
  825. call <SID>OptionL("fml")
  826. call append("$", "commentstring\ttemplate for comments; used to put the marker in")
  827. call <SID>OptionL("cms")
  828. call append("$", "foldmethod\tfolding type: \"manual\", \"indent\", \"expr\", \"marker\" or \"syntax\"")
  829. call append("$", "\t(local to window)")
  830. call <SID>OptionL("fdm")
  831. call append("$", "foldexpr\texpression used when 'foldmethod' is \"expr\"")
  832. call append("$", "\t(local to window)")
  833. call <SID>OptionL("fde")
  834. call append("$", "foldignore\tused to ignore lines when 'foldmethod' is \"indent\"")
  835. call append("$", "\t(local to window)")
  836. call <SID>OptionL("fdi")
  837. call append("$", "foldmarker\tmarkers used when 'foldmethod' is \"marker\"")
  838. call append("$", "\t(local to window)")
  839. call <SID>OptionL("fmr")
  840. call append("$", "foldnestmax\tmaximum fold depth for when 'foldmethod' is \"indent\" or \"syntax\"")
  841. call append("$", "\t(local to window)")
  842. call <SID>OptionL("fdn")
  843. endif
  844. if has("diff")
  845. call <SID>Header("diff mode")
  846. call append("$", "diff\tuse diff mode for the current window")
  847. call append("$", "\t(local to window)")
  848. call <SID>BinOptionL("diff")
  849. call append("$", "diffopt\toptions for using diff mode")
  850. call <SID>OptionG("dip", &dip)
  851. call append("$", "diffexpr\texpression used to obtain a diff file")
  852. call <SID>OptionG("dex", &dex)
  853. call append("$", "patchexpr\texpression used to patch a file")
  854. call <SID>OptionG("pex", &pex)
  855. endif
  856. call <SID>Header("mapping")
  857. call append("$", "maxmapdepth\tmaximum depth of mapping")
  858. call append("$", " \tset mmd=" . &mmd)
  859. call append("$", "remap\trecognize mappings in mapped keys")
  860. call <SID>BinOptionG("remap", &remap)
  861. call append("$", "timeout\tallow timing out halfway into a mapping")
  862. call <SID>BinOptionG("to", &to)
  863. call append("$", "ttimeout\tallow timing out halfway into a key code")
  864. call <SID>BinOptionG("ttimeout", &ttimeout)
  865. call append("$", "timeoutlen\ttime in msec for 'timeout'")
  866. call append("$", " \tset tm=" . &tm)
  867. call append("$", "ttimeoutlen\ttime in msec for 'ttimeout'")
  868. call append("$", " \tset ttm=" . &ttm)
  869. call <SID>Header("reading and writing files")
  870. call append("$", "modeline\tenable using settings from modelines when reading a file")
  871. call append("$", "\t(local to buffer)")
  872. call <SID>BinOptionL("ml")
  873. call append("$", "modelineexpr\tallow setting expression options from a modeline")
  874. call <SID>BinOptionG("mle", &mle)
  875. call append("$", "modelines\tnumber of lines to check for modelines")
  876. call append("$", " \tset mls=" . &mls)
  877. call append("$", "binary\tbinary file editing")
  878. call append("$", "\t(local to buffer)")
  879. call <SID>BinOptionL("bin")
  880. call append("$", "endofline\tlast line in the file has an end-of-line")
  881. call append("$", "\t(local to buffer)")
  882. call <SID>BinOptionL("eol")
  883. call append("$", "fixendofline\tfixes missing end-of-line at end of text file")
  884. call append("$", "\t(local to buffer)")
  885. call <SID>BinOptionL("fixeol")
  886. if has("multi_byte")
  887. call append("$", "bomb\tprepend a Byte Order Mark to the file")
  888. call append("$", "\t(local to buffer)")
  889. call <SID>BinOptionL("bomb")
  890. endif
  891. call append("$", "fileformat\tend-of-line format: \"dos\", \"unix\" or \"mac\"")
  892. call append("$", "\t(local to buffer)")
  893. call <SID>OptionL("ff")
  894. call append("$", "fileformats\tlist of file formats to look for when editing a file")
  895. call <SID>OptionG("ffs", &ffs)
  896. call append("$", "\t(local to buffer)")
  897. call append("$", "write\twriting files is allowed")
  898. call <SID>BinOptionG("write", &write)
  899. call append("$", "writebackup\twrite a backup file before overwriting a file")
  900. call <SID>BinOptionG("wb", &wb)
  901. call append("$", "backup\tkeep a backup after overwriting a file")
  902. call <SID>BinOptionG("bk", &bk)
  903. call append("$", "backupskip\tpatterns that specify for which files a backup is not made")
  904. call append("$", " \tset bsk=" . &bsk)
  905. call append("$", "backupcopy\twhether to make the backup as a copy or rename the existing file")
  906. call append("$", "\t(global or local to buffer)")
  907. call append("$", " \tset bkc=" . &bkc)
  908. call append("$", "backupdir\tlist of directories to put backup files in")
  909. call <SID>OptionG("bdir", &bdir)
  910. call append("$", "backupext\tfile name extension for the backup file")
  911. call <SID>OptionG("bex", &bex)
  912. call append("$", "autowrite\tautomatically write a file when leaving a modified buffer")
  913. call <SID>BinOptionG("aw", &aw)
  914. call append("$", "autowriteall\tas 'autowrite', but works with more commands")
  915. call <SID>BinOptionG("awa", &awa)
  916. call append("$", "writeany\talways write without asking for confirmation")
  917. call <SID>BinOptionG("wa", &wa)
  918. call append("$", "autoread\tautomatically read a file when it was modified outside of Vim")
  919. call append("$", "\t(global or local to buffer)")
  920. call <SID>BinOptionG("ar", &ar)
  921. call append("$", "patchmode\tkeep oldest version of a file; specifies file name extension")
  922. call <SID>OptionG("pm", &pm)
  923. call append("$", "fsync\tforcibly sync the file to disk after writing it")
  924. call <SID>BinOptionG("fs", &fs)
  925. call <SID>Header("the swap file")
  926. call append("$", "directory\tlist of directories for the swap file")
  927. call <SID>OptionG("dir", &dir)
  928. call append("$", "swapfile\tuse a swap file for this buffer")
  929. call append("$", "\t(local to buffer)")
  930. call <SID>BinOptionL("swf")
  931. call append("$", "updatecount\tnumber of characters typed to cause a swap file update")
  932. call append("$", " \tset uc=" . &uc)
  933. call append("$", "updatetime\ttime in msec after which the swap file will be updated")
  934. call append("$", " \tset ut=" . &ut)
  935. call <SID>Header("command line editing")
  936. call append("$", "history\thow many command lines are remembered ")
  937. call append("$", " \tset hi=" . &hi)
  938. call append("$", "wildchar\tkey that triggers command-line expansion")
  939. call append("$", " \tset wc=" . &wc)
  940. call append("$", "wildcharm\tlike 'wildchar' but can also be used in a mapping")
  941. call append("$", " \tset wcm=" . &wcm)
  942. call append("$", "wildmode\tspecifies how command line completion works")
  943. call <SID>OptionG("wim", &wim)
  944. if has("wildoptions")
  945. call append("$", "wildoptions\tempty or \"tagfile\" to list file name of matching tags")
  946. call <SID>OptionG("wop", &wop)
  947. endif
  948. call append("$", "suffixes\tlist of file name extensions that have a lower priority")
  949. call <SID>OptionG("su", &su)
  950. if has("file_in_path")
  951. call append("$", "suffixesadd\tlist of file name extensions added when searching for a file")
  952. call append("$", "\t(local to buffer)")
  953. call <SID>OptionL("sua")
  954. endif
  955. if has("wildignore")
  956. call append("$", "wildignore\tlist of patterns to ignore files for file name completion")
  957. call <SID>OptionG("wig", &wig)
  958. endif
  959. call append("$", "fileignorecase\tignore case when using file names")
  960. call <SID>BinOptionG("fic", &fic)
  961. call append("$", "wildignorecase\tignore case when completing file names")
  962. call <SID>BinOptionG("wic", &wic)
  963. if has("wildmenu")
  964. call append("$", "wildmenu\tcommand-line completion shows a list of matches")
  965. call <SID>BinOptionG("wmnu", &wmnu)
  966. endif
  967. call append("$", "cedit\tkey used to open the command-line window")
  968. call <SID>OptionG("cedit", &cedit)
  969. call append("$", "cmdwinheight\theight of the command-line window")
  970. call <SID>OptionG("cwh", &cwh)
  971. call <SID>Header("executing external commands")
  972. call append("$", "shell\tname of the shell program used for external commands")
  973. call <SID>OptionG("sh", &sh)
  974. call append("$", "shellquote\tcharacter(s) to enclose a shell command in")
  975. call <SID>OptionG("shq", &shq)
  976. call append("$", "shellxquote\tlike 'shellquote' but include the redirection")
  977. call <SID>OptionG("sxq", &sxq)
  978. call append("$", "shellxescape\tcharacters to escape when 'shellxquote' is (")
  979. call <SID>OptionG("sxe", &sxe)
  980. call append("$", "shellcmdflag\targument for 'shell' to execute a command")
  981. call <SID>OptionG("shcf", &shcf)
  982. call append("$", "shellredir\tused to redirect command output to a file")
  983. call <SID>OptionG("srr", &srr)
  984. call append("$", "shelltemp\tuse a temp file for shell commands instead of using a pipe")
  985. call <SID>BinOptionG("stmp", &stmp)
  986. call append("$", "equalprg\tprogram used for \"=\" command")
  987. call append("$", "\t(global or local to buffer)")
  988. call <SID>OptionG("ep", &ep)
  989. call append("$", "formatprg\tprogram used to format lines with \"gq\" command")
  990. call <SID>OptionG("fp", &fp)
  991. call append("$", "keywordprg\tprogram used for the \"K\" command")
  992. call <SID>OptionG("kp", &kp)
  993. call append("$", "warn\twarn when using a shell command and a buffer has changes")
  994. call <SID>BinOptionG("warn", &warn)
  995. if has("quickfix")
  996. call <SID>Header("running make and jumping to errors")
  997. call append("$", "errorfile\tname of the file that contains error messages")
  998. call <SID>OptionG("ef", &ef)
  999. call append("$", "errorformat\tlist of formats for error messages")
  1000. call append("$", "\t(global or local to buffer)")
  1001. call <SID>OptionG("efm", &efm)
  1002. call append("$", "makeprg\tprogram used for the \":make\" command")
  1003. call append("$", "\t(global or local to buffer)")
  1004. call <SID>OptionG("mp", &mp)
  1005. call append("$", "shellpipe\tstring used to put the output of \":make\" in the error file")
  1006. call <SID>OptionG("sp", &sp)
  1007. call append("$", "makeef\tname of the errorfile for the 'makeprg' command")
  1008. call <SID>OptionG("mef", &mef)
  1009. call append("$", "grepprg\tprogram used for the \":grep\" command")
  1010. call append("$", "\t(global or local to buffer)")
  1011. call <SID>OptionG("gp", &gp)
  1012. call append("$", "grepformat\tlist of formats for output of 'grepprg'")
  1013. call <SID>OptionG("gfm", &gfm)
  1014. call append("$", "makeencoding\tencoding of the \":make\" and \":grep\" output")
  1015. call append("$", "\t(global or local to buffer)")
  1016. call <SID>OptionG("menc", &menc)
  1017. endif
  1018. if has("msdos") || has("win16") || has("win32")
  1019. call <SID>Header("system specific")
  1020. if has("msdos") || has("win16") || has("win32")
  1021. call append("$", "shellslash\tuse forward slashes in file names; for Unix-like shells")
  1022. call <SID>BinOptionG("ssl", &ssl)
  1023. endif
  1024. endif
  1025. call <SID>Header("language specific")
  1026. call append("$", "isfname\tspecifies the characters in a file name")
  1027. call <SID>OptionG("isf", &isf)
  1028. call append("$", "isident\tspecifies the characters in an identifier")
  1029. call <SID>OptionG("isi", &isi)
  1030. call append("$", "iskeyword\tspecifies the characters in a keyword")
  1031. call append("$", "\t(local to buffer)")
  1032. call <SID>OptionL("isk")
  1033. call append("$", "isprint\tspecifies printable characters")
  1034. call <SID>OptionG("isp", &isp)
  1035. if has("textobjects")
  1036. call append("$", "quoteescape\tspecifies escape characters in a string")
  1037. call append("$", "\t(local to buffer)")
  1038. call <SID>OptionL("qe")
  1039. endif
  1040. if has("rightleft")
  1041. call append("$", "rightleft\tdisplay the buffer right-to-left")
  1042. call append("$", "\t(local to window)")
  1043. call <SID>BinOptionL("rl")
  1044. call append("$", "rightleftcmd\twhen to edit the command-line right-to-left")
  1045. call append("$", "\t(local to window)")
  1046. call <SID>OptionL("rlc")
  1047. call append("$", "revins\tinsert characters backwards")
  1048. call <SID>BinOptionG("ri", &ri)
  1049. call append("$", "allowrevins\tallow CTRL-_ in Insert and Command-line mode to toggle 'revins'")
  1050. call <SID>BinOptionG("ari", &ari)
  1051. call append("$", "aleph\tthe ASCII code for the first letter of the Hebrew alphabet")
  1052. call append("$", " \tset al=" . &al)
  1053. call append("$", "hkmap\tuse Hebrew keyboard mapping")
  1054. call <SID>BinOptionG("hk", &hk)
  1055. call append("$", "hkmapp\tuse phonetic Hebrew keyboard mapping")
  1056. call <SID>BinOptionG("hkp", &hkp)
  1057. endif
  1058. if has("arabic")
  1059. call append("$", "arabic\tprepare for editing Arabic text")
  1060. call append("$", "\t(local to window)")
  1061. call <SID>BinOptionL("arab")
  1062. call append("$", "arabicshape\tperform shaping of Arabic characters")
  1063. call <SID>BinOptionG("arshape", &arshape)
  1064. call append("$", "termbidi\tterminal will perform bidi handling")
  1065. call <SID>BinOptionG("tbidi", &tbidi)
  1066. endif
  1067. if has("keymap")
  1068. call append("$", "keymap\tname of a keyboard mapping")
  1069. call <SID>OptionL("kmp")
  1070. endif
  1071. if has("langmap")
  1072. call append("$", "langmap\tlist of characters that are translated in Normal mode")
  1073. call <SID>OptionG("lmap", &lmap)
  1074. call append("$", "langremap\tapply 'langmap' to mapped characters")
  1075. call <SID>BinOptionG("lrm", &lrm)
  1076. endif
  1077. if has("xim")
  1078. call append("$", "imdisable\twhen set never use IM; overrules following IM options")
  1079. call <SID>BinOptionG("imd", &imd)
  1080. endif
  1081. call append("$", "iminsert\tin Insert mode: 1: use :lmap; 2: use IM; 0: neither")
  1082. call append("$", "\t(local to window)")
  1083. call <SID>OptionL("imi")
  1084. call append("$", "imsearch\tentering a search pattern: 1: use :lmap; 2: use IM; 0: neither")
  1085. call append("$", "\t(local to window)")
  1086. call <SID>OptionL("ims")
  1087. if has("xim")
  1088. call append("$", "imcmdline\twhen set always use IM when starting to edit a command line")
  1089. call <SID>BinOptionG("imc", &imc)
  1090. call append("$", "imstatusfunc\tfunction to obtain IME status")
  1091. call <SID>OptionG("imsf", &imsf)
  1092. call append("$", "imactivatefunc\tfunction to enable/disable IME")
  1093. call <SID>OptionG("imaf", &imaf)
  1094. endif
  1095. if has("multi_byte")
  1096. call <SID>Header("multi-byte characters")
  1097. call append("$", "encoding\tcharacter encoding used in Vim: \"latin1\", \"utf-8\"")
  1098. call append("$", "\t\"euc-jp\", \"big5\", etc.")
  1099. call <SID>OptionG("enc", &enc)
  1100. call append("$", "fileencoding\tcharacter encoding for the current file")
  1101. call append("$", "\t(local to buffer)")
  1102. call <SID>OptionL("fenc")
  1103. call append("$", "fileencodings\tautomatically detected character encodings")
  1104. call <SID>OptionG("fencs", &fencs)
  1105. call append("$", "charconvert\texpression used for character encoding conversion")
  1106. call <SID>OptionG("ccv", &ccv)
  1107. call append("$", "delcombine\tdelete combining (composing) characters on their own")
  1108. call <SID>BinOptionG("deco", &deco)
  1109. call append("$", "maxcombine\tmaximum number of combining (composing) characters displayed")
  1110. call <SID>OptionG("mco", &mco)
  1111. if has("xim") && has("gui_gtk")
  1112. call append("$", "imactivatekey\tkey that activates the X input method")
  1113. call <SID>OptionG("imak", &imak)
  1114. endif
  1115. call append("$", "ambiwidth\twidth of ambiguous width characters")
  1116. call <SID>OptionG("ambw", &ambw)
  1117. call append("$", "emoji\temoji characters are full width")
  1118. call <SID>BinOptionG("emo", &emo)
  1119. endif
  1120. call <SID>Header("various")
  1121. call append("$", "virtualedit\twhen to use virtual editing: \"block\", \"insert\" and/or \"all\"")
  1122. call <SID>OptionG("ve", &ve)
  1123. call append("$", "eventignore\tlist of autocommand events which are to be ignored")
  1124. call <SID>OptionG("ei", &ei)
  1125. call append("$", "loadplugins\tload plugin scripts when starting up")
  1126. call <SID>BinOptionG("lpl", &lpl)
  1127. call append("$", "exrc\tenable reading .vimrc/.exrc/.gvimrc in the current directory")
  1128. call <SID>BinOptionG("ex", &ex)
  1129. call append("$", "secure\tsafer working with script files in the current directory")
  1130. call <SID>BinOptionG("secure", &secure)
  1131. call append("$", "gdefault\tuse the 'g' flag for \":substitute\"")
  1132. call <SID>BinOptionG("gd", &gd)
  1133. if exists("+opendevice")
  1134. call append("$", "opendevice\tallow reading/writing devices")
  1135. call <SID>BinOptionG("odev", &odev)
  1136. endif
  1137. if exists("+maxfuncdepth")
  1138. call append("$", "maxfuncdepth\tmaximum depth of function calls")
  1139. call append("$", " \tset mfd=" . &mfd)
  1140. endif
  1141. if has("mksession")
  1142. call append("$", "sessionoptions\tlist of words that specifies what to put in a session file")
  1143. call <SID>OptionG("ssop", &ssop)
  1144. call append("$", "viewoptions\tlist of words that specifies what to save for :mkview")
  1145. call <SID>OptionG("vop", &vop)
  1146. call append("$", "viewdir\tdirectory where to store files with :mkview")
  1147. call <SID>OptionG("vdir", &vdir)
  1148. endif
  1149. if has("shada")
  1150. call append("$", "viminfo\tlist that specifies what to write in the ShaDa file")
  1151. call <SID>OptionG("vi", &vi)
  1152. endif
  1153. if has("quickfix")
  1154. call append("$", "bufhidden\twhat happens with a buffer when it's no longer in a window")
  1155. call append("$", "\t(local to buffer)")
  1156. call <SID>OptionL("bh")
  1157. call append("$", "buftype\t\"\", \"nofile\", \"nowrite\" or \"quickfix\": type of buffer")
  1158. call append("$", "\t(local to buffer)")
  1159. call <SID>OptionL("bt")
  1160. endif
  1161. call append("$", "buflisted\twhether the buffer shows up in the buffer list")
  1162. call append("$", "\t(local to buffer)")
  1163. call <SID>BinOptionL("bl")
  1164. call append("$", "debug\tset to \"msg\" to see all error messages")
  1165. call append("$", " \tset debug=" . &debug)
  1166. call append("$", "signcolumn\twhether to show the signcolumn")
  1167. call append("$", "\t(local to window)")
  1168. call <SID>OptionL("scl")
  1169. set cpo&vim
  1170. " go to first line
  1171. 1
  1172. " reset 'modified', so that ":q" can be used to close the window
  1173. setlocal nomodified
  1174. if has("syntax")
  1175. " Use Vim highlighting, with some additional stuff
  1176. setlocal ft=vim
  1177. syn match optwinHeader "^ \=[0-9].*"
  1178. syn match optwinName "^[a-z]*\t" nextgroup=optwinComment
  1179. syn match optwinComment ".*" contained
  1180. syn match optwinComment "^\t.*"
  1181. if !exists("did_optwin_syntax_inits")
  1182. let did_optwin_syntax_inits = 1
  1183. hi link optwinHeader Title
  1184. hi link optwinName Identifier
  1185. hi link optwinComment Comment
  1186. endif
  1187. endif
  1188. if exists("&mzschemedll")
  1189. call append("$", "mzschemedll\tname of the Tcl dynamic library")
  1190. call <SID>OptionG("mzschemedll", &mzschemedll)
  1191. call append("$", "mzschemegcdll\tname of the Tcl GC dynamic library")
  1192. call <SID>OptionG("mzschemegcdll", &mzschemegcdll)
  1193. endif
  1194. if has('pythonx')
  1195. call append("$", "pyxversion\twhether to use Python 2 or 3")
  1196. call append("$", " \tset pyx=" . &wd)
  1197. endif
  1198. " Install autocommands to enable mappings in option-window
  1199. noremap <silent> <buffer> <CR> <C-\><C-N>:call <SID>CR()<CR>
  1200. inoremap <silent> <buffer> <CR> <Esc>:call <SID>CR()<CR>
  1201. noremap <silent> <buffer> <Space> :call <SID>Space()<CR>
  1202. " Make the buffer be deleted when the window is closed.
  1203. setlocal buftype=nofile bufhidden=delete noswapfile
  1204. augroup optwin
  1205. au! BufUnload,BufHidden option-window nested
  1206. \ call <SID>unload() | delfun <SID>unload
  1207. augroup END
  1208. fun! <SID>unload()
  1209. delfun <SID>CR
  1210. delfun <SID>Space
  1211. delfun <SID>Find
  1212. delfun <SID>Update
  1213. delfun <SID>OptionL
  1214. delfun <SID>OptionG
  1215. delfun <SID>BinOptionL
  1216. delfun <SID>BinOptionG
  1217. delfun <SID>Header
  1218. au! optwin
  1219. endfun
  1220. " Restore the previous value of 'title' and 'icon'.
  1221. let &title = s:old_title
  1222. let &icon = s:old_icon
  1223. let &ru = s:old_ru
  1224. let &sc = s:old_sc
  1225. let &cpo = s:cpo_save
  1226. let &ul = s:old_ul
  1227. unlet s:old_title s:old_icon s:old_ru s:old_sc s:cpo_save s:idx s:lnum s:old_ul
  1228. " vim: ts=8 sw=2 sts=2