📄 optwin.vim
字号:
call append("$", "binary\tbinary file editing")call append("$", "\t(local to buffer)")call OW_BinOption("bin")call append("$", "endofline\tlast line in the file has an end-of-line")call append("$", "\t(local to buffer)")call OW_BinOption("eol")call append("$", "fileformat\tend-of-line format: \"dos\", \"unix\" or \"mac\"")call append("$", "\t(local to buffer)")call OW_Option("ff")call append("$", "fileformats\tlist of file formats to look for when editing a file")call OW_OptionL("ffs", &ffs)call append("$", "textmode\tobsolete, use 'fileformat'")call append("$", "\t(local to buffer)")call OW_BinOption("tx")call append("$", "textauto\tobsolete, use 'fileformats'")call OW_BinOptionL("ta", &ta)call append("$", "write\twriting files is allowed")call OW_BinOptionL("write", &write)call append("$", "writebackup\twrite a backup file before overwriting")call OW_BinOptionL("wb", &wb)call append("$", "backup\tkeep a backup after overwriting a file")call OW_BinOptionL("bk", &bk)call append("$", "backupdir\tlist of directories to put backup files in")call OW_OptionL("bdir", &bdir)call append("$", "backupext\tfile name extension for the backup file")call OW_OptionL("bex", &bex)call append("$", "autowrite\tautomatically write a file when leaving a modified buffer")call OW_BinOptionL("aw", &aw)call append("$", "writeany\talways write without asking for confirmation")call OW_BinOptionL("wa", &wa)call append("$", "patchmode\tkeep oldest version of a file; specifies file name extension")call OW_OptionL("pm", &pm)if !has("msdos") call append("$", "shortname\tuse 8.3 file names") call append("$", "\t(local to buffer)") call OW_BinOption("sn")endifcall OW_Header("the swap file")call append("$", "directory\tlist of directories for the swap file")call OW_OptionL("dir", &dir)call append("$", "swapfile\tuse a swap file for this buffer")call append("$", "\t(local to buffer)")call OW_BinOption("swf")call append("$", "swapsync\t\"sync\", \"fsync\" or empty; how to flush a swap file to disk")call OW_OptionL("sws", &sws)call append("$", "updatecount\tnumber of characters typed to cause a swap file update")call append("$", "set uc=" . &uc)call append("$", "updatetime\ttime in msec after which the swap file will be updated")call append("$", "set ut=" . &ut)call append("$", "maxmem\tmaximum amount of memory in Kbyte used for one buffer")call append("$", "set mm=" . &mm)call append("$", "maxmemtot\tmaximum amount of memory in Kbyte used for all buffers")call append("$", "set mmt=" . &mmt)call OW_Header("command line editing")call append("$", "history\thow many command lines are remembered ")call append("$", "set hi=" . &hi)call append("$", "wildchar\tkey that triggers command-line expansion")call append("$", "set wc=" . &wc)call append("$", "wildcharm\tlike 'wildchar' but can also be used in a mapping")call append("$", "set wcm=" . &wcm)call append("$", "wildmode\tspecifies how command line completion works")call OW_OptionL("wim", &wim)call append("$", "suffixes\tlist of file name extensions that have a lower priority")call OW_OptionL("su", &su)if has("wildignore") call append("$", "wildignore\tlist of patterns to ignore files for file name completion") call OW_OptionL("wig", &wig)endifif has("wildmenu") call append("$", "wildmenu\tcommand-line completion shows a list of matches") call OW_BinOptionL("wmnu", &wmnu)endifcall OW_Header("executing external commands")call append("$", "shell\tname of the shell program used for external commands")call OW_OptionL("sh", &sh)if has("amiga") call append("$", "shelltype\twhen to use the shell or directly execute a command") call append("$", "set st=" . &st)endifcall append("$", "shellquote\tcharacter(s) to enclose a shell command in")call OW_OptionL("shq", &shq)call append("$", "shellxquote\tlike 'shellquote' but include the redirection")call OW_OptionL("sxq", &sxq)call append("$", "shellcmdflag\targument for 'shell' to execute a command")call OW_OptionL("shcf", &shcf)call append("$", "shellredir\tused to redirect command output to a file")call OW_OptionL("srr", &srr)call append("$", "equalprg\tprogram used for \"=\" command")call OW_OptionL("ep", &ep)call append("$", "formatprg\tprogram used to format lines with \"gq\" command")call OW_OptionL("fp", &fp)call append("$", "keywordprg\tprogram used for the \"K\" command")call OW_OptionL("kp", &kp)call append("$", "warn\twarn when using a shell command and a buffer has changes")call OW_BinOptionL("warn", &warn)if has("quickfix") call OW_Header("running make and jumping to errors") call append("$", "errorfile\tname of the file that contains error messages") call OW_OptionL("ef", &ef) call append("$", "errorformat\tlist of formats for error messages") call OW_OptionL("efm", &efm) call append("$", "makeprg\tprogram used for the \":make\" command") call OW_OptionL("mp", &mp) call append("$", "shellpipe\tstring used to put the output of \":make\" in the error file") call OW_OptionL("sp", &sp) call append("$", "makeef\tname of the errorfile for the 'makeprg' command") call OW_OptionL("mef", &mef) call append("$", "grepprg\tprogram used for the \":grep\" command") call OW_OptionL("gp", &gp) call append("$", "grepformat\tlist of formats for output of 'grepprg'") call OW_OptionL("gfm", &gfm)endifif has("msdos") || has("osfiletype") call OW_Header("system specific") if has("msdos") call append("$", "bioskey\tcall the BIOS to get a keyoard character") call OW_BinOptionL("biosk", &biosk) call append("$", "conskey\tuse direct console I/O to get a keyboard character") call OW_BinOptionL("consk", &consk) endif if has("osfiletype") call append("$", "osfiletype\tOS-specific information about the type of file") call append("$", "\t(local to buffer)") call OW_Option("oft") endifendifcall OW_Header("language specific")call append("$", "isfname\tspecifies the characters in a file name")call OW_OptionL("isf", &isf)call append("$", "isident\tspecifies the characters in an identifier")call OW_OptionL("isi", &isi)call append("$", "iskeyword\tspecifies the characters in a keyword")call append("$", "\t(local to buffer)")call OW_Option("isk")call append("$", "isprint\tspecifies printable characters")call OW_OptionL("isp", &isp)if has("rightleft") call append("$", "rightleft\tdisplay the buffer right-to-left") call append("$", "\t(local to window)") call OW_BinOption("rl") call append("$", "revins\tInsert characters backwards") call OW_BinOptionL("ri", &ri) call append("$", "allowrevins\tAllow CTRL-_ in Insert and Command-line mode to toggle 'revins'") call OW_BinOptionL("ari", &ari) call append("$", "aleph\tthe ASCII code for the first letter of the Hebrew alphabet") call append("$", "set al=" . &al) call append("$", "hkmap\tuse Hebrew keyboard mapping") call OW_BinOptionL("hk", &hk) call append("$", "hkmapp\tuse phonetic Hebrew keyboard mapping") call OW_BinOptionL("hkp", &hkp)endifif has("farsi") call append("$", "altkeymap\tuse Farsi as the second language when 'revins' is set") call OW_BinOptionL("akm", &akm) call append("$", "fkmap\tuse Farsi keyboard mapping") call OW_BinOptionL("fk", &fk)endifif has("multi_byte") call append("$", "fileencoding\tcharacter encoding of the file: \"ansi\", \"japan\"") call append("$", "\t\"korea\", \"prc\" or \"taiwan\"") call append("$", "\t(local to buffer)") call OW_Option("fe")endifif has("langmap") call append("$", "langmap\ttranslate characters for Command mode") call OW_OptionL("lmap", &lmap)endifcall OW_Header("various")if has("autocmd") call append("$", "eventignore\tlist of autocommand events which are to be ignored") call OW_OptionL("ei", &ei)endifcall append("$", "exrc\tenable reading .vimrc/.exrc/.gvimrc in the current directory")call OW_BinOptionL("ex", &ex)call append("$", "secure\tsafer working with script files in the current directory")call OW_BinOptionL("secure", &secure)call append("$", "gdefault\tuse the 'g' flag for \":substitute\"")call OW_BinOptionL("gd", &gd)call append("$", "edcompatible\t'g' and 'c' flags of \":substitute\" toggle")call OW_BinOptionL("ed", &ed) call append("$", "maxfuncdepth\tmaximum depth of function calls") call append("$", "set mfd=" . &mfd)if has("mksession") call append("$", "sessionoptions\tlist of words that specifies what to put in a session file") call OW_OptionL("ssop", &ssop)endifif has("viminfo") call append("$", "viminfo\tlist that specifies what to write in the viminfo file") call OW_OptionL("vi", &vi)endiflet &cpo = """ go to first line1" reset 'modified', so that ":q" can be used to close the windowset nomodifiedif has("syntax") " Use Vim highlighting, with some additional stuff set ft=vim syn match optwinHeader "^ \=[0-9].*" syn match optwinName "^[a-z]*\t" nextgroup=optwinComment syn match optwinComment ".*" contained syn match optwinComment "^\t.*" if !exists("did_optwin_syntax_inits") let did_optwin_syntax_inits = 1 hi link optwinHeader Title hi link optwinName Identifier hi link optwinComment Comment endifendif" Install autocommands to enable mappings in option-windowaugroup optwin au! au BufEnter option-window call OW_enter() au BufLeave option-window call OW_leave() au BufUnload,BufHidden option-window nested call OW_unload() | \ delfun OW_unloadaugroup ENDfun! OW_enter() let cpo_save = &cpo let &cpo = "" " save existing mappings let g:OW_mappings = "" call OW_mapsave("<CR>", "n") call OW_mapsave("<CR>", "i") call OW_mapsave("<Space>", "n") call OW_mapsave("<Space>", "i") noremap <CR> :call OW_CR()<CR><C-\><C-N>:echo<CR> inoremap <CR> <Esc>:call OW_CR()<CR>:echo<CR> noremap <Space> :call OW_Space()<CR>:echo<CR> inoremap <Space> <Esc>:call OW_Space()<CR>:echo<CR> let &cpo = cpo_saveendfunfun! OW_mapsave(map, mode) let m = maparg(a:map, a:mode) if m != "" let m = escape(m, '\|') let g:OW_mappings = g:OW_mappings . ":".a:mode."map ".a:map." ".m."|" endifendfunfun! OW_leave() let cpo_save = &cpo let &cpo = "" if mapcheck("<CR>") != "" unmap <CR> iunmap <CR> unmap <Space> iunmap <Space> endif if exists("g:OW_mappings") exe g:OW_mappings unlet g:OW_mappings endif let &cpo = cpo_saveendfunfun! OW_unload() delfun OW_CR delfun OW_Space delfun OW_Find delfun OW_Update delfun OW_Option delfun OW_OptionL delfun OW_BinOption delfun OW_BinOptionL delfun OW_Header au! optwin bdel! option-window delfun OW_enter delfun OW_leave delfun OW_mapsaveendfun" Execute the enter autocommands now, to enable the mappingsdoau optwin BufEnter" Restore the previous value of 'title' and 'icon'.let &title = old_titlelet &icon = old_iconlet &ru = old_rulet &sc = old_sclet &cpo = optwin_cpo_saveunlet optwin_cpo_save OW_idx OW_lnum old_title old_icon old_ru old_sc
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -