codekingpro/portable-devtools
114k
1" These commands create the option window.2"3" Maintainer: The Vim Project <https://github.com/vim/vim>4" Last Change: 2026 Apr 155" Former Maintainer: Bram Moolenaar <Bram@vim.org>6 7" If there already is an option window, jump to that one.8let buf = bufexists('option-window') ? bufnr('option-window') : -19if buf >= 010 let winids = win_findbuf(buf)11 if len(winids) > 012 if win_gotoid(winids[0]) == 113 finish14 endif15 endif16endif17 18" Make sure the '<' flag is not included in 'cpoptions', otherwise <CR> would19" not be recognized. See ":help 'cpoptions'".20let s:cpo_save = &cpo21set cpo&vim22 23" function to be called when <CR> is hit in the option-window24func <SID>CR()25 26 " If on a continued comment line, go back to the first comment line27 let lnum = search("^[^\t]", 'bWcn')28 let line = getline(lnum)29 30 " <CR> on a "set" line executes the option line31 if match(line, "^ \tset ") >= 032 33 " For a local option: go to the previous window34 " If this is a help window, go to the window below it35 let thiswin = winnr()36 let local = <SID>Find(lnum)37 if local >= 038 exe line39 call <SID>Update(lnum, line, local, thiswin)40 endif41 42 " <CR> on a "option" line shows help for that option43 elseif match(line, "^[a-z]") >= 044 let name = substitute(line, '\([^\t]*\).*', '\1', "")45 exe "help '" . name . "'"46 47 " <CR> on an index line jumps to the group48 elseif match(line, '^ \=[0-9]') >= 049 exe "norm! /" . line . "\<CR>zt"50 endif51endfunc52 53" function to be called when <Space> is hit in the option-window54func <SID>Space()55 56 let lnum = line(".")57 let line = getline(lnum)58 59 " <Space> on a "set" line refreshes the option line60 if match(line, "^ \tset ") >= 061 62 " For a local option: go to the previous window63 " If this is a help window, go to the window below it64 let thiswin = winnr()65 let local = <SID>Find(lnum)66 if local >= 067 call <SID>Update(lnum, line, local, thiswin)68 endif69 70 endif71endfunc72 73let s:local_to_window = gettext('(local to window)')74let s:local_to_buffer = gettext('(local to buffer)')75let s:global_or_local = gettext('(global or local to buffer)')76 77" find the window in which the option applies78" returns 0 for global option, 1 for local option, -1 for error79func <SID>Find(lnum)80 let line = getline(a:lnum - 1)81 if line =~ s:local_to_window || line =~ s:local_to_buffer82 let local = 183 let thiswin = winnr()84 wincmd p85 if exists("b:current_syntax") && b:current_syntax == "help"86 wincmd j87 if winnr() == thiswin88 wincmd j89 endif90 endif91 else92 let local = 093 endif94 if local && (winnr() == thiswin || (exists("b:current_syntax")95 \ && b:current_syntax == "help"))96 echo "Don't know in which window"97 let local = -198 endif99 return local100endfunc101 102" Update a "set" line in the option window103func <SID>Update(lnum, line, local, thiswin)104 " get the new value of the option and update the option window line105 if match(a:line, "=") >= 0106 let name = substitute(a:line, '^ \tset \([^=]*\)=.*', '\1', "")107 else108 let name = substitute(a:line, '^ \tset \(no\)\=\([a-z]*\).*', '\2', "")109 endif110 if name == "pt" && &pt =~ "\x80"111 let val = <SID>PTvalue()112 else113 let val = escape(eval('&' . name), " \t\\\"|")114 endif115 if a:local116 exe a:thiswin . "wincmd w"117 endif118 if match(a:line, "=") >= 0 || (val != "0" && val != "1")119 call setline(a:lnum, " \tset " . name . "=" . val)120 else121 if val122 call setline(a:lnum, " \tset " . name . "\tno" . name)123 else124 call setline(a:lnum, " \tset no" . name . "\t" . name)125 endif126 endif127 set nomodified128endfunc129 130" Reset 'title' and 'icon' to make it work faster.131" Reset 'undolevels' to avoid undo'ing until the buffer is empty.132let s:old_title = &title133let s:old_icon = &icon134let s:old_sc = &sc135let s:old_ru = &ru136let s:old_ul = &ul137set notitle noicon nosc noru ul=-1138 139" If the current window is a help window, try finding a non-help window.140" Relies on syntax highlighting to be switched on.141let s:thiswin = winnr()142while exists("b:current_syntax") && b:current_syntax == "help"143 wincmd w144 if s:thiswin == winnr()145 break146 endif147endwhile148 149" Open the window. $OPTWIN_CMD is set to "tab" for ":tab options".150exe $OPTWIN_CMD . ' new option-window'151setlocal ts=15 tw=0 noro buftype=nofile152 153" Insert help and a "set" command for each option.154call append(0, gettext('" Each "set" line shows the current value of an option (on the left).'))155call append(1, gettext('" Hit <Enter> on a "set" line to execute it.'))156call append(2, gettext('" A boolean option will be toggled.'))157call append(3, gettext('" For other options you can edit the value before hitting <Enter>.'))158call append(4, gettext('" Hit <Enter> on a help line to open a help window on this option.'))159call append(5, gettext('" Hit <Enter> on an index line to jump there.'))160call append(6, gettext('" Hit <Space> on a "set" line to refresh it.'))161 162" These functions are called often below. Keep them fast!163 164" Add an option name and explanation. The text can contain "\n" characters165" where a line break is to be inserted.166func <SID>AddOption(name, text)167 let lines = split(a:text, "\n")168 call append("$", a:name .. "\t" .. lines[0])169 for line in lines[1:]170 call append("$", "\t" .. line)171 endfor172endfunc173 174" Init a local binary option175func <SID>BinOptionL(name)176 let val = getwinvar(winnr('#'), '&' . a:name)177 call append("$", substitute(substitute(" \tset " . val . a:name . "\t" .178 \!val . a:name, "0", "no", ""), "1", "", ""))179endfunc180 181" Init a global binary option182func <SID>BinOptionG(name, val)183 call append("$", substitute(substitute(" \tset " . a:val . a:name . "\t" .184 \!a:val . a:name, "0", "no", ""), "1", "", ""))185endfunc186 187" Init a local string option188func <SID>OptionL(name)189 let val = escape(getwinvar(winnr('#'), '&' . a:name), " \t\\\"|")190 call append("$", " \tset " . a:name . "=" . val)191endfunc192 193" Init a global string option194func <SID>OptionG(name, val)195 call append("$", " \tset " . a:name . "=" . escape(a:val, " \t\\\"|"))196endfunc197 198let s:idx = 1199let s:lnum = line("$")200call append("$", "")201 202func <SID>Header(text)203 let line = s:idx . " " . a:text204 if s:idx < 10205 let line = " " . line206 endif207 call append("$", "")208 call append("$", line)209 call append("$", "")210 call append(s:lnum, line)211 let s:idx = s:idx + 1212 let s:lnum = s:lnum + 1213endfunc214 215" Get the value of 'pastetoggle'. It could be a special key.216func <SID>PTvalue()217 redir @a218 silent set pt219 redir END220 return substitute(@a, '[^=]*=\(.*\)', '\1', "")221endfunc222 223" Restore the previous value of 'cpoptions' here, it's used below.224let &cpo = s:cpo_save225 226" List of all options, organized by function.227" The text should be sufficient to know what the option is used for.228 229call <SID>Header(gettext("important"))230call <SID>AddOption("compatible", gettext("behave very Vi compatible (not advisable)"))231call <SID>BinOptionG("cp", &cp)232call <SID>AddOption("cpoptions", gettext("list of flags to specify Vi compatibility"))233call <SID>OptionG("cpo", &cpo)234call <SID>AddOption("insertmode", gettext("use Insert mode as the default mode"))235call <SID>BinOptionG("im", &im)236call <SID>AddOption("paste", gettext("paste mode, insert typed text literally"))237call <SID>BinOptionG("paste", &paste)238call <SID>AddOption("pastetoggle", gettext("key sequence to toggle paste mode"))239if &pt =~ "\x80"240 call append("$", " \tset pt=" . <SID>PTvalue())241else242 call <SID>OptionG("pt", &pt)243endif244call <SID>AddOption("runtimepath", gettext("list of directories used for runtime files and plugins"))245call <SID>OptionG("rtp", &rtp)246call <SID>AddOption("packpath", gettext("list of directories used for plugin packages"))247call <SID>OptionG("pp", &pp)248call <SID>AddOption("helpfile", gettext("name of the main help file"))249call <SID>OptionG("hf", &hf)250 251 252call <SID>Header(gettext("moving around, searching and patterns"))253call <SID>AddOption("whichwrap", gettext("list of flags specifying which commands wrap to another line"))254call <SID>OptionG("ww", &ww)255call <SID>AddOption("startofline", gettext("many jump commands move the cursor to the first non-blank\ncharacter of a line"))256call <SID>BinOptionG("sol", &sol)257call <SID>AddOption("paragraphs", gettext("nroff macro names that separate paragraphs"))258call <SID>OptionG("para", ¶)259call <SID>AddOption("sections", gettext("nroff macro names that separate sections"))260call <SID>OptionG("sect", §)261call <SID>AddOption("path", gettext("list of directory names used for file searching"))262call append("$", "\t" .. s:global_or_local)263call <SID>OptionG("pa", &pa)264call <SID>AddOption("cdhome", gettext(":cd without argument goes to the home directory"))265call <SID>BinOptionG("cdh", &cdh)266call <SID>AddOption("cdpath", gettext("list of directory names used for :cd"))267call <SID>OptionG("cd", &cd)268if exists("+autochdir")269 call <SID>AddOption("autochdir", gettext("change to directory of file in buffer"))270 call <SID>BinOptionG("acd", &acd)271endif272call <SID>AddOption("autoshelldir", gettext("change to pwd of shell in terminal buffer"))273call <SID>BinOptionG("asd", &asd)274call <SID>AddOption("wrapscan", gettext("search commands wrap around the end of the buffer"))275call <SID>BinOptionG("ws", &ws)276call <SID>AddOption("incsearch", gettext("show match for partly typed search command"))277call <SID>BinOptionG("is", &is)278call <SID>AddOption("magic", gettext("change the way backslashes are used in search patterns"))279call <SID>BinOptionG("magic", &magic)280call <SID>AddOption("regexpengine", gettext("select the default regexp engine used"))281call <SID>OptionG("re", &re)282call <SID>AddOption("ignorecase", gettext("ignore case when using a search pattern"))283call <SID>BinOptionG("ic", &ic)284call <SID>AddOption("smartcase", gettext("override 'ignorecase' when pattern has upper case characters"))285call <SID>BinOptionG("scs", &scs)286call <SID>AddOption("maxsearchcount", gettext("maximum number for the search count feature"))287call <SID>OptionG("msc", &msc)288call <SID>AddOption("casemap", gettext("what method to use for changing case of letters"))289call <SID>OptionG("cmp", &cmp)290call <SID>AddOption("maxmempattern", gettext("maximum amount of memory in Kbyte used for pattern matching"))291call append("$", " \tset mmp=" . &mmp)292call <SID>AddOption("define", gettext("pattern for a macro definition line"))293call append("$", "\t" .. s:global_or_local)294call <SID>OptionG("def", &def)295if has("find_in_path")296 call <SID>AddOption("include", gettext("pattern for an include-file line"))297 call append("$", "\t" .. s:local_to_buffer)298 call <SID>OptionL("inc")299 call <SID>AddOption("includeexpr", gettext("expression used to transform an include line to a file name"))300 call append("$", "\t" .. s:local_to_buffer)301 call <SID>OptionL("inex")302endif303 304 305call <SID>Header(gettext("tags"))306call <SID>AddOption("tagbsearch", gettext("use binary searching in tags files"))307call <SID>BinOptionG("tbs", &tbs)308call <SID>AddOption("taglength", gettext("number of significant characters in a tag name or zero"))309call append("$", " \tset tl=" . &tl)310call <SID>AddOption("tags", gettext("list of file names to search for tags"))311call append("$", "\t" .. s:global_or_local)312call <SID>OptionG("tag", &tag)313call <SID>AddOption("tagcase", gettext("how to handle case when searching in tags files:\n\"followic\" to follow 'ignorecase', \"ignore\" or \"match\""))314call append("$", "\t" .. s:global_or_local)315call <SID>OptionG("tc", &tc)316call <SID>AddOption("tagrelative", gettext("file names in a tags file are relative to the tags file"))317call <SID>BinOptionG("tr", &tr)318call <SID>AddOption("tagstack", gettext("a :tag command will use the tagstack"))319call <SID>BinOptionG("tgst", &tgst)320call <SID>AddOption("showfulltag", gettext("when completing tags in Insert mode show more info"))321call <SID>BinOptionG("sft", &sft)322if has("eval")323 call <SID>AddOption("tagfunc", gettext("a function to be used to perform tag searches"))324 call append("$", "\t" .. s:local_to_buffer)325 call <SID>OptionL("tfu")326endif327if has("cscope")328 call <SID>AddOption("cscopeprg", gettext("command for executing cscope"))329 call <SID>OptionG("csprg", &csprg)330 call <SID>AddOption("cscopetag", gettext("use cscope for tag commands"))331 call <SID>BinOptionG("cst", &cst)332 call <SID>AddOption("cscopetagorder", gettext("0 or 1; the order in which \":cstag\" performs a search"))333 call append("$", " \tset csto=" . &csto)334 call <SID>AddOption("cscopeverbose", gettext("give messages when adding a cscope database"))335 call <SID>BinOptionG("csverb", &csverb)336 call <SID>AddOption("cscopepathcomp", gettext("how many components of the path to show"))337 call append("$", " \tset cspc=" . &cspc)338 call <SID>AddOption("cscopequickfix", gettext("when to open a quickfix window for cscope"))339 call <SID>OptionG("csqf", &csqf)340 call <SID>AddOption("cscoperelative", gettext("file names in a cscope file are relative to that file"))341 call <SID>BinOptionG("csre", &csre)342endif343 344 345call <SID>Header(gettext("displaying text"))346call <SID>AddOption("scroll", gettext("number of lines to scroll for CTRL-U and CTRL-D"))347call append("$", "\t" .. s:local_to_window)348call <SID>OptionL("scr")349call <SID>AddOption("smoothscroll", gettext("scroll by screen line"))350call append("$", "\t" .. s:local_to_window)351call <SID>BinOptionL("sms")352call <SID>AddOption("scrolloff", gettext("number of screen lines to show around the cursor"))353call append("$", " \tset so=" . &so)354call <SID>AddOption("scrolloffpad", gettext("keep 'scrolloff' context even at end of file"))355call append("$", " \tset sop=" . &sop)356call <SID>AddOption("wrap", gettext("long lines wrap"))357call append("$", "\t" .. s:local_to_window)358call <SID>BinOptionL("wrap")359call <SID>AddOption("linebreak", gettext("wrap long lines at a character in 'breakat'"))360call append("$", "\t" .. s:local_to_window)361call <SID>BinOptionL("lbr")362call <SID>AddOption("breakindent", gettext("preserve indentation in wrapped text"))363call append("$", "\t" .. s:local_to_window)364call <SID>BinOptionL("bri")365call <SID>AddOption("breakindentopt", gettext("adjust breakindent behaviour"))366call append("$", "\t" .. s:local_to_window)367call <SID>OptionL("briopt")368call <SID>AddOption("breakat", gettext("which characters might cause a line break"))369call <SID>OptionG("brk", &brk)370call <SID>AddOption("showbreak", gettext("string to put before wrapped screen lines"))371call <SID>OptionG("sbr", &sbr)372call <SID>AddOption("sidescroll", gettext("minimal number of columns to scroll horizontally"))373call append("$", " \tset ss=" . &ss)374call <SID>AddOption("sidescrolloff", gettext("minimal number of columns to keep left and right of the cursor"))375call append("$", " \tset siso=" . &siso)376call <SID>AddOption("display", gettext("include \"lastline\" to show the last line even if it doesn't fit\ninclude \"uhex\" to show unprintable characters as a hex number"))377call <SID>OptionG("dy", &dy)378call <SID>AddOption("fillchars", gettext("characters to use for the status line, folds, diffs,\nbuffer text, filler lines and truncation in the completion menu"))379call <SID>OptionG("fcs", &fcs)380call <SID>AddOption("cmdheight", gettext("number of lines used for the command-line"))381call append("$", " \tset ch=" . &ch)382call <SID>AddOption("columns", gettext("width of the display"))383call append("$", " \tset co=" . &co)384call <SID>AddOption("lines", gettext("number of lines in the display"))385call append("$", " \tset lines=" . &lines)386call <SID>AddOption("window", gettext("number of lines to scroll for CTRL-F and CTRL-B"))387call append("$", " \tset window=" . &window)388call <SID>AddOption("lazyredraw", gettext("don't redraw while executing macros"))389call <SID>BinOptionG("lz", &lz)390if has("unix")391 call <SID>AddOption("termresize", gettext("configure method of receiving terminal size changes"))392 call <SID>BinOptionG("trz", &trz)393endif394call <SID>AddOption("termsync", gettext("enable terminal sync mode"))395call <SID>BinOptionG("tsy", &tsy)396if has("reltime")397 call <SID>AddOption("redrawtime", gettext("timeout for 'hlsearch' and :match highlighting in msec"))398 call append("$", " \tset rdt=" . &rdt)399endif400call <SID>AddOption("writedelay", gettext("delay in msec for each char written to the display\n(for debugging)"))401call append("$", " \tset wd=" . &wd)402call <SID>AddOption("list", gettext("show <Tab> as ^I and end-of-line as $"))403call append("$", "\t" .. s:local_to_window)404call <SID>BinOptionL("list")405call <SID>AddOption("listchars", gettext("list of strings used for list mode"))406call <SID>OptionG("lcs", &lcs)407call <SID>AddOption("number", gettext("show the line number for each line"))408call append("$", "\t" .. s:local_to_window)409call <SID>BinOptionL("nu")410call <SID>AddOption("relativenumber", gettext("show the relative line number for each line"))411call append("$", "\t" .. s:local_to_window)412call <SID>BinOptionL("rnu")413if has("linebreak")414 call <SID>AddOption("numberwidth", gettext("number of columns to use for the line number"))415 call append("$", "\t" .. s:local_to_window)416 call <SID>OptionL("nuw")417endif418if has("quickfix")419 call <SID>AddOption("chistory", gettext("maximum number of quickfix lists that can be stored in history"))420 call <SID>OptionL("chi")421 call <SID>AddOption("lhistory", gettext("maximum number of location lists that can be stored in history"))422 call append("$", "\t" .. s:local_to_window)423 call <SID>OptionL("lhi")424endif425if has("conceal")426 call <SID>AddOption("conceallevel", gettext("controls whether concealable text is hidden"))427 call append("$", "\t" .. s:local_to_window)428 call <SID>OptionL("cole")429 call <SID>AddOption("concealcursor", gettext("modes in which text in the cursor line can be concealed"))430 call append("$", "\t" .. s:local_to_window)431 call <SID>OptionL("cocu")432endif433 434 435call <SID>Header(gettext("syntax, highlighting and spelling"))436call <SID>AddOption("background", gettext("\"dark\" or \"light\"; the background color brightness"))437call <SID>OptionG("bg", &bg)438call <SID>AddOption("filetype", gettext("type of file; triggers the FileType event when set"))439call append("$", "\t" .. s:local_to_buffer)440call <SID>OptionL("ft")441if has("syntax")442 call <SID>AddOption("syntax", gettext("name of syntax highlighting used"))443 call append("$", "\t" .. s:local_to_buffer)444 call <SID>OptionL("syn")445 call <SID>AddOption("synmaxcol", gettext("maximum column to look for syntax items"))446 call append("$", "\t" .. s:local_to_buffer)447 call <SID>OptionL("smc")448endif449call <SID>AddOption("highlight", gettext("which highlighting to use for various occasions"))450call <SID>OptionG("hl", &hl)451call <SID>AddOption("hlsearch", gettext("highlight all matches for the last used search pattern"))452call <SID>BinOptionG("hls", &hls)453call <SID>AddOption("wincolor", gettext("highlight group to use for the window"))454call append("$", "\t" .. s:local_to_window)455call <SID>OptionL("wcr")456call <SID>AddOption("winhighlight", gettext("highlight group mappings for the window"))457call append("$", "\t" .. s:local_to_window)458call <SID>OptionL("whl")459if has("termguicolors")460 call <SID>AddOption("termguicolors", gettext("use GUI colors for the terminal"))461 call <SID>BinOptionG("tgc", &tgc)462endif463if has("syntax")464 call <SID>AddOption("cursorcolumn", gettext("highlight the screen column of the cursor"))465 call append("$", "\t" .. s:local_to_window)466 call <SID>BinOptionL("cuc")467 call <SID>AddOption("cursorline", gettext("highlight the screen line of the cursor"))468 call append("$", "\t" .. s:local_to_window)469 call <SID>BinOptionL("cul")470 call <SID>AddOption("cursorlineopt", gettext("specifies which area 'cursorline' highlights"))471 call append("$", "\t" .. s:local_to_window)472 call <SID>OptionL("culopt")473 call <SID>AddOption("colorcolumn", gettext("columns to highlight"))474 call append("$", "\t" .. s:local_to_window)475 call <SID>OptionL("cc")476 call <SID>AddOption("spell", gettext("highlight spelling mistakes"))477 call append("$", "\t" .. s:local_to_window)478 call <SID>BinOptionL("spell")479 call <SID>AddOption("spelllang", gettext("list of accepted languages"))480 call append("$", "\t" .. s:local_to_buffer)481 call <SID>OptionL("spl")482 call <SID>AddOption("spellfile", gettext("file that \"zg\" adds good words to"))483 call append("$", "\t" .. s:local_to_buffer)484 call <SID>OptionL("spf")485 call <SID>AddOption("spellcapcheck", gettext("pattern to locate the end of a sentence"))486 call append("$", "\t" .. s:local_to_buffer)487 call <SID>OptionL("spc")488 call <SID>AddOption("spelloptions", gettext("flags to change how spell checking works"))489 call append("$", "\t" .. s:local_to_buffer)490 call <SID>OptionL("spo")491 call <SID>AddOption("spellsuggest", gettext("methods used to suggest corrections"))492 call <SID>OptionG("sps", &sps)493 call <SID>AddOption("mkspellmem", gettext("amount of memory used by :mkspell before compressing"))494 call <SID>OptionG("msm", &msm)495endif496 497 498call <SID>Header(gettext("multiple windows"))499call <SID>AddOption("laststatus", gettext("0, 1 or 2; when to use a status line for the last window"))500call append("$", " \tset ls=" . &ls)501if has("statusline")502 call <SID>AddOption("statusline", gettext("alternate format to be used for a status line"))503 call <SID>OptionG("stl", &stl)504 call append("$", "\t" .. s:local_to_window)505 call <SID>AddOption("statuslineopt", gettext("optional settings for the status line"))506 call <SID>OptionG("stlo", &stlo)507endif508call <SID>AddOption("equalalways", gettext("make all windows the same size when adding/removing windows"))509call <SID>BinOptionG("ea", &ea)510call <SID>AddOption("eadirection", gettext("in which direction 'equalalways' works: \"ver\", \"hor\" or \"both\""))511call <SID>OptionG("ead", &ead)512call <SID>AddOption("winheight", gettext("minimal number of lines used for the current window"))513call append("$", " \tset wh=" . &wh)514call <SID>AddOption("winminheight", gettext("minimal number of lines used for any window"))515call append("$", " \tset wmh=" . &wmh)516call <SID>AddOption("winfixbuf", gettext("keep window focused on a single buffer"))517call <SID>OptionG("wfb", &wfb)518call <SID>AddOption("winfixheight", gettext("keep the height of the window"))519call append("$", "\t" .. s:local_to_window)520call <SID>BinOptionL("wfh")521call <SID>AddOption("winfixwidth", gettext("keep the width of the window"))522call append("$", "\t" .. s:local_to_window)523call <SID>BinOptionL("wfw")524call <SID>AddOption("winwidth", gettext("minimal number of columns used for the current window"))525call append("$", " \tset wiw=" . &wiw)526call <SID>AddOption("winminwidth", gettext("minimal number of columns used for any window"))527call append("$", " \tset wmw=" . &wmw)528call <SID>AddOption("helpheight", gettext("initial height of the help window"))529call append("$", " \tset hh=" . &hh)530if has("quickfix")531 call <SID>AddOption("previewpopup", gettext("use a popup window for preview"))532 call append("$", " \tset pvp=" . &pvp)533 call <SID>AddOption("previewheight", gettext("default height for the preview window"))534 call append("$", " \tset pvh=" . &pvh)535 call <SID>AddOption("previewwindow", gettext("identifies the preview window"))536 call append("$", "\t" .. s:local_to_window)537 call <SID>BinOptionL("pvw")538endif539call <SID>AddOption("hidden", gettext("don't unload a buffer when no longer shown in a window"))540call <SID>BinOptionG("hid", &hid)541call <SID>AddOption("switchbuf", gettext("\"useopen\" and/or \"split\"; which window to use when jumping\nto a buffer"))542call <SID>OptionG("swb", &swb)543call <SID>AddOption("splitbelow", gettext("a new window is put below the current one"))544call <SID>BinOptionG("sb", &sb)545call <SID>AddOption("splitkeep", gettext("determines scroll behavior for split windows"))546call <SID>OptionG("spk", &spk)547call <SID>AddOption("splitright", gettext("a new window is put right of the current one"))548call <SID>BinOptionG("spr", &spr)549call <SID>AddOption("scrollbind", gettext("this window scrolls together with other bound windows"))550call append("$", "\t" .. s:local_to_window)551call <SID>BinOptionL("scb")552call <SID>AddOption("scrollopt", gettext("\"ver\", \"hor\" and/or \"jump\"; list of options for 'scrollbind'"))553call <SID>OptionG("sbo", &sbo)554call <SID>AddOption("cursorbind", gettext("this window's cursor moves together with other bound windows"))555call append("$", "\t" .. s:local_to_window)556call <SID>BinOptionL("crb")557if has("terminal")558 call <SID>AddOption("termwinsize", gettext("size of a terminal window"))559 call append("$", "\t" .. s:local_to_window)560 call <SID>OptionL("tws")561 call <SID>AddOption("termwinkey", gettext("key that precedes Vim commands in a terminal window"))562 call append("$", "\t" .. s:local_to_window)563 call <SID>OptionL("twk")564 call <SID>AddOption("termwinscroll", gettext("max number of lines to keep for scrollback in a terminal window"))565 call append("$", "\t" .. s:local_to_window)566 call <SID>OptionL("twsl")567 if has('win32')568 call <SID>AddOption("termwintype", gettext("type of pty to use for a terminal window"))569 call <SID>OptionG("twt", &twt)570 endif571 if exists("&winptydll")572 call <SID>AddOption("winptydll", gettext("name of the winpty dynamic library"))573 call <SID>OptionG("winptydll", &winptydll)574 endif575endif576 577 578call <SID>Header(gettext("multiple tab pages"))579call <SID>AddOption("showtabline", gettext("0, 1 or 2; when to use a tab pages line"))580call append("$", " \tset stal=" . &stal)581call <SID>AddOption("tabclose", gettext("behaviour when closing tab pages: left, uselast or empty"))582call append("$", " \tset tcl=" . &tcl)583call <SID>AddOption("tabpagemax", gettext("maximum number of tab pages to open for -p and \"tab all\""))584call append("$", " \tset tpm=" . &tpm)585call <SID>AddOption("tabline", gettext("custom tab pages line"))586call <SID>OptionG("tal", &tal)587if has("gui")588 call <SID>AddOption("guitablabel", gettext("custom tab page label for the GUI"))589 call <SID>OptionG("gtl", >l)590 call <SID>AddOption("guitabtooltip", gettext("custom tab page tooltip for the GUI"))591 call <SID>OptionG("gtt", >t)592endif593 594 595call <SID>Header(gettext("terminal"))596call <SID>AddOption("term", gettext("name of the used terminal"))597call <SID>OptionG("term", &term)598 599call <SID>AddOption("ttytype", gettext("alias for 'term'"))600call <SID>OptionG("tty", &tty)601 602call <SID>AddOption("ttybuiltin", gettext("check built-in termcaps first"))603call <SID>BinOptionG("tbi", &tbi)604 605call <SID>AddOption("ttyfast", gettext("terminal connection is fast"))606call <SID>BinOptionG("tf", &tf)607 608call <SID>AddOption("xtermcodes", gettext("request terminal key codes when an xterm is detected"))609call <SID>BinOptionG("xtermcodes", &xtermcodes)610 611call <SID>AddOption("weirdinvert", gettext("terminal that requires extra redrawing"))612call <SID>BinOptionG("wiv", &wiv)613 614call <SID>AddOption("keyprotocol", gettext("what keyboard protocol to use for which terminal"))615call <SID>OptionG("kpc", &kpc)616call <SID>AddOption("esckeys", gettext("recognize keys that start with <Esc> in Insert mode"))617call <SID>BinOptionG("ek", &ek)618call <SID>AddOption("scrolljump", gettext("minimal number of lines to scroll at a time"))619call append("$", " \tset sj=" . &sj)620call <SID>AddOption("ttyscroll", gettext("maximum number of lines to use scrolling instead of redrawing"))621call append("$", " \tset tsl=" . &tsl)622if has("gui") || has("win32")623 call <SID>AddOption("guicursor", gettext("specifies what the cursor looks like in different modes"))624 call <SID>OptionG("gcr", &gcr)625endif626if has("title")627 let &title = s:old_title628 call <SID>AddOption("title", gettext("show info in the window title"))629 call <SID>BinOptionG("title", &title)630 set notitle631 call <SID>AddOption("titlelen", gettext("percentage of 'columns' used for the window title"))632 call append("$", " \tset titlelen=" . &titlelen)633 call <SID>AddOption("titlestring", gettext("when not empty, string to be used for the window title"))634 call <SID>OptionG("titlestring", &titlestring)635 call <SID>AddOption("titleold", gettext("string to restore the title to when exiting Vim"))636 call <SID>OptionG("titleold", &titleold)637 let &icon = s:old_icon638 call <SID>AddOption("icon", gettext("set the text of the icon for this window"))639 call <SID>BinOptionG("icon", &icon)640 set noicon641 call <SID>AddOption("iconstring", gettext("when not empty, text for the icon of this window"))642 call <SID>OptionG("iconstring", &iconstring)643endif644if has("win32")645 call <SID>AddOption("restorescreen", gettext("restore the screen contents when exiting Vim"))646 call <SID>BinOptionG("rs", &rs)647endif648call <SID>AddOption("osctimeoutlen", gettext("timeout used for terminal OSC responses"))649call <SID>OptionG("ost", &ost)650 651call <SID>Header(gettext("using the mouse"))652call <SID>AddOption("mouse", gettext("list of flags for using the mouse"))653call <SID>OptionG("mouse", &mouse)654if has("gui")655 call <SID>AddOption("mousefocus", gettext("the window with the mouse pointer becomes the current one"))656 call <SID>BinOptionG("mousef", &mousef)657endif658call <SID>AddOption("scrollfocus", gettext("the window with the mouse pointer scrolls with the mouse wheel"))659call <SID>BinOptionG("scf", &scf)660if has("gui")661 call <SID>AddOption("mousehide", gettext("hide the mouse pointer while typing"))662 call <SID>BinOptionG("mh", &mh)663 call <SID>AddOption("mousemoveevent", gettext("report mouse movement events"))664 call <SID>BinOptionG("mousemev", &mousemev)665endif666call <SID>AddOption("mousemodel", gettext("\"extend\", \"popup\" or \"popup_setpos\"; what the right\nmouse button is used for"))667call <SID>OptionG("mousem", &mousem)668call <SID>AddOption("mousetime", gettext("maximum time in msec to recognize a double-click"))669call append("$", " \tset mouset=" . &mouset)670call <SID>AddOption("ttymouse", gettext("\"xterm\", \"xterm2\", \"sgr\", etc.; type of mouse"))671call <SID>OptionG("ttym", &ttym)672if has("mouseshape")673 call <SID>AddOption("mouseshape", gettext("what the mouse pointer looks like in different modes"))674 call <SID>OptionG("mouses", &mouses)675endif676 677 678if has("gui")679 call <SID>Header(gettext("GUI"))680 call <SID>AddOption("guifont", gettext("list of font names to be used in the GUI"))681 call <SID>OptionG("gfn", &gfn)682 if has("xfontset")683 call <SID>AddOption("guifontset", gettext("pair of fonts to be used, for multibyte editing"))684 call <SID>OptionG("gfs", &gfs)685 endif686 call <SID>AddOption("guifontwide", gettext("list of font names to be used for double-wide characters"))687 call <SID>OptionG("gfw", &gfw)688 if has("mac")689 call <SID>AddOption("antialias", gettext("use smooth, antialiased fonts"))690 call <SID>BinOptionG("anti", &anti)691 endif692 call <SID>AddOption("guioptions", gettext("list of flags that specify how the GUI works"))693 call <SID>OptionG("go", &go)694 if has("gui_gtk")695 call <SID>AddOption("toolbar", gettext("\"icons\", \"text\" and/or \"tooltips\"; how to show the toolbar"))696 call <SID>OptionG("tb", &tb)697 if has("gui_gtk2")698 call <SID>AddOption("toolbariconsize", gettext("size of toolbar icons"))699 call <SID>OptionG("tbis", &tbis)700 endif701 call <SID>AddOption("guiheadroom", gettext("room (in pixels) left above/below the window"))702 call append("$", " \tset ghr=" . &ghr)703 endif704 if has("gui_gtk") || has("gui_win32")705 call <SID>AddOption("guiligatures", gettext("list of ASCII characters that can be combined into complex\nshapes"))706 call <SID>OptionG("gli", &gli)707 endif708 if has("directx")709 call <SID>AddOption("renderoptions", gettext("options for text rendering"))710 call <SID>OptionG("rop", &rop)711 endif712 call <SID>AddOption("guipty", gettext("use a pseudo-tty for I/O to external commands"))713 call <SID>BinOptionG("guipty", &guipty)714 if has("browse")715 call <SID>AddOption("browsedir", gettext("\"last\", \"buffer\" or \"current\": which directory used for\nthe file browser"))716 call <SID>OptionG("bsdir", &bsdir)717 endif718 if has("multi_lang")719 call <SID>AddOption("langmenu", gettext("language to be used for the menus"))720 call <SID>OptionG("langmenu", &lm)721 endif722 call <SID>AddOption("menuitems", gettext("maximum number of items in one menu"))723 call append("$", " \tset mis=" . &mis)724 if has("winaltkeys")725 call <SID>AddOption("winaltkeys", gettext("\"no\", \"yes\" or \"menu\"; how to use the ALT key"))726 call <SID>OptionG("wak", &wak)727 endif728 call <SID>AddOption("linespace", gettext("number of pixel lines to use between characters"))729 call append("$", " \tset lsp=" . &lsp)730 if has("balloon_eval") || has("balloon_eval_term")731 call <SID>AddOption("balloondelay", gettext("delay in milliseconds before a balloon may pop up"))732 call append("$", " \tset bdlay=" . &bdlay)733 if has("balloon_eval")734 call <SID>AddOption("ballooneval", gettext("use balloon evaluation in the GUI"))735 call <SID>BinOptionG("beval", &beval)736 endif737 if has("balloon_eval_term")738 call <SID>AddOption("balloonevalterm", gettext(" \nuse balloon evaluation in the terminal"))739 call <SID>BinOptionG("bevalterm", &beval)740 endif741 if has("eval")742 call <SID>AddOption("balloonexpr", gettext("expression to show in balloon eval"))743 call append("$", " \tset bexpr=" . &bexpr)744 endif745 endif746endif747 748if has("printer")749 call <SID>Header(gettext("printing"))750 call <SID>AddOption("printoptions", gettext("list of items that control the format of :hardcopy output"))751 call <SID>OptionG("popt", &popt)752 call <SID>AddOption("printdevice", gettext("name of the printer to be used for :hardcopy"))753 call <SID>OptionG("pdev", &pdev)754 if has("postscript")755 call <SID>AddOption("printexpr", gettext("expression used to print the PostScript file for :hardcopy"))756 call <SID>OptionG("pexpr", &pexpr)757 endif758 call <SID>AddOption("printfont", gettext("name of the font to be used for :hardcopy"))759 call <SID>OptionG("pfn", &pfn)760 call <SID>AddOption("printheader", gettext("format of the header used for :hardcopy"))761 call <SID>OptionG("pheader", &pheader)762 if has("postscript")763 call <SID>AddOption("printencoding", gettext("encoding used to print the PostScript file for :hardcopy"))764 call <SID>OptionG("penc", &penc)765 endif766 call <SID>AddOption("printmbcharset", gettext("the CJK character set to be used for CJK output from :hardcopy"))767 call <SID>OptionG("pmbcs", &pmbcs)768 call <SID>AddOption("printmbfont", gettext("list of font names to be used for CJK output from :hardcopy"))769 call <SID>OptionG("pmbfn", &pmbfn)770endif771 772call <SID>Header(gettext("messages and info"))773call <SID>AddOption("terse", gettext("add 's' flag in 'shortmess' (don't show search message)"))774call <SID>BinOptionG("terse", &terse)775call <SID>AddOption("shortmess", gettext("list of flags to make messages shorter"))776call <SID>OptionG("shm", &shm)777call <SID>AddOption("messagesopt", gettext("options for outputting messages"))778call <SID>OptionG("mopt", &mopt)779call <SID>AddOption("showcmd", gettext("show (partial) command keys in location given by 'showcmdloc'"))780let &sc = s:old_sc781call <SID>BinOptionG("sc", &sc)782set nosc783call <SID>AddOption("showcmdloc", gettext("location where to show the (partial) command keys for 'showcmd'"))784 call <SID>OptionG("sloc", &sloc)785call <SID>AddOption("showmode", gettext("display the current mode in the status line"))786call <SID>BinOptionG("smd", &smd)787call <SID>AddOption("ruler", gettext("show cursor position below each window"))788let &ru = s:old_ru789call <SID>BinOptionG("ru", &ru)790set noru791if has("statusline")792 call <SID>AddOption("rulerformat", gettext("alternate format to be used for the ruler"))793 call <SID>OptionG("ruf", &ruf)794endif795call <SID>AddOption("report", gettext("threshold for reporting number of changed lines"))796call append("$", " \tset report=" . &report)797call <SID>AddOption("verbose", gettext("the higher the more messages are given"))798call append("$", " \tset vbs=" . &vbs)799call <SID>AddOption("verbosefile", gettext("file to write messages in"))800call <SID>OptionG("vfile", &vfile)801call <SID>AddOption("more", gettext("pause listings when the screen is full"))802call <SID>BinOptionG("more", &more)803if has("dialog_con") || has("dialog_gui")804 call <SID>AddOption("confirm", gettext("start a dialog when a command fails"))805 call <SID>BinOptionG("cf", &cf)806endif807call <SID>AddOption("errorbells", gettext("ring the bell for error messages"))808call <SID>BinOptionG("eb", &eb)809call <SID>AddOption("visualbell", gettext("use a visual bell instead of beeping"))810call <SID>BinOptionG("vb", &vb)811call <SID>AddOption("belloff", gettext("do not ring the bell for these reasons"))812call <SID>OptionG("belloff", &belloff)813if has("multi_lang")814 call <SID>AddOption("helplang", gettext("list of preferred languages for finding help"))815 call <SID>OptionG("hlg", &hlg)816endif817 818 819call <SID>Header(gettext("selecting text"))820call <SID>AddOption("selection", gettext("\"old\", \"inclusive\" or \"exclusive\"; how selecting text behaves"))821call <SID>OptionG("sel", &sel)822call <SID>AddOption("selectmode", gettext("\"mouse\", \"key\" and/or \"cmd\"; when to start Select mode\ninstead of Visual mode"))823call <SID>OptionG("slm", &slm)824if has("clipboard")825 call <SID>AddOption("clipboard", gettext("\"unnamed\" to use the * register like unnamed register\n\"autoselect\" to always put selected text on the clipboard"))826 call <SID>OptionG("cb", &cb)827 call <SID>AddOption("clipmethod", gettext("Ordered list of possible methods for accessing the clipboard"))828 call <SID>OptionG("cpm", &cpm)829endif830if has("wayland_clipboard")831 call <SID>AddOption("wltimeoutlen", gettext("Timeout to use when polling for data to read or write in wayland"))832 call <SID>OptionG("wtm", &wtm)833endif834if has('wayland')835 call <SID>AddOption("wlseat", gettext("Wayland seat to use"))836 call <SID>OptionG("wse", &wse)837endif838if has("wayland_focus_steal")839 call <SID>AddOption("wlsteal", gettext("Enable wayland focus stealing functionality in order to access the clipboard"))840 call <SID>BinOptionG("wst", &wst)841endif842call <SID>AddOption("keymodel", gettext("\"startsel\" and/or \"stopsel\"; what special keys can do"))843call <SID>OptionG("km", &km)844 845 846call <SID>Header(gettext("editing text"))847call <SID>AddOption("undolevels", gettext("maximum number of changes that can be undone"))848call append("$", "\t" .. s:global_or_local)849call append("$", " \tset ul=" . s:old_ul)850call <SID>AddOption("undofile", gettext("automatically save and restore undo history"))851call <SID>BinOptionG("udf", &udf)852call <SID>AddOption("undodir", gettext("list of directories for undo files"))853call <SID>OptionG("udir", &udir)854call <SID>AddOption("undoreload", gettext("maximum number lines to save for undo on a buffer reload"))855call append("$", " \tset ur=" . &ur)856call <SID>AddOption("modified", gettext("changes have been made and not written to a file"))857call append("$", "\t" .. s:local_to_buffer)858call <SID>BinOptionL("mod")859call <SID>AddOption("readonly", gettext("buffer is not to be written"))860call append("$", "\t" .. s:local_to_buffer)861call <SID>BinOptionL("ro")862call <SID>AddOption("modifiable", gettext("changes to the text are possible"))863call append("$", "\t" .. s:local_to_buffer)864call <SID>BinOptionL("ma")865call <SID>AddOption("textwidth", gettext("line length above which to break a line"))866call append("$", "\t" .. s:local_to_buffer)867call <SID>OptionL("tw")868call <SID>AddOption("wrapmargin", gettext("margin from the right in which to break a line"))869call append("$", "\t" .. s:local_to_buffer)870call <SID>OptionL("wm")871call <SID>AddOption("backspace", gettext("specifies what <BS>, CTRL-W, etc. can do in Insert mode"))872call append("$", " \tset bs=" . &bs)873call <SID>AddOption("comments", gettext("definition of what comment lines look like"))874call append("$", "\t" .. s:local_to_buffer)875call <SID>OptionL("com")876call <SID>AddOption("commentstring", gettext("template for comments; used to put the marker in"))877call <SID>OptionL("cms")878call <SID>AddOption("formatoptions", gettext("list of flags that tell how automatic formatting works"))879call append("$", "\t" .. s:local_to_buffer)880call <SID>OptionL("fo")881call <SID>AddOption("formatlistpat", gettext("pattern to recognize a numbered list"))882call append("$", "\t" .. s:local_to_buffer)883call <SID>OptionL("flp")884if has("eval")885 call <SID>AddOption("formatexpr", gettext("expression used for \"gq\" to format lines"))886 call append("$", "\t" .. s:local_to_buffer)887 call <SID>OptionL("fex")888endif889if has("insert_expand")890 call <SID>AddOption("complete", gettext("specifies how Insert mode completion works for CTRL-N and CTRL-P"))891 call append("$", "\t" .. s:local_to_buffer)892 call <SID>OptionL("cpt")893 call <SID>AddOption("autocomplete", gettext("automatic completion in insert mode"))894 call append("$", "\t" .. s:global_or_local)895 call <SID>BinOptionG("ac", &ac)896 call <SID>AddOption("autocompletetimeout", gettext(" \ninitial decay timeout for 'autocomplete' algorithm"))897 call append("$", " \tset act=" . &act)898 call <SID>AddOption("completetimeout", gettext(" \ninitial decay timeout for CTRL-N and CTRL-P completion"))899 call append("$", " \tset cto=" . &cto)900 call <SID>AddOption("autocompletedelay", gettext(" \ndelay in msec before menu appears after typing"))901 call append("$", " \tset acl=" . &acl)902 call <SID>AddOption("completeopt", gettext("whether to use a popup menu for Insert mode completion"))903 call <SID>OptionL("cot")904 call <SID>AddOption("completeitemalign", gettext(" \npopup menu item align order"))905 call <SID>OptionG("cia", &cia)906 if exists("+completepopup")907 call <SID>AddOption("completepopup", gettext("options for the Insert mode completion info popup"))908 call <SID>OptionG("cpp", &cpp)909 endif910 call <SID>AddOption("pumheight", gettext("maximum height of the popup menu"))911 call <SID>OptionG("ph", &ph)912 call <SID>AddOption("pumwidth", gettext("minimum width of the popup menu"))913 call <SID>OptionG("pw", &pw)914 call <SID>AddOption("pummaxwidth", gettext("maximum width of the popup menu"))915 call <SID>OptionG("pmw", &pmw)916 call <SID>AddOption("pumborder", gettext("popup border style"))917 call <SID>OptionG("pb", &pb)918 call <SID>AddOption("pumopt", gettext("additional options for the popup menu"))919 call <SID>OptionG("pumopt", &pumopt)920 call <SID>AddOption("completefunc", gettext("user defined function for Insert mode completion"))921 call append("$", "\t" .. s:local_to_buffer)922 call <SID>OptionL("cfu")923 call <SID>AddOption("omnifunc", gettext("function for filetype-specific Insert mode completion"))924 call append("$", "\t" .. s:local_to_buffer)925 call <SID>OptionL("ofu")926 call <SID>AddOption("dictionary", gettext("list of dictionary files for keyword completion"))927 call append("$", "\t" .. s:global_or_local)928 call <SID>OptionG("dict", &dict)929 call <SID>AddOption("thesaurus", gettext("list of thesaurus files for keyword completion"))930 call append("$", "\t" .. s:global_or_local)931 call <SID>OptionG("tsr", &tsr)932 call <SID>AddOption("thesaurusfunc", gettext("function used for thesaurus completion"))933 call append("$", "\t" .. s:global_or_local)934 call <SID>OptionG("tsrfu", &tsrfu)935endif936call <SID>AddOption("infercase", gettext("adjust case of a keyword completion match"))937call append("$", "\t" .. s:local_to_buffer)938call <SID>BinOptionL("inf")939if has("digraphs")940 call <SID>AddOption("digraph", gettext("enable entering digraphs with c1 <BS> c2"))941 call <SID>BinOptionG("dg", &dg)942endif943call <SID>AddOption("tildeop", gettext("the \"~\" command behaves like an operator"))944call <SID>BinOptionG("top", &top)945call <SID>AddOption("operatorfunc", gettext("function called for the \"g@\" operator"))946call <SID>OptionG("opfunc", &opfunc)947call <SID>AddOption("showmatch", gettext("when inserting a bracket, briefly jump to its match"))948call <SID>BinOptionG("sm", &sm)949call <SID>AddOption("matchtime", gettext("tenth of a second to show a match for 'showmatch'"))950call append("$", " \tset mat=" . &mat)951call <SID>AddOption("matchpairs", gettext("list of pairs that match for the \"%\" command"))952call append("$", "\t" .. s:local_to_buffer)953call <SID>OptionL("mps")954call <SID>AddOption("joinspaces", gettext("use two spaces after '.' when joining a line"))955call <SID>BinOptionG("js", &js)956call <SID>AddOption("nrformats", gettext("\"alpha\", \"octal\", \"hex\", \"bin\" and/or \"unsigned\"; number formats\nrecognized for CTRL-A and CTRL-X commands"))957call append("$", "\t" .. s:local_to_buffer)958call <SID>OptionL("nf")959 960 961call <SID>Header(gettext("tabs and indenting"))962call <SID>AddOption("tabstop", gettext("number of spaces a <Tab> in the text stands for"))963call append("$", "\t" .. s:local_to_buffer)964call <SID>OptionL("ts")965call <SID>AddOption("shiftwidth", gettext("number of spaces used for each step of (auto)indent"))966call append("$", "\t" .. s:local_to_buffer)967call <SID>OptionL("sw")968if has("vartabs")969 call <SID>AddOption("vartabstop", gettext("list of number of spaces a tab counts for"))970 call append("$", "\t" .. s:local_to_buffer)971 call <SID>OptionL("vts")972 call <SID>AddOption("varsofttabstop", gettext("list of number of spaces a soft tabsstop counts for"))973 call append("$", "\t" .. s:local_to_buffer)974 call <SID>OptionL("vsts")975endif976call <SID>AddOption("smarttab", gettext("a <Tab> in an indent inserts 'shiftwidth' spaces"))977call <SID>BinOptionG("sta", &sta)978call <SID>AddOption("softtabstop", gettext("if non-zero, number of spaces to insert for a <Tab>"))979call append("$", "\t" .. s:local_to_buffer)980call <SID>OptionL("sts")981call <SID>AddOption("shiftround", gettext("round to 'shiftwidth' for \"<<\" and \">>\""))982call <SID>BinOptionG("sr", &sr)983call <SID>AddOption("expandtab", gettext("expand <Tab> to spaces in Insert mode"))984call append("$", "\t" .. s:local_to_buffer)985call <SID>BinOptionL("et")986call <SID>AddOption("autoindent", gettext("automatically set the indent of a new line"))987call append("$", "\t" .. s:local_to_buffer)988call <SID>BinOptionL("ai")989if has("smartindent")990 call <SID>AddOption("smartindent", gettext("do clever autoindenting"))991 call append("$", "\t" .. s:local_to_buffer)992 call <SID>BinOptionL("si")993endif994if has("cindent")995 call <SID>AddOption("cindent", gettext("enable specific indenting for C code"))996 call append("$", "\t" .. s:local_to_buffer)997 call <SID>BinOptionL("cin")998 call <SID>AddOption("cinoptions", gettext("options for C-indenting"))999 call append("$", "\t" .. s:local_to_buffer)1000 call <SID>OptionL("cino")1001 call <SID>AddOption("cinkeys", gettext("keys that trigger C-indenting in Insert mode"))1002 call append("$", "\t" .. s:local_to_buffer)1003 call <SID>OptionL("cink")1004 call <SID>AddOption("cinwords", gettext("list of words that cause more C-indent"))1005 call append("$", "\t" .. s:local_to_buffer)1006 call <SID>OptionL("cinw")1007 call <SID>AddOption("cinscopedecls", gettext("list of scope declaration names used by cino-g"))1008 call append("$", "\t" .. s:local_to_buffer)1009 call <SID>OptionL("cinsd")1010 call <SID>AddOption("indentexpr", gettext("expression used to obtain the indent of a line"))1011 call append("$", "\t" .. s:local_to_buffer)1012 call <SID>OptionL("inde")1013 call <SID>AddOption("indentkeys", gettext("keys that trigger indenting with 'indentexpr' in Insert mode"))1014 call append("$", "\t" .. s:local_to_buffer)1015 call <SID>OptionL("indk")1016endif1017call <SID>AddOption("copyindent", gettext("copy whitespace for indenting from previous line"))1018call append("$", "\t" .. s:local_to_buffer)1019call <SID>BinOptionL("ci")1020call <SID>AddOption("preserveindent", gettext("preserve kind of whitespace when changing indent"))1021call append("$", "\t" .. s:local_to_buffer)1022call <SID>BinOptionL("pi")1023if has("lispindent")1024 call <SID>AddOption("lisp", gettext("enable lisp mode"))1025 call append("$", "\t" .. s:local_to_buffer)1026 call <SID>BinOptionL("lisp")1027 call <SID>AddOption("lispwords", gettext("words that change how lisp indenting works"))1028 call <SID>OptionL("lw")1029 call <SID>AddOption("lispoptions", gettext("options for Lisp indenting"))1030 call <SID>OptionL("lop")1031endif1032 1033 1034if has("folding")1035 call <SID>Header(gettext("folding"))1036 call <SID>AddOption("foldenable", gettext("unset to display all folds open"))1037 call append("$", "\t" .. s:local_to_window)1038 call <SID>BinOptionL("fen")1039 call <SID>AddOption("foldlevel", gettext("folds with a level higher than this number will be closed"))1040 call append("$", "\t" .. s:local_to_window)1041 call <SID>OptionL("fdl")1042 call <SID>AddOption("foldlevelstart", gettext("value for 'foldlevel' when starting to edit a file"))1043 call append("$", " \tset fdls=" . &fdls)1044 call <SID>AddOption("foldcolumn", gettext("width of the column used to indicate folds"))1045 call append("$", "\t" .. s:local_to_window)1046 call <SID>OptionL("fdc")1047 call <SID>AddOption("foldtext", gettext("expression used to display the text of a closed fold"))1048 call append("$", "\t" .. s:local_to_window)1049 call <SID>OptionL("fdt")1050 call <SID>AddOption("foldclose", gettext("set to \"all\" to close a fold when the cursor leaves it"))1051 call <SID>OptionG("fcl", &fcl)1052 call <SID>AddOption("foldopen", gettext("specifies for which commands a fold will be opened"))1053 call <SID>OptionG("fdo", &fdo)1054 call <SID>AddOption("foldminlines", gettext("minimum number of screen lines for a fold to be closed"))1055 call append("$", "\t" .. s:local_to_window)1056 call <SID>OptionL("fml")1057 call <SID>AddOption("foldmethod", gettext("folding type: \"manual\", \"indent\", \"expr\", \"marker\",\n\"syntax\" or \"diff\""))1058 call append("$", "\t" .. s:local_to_window)1059 call <SID>OptionL("fdm")1060 call <SID>AddOption("foldexpr", gettext("expression used when 'foldmethod' is \"expr\""))1061 call append("$", "\t" .. s:local_to_window)1062 call <SID>OptionL("fde")1063 call <SID>AddOption("foldignore", gettext("used to ignore lines when 'foldmethod' is \"indent\""))1064 call append("$", "\t" .. s:local_to_window)1065 call <SID>OptionL("fdi")1066 call <SID>AddOption("foldmarker", gettext("markers used when 'foldmethod' is \"marker\""))1067 call append("$", "\t" .. s:local_to_window)1068 call <SID>OptionL("fmr")1069 call <SID>AddOption("foldnestmax", gettext("maximum fold depth for when 'foldmethod' is \"indent\" or \"syntax\""))1070 call append("$", "\t" .. s:local_to_window)1071 call <SID>OptionL("fdn")1072endif1073 1074 1075if has("diff")1076 call <SID>Header(gettext("diff mode"))1077 call <SID>AddOption("diff", gettext("use diff mode for the current window"))1078 call append("$", "\t" .. s:local_to_window)1079 call <SID>BinOptionL("diff")1080 call <SID>AddOption("diffopt", gettext("options for using diff mode"))1081 call <SID>OptionG("dip", &dip)1082 call <SID>AddOption("diffexpr", gettext("expression used to obtain a diff file"))1083 call <SID>OptionG("dex", &dex)1084 call <SID>AddOption("diffanchors", gettext("list of addresses for anchoring a diff"))1085 call append("$", "\t" .. s:global_or_local)1086 call <SID>OptionG("dia", &dia)1087 call <SID>AddOption("patchexpr", gettext("expression used to patch a file"))1088 call <SID>OptionG("pex", &pex)1089endif1090 1091 1092call <SID>Header(gettext("mapping"))1093call <SID>AddOption("maxmapdepth", gettext("maximum depth of mapping"))1094call append("$", " \tset mmd=" . &mmd)1095call <SID>AddOption("remap", gettext("recognize mappings in mapped keys"))1096call <SID>BinOptionG("remap", &remap)1097call <SID>AddOption("timeout", gettext("allow timing out halfway into a mapping"))1098call <SID>BinOptionG("to", &to)1099call <SID>AddOption("ttimeout", gettext("allow timing out halfway into a key code"))1100call <SID>BinOptionG("ttimeout", &ttimeout)1101call <SID>AddOption("timeoutlen", gettext("time in msec for 'timeout'"))1102call append("$", " \tset tm=" . &tm)1103call <SID>AddOption("ttimeoutlen", gettext("time in msec for 'ttimeout'"))1104call append("$", " \tset ttm=" . &ttm)1105 1106 1107call <SID>Header(gettext("reading and writing files"))1108call <SID>AddOption("modeline", gettext("enable using settings from modelines when reading a file"))1109call append("$", "\t" .. s:local_to_buffer)1110call <SID>BinOptionL("ml")1111call <SID>AddOption("modelineexpr", gettext("allow setting expression options from a modeline"))1112call <SID>BinOptionG("mle", &mle)1113call <SID>AddOption("modelinestrict", gettext("only allow safe options to be set from a modeline"))1114call <SID>BinOptionG("modelinestrict", &modelinestrict)1115call <SID>AddOption("modelines", gettext("number of lines to check for modelines"))1116call append("$", " \tset mls=" . &mls)1117call <SID>AddOption("binary", gettext("binary file editing"))1118call append("$", "\t" .. s:local_to_buffer)1119call <SID>BinOptionL("bin")1120call <SID>AddOption("endofline", gettext("last line in the file has an end-of-line"))1121call append("$", "\t" .. s:local_to_buffer)1122call <SID>BinOptionL("eol")1123call <SID>AddOption("endoffile", gettext("last line in the file followed by CTRL-Z"))1124call append("$", "\t" .. s:local_to_buffer)1125call <SID>BinOptionL("eof")1126call <SID>AddOption("fixendofline", gettext("fixes missing end-of-line at end of text file"))1127call append("$", "\t" .. s:local_to_buffer)1128call <SID>BinOptionL("fixeol")1129call <SID>AddOption("bomb", gettext("prepend a Byte Order Mark to the file"))1130call append("$", "\t" .. s:local_to_buffer)1131call <SID>BinOptionL("bomb")1132call <SID>AddOption("fileformat", gettext("end-of-line format: \"dos\", \"unix\" or \"mac\""))1133call append("$", "\t" .. s:local_to_buffer)1134call <SID>OptionL("ff")1135call <SID>AddOption("fileformats", gettext("list of file formats to look for when editing a file"))1136call <SID>OptionG("ffs", &ffs)1137call <SID>AddOption("textmode", gettext("obsolete, use 'fileformat'"))1138call append("$", "\t" .. s:local_to_buffer)1139call <SID>BinOptionL("tx")1140call <SID>AddOption("textauto", gettext("obsolete, use 'fileformats'"))1141call <SID>BinOptionG("ta", &ta)1142call <SID>AddOption("write", gettext("writing files is allowed"))1143call <SID>BinOptionG("write", &write)1144call <SID>AddOption("writebackup", gettext("write a backup file before overwriting a file"))1145call <SID>BinOptionG("wb", &wb)1146call <SID>AddOption("backup", gettext("keep a backup after overwriting a file"))1147call <SID>BinOptionG("bk", &bk)1148call <SID>AddOption("backupskip", gettext("patterns that specify for which files a backup is not made"))1149call append("$", " \tset bsk=" . &bsk)1150call <SID>AddOption("backupcopy", gettext("whether to make the backup as a copy or rename the existing file"))1151call append("$", "\t" .. s:global_or_local)1152call append("$", " \tset bkc=" . &bkc)1153call <SID>AddOption("backupdir", gettext("list of directories to put backup files in"))1154call <SID>OptionG("bdir", &bdir)1155call <SID>AddOption("backupext", gettext("file name extension for the backup file"))1156call <SID>OptionG("bex", &bex)1157call <SID>AddOption("autowrite", gettext("automatically write a file when leaving a modified buffer"))1158call <SID>BinOptionG("aw", &aw)1159call <SID>AddOption("autowriteall", gettext("as 'autowrite', but works with more commands"))1160call <SID>BinOptionG("awa", &awa)1161call <SID>AddOption("writeany", gettext("always write without asking for confirmation"))1162call <SID>BinOptionG("wa", &wa)1163call <SID>AddOption("autoread", gettext("automatically read a file when it was modified outside of Vim"))1164call append("$", "\t" .. s:global_or_local)1165call <SID>BinOptionG("ar", &ar)1166call <SID>AddOption("patchmode", gettext("keep oldest version of a file; specifies file name extension"))1167call <SID>OptionG("pm", &pm)1168call <SID>AddOption("fsync", gettext("forcibly sync the file to disk after writing it"))1169call <SID>BinOptionG("fs", &fs)1170call <SID>AddOption("shortname", gettext("use 8.3 file names"))1171call append("$", "\t" .. s:local_to_buffer)1172call <SID>BinOptionL("sn")1173call <SID>AddOption("cryptmethod", gettext("encryption method for file writing: zip, blowfish or blowfish2"))1174call append("$", "\t" .. s:local_to_buffer)1175call <SID>OptionL("cm")1176 1177 1178call <SID>Header(gettext("the swap file"))1179call <SID>AddOption("directory", gettext("list of directories for the swap file"))1180call <SID>OptionG("dir", &dir)1181call <SID>AddOption("swapfile", gettext("use a swap file for this buffer"))1182call append("$", "\t" .. s:local_to_buffer)1183call <SID>BinOptionL("swf")1184call <SID>AddOption("swapsync", gettext("\"sync\", \"fsync\" or empty; how to flush a swap file to disk"))1185call <SID>OptionG("sws", &sws)1186call <SID>AddOption("updatecount", gettext("number of characters typed to cause a swap file update"))1187call append("$", " \tset uc=" . &uc)1188call <SID>AddOption("updatetime", gettext("time in msec after which the swap file will be updated"))1189call append("$", " \tset ut=" . &ut)1190call <SID>AddOption("maxmem", gettext("maximum amount of memory in Kbyte used for one buffer"))1191call append("$", " \tset mm=" . &mm)1192call <SID>AddOption("maxmemtot", gettext("maximum amount of memory in Kbyte used for all buffers"))1193call append("$", " \tset mmt=" . &mmt)1194 1195 1196call <SID>Header(gettext("command line editing"))1197call <SID>AddOption("history", gettext("how many command lines are remembered"))1198call append("$", " \tset hi=" . &hi)1199call <SID>AddOption("wildchar", gettext("key that triggers command-line expansion"))1200call append("$", " \tset wc=" . &wc)