" These commands create the option window.
"
" Maintainer: Bram Moolenaar
" Last Change: 2013 Jun 29
" If there already is an option window, jump to that one.
if bufwinnr("option-window") > 0
let s:thiswin = winnr()
while 1
if @% == "option-window"
finish
endif
wincmd w
if s:thiswin == winnr()
break
endif
endwhile
endif
" Make sure the '<' flag is not included in 'cpoptions', otherwise would
" not be recognized. See ":help 'cpoptions'".
let s:cpo_save = &cpo
set cpo&vim
" function to be called when is hit in the option-window
fun! CR()
" If on a continued comment line, go back to the first comment line
let lnum = search("^[^\t]", 'bWcn')
let line = getline(lnum)
" on a "set" line executes the option line
if match(line, "^ \tset ") >= 0
" For a local option: go to the previous window
" If this is a help window, go to the window below it
let thiswin = winnr()
let local = Find(lnum)
if local >= 0
exe line
call Update(lnum, line, local, thiswin)
endif
" on a "option" line shows help for that option
elseif match(line, "^[a-z]") >= 0
let name = substitute(line, '\([^\t]*\).*', '\1', "")
exe "help '" . name . "'"
" on an index line jumps to the group
elseif match(line, '^ \=[0-9]') >= 0
exe "norm! /" . line . "\zt"
endif
endfun
" function to be called when is hit in the option-window
fun! Space()
let lnum = line(".")
let line = getline(lnum)
" on a "set" line refreshes the option line
if match(line, "^ \tset ") >= 0
" For a local option: go to the previous window
" If this is a help window, go to the window below it
let thiswin = winnr()
let local = Find(lnum)
if local >= 0
call Update(lnum, line, local, thiswin)
endif
endif
endfun
" find the window in which the option applies
" returns 0 for global option, 1 for local option, -1 for error
fun! Find(lnum)
if getline(a:lnum - 1) =~ "(local to"
let local = 1
let thiswin = winnr()
wincmd p
if exists("b:current_syntax") && b:current_syntax == "help"
wincmd j
if winnr() == thiswin
wincmd j
endif
endif
else
let local = 0
endif
if local && (winnr() == thiswin || (exists("b:current_syntax")
\ && b:current_syntax == "help"))
echo "Don't know in which window"
let local = -1
endif
return local
endfun
" Update a "set" line in the option window
fun! Update(lnum, line, local, thiswin)
" get the new value of the option and update the option window line
if match(a:line, "=") >= 0
let name = substitute(a:line, '^ \tset \([^=]*\)=.*', '\1', "")
else
let name = substitute(a:line, '^ \tset \(no\)\=\([a-z]*\).*', '\2', "")
endif
if name == "pt" && &pt =~ "\x80"
let val = PTvalue()
else
let val = escape(eval('&' . name), " \t\\\"|")
endif
if a:local
exe a:thiswin . "wincmd w"
endif
if match(a:line, "=") >= 0 || (val != "0" && val != "1")
call setline(a:lnum, " \tset " . name . "=" . val)
else
if val
call setline(a:lnum, " \tset " . name . "\tno" . name)
else
call setline(a:lnum, " \tset no" . name . "\t" . name)
endif
endif
set nomodified
endfun
" Reset 'title' and 'icon' to make it work faster.
let s:old_title = &title
let s:old_icon = &icon
let s:old_sc = &sc
let s:old_ru = &ru
set notitle noicon nosc noru
" If the current window is a help window, try finding a non-help window.
" Relies on syntax highlighting to be switched on.
let s:thiswin = winnr()
while exists("b:current_syntax") && b:current_syntax == "help"
wincmd w
if s:thiswin == winnr()
break
endif
endwhile
" Open the window
new option-window
setlocal ts=15 tw=0 noro buftype=nofile
" Insert help and a "set" command for each option.
call append(0, '" Each "set" line shows the current value of an option (on the left).')
call append(1, '" Hit on a "set" line to execute it.')
call append(2, '" A boolean option will be toggled.')
call append(3, '" For other options you can edit the value.')
call append(4, '" Hit on a help line to open a help window on this option.')
call append(5, '" Hit on an index line to jump there.')
call append(6, '" Hit on a "set" line to refresh it.')
" These functions are called often below. Keep them fast!
" Init a local binary option
fun! BinOptionL(name)
let val = getwinvar(winnr('#'), '&' . a:name)
call append("$", substitute(substitute(" \tset " . val . a:name . "\t" .
\!val . a:name, "0", "no", ""), "1", "", ""))
endfun
" Init a global binary option
fun! BinOptionG(name, val)
call append("$", substitute(substitute(" \tset " . a:val . a:name . "\t" .
\!a:val . a:name, "0", "no", ""), "1", "", ""))
endfun
" Init a local string option
fun! OptionL(name)
let val = escape(getwinvar(winnr('#'), '&' . a:name), " \t\\\"|")
call append("$", " \tset " . a:name . "=" . val)
endfun
" Init a global string option
fun! OptionG(name, val)
call append("$", " \tset " . a:name . "=" . escape(a:val, " \t\\\"|"))
endfun
let s:idx = 1
let s:lnum = line("$")
call append("$", "")
fun! Header(text)
let line = s:idx . " " . a:text
if s:idx < 10
let line = " " . line
endif
call append("$", "")
call append("$", line)
call append("$", "")
call append(s:lnum, line)
let s:idx = s:idx + 1
let s:lnum = s:lnum + 1
endfun
" Get the value of 'pastetoggle'. It could be a special key.
fun! PTvalue()
redir @a
silent set pt
redir END
return substitute(@a, '[^=]*=\(.*\)', '\1', "")
endfun
" Restore the previous value of 'cpoptions' here, it's used below.
let &cpo = s:cpo_save
" List of all options, organized by function.
" The text should be sufficient to know what the option is used for.
call Header("important")
call append("$", "compatible\tbehave very Vi compatible (not advisable)")
call BinOptionG("cp", &cp)
call append("$", "cpoptions\tlist of flags to specify Vi compatibility")
call OptionG("cpo", &cpo)
call append("$", "insertmode\tuse Insert mode as the default mode")
call BinOptionG("im", &im)
call append("$", "paste\tpaste mode, insert typed text literally")
call BinOptionG("paste", &paste)
call append("$", "pastetoggle\tkey sequence to toggle paste mode")
if &pt =~ "\x80"
call append("$", " \tset pt=" . PTvalue())
else
call OptionG("pt", &pt)
endif
call append("$", "runtimepath\tlist of directories used for runtime files and plugins")
call OptionG("rtp", &rtp)
call append("$", "helpfile\tname of the main help file")
call OptionG("hf", &hf)
call Header("moving around, searching and patterns")
call append("$", "whichwrap\tlist of flags specifying which commands wrap to another line")
call append("$", "\t(local to window)")
call OptionL("ww")
call append("$", "startofline\tmany jump commands move the cursor to the first non-blank")
call append("$", "\tcharacter of a line")
call BinOptionG("sol", &sol)
call append("$", "paragraphs\tnroff macro names that separate paragraphs")
call OptionG("para", ¶)
call append("$", "sections\tnroff macro names that separate sections")
call OptionG("sect", §)
call append("$", "path\tlist of directory names used for file searching")
call append("$", "\t(global or local to buffer)")
call OptionG("pa", &pa)
call append("$", "cdpath\tlist of directory names used for :cd")
call OptionG("cd", &cd)
if exists("+autochdir")
call append("$", "autochdir\tchange to directory of file in buffer")
call BinOptionG("acd", &acd)
endif
call append("$", "wrapscan\tsearch commands wrap around the end of the buffer")
call BinOptionG("ws", &ws)
call append("$", "incsearch\tshow match for partly typed search command")
call BinOptionG("is", &is)
call append("$", "magic\tchange the way backslashes are used in search patterns")
call BinOptionG("magic", &magic)
call append("$", "regexpengine\tselect the default regexp engine used")
call OptionG("re", &re)
call append("$", "ignorecase\tignore case when using a search pattern")
call BinOptionG("ic", &ic)
call append("$", "smartcase\toverride 'ignorecase' when pattern has upper case characters")
call BinOptionG("scs", &scs)
call append("$", "casemap\twhat method to use for changing case of letters")
call OptionG("cmp", &cmp)
call append("$", "maxmempattern\tmaximum amount of memory in Kbyte used for pattern matching")
call append("$", " \tset mmp=" . &mmp)
call append("$", "define\tpattern for a macro definition line")
call append("$", "\t(global or local to buffer)")
call OptionG("def", &def)
if has("find_in_path")
call append("$", "include\tpattern for an include-file line")
call append("$", "\t(local to buffer)")
call OptionL("inc")
call append("$", "includeexpr\texpression used to transform an include line to a file name")
call append("$", "\t(local to buffer)")
call OptionL("inex")
endif
call Header("tags")
call append("$", "tagbsearch\tuse binary searching in tags files")
call BinOptionG("tbs", &tbs)
call append("$", "taglength\tnumber of significant characters in a tag name or zero")
call append("$", " \tset tl=" . &tl)
call append("$", "tags\tlist of file names to search for tags")
call append("$", "\t(global or local to buffer)")
call OptionG("tag", &tag)
call append("$", "tagrelative\tfile names in a tags file are relative to the tags file")
call BinOptionG("tr", &tr)
call append("$", "tagstack\ta :tag command will use the tagstack")
call BinOptionG("tgst", &tgst)
call append("$", "showfulltag\twhen completing tags in Insert mode show more info")
call BinOptionG("sft", &sft)
if has("cscope")
call append("$", "cscopeprg\tcommand for executing cscope")
call OptionG("csprg", &csprg)
call append("$", "cscopetag\tuse cscope for tag commands")
call BinOptionG("cst", &cst)
call append("$", "cscopetagorder\t0 or 1; the order in which \":cstag\" performs a search")
call append("$", " \tset csto=" . &csto)
call append("$", "cscopeverbose\tgive messages when adding a cscope database")
call BinOptionG("csverb", &csverb)
call append("$", "cscopepathcomp\thow many components of the path to show")
call append("$", " \tset cspc=" . &cspc)
call append("$", "cscopequickfix\twhen to open a quickfix window for cscope")
call OptionG("csqf", &csqf)
call append("$", "cscoperelative\tfile names in a cscope file are relative to that file")
call BinOptionG("csre", &csre)
endif
call Header("displaying text")
call append("$", "scroll\tnumber of lines to scroll for CTRL-U and CTRL-D")
call append("$", "\t(local to window)")
call OptionL("scr")
call append("$", "scrolloff\tnumber of screen lines to show around the cursor")
call append("$", " \tset so=" . &so)
call append("$", "wrap\tlong lines wrap")
call BinOptionG("wrap", &wrap)
call append("$", "linebreak\twrap long lines at a character in 'breakat'")
call append("$", "\t(local to window)")
call BinOptionL("lbr")
call append("$", "breakindent\tpreserve indentation in wrapped text")
call append("$", "\t(local to window)")
call BinOptionL("bri")
call append("$", "breakindentopt\tadjust breakindent behaviour")
call append("$", "\t(local to window)")
call OptionL("briopt")
call append("$", "breakat\twhich characters might cause a line break")
call OptionG("brk", &brk)
call append("$", "showbreak\tstring to put before wrapped screen lines")
call OptionG("sbr", &sbr)
call append("$", "sidescroll\tminimal number of columns to scroll horizontally")
call append("$", " \tset ss=" . &ss)
call append("$", "sidescrolloff\tminimal number of columns to keep left and right of the cursor")
call append("$", " \tset siso=" . &siso)
call append("$", "display\tinclude \"lastline\" to show the last line even if it doesn't fit")
call append("$", "\tinclude \"uhex\" to show unprintable characters as a hex number")
call OptionG("dy", &dy)
call append("$", "fillchars\tcharacters to use for the status line, folds and filler lines")
call OptionG("fcs", &fcs)
call append("$", "cmdheight\tnumber of lines used for the command-line")
call append("$", " \tset ch=" . &ch)
call append("$", "columns\twidth of the display")
call append("$", " \tset co=" . &co)
call append("$", "lines\tnumber of lines in the display")
call append("$", " \tset lines=" . &lines)
call append("$", "window\tnumber of lines to scroll for CTRL-F and CTRL-B")
call append("$", " \tset window=" . &window)
call append("$", "lazyredraw\tdon't redraw while executing macros")
call BinOptionG("lz", &lz)
if has("reltime")
call append("$", "redrawtime\ttimeout for 'hlsearch' and :match highlighting in msec")
call append("$", " \tset rdt=" . &rdt)
endif
call append("$", "writedelay\tdelay in msec for each char written to the display")
call append("$", "\t(for debugging)")
call append("$", " \tset wd=" . &wd)
call append("$", "list\tshow as ^I and end-of-line as $")
call append("$", "\t(local to window)")
call BinOptionL("list")
call append("$", "listchars\tlist of strings used for list mode")
call OptionG("lcs", &lcs)
call append("$", "number\tshow the line number for each line")
call append("$", "\t(local to window)")
call BinOptionL("nu")
call append("$", "relativenumber\tshow the relative line number for each line")
call append("$", "\t(local to window)")
call BinOptionL("rnu")
if has("linebreak")
call append("$", "numberwidth\tnumber of columns to use for the line number")
call append("$", "\t(local to window)")
call OptionL("nuw")
endif
if has("conceal")
call append("$", "conceallevel\tcontrols whether concealable text is hidden")
call append("$", "\t(local to window)")
call OptionL("cole")
call append("$", "concealcursor\tmodes in which text in the cursor line can be concealed")
call append("$", "\t(local to window)")
call OptionL("cocu")
endif
call Header("syntax, highlighting and spelling")
call append("$", "background\t\"dark\" or \"light\"; the background color brightness")
call OptionG("bg", &bg)
if has("autocmd")
call append("$", "filetype\ttype of file; triggers the FileType event when set")
call append("$", "\t(local to buffer)")
call OptionL("ft")
endif
if has("syntax")
call append("$", "syntax\tname of syntax highlighting used")
call append("$", "\t(local to buffer)")
call OptionL("syn")
call append("$", "synmaxcol\tmaximum column to look for syntax items")
call append("$", "\t(local to buffer)")
call OptionL("smc")
endif
call append("$", "highlight\twhich highlighting to use for various occasions")
call OptionG("hl", &hl)
call append("$", "hlsearch\thighlight all matches for the last used search pattern")
call BinOptionG("hls", &hls)
if has("syntax")
call append("$", "cursorcolumn\thighlight the screen column of the cursor")
call append("$", "\t(local to window)")
call BinOptionL("cuc")
call append("$", "cursorline\thighlight the screen line of the cursor")
call append("$", "\t(local to window)")
call BinOptionL("cul")
call append("$", "colorcolumn\tcolumns to highlight")
call append("$", "\t(local to window)")
call OptionL("cc")
call append("$", "spell\thighlight spelling mistakes")
call append("$", "\t(local to window)")
call BinOptionL("spell")
call append("$", "spelllang\tlist of accepted languages")
call append("$", "\t(local to buffer)")
call OptionL("spl")
call append("$", "spellfile\tfile that \"zg\" adds good words to")
call append("$", "\t(local to buffer)")
call OptionL("spf")
call append("$", "spellcapcheck\tpattern to locate the end of a sentence")
call append("$", "\t(local to buffer)")
call OptionL("spc")
call append("$", "spellsuggest\tmethods used to suggest corrections")
call OptionG("sps", &sps)
call append("$", "mkspellmem\tamount of memory used by :mkspell before compressing")
call OptionG("msm", &msm)
endif
call Header("multiple windows")
call append("$", "laststatus\t0, 1 or 2; when to use a status line for the last window")
call append("$", " \tset ls=" . &ls)
if has("statusline")
call append("$", "statusline\talternate format to be used for a status line")
call OptionG("stl", &stl)
endif
call append("$", "equalalways\tmake all windows the same size when adding/removing windows")
call BinOptionG("ea", &ea)
if has("vertsplit")
call append("$", "eadirection\tin which direction 'equalalways' works: \"ver\", \"hor\" or \"both\"")
call OptionG("ead", &ead)
endif
call append("$", "winheight\tminimal number of lines used for the current window")
call append("$", " \tset wh=" . &wh)
call append("$", "winminheight\tminimal number of lines used for any window")
call append("$", " \tset wmh=" . &wmh)
call append("$", "winfixheight\tkeep the height of the window")
call append("$", "\t(local to window)")
call BinOptionL("wfh")
if has("vertsplit")
call append("$", "winfixwidth\tkeep the width of the window")
call append("$", "\t(local to window)")
call BinOptionL("wfw")
call append("$", "winwidth\tminimal number of columns used for the current window")
call append("$", " \tset wiw=" . &wiw)
call append("$", "winminwidth\tminimal number of columns used for any window")
call append("$", " \tset wmw=" . &wmw)
endif
call append("$", "helpheight\tinitial height of the help window")
call append("$", " \tset hh=" . &hh)
if has("quickfix")
call append("$", "previewheight\tdefault height for the preview window")
call append("$", " \tset pvh=" . &pvh)
call append("$", "previewwindow\tidentifies the preview window")
call append("$", "\t(local to window)")
call BinOptionL("pvw")
endif
call append("$", "hidden\tdon't unload a buffer when no longer shown in a window")
call BinOptionG("hid", &hid)
call append("$", "switchbuf\t\"useopen\" and/or \"split\"; which window to use when jumping")
call append("$", "\tto a buffer")
call OptionG("swb", &swb)
call append("$", "splitbelow\ta new window is put below the current one")
call BinOptionG("sb", &sb)
if has("vertsplit")
call append("$", "splitright\ta new window is put right of the current one")
call BinOptionG("spr", &spr)
endif
if has("scrollbind")
call append("$", "scrollbind\tthis window scrolls together with other bound windows")
call append("$", "\t(local to window)")
call BinOptionL("scb")
call append("$", "scrollopt\t\"ver\", \"hor\" and/or \"jump\"; list of options for 'scrollbind'")
call OptionG("sbo", &sbo)
endif
if has("cursorbind")
call append("$", "cursorbind\tthis window's cursor moves together with other bound windows")
call append("$", "\t(local to window)")
call BinOptionL("crb")
endif
call Header("multiple tab pages")
call append("$", "showtabline\t0, 1 or 2; when to use a tab pages line")
call append("$", " \tset stal=" . &stal)
call append("$", "tabpagemax\tmaximum number of tab pages to open for -p and \"tab all\"")
call append("$", " \tset tpm=" . &tpm)
call append("$", "tabline\tcustom tab pages line")
call OptionG("tal", &tal)
if has("gui")
call append("$", "guitablabel\tcustom tab page label for the GUI")
call OptionG("gtl", >l)
call append("$", "guitabtooltip\tcustom tab page tooltip for the GUI")
call OptionG("gtt", >t)
endif
call Header("terminal")
call append("$", "term\tname of the used terminal")
call OptionG("term", &term)
call append("$", "ttytype\talias for 'term'")
call OptionG("tty", &tty)
call append("$", "ttybuiltin\tcheck built-in termcaps first")
call BinOptionG("tbi", &tbi)
call append("$", "ttyfast\tterminal connection is fast")
call BinOptionG("tf", &tf)
call append("$", "weirdinvert\tterminal that requires extra redrawing")
call BinOptionG("wiv", &wiv)
call append("$", "esckeys\trecognize keys that start with in Insert mode")
call BinOptionG("ek", &ek)
call append("$", "scrolljump\tminimal number of lines to scroll at a time")
call append("$", " \tset sj=" . &sj)
call append("$", "ttyscroll\tmaximum number of lines to use scrolling instead of redrawing")
call append("$", " \tset tsl=" . &tsl)
if has("gui") || has("msdos") || has("win32")
call append("$", "guicursor\tspecifies what the cursor looks like in different modes")
call OptionG("gcr", &gcr)
endif
if has("title")
let &title = s:old_title
call append("$", "title\tshow info in the window title")
call BinOptionG("title", &title)
set notitle
call append("$", "titlelen\tpercentage of 'columns' used for the window title")
call append("$", " \tset titlelen=" . &titlelen)
call append("$", "titlestring\twhen not empty, string to be used for the window title")
call OptionG("titlestring", &titlestring)
call append("$", "titleold\tstring to restore the title to when exiting Vim")
call OptionG("titleold", &titleold)
let &icon = s:old_icon
call append("$", "icon\tset the text of the icon for this window")
call BinOptionG("icon", &icon)
set noicon
call append("$", "iconstring\twhen not empty, text for the icon of this window")
call OptionG("iconstring", &iconstring)
endif
if has("win32")
call append("$", "restorescreen\trestore the screen contents when exiting Vim")
call BinOptionG("rs", &rs)
endif
call Header("using the mouse")
call append("$", "mouse\tlist of flags for using the mouse")
call OptionG("mouse", &mouse)
if has("gui")
call append("$", "mousefocus\tthe window with the mouse pointer becomes the current one")
call BinOptionG("mousef", &mousef)
call append("$", "mousehide\thide the mouse pointer while typing")
call BinOptionG("mh", &mh)
endif
call append("$", "mousemodel\t\"extend\", \"popup\" or \"popup_setpos\"; what the right")
call append("$", "\tmouse button is used for")
call OptionG("mousem", &mousem)
call append("$", "mousetime\tmaximum time in msec to recognize a double-click")
call append("$", " \tset mouset=" . &mouset)
call append("$", "ttymouse\t\"xterm\", \"xterm2\", \"dec\" or \"netterm\"; type of mouse")
call OptionG("ttym", &ttym)
if has("mouseshape")
call append("$", "mouseshape\twhat the mouse pointer looks like in different modes")
call OptionG("mouses", &mouses)
endif
if has("gui")
call Header("GUI")
call append("$", "guifont\tlist of font names to be used in the GUI")
call OptionG("gfn", &gfn)
if has("xfontset")
call append("$", "guifontset\tpair of fonts to be used, for multibyte editing")
call OptionG("gfs", &gfs)
endif
call append("$", "guifontwide\tlist of font names to be used for double-wide characters")
call OptionG("gfw", &gfw)
if has("mac")
call append("$", "antialias\tuse smooth, antialiased fonts")
call BinOptionG("anti", &anti)
endif
call append("$", "guioptions\tlist of flags that specify how the GUI works")
call OptionG("go", &go)
if has("gui_gtk")
call append("$", "toolbar\t\"icons\", \"text\" and/or \"tooltips\"; how to show the toolbar")
call OptionG("tb", &tb)
if has("gui_gtk2")
call append("$", "toolbariconsize\tsize of toolbar icons")
call OptionG("tbis", &tbis)
endif
call append("$", "guiheadroom\troom (in pixels) left above/below the window")
call append("$", " \tset ghr=" . &ghr)
endif
call append("$", "guipty\tuse a pseudo-tty for I/O to external commands")
call BinOptionG("guipty", &guipty)
if has("browse")
call append("$", "browsedir\t\"last\", \"buffer\" or \"current\": which directory used for the file browser")
call OptionG("bsdir", &bsdir)
endif
if has("multi_lang")
call append("$", "langmenu\tlanguage to be used for the menus")
call OptionG("langmenu", &lm)
endif
call append("$", "menuitems\tmaximum number of items in one menu")
call append("$", " \tset mis=" . &mis)
if has("winaltkeys")
call append("$", "winaltkeys\t\"no\", \"yes\" or \"menu\"; how to use the ALT key")
call OptionG("wak", &wak)
endif
call append("$", "linespace\tnumber of pixel lines to use between characters")
call append("$", " \tset lsp=" . &lsp)
if has("balloon_eval")
call append("$", "balloondelay\tdelay in milliseconds before a balloon may pop up")
call append("$", " \tset bdlay=" . &bdlay)
call append("$", "ballooneval\twhether the balloon evaluation is to be used")
call BinOptionG("beval", &beval)
if has("eval")
call append("$", "balloonexpr\texpression to show in balloon eval")
call append("$", " \tset bexpr=" . &bexpr)
endif
endif
if exists("+macatsui")
call append("$", "macatsui\tuse ATSUI text drawing; disable to avoid display problems")
call OptionG("macatsui", &macatsui)
endif
endif
if has("printer")
call Header("printing")
call append("$", "printoptions\tlist of items that control the format of :hardcopy output")
call OptionG("popt", &popt)
call append("$", "printdevice\tname of the printer to be used for :hardcopy")
call OptionG("pdev", &pdev)
if has("postscript")
call append("$", "printexpr\texpression used to print the PostScript file for :hardcopy")
call OptionG("pexpr", &pexpr)
endif
call append("$", "printfont\tname of the font to be used for :hardcopy")
call OptionG("pfn", &pfn)
call append("$", "printheader\tformat of the header used for :hardcopy")
call OptionG("pheader", &pheader)
if has("postscript")
call append("$", "printencoding\tencoding used to print the PostScript file for :hardcopy")
call OptionG("penc", &penc)
endif
if has("multi_byte")
call append("$", "printmbcharset\tthe CJK character set to be used for CJK output from :hardcopy")
call OptionG("pmbcs", &pmbcs)
call append("$", "printmbfont\tlist of font names to be used for CJK output from :hardcopy")
call OptionG("pmbfn", &pmbfn)
endif
endif
call Header("messages and info")
call append("$", "terse\tadd 's' flag in 'shortmess' (don't show search message)")
call BinOptionG("terse", &terse)
call append("$", "shortmess\tlist of flags to make messages shorter")
call OptionG("shm", &shm)
call append("$", "showcmd\tshow (partial) command keys in the status line")
let &sc = s:old_sc
call BinOptionG("sc", &sc)
set nosc
call append("$", "showmode\tdisplay the current mode in the status line")
call BinOptionG("smd", &smd)
call append("$", "ruler\tshow cursor position below each window")
let &ru = s:old_ru
call BinOptionG("ru", &ru)
set noru
if has("statusline")
call append("$", "rulerformat\talternate format to be used for the ruler")
call OptionG("ruf", &ruf)
endif
call append("$", "report\tthreshold for reporting number of changed lines")
call append("$", " \tset report=" . &report)
call append("$", "verbose\tthe higher the more messages are given")
call append("$", " \tset vbs=" . &vbs)
call append("$", "verbosefile\tfile to write messages in")
call OptionG("vfile", &vfile)
call append("$", "more\tpause listings when the screen is full")
call BinOptionG("more", &more)
if has("dialog_con") || has("dialog_gui")
call append("$", "confirm\tstart a dialog when a command fails")
call BinOptionG("cf", &cf)
endif
call append("$", "errorbells\tring the bell for error messages")
call BinOptionG("eb", &eb)
call append("$", "visualbell\tuse a visual bell instead of beeping")
call BinOptionG("vb", &vb)
if has("multi_lang")
call append("$", "helplang\tlist of preferred languages for finding help")
call OptionG("hlg", &hlg)
endif
call Header("selecting text")
call append("$", "selection\t\"old\", \"inclusive\" or \"exclusive\"; how selecting text behaves")
call OptionG("sel", &sel)
call append("$", "selectmode\t\"mouse\", \"key\" and/or \"cmd\"; when to start Select mode")
call append("$", "\tinstead of Visual mode")
call OptionG("slm", &slm)
if has("clipboard")
call append("$", "clipboard\t\"unnamed\" to use the * register like unnamed register")
call append("$", "\t\"autoselect\" to always put selected text on the clipboard")
call OptionG("cb", &cb)
endif
call append("$", "keymodel\t\"startsel\" and/or \"stopsel\"; what special keys can do")
call OptionG("km", &km)
call Header("editing text")
call append("$", "undolevels\tmaximum number of changes that can be undone")
call append("$", " \tset ul=" . &ul)
call append("$", "undoreload\tmaximum number lines to save for undo on a buffer reload")
call append("$", " \tset ur=" . &ur)
call append("$", "modified\tchanges have been made and not written to a file")
call append("$", "\t(local to buffer)")
call BinOptionL("mod")
call append("$", "readonly\tbuffer is not to be written")
call append("$", "\t(local to buffer)")
call BinOptionL("ro")
call append("$", "modifiable\tchanges to the text are not possible")
call append("$", "\t(local to buffer)")
call BinOptionL("ma")
call append("$", "textwidth\tline length above which to break a line")
call append("$", "\t(local to buffer)")
call OptionL("tw")
call append("$", "wrapmargin\tmargin from the right in which to break a line")
call append("$", "\t(local to buffer)")
call OptionL("wm")
call append("$", "backspace\tspecifies what , CTRL-W, etc. can do in Insert mode")
call append("$", " \tset bs=" . &bs)
call append("$", "comments\tdefinition of what comment lines look like")
call append("$", "\t(local to buffer)")
call OptionL("com")
call append("$", "formatoptions\tlist of flags that tell how automatic formatting works")
call append("$", "\t(local to buffer)")
call OptionL("fo")
call append("$", "formatlistpat\tpattern to recognize a numbered list")
call append("$", "\t(local to buffer)")
call OptionL("flp")
if has("eval")
call append("$", "formatexpr\texpression used for \"gq\" to format lines")
call append("$", "\t(local to buffer)")
call OptionL("fex")
endif
if has("insert_expand")
call append("$", "complete\tspecifies how Insert mode completion works for CTRL-N and CTRL-P")
call append("$", "\t(local to buffer)")
call OptionL("cpt")
call append("$", "completeopt\twhether to use a popup menu for Insert mode completion")
call OptionG("cot", &cot)
call append("$", "pumheight\tmaximum height of the popup menu")
call OptionG("ph", &ph)
call append("$", "completefunc\tuser defined function for Insert mode completion")
call append("$", "\t(local to buffer)")
call OptionL("cfu")
call append("$", "omnifunc\tfunction for filetype-specific Insert mode completion")
call append("$", "\t(local to buffer)")
call OptionL("ofu")
call append("$", "dictionary\tlist of dictionary files for keyword completion")
call append("$", "\t(global or local to buffer)")
call OptionG("dict", &dict)
call append("$", "thesaurus\tlist of thesaurus files for keyword completion")
call append("$", "\t(global or local to buffer)")
call OptionG("tsr", &tsr)
endif
call append("$", "infercase\tadjust case of a keyword completion match")
call append("$", "\t(local to buffer)")
call BinOptionL("inf")
if has("digraphs")
call append("$", "digraph\tenable entering digraps with c1 c2")
call BinOptionG("dg", &dg)
endif
call append("$", "tildeop\tthe \"~\" command behaves like an operator")
call BinOptionG("top", &top)
call append("$", "operatorfunc\tfunction called for the\"g@\" operator")
call OptionG("opfunc", &opfunc)
call append("$", "showmatch\twhen inserting a bracket, briefly jump to its match")
call BinOptionG("sm", &sm)
call append("$", "matchtime\ttenth of a second to show a match for 'showmatch'")
call append("$", " \tset mat=" . &mat)
call append("$", "matchpairs\tlist of pairs that match for the \"%\" command")
call append("$", "\t(local to buffer)")
call OptionL("mps")
call append("$", "joinspaces\tuse two spaces after '.' when joining a line")
call BinOptionG("js", &js)
call append("$", "nrformats\t\"alpha\", \"octal\" and/or \"hex\"; number formats recognized for")
call append("$", "\tCTRL-A and CTRL-X commands")
call append("$", "\t(local to buffer)")
call OptionL("nf")
call Header("tabs and indenting")
call append("$", "tabstop\tnumber of spaces a in the text stands for")
call append("$", "\t(local to buffer)")
call OptionL("ts")
call append("$", "shiftwidth\tnumber of spaces used for each step of (auto)indent")
call append("$", "\t(local to buffer)")
call OptionL("sw")
call append("$", "smarttab\ta in an indent inserts 'shiftwidth' spaces")
call BinOptionG("sta", &sta)
call append("$", "softtabstop\tif non-zero, number of spaces to insert for a ")
call append("$", "\t(local to buffer)")
call OptionL("sts")
call append("$", "shiftround\tround to 'shiftwidth' for \"<<\" and \">>\"")
call BinOptionG("sr", &sr)
call append("$", "expandtab\texpand to spaces in Insert mode")
call append("$", "\t(local to buffer)")
call BinOptionL("et")
call append("$", "autoindent\tautomatically set the indent of a new line")
call append("$", "\t(local to buffer)")
call BinOptionL("ai")
if has("smartindent")
call append("$", "smartindent\tdo clever autoindenting")
call append("$", "\t(local to buffer)")
call BinOptionL("si")
endif
if has("cindent")
call append("$", "cindent\tenable specific indenting for C code")
call append("$", "\t(local to buffer)")
call BinOptionL("cin")
call append("$", "cinoptions\toptions for C-indenting")
call append("$", "\t(local to buffer)")
call OptionL("cino")
call append("$", "cinkeys\tkeys that trigger C-indenting in Insert mode")
call append("$", "\t(local to buffer)")
call OptionL("cink")
call append("$", "cinwords\tlist of words that cause more C-indent")
call append("$", "\t(local to buffer)")
call OptionL("cinw")
call append("$", "indentexpr\texpression used to obtain the indent of a line")
call append("$", "\t(local to buffer)")
call OptionL("inde")
call append("$", "indentkeys\tkeys that trigger indenting with 'indentexpr' in Insert mode")
call append("$", "\t(local to buffer)")
call OptionL("indk")
endif
call append("$", "copyindent\tcopy whitespace for indenting from previous line")
call append("$", "\t(local to buffer)")
call BinOptionL("ci")
call append("$", "preserveindent\tpreserve kind of whitespace when changing indent")
call append("$", "\t(local to buffer)")
call BinOptionL("pi")
if has("lispindent")
call append("$", "lisp\tenable lisp mode")
call append("$", "\t(local to buffer)")
call BinOptionL("lisp")
call append("$", "lispwords\twords that change how lisp indenting works")
call OptionL("lw")
endif
if has("folding")
call Header("folding")
call append("$", "foldenable\tset to display all folds open")
call append("$", "\t(local to window)")
call BinOptionL("fen")
call append("$", "foldlevel\tfolds with a level higher than this number will be closed")
call append("$", "\t(local to window)")
call OptionL("fdl")
call append("$", "foldlevelstart\tvalue for 'foldlevel' when starting to edit a file")
call append("$", " \tset fdls=" . &fdls)
call append("$", "foldcolumn\twidth of the column used to indicate folds")
call append("$", "\t(local to window)")
call OptionL("fdc")
call append("$", "foldtext\texpression used to display the text of a closed fold")
call append("$", "\t(local to window)")
call OptionL("fdt")
call append("$", "foldclose\tset to \"all\" to close a fold when the cursor leaves it")
call OptionG("fcl", &fcl)
call append("$", "foldopen\tspecifies for which commands a fold will be opened")
call OptionG("fdo", &fdo)
call append("$", "foldminlines\tminimum number of screen lines for a fold to be closed")
call append("$", "\t(local to window)")
call OptionL("fml")
call append("$", "commentstring\ttemplate for comments; used to put the marker in")
call OptionL("cms")
call append("$", "foldmethod\tfolding type: \"manual\", \"indent\", \"expr\", \"marker\" or \"syntax\"")
call append("$", "\t(local to window)")
call OptionL("fdm")
call append("$", "foldexpr\texpression used when 'foldmethod' is \"expr\"")
call append("$", "\t(local to window)")
call OptionL("fde")
call append("$", "foldignore\tused to ignore lines when 'foldmethod' is \"indent\"")
call append("$", "\t(local to window)")
call OptionL("fdi")
call append("$", "foldmarker\tmarkers used when 'foldmethod' is \"marker\"")
call append("$", "\t(local to window)")
call OptionL("fmr")
call append("$", "foldnestmax\tmaximum fold depth for when 'foldmethod is \"indent\" or \"syntax\"")
call append("$", "\t(local to window)")
call OptionL("fdn")
endif
if has("diff")
call Header("diff mode")
call append("$", "diff\tuse diff mode for the current window")
call append("$", "\t(local to window)")
call BinOptionL("diff")
call append("$", "diffopt\toptions for using diff mode")
call OptionG("dip", &dip)
call append("$", "diffexpr\texpression used to obtain a diff file")
call OptionG("dex", &dex)
call append("$", "patchexpr\texpression used to patch a file")
call OptionG("pex", &pex)
endif
call Header("mapping")
call append("$", "maxmapdepth\tmaximum depth of mapping")
call append("$", " \tset mmd=" . &mmd)
call append("$", "remap\trecognize mappings in mapped keys")
call BinOptionG("remap", &remap)
call append("$", "timeout\tallow timing out halfway into a mapping")
call