Merge pull request #14424 from janlazo/vim-8.1.1726

vim-patch:8.1.1726,8.2.{296,860,1827,2388,2788,2790,2801}
This commit is contained in:
Jan Edmund Lazo 2021-05-04 19:18:16 -04:00 committed by GitHub
commit 4ad30f775e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
417 changed files with 38321 additions and 11226 deletions

1
.gitignore vendored
View File

@ -30,6 +30,7 @@ compile_commands.json
# Generated by scripts/vim-patch.sh
/.vim-src
*.rej
# Generated by old (Vim) tests.
/src/nvim/testdir/del

View File

@ -1,13 +1,13 @@
" Vim completion script
" Language: C
" Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2018 Aug 20
" Last Change: 2020 Nov 14
let s:cpo_save = &cpo
set cpo&vim
" This function is used for the 'omnifunc' option.
function! ccomplete#Complete(findstart, base)
func ccomplete#Complete(findstart, base)
if a:findstart
" Locate the start of the item, including ".", "->" and "[...]".
let line = getline('.')
@ -244,7 +244,7 @@ function! ccomplete#Complete(findstart, base)
return map(res, 's:Tagline2item(v:val, brackets)')
endfunc
function! s:GetAddition(line, match, memarg, bracket)
func s:GetAddition(line, match, memarg, bracket)
" Guess if the item is an array.
if a:bracket && match(a:line, a:match . '\s*\[') > 0
return '['
@ -260,13 +260,13 @@ function! s:GetAddition(line, match, memarg, bracket)
endif
endif
return ''
endfunction
endfunc
" Turn the tag info "val" into an item for completion.
" "val" is is an item in the list returned by taglist().
" If it is a variable we may add "." or "->". Don't do it for other types,
" such as a typedef, by not including the info that s:GetAddition() uses.
function! s:Tag2item(val)
func s:Tag2item(val)
let res = {'match': a:val['name']}
let res['extra'] = s:Tagcmd2extra(a:val['cmd'], a:val['name'], a:val['filename'])
@ -289,10 +289,10 @@ function! s:Tag2item(val)
endif
return res
endfunction
endfunc
" Use all the items in dictionary for the "info" entry.
function! s:Dict2info(dict)
func s:Dict2info(dict)
let info = ''
for k in sort(keys(a:dict))
let info .= k . repeat(' ', 10 - len(k))
@ -307,7 +307,7 @@ function! s:Dict2info(dict)
endfunc
" Parse a tag line and return a dictionary with items like taglist()
function! s:ParseTagline(line)
func s:ParseTagline(line)
let l = split(a:line, "\t")
let d = {}
if len(l) >= 3
@ -334,12 +334,12 @@ function! s:ParseTagline(line)
endif
return d
endfunction
endfunc
" Turn a match item "val" into an item for completion.
" "val['match']" is the matching item.
" "val['tagline']" is the tagline in which the last part was found.
function! s:Tagline2item(val, brackets)
func s:Tagline2item(val, brackets)
let line = a:val['tagline']
let add = s:GetAddition(line, a:val['match'], [a:val], a:brackets == '')
let res = {'word': a:val['match'] . a:brackets . add }
@ -377,10 +377,10 @@ function! s:Tagline2item(val, brackets)
let res['menu'] = s:Tagcmd2extra(s, a:val['match'], matchstr(line, '[^\t]*\t\zs[^\t]*\ze\t'))
endif
return res
endfunction
endfunc
" Turn a command from a tag line to something that is useful in the menu
function! s:Tagcmd2extra(cmd, name, fname)
func s:Tagcmd2extra(cmd, name, fname)
if a:cmd =~ '^/^'
" The command is a search command, useful to see what it is.
let x = matchstr(a:cmd, '^/^\s*\zs.*\ze$/')
@ -395,13 +395,13 @@ function! s:Tagcmd2extra(cmd, name, fname)
let x = a:cmd . ' - ' . a:fname
endif
return x
endfunction
endfunc
" Find composing type in "lead" and match items[0] with it.
" Repeat this recursively for items[1], if it's there.
" When resolving typedefs "depth" is used to avoid infinite recursion.
" Return the list of matches.
function! s:Nextitem(lead, items, depth, all)
func s:Nextitem(lead, items, depth, all)
" Use the text up to the variable name and split it in tokens.
let tokens = split(a:lead, '\s\+\|\<')
@ -485,7 +485,7 @@ function! s:Nextitem(lead, items, depth, all)
endfor
return res
endfunction
endfunc
" Search for members of structure "typename" in tags files.
@ -493,7 +493,7 @@ endfunction
" Each match is a dictionary with "match" and "tagline" entries.
" When "all" is non-zero find all, otherwise just return 1 if there is any
" member.
function! s:StructMembers(typename, items, all)
func s:StructMembers(typename, items, all)
" Todo: What about local structures?
let fnames = join(map(tagfiles(), 'escape(v:val, " \\#%")'))
if fnames == ''
@ -586,12 +586,12 @@ function! s:StructMembers(typename, items, all)
" Failed to find anything.
return []
endfunction
endfunc
" For matching members, find matches for following items.
" When "all" is non-zero find all, otherwise just return 1 if there is any
" member.
function! s:SearchMembers(matches, items, all)
func s:SearchMembers(matches, items, all)
let res = []
for i in range(len(a:matches))
let typename = ''
@ -635,3 +635,5 @@ endfunc
let &cpo = s:cpo_save
unlet s:cpo_save
" vim: noet sw=2 sts=2

File diff suppressed because one or more lines are too long

View File

@ -25,7 +25,7 @@ function decada#Unit_Name () dict " {{{1
" Convert filename into acs unit:
" 1: remove the file extenstion.
" 2: replace all double '_' or '-' with an dot (which denotes a separate)
" 3: remove a trailing '_' (wich denotes a specification)
" 3: remove a trailing '_' (which denotes a specification)
return substitute (substitute (expand ("%:t:r"), '__\|-', ".", "g"), '_$', "", '')
endfunction decada#Unit_Name " }}}1

View File

@ -1,7 +1,7 @@
" Vim functions for file type detection
"
" Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2019 Mar 08
" Last Change: 2020 Aug 17
" These functions are moved here from runtime/filetype.vim to make startup
" faster.
@ -298,7 +298,7 @@ endfunc
func dist#ft#FTmms()
let n = 1
while n < 10
while n < 20
let line = getline(n)
if line =~ '^\s*\(%\|//\)' || line =~ '^\*'
setf mmix
@ -325,7 +325,7 @@ endfunc
func dist#ft#FTmm()
let n = 1
while n < 10
while n < 20
let line = getline(n)
if line =~ '^\s*\(#\s*\(include\|import\)\>\|@import\>\|/\*\)'
setf objcpp

View File

@ -1,7 +1,7 @@
" Vim completion script
" Language: HTML and XHTML
" Maintainer: Mikolaj Machowski ( mikmach AT wp DOT pl )
" Last Change: 2014 Jun 20
" Last Change: 2019 Sep 27
" Distinguish between HTML versions.
" To use with other HTML versions add another "elseif" condition to match
@ -245,7 +245,8 @@ function! htmlcomplete#CompleteTags(findstart, base)
" If context contains white space it is attribute.
" It can be also value of attribute.
" We have to get first word to offer proper completions
if context == ''
if context =~ '^\s*$'
" empty or whitespace line
let tag = ''
else
let tag = split(context)[0]

View File

@ -252,11 +252,11 @@ function! s:verify_exists(sect, name) abort
if !empty($MANSECT)
try
let MANSECT = $MANSECT
unset $MANSECT
call setenv('MANSECT', v:null)
return s:get_path('', a:name)
catch /^command error (/
finally
let $MANSECT = MANSECT
call setenv('MANSECT', MANSECT)
endtry
endif

View File

@ -1,7 +1,7 @@
" netrw.vim: Handles file transfer and remote directory listing across
" AUTOLOAD SECTION
" Date: Jan 07, 2020
" Version: 168
" Date: Sep 18, 2020
" Version: 170
" Maintainer: Charles E Campbell <NcampObell@SdrPchip.AorgM-NOSPAM>
" GetLatestVimScripts: 1075 1 :AutoInstall: netrw.vim
" Copyright: Copyright (C) 2016 Charles E. Campbell {{{1
@ -43,7 +43,7 @@ if exists("s:needspatches")
endfor
endif
let g:loaded_netrw = "v168"
let g:loaded_netrw = "v170"
if !exists("s:NOTE")
let s:NOTE = 0
let s:WARNING = 1
@ -86,7 +86,16 @@ fun! netrw#ErrorMsg(level,msg,errnum)
endif
" call Decho("level=".level,'~'.expand("<slnum>"))
if g:netrw_use_errorwindow
if g:netrw_use_errorwindow == 2 && (v:version > 802 || (v:version == 802 && has("patch486")))
" use popup window
if type(a:msg) == 3
let msg = [level]+a:msg
else
let msg= level.a:msg
endif
let s:popuperr_id = popup_beval(msg,{})
let s:popuperr_text= ""
elseif g:netrw_use_errorwindow
" (default) netrw creates a one-line window to show error/warning
" messages (reliably displayed)
@ -203,7 +212,11 @@ let g:netrw_localrmdiropt = ""
" ---------------------------------------------------------------------
" Default values for netrw's global protocol variables {{{2
call s:NetrwInit("g:netrw_use_errorwindow",1)
if (v:version > 802 || (v:version == 802 && has("patch486"))) && has("balloon_eval") && !exists("s:initbeval") && !exists("g:netrw_nobeval") && has("syntax") && exists("g:syntax_on") && has("mouse")
call s:NetrwInit("g:netrw_use_errorwindow",2)
else
call s:NetrwInit("g:netrw_use_errorwindow",1)
endif
if !exists("g:netrw_dav_cmd")
if executable("cadaver")
@ -559,6 +572,7 @@ call s:NetrwInit("s:netrw_posn",'{}')
if v:version >= 700 && has("balloon_eval") && !exists("s:initbeval") && !exists("g:netrw_nobeval") && has("syntax") && exists("g:syntax_on")
" call Decho("installed beval events",'~'.expand("<slnum>"))
let &l:bexpr = "netrw#BalloonHelp()"
" call Decho("&l:bexpr<".&l:bexpr."> buf#".bufnr())
au FileType netrw setl beval
au WinLeave * if &ft == "netrw" && exists("s:initbeval")|let &beval= s:initbeval|endif
au VimEnter * let s:initbeval= &beval
@ -591,7 +605,18 @@ if v:version >= 700 && has("balloon_eval") && has("syntax") && exists("g:syntax_
if &ft != "netrw"
return ""
endif
if !exists("w:netrw_bannercnt") || v:beval_lnum >= w:netrw_bannercnt || (exists("g:netrw_nobeval") && g:netrw_nobeval)
if exists("s:popuperr_id") && popup_getpos(s:popuperr_id) != {}
" popup error window is still showing
" s:pouperr_id and s:popuperr_text are set up in netrw#ErrorMsg()
if exists("s:popuperr_text") && s:popuperr_text != "" && v:beval_text != s:popuperr_text
" text under mouse hasn't changed; only close window when it changes
call popup_close(s:popuperr_id)
unlet s:popuperr_text
else
let s:popuperr_text= v:beval_text
endif
let mesg= ""
elseif !exists("w:netrw_bannercnt") || v:beval_lnum >= w:netrw_bannercnt || (exists("g:netrw_nobeval") && g:netrw_nobeval)
let mesg= ""
elseif v:beval_text == "Netrw" || v:beval_text == "Directory" || v:beval_text == "Listing"
let mesg = "i: thin-long-wide-tree gh: quick hide/unhide of dot-files qf: quick file info %:open new file"
@ -1212,6 +1237,10 @@ fun! netrw#Lexplore(count,rightside,...)
setlocal winfixwidth
let g:netrw_altv = keep_altv
let t:netrw_lexbufnr = bufnr("%")
" done to prevent build-up of hidden buffers due to quitting and re-invocation of :Lexplore.
" Since the intended use of :Lexplore is to have an always-present explorer window, the extra
" effort to mis-use :Lex is warranted.
set bh=wipe
" call Decho("let t:netrw_lexbufnr=".t:netrw_lexbufnr)
" call Decho("t:netrw_lexposn".(exists("t:netrw_lexposn")? string(t:netrw_lexposn) : " n/a"))
if exists("t:netrw_lexposn")
@ -1864,7 +1893,7 @@ fun! s:NetrwRestoreSetting(keepvar,setting)
if type(a:setting) == 0
exe "let ".a:setting."= ".keepvarval
elseif type(a:setting) == 1
exe "let ".a:setting."= '".keepvarval."'"
exe "let ".a:setting."= '".substitute(keepvarval,"'","''","g")."'"
else
call netrw#ErrorMsg(s:ERROR,"(s:NetrwRestoreSetting) doesn't know how to restore ".a:keepvar." with a setting of type#".type(a:setting),105)
endif
@ -3596,6 +3625,8 @@ fun! s:NetrwBookHistSave()
let savefile= s:NetrwHome()."/.netrwhist"
" call Decho("savefile<".savefile.">",'~'.expand("<slnum>"))
1split
" setting up a new buffer which will become .netrwhist
call s:NetrwEnew()
" call Decho("case g:netrw_use_noswf=".g:netrw_use_noswf.(exists("+acd")? " +acd" : " -acd"),'~'.expand("<slnum>"))
if g:netrw_use_noswf
@ -4678,7 +4709,7 @@ endfun
" "new directory name" is actually a file,
" NetrwBrowseChgDir() edits the file.
fun! s:NetrwBrowseChgDir(islocal,newdir,...)
" call Dfunc("s:NetrwBrowseChgDir(islocal=".a:islocal."> newdir<".a:newdir.">) a:0=".a:0." curpos<".string(getpos("."))."> b:netrw_curdir<".(exists("b:netrw_curdir")? b:netrw_curdir : "").">")
" call Dfunc("s:NetrwBrowseChgDir(islocal=".a:islocal."> newdir<".a:newdir.">) a:0=".a:0." win#".winnr()." curpos<".string(getpos("."))."> b:netrw_curdir<".(exists("b:netrw_curdir")? b:netrw_curdir : "").">")
" call Decho("tab#".tabpagenr()." win#".winnr()." buf#".bufnr("%")."<".bufname("%")."> line#".line(".")." col#".col(".")." winline#".winline()." wincol#".wincol(),'~'.expand("<slnum>"))
let ykeep= @@
@ -4707,13 +4738,14 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...)
let newdir = a:newdir
let dolockout = 0
let dorestore = 1
" call Decho("win#".winnr(),'~'.expand("<slnum>"))
" call Decho("dirname<".dirname.">",'~'.expand("<slnum>"))
" call Decho("newdir<".newdir.">",'~'.expand("<slnum>"))
" ignore <cr>s when done in the banner
" call Decho('(s:NetrwBrowseChgDir) ignore [return]s when done in banner (g:netrw_banner='.g:netrw_banner.")",'~'.expand("<slnum>"))
if g:netrw_banner
" call Decho("w:netrw_bannercnt=".(exists("w:netrw_bannercnt")? w:netrw_bannercnt : 'n/a')." line(.)#".line('.')." line($)#".line("#"),'~'.expand("<slnum>"))
" call Decho("win#".winnr()." w:netrw_bannercnt=".(exists("w:netrw_bannercnt")? w:netrw_bannercnt : 'n/a')." line(.)#".line('.')." line($)#".line("#"),'~'.expand("<slnum>"))
if exists("w:netrw_bannercnt") && line(".") < w:netrw_bannercnt && line("$") >= w:netrw_bannercnt
if getline(".") =~# 'Quick Help'
" call Decho("#1: quickhelp=".g:netrw_quickhelp." ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)",'~'.expand("<slnum>"))
@ -4750,7 +4782,7 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...)
" ------------------------------
" NetrwBrowseChgDir: edit a file {{{3
" ------------------------------
" call Decho('(s:NetrwBrowseChgDir) edit-a-file: case "handling a file": newdir<'.newdir.'> !~ dirpat<'.dirpat.">",'~'.expand("<slnum>"))
" call Decho('edit-a-file: case "handling a file": win#'.winnr().' newdir<'.newdir.'> !~ dirpat<'.dirpat.">",'~'.expand("<slnum>"))
" save position for benefit of Rexplore
let s:rexposn_{bufnr("%")}= winsaveview()
@ -4785,7 +4817,7 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...)
NetrwKeepj call s:NetrwOptionsRestore("s:")
let curdir= b:netrw_curdir
if !exists("s:didsplit")
" call Decho("edit-a-file: s:didsplit does not exist; g:netrw_browse_split=".string(g:netrw_browse_split)." win#".winnr(),'~'.expand("<slnum>"))
" " call Decho("edit-a-file: s:didsplit does not exist; g:netrw_browse_split=".string(g:netrw_browse_split)." win#".winnr()." g:netrw_chgwin=".g:netrw_chgwin",'~'.expand("<slnum>"))
if type(g:netrw_browse_split) == 3
" open file in server
" Note that g:netrw_browse_split is a List: [servername,tabnr,winnr]
@ -4793,22 +4825,27 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...)
call s:NetrwServerEdit(a:islocal,dirname)
" call Dret("s:NetrwBrowseChgDir")
return
elseif g:netrw_browse_split == 1
" horizontally splitting the window first
" call Decho("edit-a-file: horizontally splitting window prior to edit",'~'.expand("<slnum>"))
keepalt new
let winsz= (g:netrw_winsize > 0)? (g:netrw_winsize*winheight(0))/100 : -g:netrw_winsize
exe "keepalt ".(g:netrw_alto? "bel " : "abo ").winsz."wincmd s"
if !&ea
keepalt wincmd _
endif
call s:SetRexDir(a:islocal,curdir)
elseif g:netrw_browse_split == 2
" vertically splitting the window first
" call Decho("edit-a-file: vertically splitting window prior to edit",'~'.expand("<slnum>"))
keepalt rightb vert new
let winsz= (g:netrw_winsize > 0)? (g:netrw_winsize*winwidth(0))/100 : -g:netrw_winsize
exe "keepalt ".(g:netrw_alto? "top " : "bot ")."vert ".winsz."wincmd s"
if !&ea
keepalt wincmd |
endif
call s:SetRexDir(a:islocal,curdir)
elseif g:netrw_browse_split == 3
" open file in new tab
" call Decho("edit-a-file: opening new tab prior to edit",'~'.expand("<slnum>"))
@ -4817,6 +4854,7 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...)
let b:netrw_curdir= getcwd()
endif
call s:SetRexDir(a:islocal,curdir)
elseif g:netrw_browse_split == 4
" act like "P" (ie. open previous window)
" call Decho("edit-a-file: use previous window for edit",'~'.expand("<slnum>"))
@ -4826,13 +4864,14 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...)
return
endif
call s:SetRexDir(a:islocal,curdir)
else
" handling a file, didn't split, so remove menu
" call Decho("edit-a-file: handling a file+didn't split, so remove menu",'~'.expand("<slnum>"))
call s:NetrwMenu(0)
" optional change to window
if g:netrw_chgwin >= 1
" call Decho("edit-a-file: changing window to #".g:netrw_chgwin,'~'.expand("<slnum>"))
" call Decho("edit-a-file: changing window to #".g:netrw_chgwin.": (due to g:netrw_chgwin)",'~'.expand("<slnum>"))
if winnr("$")+1 == g:netrw_chgwin
" if g:netrw_chgwin is set to one more than the last window, then
" vertically split the last window to make that window available.
@ -4845,19 +4884,26 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...)
endif
call s:SetRexDir(a:islocal,curdir)
endif
endif
" the point where netrw actually edits the (local) file
" if its local only: LocalBrowseCheck() doesn't edit a file, but NetrwBrowse() will
" no keepalt to support :e # to return to a directory listing
if !&mod
" if e the new file would fail due to &mod, then don't change any of the flags
let dolockout= 1
endif
if a:islocal
" call Decho("edit-a-file: edit local file: exe e! ".fnameescape(dirname),'~'.expand("<slnum>"))
" some like c-^ to return to the last edited file
" others like c-^ to return to the netrw buffer
" Apr 30, 2020: used to have e! here. That can cause loss of a modified file,
" so emit error E37 instead.
if exists("g:netrw_altfile") && g:netrw_altfile
exe "NetrwKeepj keepalt e! ".fnameescape(dirname)
exe "NetrwKeepj keepalt e ".fnameescape(dirname)
else
exe "NetrwKeepj e! ".fnameescape(dirname)
exe "NetrwKeepj e ".fnameescape(dirname)
endif
" call Decho("edit-a-file: after e! ".dirname.": hidden=".&hidden." bufhidden<".&bufhidden."> mod=".&mod,'~'.expand("<slnum>"))
call s:NetrwCursor()
@ -4868,7 +4914,6 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...)
else
" call Decho("edit-a-file: remote file: NetrwBrowse will edit it",'~'.expand("<slnum>"))
endif
let dolockout= 1
" handle g:Netrw_funcref -- call external-to-netrw functions
" This code will handle g:Netrw_funcref as an individual function reference
@ -5332,16 +5377,6 @@ fun! netrw#BrowseX(fname,remote)
endif
let ret= v:shell_error
elseif has("unix") && executable("kfmclient") && s:CheckIfKde()
" call Decho("(netrw#BrowseX) unix and kfmclient",'~'.expand("<slnum>"))
call s:NetrwExe("sil !kfmclient exec ".s:ShellEscape(fname,1)." ".redir)
let ret= v:shell_error
elseif has("unix") && executable("exo-open") && executable("xdg-open") && executable("setsid")
" call Decho("(netrw#BrowseX) unix, exo-open, xdg-open",'~'.expand("<slnum>"))
call s:NetrwExe("sil !setsid xdg-open ".s:ShellEscape(fname,1).redir)
let ret= v:shell_error
elseif has("unix") && $DESKTOP_SESSION == "mate" && executable("atril")
" call Decho("(netrw#BrowseX) unix and atril",'~'.expand("<slnum>"))
if a:fname =~ '^https\=://'
@ -5356,9 +5391,19 @@ fun! netrw#BrowseX(fname,remote)
endif
let ret= v:shell_error
elseif has("unix") && executable("kfmclient") && s:CheckIfKde()
" call Decho("(netrw#BrowseX) unix and kfmclient",'~'.expand("<slnum>"))
call s:NetrwExe("sil !kfmclient exec ".s:ShellEscape(fname,1)." ".redir)
let ret= v:shell_error
elseif has("unix") && executable("exo-open") && executable("xdg-open") && executable("setsid")
" call Decho("(netrw#BrowseX) unix, exo-open, xdg-open",'~'.expand("<slnum>"))
call s:NetrwExe("sil !setsid xdg-open ".s:ShellEscape(fname,1).redir.'&')
let ret= v:shell_error
elseif has("unix") && executable("xdg-open")
" call Decho("(netrw#BrowseX) unix and xdg-open",'~'.expand("<slnum>"))
call s:NetrwExe("sil !xdg-open ".s:ShellEscape(fname,1).redir)
call s:NetrwExe("sil !xdg-open ".s:ShellEscape(fname,1).redir.'&')
let ret= v:shell_error
elseif has("macunix") && executable("open")
@ -6053,10 +6098,10 @@ fun! s:NetrwListHide()
" Duplicate characters don't matter.
" Remove all such characters from the '/~@#...890' string.
" Use the first character left as a separator character.
" call Decho("find a character not in the hide string to use as a separator")
" call Decho("find a character not in the hide string to use as a separator",'~'.expand("<slnum>"))
let listhide= g:netrw_list_hide
let sep = strpart(substitute('~@#$%^&*{};:,<.>?|1234567890','['.escape(listhide,'-]^\').']','','ge'),1,1)
" call Decho("sep=".sep," (sep not in hide string)'~'.expand("<slnum>"))
" call Decho("sep<".sep."> (sep not in hide string)",'~'.expand("<slnum>"))
while listhide != ""
if listhide =~ ','
@ -6066,7 +6111,7 @@ fun! s:NetrwListHide()
let hide = listhide
let listhide = ""
endif
" call Decho("..extracted from listhide: hide<".hide."> g:netrw_sort_by<".g:netrw_sort_by.'>','~'.expand("<slnum>"))
" call Decho("..extracted pattern from listhide: hide<".hide."> g:netrw_sort_by<".g:netrw_sort_by.'>','~'.expand("<slnum>"))
if g:netrw_sort_by =~ '^[ts]'
if hide =~ '^\^'
" call Decho("..modify hide to handle a \"^...\" pattern",'~'.expand("<slnum>"))
@ -6078,7 +6123,7 @@ fun! s:NetrwListHide()
endif
" Prune the list by hiding any files which match
" call Decho("..prune the list by hiding any files which ",((g:netrw_hide == 1)? "" : "don't")." match hide<".hide.">")
" call Decho("..prune the list by hiding any files which ".((g:netrw_hide == 1)? "" : "don't")."match hide<".hide.">")
if g:netrw_hide == 1
" call Decho("..hiding<".hide.">",'~'.expand("<slnum>"))
exe 'sil! NetrwKeepj '.w:netrw_bannercnt.',$g'.sep.hide.sep.'d'
@ -9161,6 +9206,7 @@ endfun
" (full path directory with trailing slash returned)
fun! s:NetrwTreeDir(islocal)
" call Dfunc("s:NetrwTreeDir(islocal=".a:islocal.") getline(".line(".").")"."<".getline('.')."> b:netrw_curdir<".b:netrw_curdir."> tab#".tabpagenr()." win#".winnr()." buf#".bufnr("%")."<".bufname("%")."> ft=".&ft)
" call Decho("Determine tree directory given current cursor position")
" call Decho("g:netrw_keepdir =".(exists("g:netrw_keepdir")? g:netrw_keepdir : 'n/a'),'~'.expand("<slnum>"))
" call Decho("w:netrw_liststyle=".(exists("w:netrw_liststyle")? w:netrw_liststyle : 'n/a'),'~'.expand("<slnum>"))
" call Decho("w:netrw_treetop =".(exists("w:netrw_treetop")? w:netrw_treetop : 'n/a'),'~'.expand("<slnum>"))
@ -9266,7 +9312,6 @@ fun! s:NetrwTreeDisplay(dir,depth)
call setline(line("$")+1,a:depth.shortdir.'/')
endif
" call Decho("setline#".line("$")." shortdir<".a:depth.shortdir.">",'~'.expand("<slnum>"))
" append a / to dir if its missing one
let dir= a:dir
@ -9280,7 +9325,7 @@ fun! s:NetrwTreeDisplay(dir,depth)
let listhide= split(g:netrw_list_hide,',')
" call Decho("listhide=".string(listhide))
for pat in listhide
call filter(w:netrw_treedict[dir],'v:val !~ "'.pat.'"')
call filter(w:netrw_treedict[dir],'v:val !~ "'.escape(pat,'\\').'"')
endfor
elseif g:netrw_hide == 2
@ -9418,6 +9463,7 @@ fun! s:NetrwTreeListing(dirname)
" call Decho("g:netrw_banner=".g:netrw_banner.": banner ".(g:netrw_banner? "enabled" : "suppressed").": (line($)=".line("$")." byte2line(1)=".byte2line(1)." bannercnt=".w:netrw_bannercnt.")",'~'.expand("<slnum>"))
" display from treetop on down
" call Decho("(s:NetrwTreeListing) w:netrw_treetop<".w:netrw_treetop.">")
NetrwKeepj call s:NetrwTreeDisplay(w:netrw_treetop,"")
" call Decho("s:NetrwTreeDisplay) setl noma nomod ro",'~'.expand("<slnum>"))
@ -9678,7 +9724,7 @@ fun! s:PerformListing(islocal)
" Hiding... -or- Showing... {{{3
if g:netrw_banner
" call Decho("--handle hiding/showing (g:netrw_hide=".g:netrw_hide." g:netrw_list_hide<".g:netrw_list_hide.">)",'~'.expand("<slnum>"))
" call Decho("--handle hiding/showing in banner (g:netrw_hide=".g:netrw_hide." g:netrw_list_hide<".g:netrw_list_hide.">)",'~'.expand("<slnum>"))
if g:netrw_list_hide != "" && g:netrw_hide
if g:netrw_hide == 1
NetrwKeepj put ='\" Hiding: '.g:netrw_list_hide
@ -9731,7 +9777,7 @@ fun! s:PerformListing(islocal)
" call Decho("g:netrw_banner=".g:netrw_banner.": banner ".(g:netrw_banner? "enabled" : "suppressed").": (line($)=".line("$")." byte2line(1)=".byte2line(1)." bannercnt=".w:netrw_bannercnt.")",'~'.expand("<slnum>"))
if !g:netrw_banner || line("$") >= w:netrw_bannercnt
" call Decho("manipulate directory listing (hide)",'~'.expand("<slnum>"))
" call Decho("manipulate directory listing (support hide)",'~'.expand("<slnum>"))
" call Decho("g:netrw_hide=".g:netrw_hide." g:netrw_list_hide<".g:netrw_list_hide.">",'~'.expand("<slnum>"))
if g:netrw_hide && g:netrw_list_hide != ""
NetrwKeepj call s:NetrwListHide()
@ -11744,7 +11790,7 @@ endfun
" ---------------------------------------------------------------------
" s:NetrwEnew: opens a new buffer, passes netrw buffer variables through {{{2
fun! s:NetrwEnew(...)
" call Dfunc("s:NetrwEnew() a:0=".a:0." bufnr($)=".bufnr("$")." expand(%)<".expand("%").">")
" call Dfunc("s:NetrwEnew() a:0=".a:0." win#".winnr()." winnr($)=".winnr("$")." bufnr($)=".bufnr("$")." expand(%)<".expand("%").">")
" call Decho("curdir<".((a:0>0)? a:1 : "")."> buf#".bufnr("%")."<".bufname("%").">",'~'.expand("<slnum>"))
" grab a function-local-variable copy of buffer variables
@ -11811,6 +11857,9 @@ fun! s:NetrwEnew(...)
endif
endif
endif
if v:version >= 700 && has("balloon_eval") && !exists("s:initbeval") && !exists("g:netrw_nobeval") && has("syntax") && exists("g:syntax_on")
let &l:bexpr = "netrw#BalloonHelp()"
endif
" call Dret("s:NetrwEnew : buf#".bufnr("%")."<".bufname("%")."> expand(%)<".expand("%")."> expand(#)<".expand("#")."> bh=".&bh." win#".winnr()." winnr($)#".winnr("$"))
endfun
@ -11870,6 +11919,7 @@ endfun
" -1=failed
fun! s:NetrwLcd(newdir)
" call Dfunc("s:NetrwLcd(newdir<".a:newdir.">)")
" call Decho("changing local directory",'~'.expand("<slnum>"))
let err472= 0
try
@ -11905,6 +11955,8 @@ fun! s:NetrwLcd(newdir)
return -1
endif
" call Decho("getcwd <".getcwd().">")
" call Decho("b:netrw_curdir<".b:netrw_curdir.">")
" call Dret("s:NetrwLcd 0")
return 0
endfun

View File

@ -1,8 +1,8 @@
" netrwFileHandlers: contains various extension-based file handlers for
" netrw's browsers' x command ("eXecute launcher")
" Author: Charles E. Campbell
" Date: May 03, 2013
" Version: 11b ASTRO-ONLY
" Date: Sep 18, 2020
" Version: 11
" Copyright: Copyright (C) 1999-2012 Charles E. Campbell {{{1
" Permission is hereby granted to use and distribute this code,
" with or without modifications, provided that this copyright
@ -20,7 +20,7 @@
if exists("g:loaded_netrwFileHandlers") || &cp
finish
endif
let g:loaded_netrwFileHandlers= "v11b"
let g:loaded_netrwFileHandlers= "v11"
if v:version < 702
echohl WarningMsg
echo "***warning*** this version of netrwFileHandlers needs vim 7.2"

View File

@ -1,7 +1,8 @@
"python3complete.vim - Omni Completion for python
" Maintainer: Aaron Griffin <aaronmgriffin@gmail.com>
" Maintainer: <vacancy>
" Previous Maintainer: Aaron Griffin <aaronmgriffin@gmail.com>
" Version: 0.9
" Last Updated: 18 Jun 2009 (small fix 2015 Sep 14 from Debian)
" Last Updated: 2020 Oct 9
"
" Roland Puntaier: this file contains adaptations for python3 and is parallel to pythoncomplete.vim
"
@ -83,7 +84,7 @@ function! python3complete#Complete(findstart, base)
break
endif
endwhile
execute "py3 vimpy3complete('" . cword . "', '" . a:base . "')"
execute "py3 vimpy3complete('" . escape(cword, "'") . "', '" . escape(a:base, "'") . "')"
return g:python3complete_completions
endif
endfunction

View File

@ -1,7 +1,8 @@
"pythoncomplete.vim - Omni Completion for python
" Maintainer: Aaron Griffin <aaronmgriffin@gmail.com>
" Maintainer: <vacancy>
" Previous Maintainer: Aaron Griffin <aaronmgriffin@gmail.com>
" Version: 0.9
" Last Updated: 18 Jun 2009
" Last Updated: 2020 Oct 9
"
" Changes
" TODO:
@ -81,7 +82,7 @@ function! pythoncomplete#Complete(findstart, base)
break
endif
endwhile
execute "python vimcomplete('" . cword . "', '" . a:base . "')"
execute "python vimcomplete('" . escape(cword, "'") . "', '" . escape(a:base, "'") . "')"
return g:pythoncomplete_completions
endif
endfunction

View File

@ -3,7 +3,7 @@
" Maintainer: Mark Guzman <segfault@hasno.info>
" URL: https://github.com/vim-ruby/vim-ruby
" Release Coordinator: Doug Kearns <dougkearns@gmail.com>
" Last Change: 2019 Jan 06
" Last Change: 2019 Feb 25
" ----------------------------------------------------------------------------
"
" Ruby IRB/Complete author: Keiju ISHITSUKA(keiju@ishitsuka.com)
@ -53,6 +53,23 @@ if !exists("g:rubycomplete_include_objectspace")
endif
" }}} configuration failsafe initialization
" {{{ regex patterns
" Regex that defines the start-match for the 'end' keyword.
let s:end_start_regex =
\ '\C\%(^\s*\|[=,*/%+\-|;{]\|<<\|>>\|:\s\)\s*\zs' .
\ '\<\%(module\|class\|if\|for\|while\|until\|case\|unless\|begin' .
\ '\|\%(\K\k*[!?]\?\s\+\)\=def\):\@!\>' .
\ '\|\%(^\|[^.:@$]\)\@<=\<do:\@!\>'
" Regex that defines the middle-match for the 'end' keyword.
let s:end_middle_regex = '\<\%(ensure\|else\|\%(\%(^\|;\)\s*\)\@<=\<rescue:\@!\>\|when\|elsif\):\@!\>'
" Regex that defines the end-match for the 'end' keyword.
let s:end_end_regex = '\%(^\|[^.:@$]\)\@<=\<end:\@!\>'
" }}} regex patterns
" {{{ vim-side support functions
let s:rubycomplete_debug = 0
@ -103,7 +120,7 @@ function! s:GetBufferRubyEntity( name, type, ... )
endif
let curpos = getpos(".")
let [enum,ecol] = searchpairpos( crex, '', '\(end\|}\)', 'W' )
let [enum,ecol] = searchpairpos( s:end_start_regex, s:end_middle_regex, s:end_end_regex, 'W' )
call cursor(lastpos[1], lastpos[2])
if lnum > enum
@ -128,19 +145,28 @@ function! s:IsPosInClassDef(pos)
return ret
endfunction
function! s:IsInComment(pos)
let stack = synstack(a:pos[0], a:pos[1])
if !empty(stack)
return synIDattr(stack[0], 'name') =~ 'ruby\%(.*Comment\|Documentation\)'
else
return 0
endif
endfunction
function! s:GetRubyVarType(v)
let stopline = 1
let vtp = ''
let pos = getpos('.')
let curpos = getpos('.')
let sstr = '^\s*#\s*@var\s*'.escape(a:v, '*').'\>\s\+[^ \t]\+\s*$'
let [lnum,lcol] = searchpos(sstr,'nb',stopline)
if lnum != 0 && lcol != 0
call setpos('.',pos)
call setpos('.',curpos)
let str = getline(lnum)
let vtp = substitute(str,sstr,'\1','')
return vtp
endif
call setpos('.',pos)
call setpos('.',curpos)
let ctors = '\(now\|new\|open\|get_instance'
if exists('g:rubycomplete_rails') && g:rubycomplete_rails == 1 && s:rubycomplete_rails_loaded == 1
let ctors = ctors.'\|find\|create'
@ -150,9 +176,13 @@ function! s:GetRubyVarType(v)
let fstr = '=\s*\([^ \t]\+.' . ctors .'\>\|[\[{"''/]\|%[xwQqr][(\[{@]\|[A-Za-z0-9@:\-()\.]\+...\?\|lambda\|&\)'
let sstr = ''.escape(a:v, '*').'\>\s*[+\-*/]*'.fstr
let [lnum,lcol] = searchpos(sstr,'nb',stopline)
if lnum != 0 && lcol != 0
let str = matchstr(getline(lnum),fstr,lcol)
let pos = searchpos(sstr,'bW')
while pos != [0,0] && s:IsInComment(pos)
let pos = searchpos(sstr,'bW')
endwhile
if pos != [0,0]
let [lnum, col] = pos
let str = matchstr(getline(lnum),fstr,col)
let str = substitute(str,'^=\s*','','')
call setpos('.',pos)
@ -174,7 +204,7 @@ function! s:GetRubyVarType(v)
end
return ''
endif
call setpos('.',pos)
call setpos('.',curpos)
return ''
endfunction
@ -671,11 +701,10 @@ class VimRubyCompletion
methods.delete_if { |c| c.match( /'/ ) }
end
when /^::([A-Z][^:\.\(]*)$/ # Absolute Constant or class methods
when /^::([A-Z][^:\.\(]*)?$/ # Absolute Constant or class methods
dprint "const or cls"
receiver = $1
methods = Object.constants
methods.grep(/^#{receiver}/).collect{|e| "::" + e}
methods = Object.constants.collect{ |c| c.to_s }.grep(/^#{receiver}/)
when /^(((::)?[A-Z][^:.\(]*)+?)::?([^:.]*)$/ # Constant or class methods
receiver = $1
@ -684,13 +713,13 @@ class VimRubyCompletion
load_buffer_class( receiver )
load_buffer_module( receiver )
begin
classes = eval("#{receiver}.constants")
#methods = eval("#{receiver}.methods")
constants = eval("#{receiver}.constants").collect{ |c| c.to_s }.grep(/^#{message}/)
methods = eval("#{receiver}.methods").collect{ |m| m.to_s }.grep(/^#{message}/)
rescue Exception
dprint "exception: %s" % $!
constants = []
methods = []
end
methods.grep(/^#{message}/).collect{|e| receiver + "::" + e}
when /^(:[^:.]+)\.([^.]*)$/ # Symbol
dprint "symbol"

View File

@ -1,12 +1,20 @@
" Vim completion script
" Language: All languages, uses existing syntax highlighting rules
" Maintainer: David Fishburn <dfishburn dot vim at gmail dot com>
" Version: 13.0
" Last Change: 2019 Aug 08
" Version: 15.0
" Last Change: 2021 Apr 27
" Usage: For detailed help, ":help ft-syntax-omni"
" History
"
" Version 15.0
" - SyntaxComplete ignored all buffer specific overrides, always used global
" https://github.com/vim/vim/issues/8153
"
" Version 14.0
" - Fixed issue with single quotes and is_keyword
" https://github.com/vim/vim/issues/7463
"
" Version 13.0
" - Extended the option omni_syntax_group_include_{filetype}
" to accept a comma separated list of regex's rather than
@ -38,7 +46,7 @@
" let g:omni_syntax_use_single_byte = 1
" - This by default will only allow single byte ASCII
" characters to be added and an additional check to ensure
" the charater is printable (see documentation for isprint).
" the character is printable (see documentation for isprint).
"
" Version 9.0
" - Add the check for cpo.
@ -86,7 +94,7 @@ endif
if exists('g:loaded_syntax_completion')
finish
endif
let g:loaded_syntax_completion = 130
let g:loaded_syntax_completion = 150
" Turn on support for line continuations when creating the script
let s:cpo_save = &cpo
@ -141,14 +149,10 @@ let s:prepended = ''
" This function is used for the 'omnifunc' option.
function! syntaxcomplete#Complete(findstart, base)
" Only display items in the completion window that are at least
" this many characters in length
if !exists('b:omni_syntax_ignorecase')
if exists('g:omni_syntax_ignorecase')
let b:omni_syntax_ignorecase = g:omni_syntax_ignorecase
else
let b:omni_syntax_ignorecase = &ignorecase
endif
" Allow user to override ignorecase per buffer
let l:omni_syntax_ignorecase = g:omni_syntax_ignorecase
if exists('b:omni_syntax_ignorecase')
let l:omni_syntax_ignorecase = b:omni_syntax_ignorecase
endif
if a:findstart
@ -179,7 +183,7 @@ function! syntaxcomplete#Complete(findstart, base)
endif
" let base = s:prepended . a:base
let base = s:prepended
let base = substitute(s:prepended, "'", "''", 'g')
let filetype = substitute(&filetype, '\.', '_', 'g')
let list_idx = index(s:cache_name, filetype, 0, &ignorecase)
@ -195,13 +199,13 @@ function! syntaxcomplete#Complete(findstart, base)
if base != ''
" let compstr = join(compl_list, ' ')
" let expr = (b:omni_syntax_ignorecase==0?'\C':'').'\<\%('.base.'\)\@!\w\+\s*'
" let expr = (l:omni_syntax_ignorecase==0?'\C':'').'\<\%('.base.'\)\@!\w\+\s*'
" let compstr = substitute(compstr, expr, '', 'g')
" let compl_list = split(compstr, '\s\+')
" Filter the list based on the first few characters the user
" entered
let expr = 'v:val '.(g:omni_syntax_ignorecase==1?'=~?':'=~#')." '^".escape(base, '\\/.*$^~[]').".*'"
let expr = 'v:val '.(l:omni_syntax_ignorecase==1?'=~?':'=~#')." '^".escape(base, '\\/.*$^~[]').".*'"
let compl_list = filter(deepcopy(compl_list), expr)
endif
@ -222,6 +226,26 @@ function! syntaxcomplete#OmniSyntaxList(...)
endif
endfunc
function! syntaxcomplete#OmniSyntaxClearCache()
let s:cache_name = []
let s:cache_list = []
endfunction
" To retrieve all syntax items regardless of syntax group:
" echo OmniSyntaxList( [] )
"
" To retrieve only the syntax items for the sqlOperator syntax group:
" echo OmniSyntaxList( ['sqlOperator'] )
"
" To retrieve all syntax items for both the sqlOperator and sqlType groups:
" echo OmniSyntaxList( ['sqlOperator', 'sqlType'] )
"
" A regular expression can also be used:
" echo OmniSyntaxList( ['sql\w\+'] )
"
" From within a plugin, you would typically assign the output to a List: >
" let myKeywords = []
" let myKeywords = OmniSyntaxList( ['sqlKeyword'] )
function! OmniSyntaxList(...)
let list_parms = []
if a:0 > 0
@ -239,37 +263,25 @@ function! OmniSyntaxList(...)
" let use_dictionary = a:1
" endif
" Only display items in the completion window that are at least
" this many characters in length
if !exists('b:omni_syntax_use_iskeyword')
if exists('g:omni_syntax_use_iskeyword')
let b:omni_syntax_use_iskeyword = g:omni_syntax_use_iskeyword
else
let b:omni_syntax_use_iskeyword = 1
endif
endif
" Only display items in the completion window that are at least
" this many characters in length
if !exists('b:omni_syntax_minimum_length')
if exists('g:omni_syntax_minimum_length')
let b:omni_syntax_minimum_length = g:omni_syntax_minimum_length
else
let b:omni_syntax_minimum_length = 0
endif
endif
let saveL = @l
let filetype = substitute(&filetype, '\.', '_', 'g')
if empty(list_parms)
" Allow user to override per buffer
if exists('g:omni_syntax_group_include_'.filetype)
let l:omni_syntax_group_include_{filetype} = g:omni_syntax_group_include_{filetype}
endif
if exists('b:omni_syntax_group_include_'.filetype)
let l:omni_syntax_group_include_{filetype} = b:omni_syntax_group_include_{filetype}
endif
" Default the include group to include the requested syntax group
let syntax_group_include_{filetype} = ''
" Check if there are any overrides specified for this filetype
if exists('g:omni_syntax_group_include_'.filetype)
if exists('l:omni_syntax_group_include_'.filetype)
let syntax_group_include_{filetype} =
\ substitute( g:omni_syntax_group_include_{filetype},'\s\+','','g')
let list_parms = split(g:omni_syntax_group_include_{filetype}, ',')
\ substitute( l:omni_syntax_group_include_{filetype},'\s\+','','g')
let list_parms = split(l:omni_syntax_group_include_{filetype}, ',')
if syntax_group_include_{filetype} =~ '\w'
let syntax_group_include_{filetype} =
\ substitute( syntax_group_include_{filetype},
@ -324,11 +336,20 @@ function! OmniSyntaxList(...)
else
" Default the exclude group to nothing
let syntax_group_exclude_{filetype} = ''
" Check if there are any overrides specified for this filetype
" Allow user to override per buffer
if exists('g:omni_syntax_group_exclude_'.filetype)
let l:omni_syntax_group_exclude_{filetype} = g:omni_syntax_group_exclude_{filetype}
endif
if exists('b:omni_syntax_group_exclude_'.filetype)
let l:omni_syntax_group_exclude_{filetype} = b:omni_syntax_group_exclude_{filetype}
endif
" Check if there are any overrides specified for this filetype
if exists('l:omni_syntax_group_exclude_'.filetype)
let syntax_group_exclude_{filetype} =
\ substitute( g:omni_syntax_group_exclude_{filetype},'\s\+','','g')
let list_exclude_groups = split(g:omni_syntax_group_exclude_{filetype}, ',')
\ substitute( l:omni_syntax_group_exclude_{filetype},'\s\+','','g')
let list_exclude_groups = split(l:omni_syntax_group_exclude_{filetype}, ',')
if syntax_group_exclude_{filetype} =~ '\w'
let syntax_group_exclude_{filetype} =
\ substitute( syntax_group_exclude_{filetype},
@ -524,6 +545,30 @@ endfunction
function! s:SyntaxCSyntaxGroupItems( group_name, syntax_full )
" Allow user to override iskeyword per buffer
let l:omni_syntax_use_iskeyword = g:omni_syntax_use_iskeyword
if exists('b:omni_syntax_use_iskeyword')
let l:omni_syntax_use_iskeyword = b:omni_syntax_use_iskeyword
endif
" Allow user to override iskeyword_numeric per buffer
let l:omni_syntax_use_iskeyword_numeric = g:omni_syntax_use_iskeyword_numeric
if exists('b:omni_syntax_use_iskeyword_numeric')
let l:omni_syntax_use_iskeyword_numeric = b:omni_syntax_use_iskeyword_numeric
endif
" Allow user to override iskeyword_numeric per buffer
let l:omni_syntax_use_single_byte = g:omni_syntax_use_single_byte
if exists('b:omni_syntax_use_single_byte')
let l:omni_syntax_use_single_byte = b:omni_syntax_use_single_byte
endif
" Allow user to override minimum_length per buffer
let l:omni_syntax_minimum_length = g:omni_syntax_minimum_length
if exists('b:omni_syntax_minimum_length')
let l:omni_syntax_minimum_length = b:omni_syntax_minimum_length
endif
let syn_list = ""
" From the full syntax listing, strip out the portion for the
@ -642,14 +687,23 @@ function! s:SyntaxCSyntaxGroupItems( group_name, syntax_full )
\ syn_list, '\%(^\|\n\)\@<=\s*\(@\w\+\)'
\ , "", 'g'
\ )
if b:omni_syntax_use_iskeyword == 0
if l:omni_syntax_use_iskeyword == 0
" There are a number of items which have non-word characters in
" them, *'T_F1'*. vim.vim is one such file.
" This will replace non-word characters with spaces.
" setlocal filetype=forth
" let g:omni_syntax_use_iskeyword = 1
" let g:omni_syntax_use_iskeyword_numeric = 1
" You will see entries like
" #>>
" (.local)
" These were found doing a grep in vim82\syntax
" grep iskeyword *
" forth.vim:setlocal iskeyword=!,@,33-35,%,$,38-64,A-Z,91-96,a-z,123-126,128-255
let syn_list = substitute( syn_list, '[^0-9A-Za-z_ ]', ' ', 'g' )
else
if g:omni_syntax_use_iskeyword_numeric == 1
if l:omni_syntax_use_iskeyword_numeric == 1
" iskeyword can contain value like this
" 38,42,43,45,47-58,60-62,64-90,97-122,_,+,-,*,/,%,<,=,>,:,$,?,!,@-@,94
" Numeric values convert to their ASCII equivalent using the
@ -669,7 +723,7 @@ function! s:SyntaxCSyntaxGroupItems( group_name, syntax_full )
" cycle through each character within the range
let [b:start, b:end] = split(item, '-')
for range_item in range( b:start, b:end )
if range_item <= 127 || g:omni_syntax_use_single_byte == 0
if range_item <= 127 || l:omni_syntax_use_single_byte == 0
if nr2char(range_item) =~ '\p'
let accepted_chars = accepted_chars . nr2char(range_item)
endif
@ -677,13 +731,13 @@ function! s:SyntaxCSyntaxGroupItems( group_name, syntax_full )
endfor
elseif item =~ '^\d\+$'
" Only numeric, translate to a character
if item < 127 || g:omni_syntax_use_single_byte == 0
if item < 127 || l:omni_syntax_use_single_byte == 0
if nr2char(item) =~ '\p'
let accepted_chars = accepted_chars . nr2char(item)
endif
endif
else
if char2nr(item) < 127 || g:omni_syntax_use_single_byte == 0
if char2nr(item) < 127 || l:omni_syntax_use_single_byte == 0
if item =~ '\p'
let accepted_chars = accepted_chars . item
endif
@ -719,9 +773,9 @@ function! s:SyntaxCSyntaxGroupItems( group_name, syntax_full )
endif
endif
if b:omni_syntax_minimum_length > 0
if l:omni_syntax_minimum_length > 0
" If the user specified a minimum length, enforce it
let syn_list = substitute(' '.syn_list.' ', ' \S\{,'.b:omni_syntax_minimum_length.'}\ze ', ' ', 'g')
let syn_list = substitute(' '.syn_list.' ', ' \S\{,'.l:omni_syntax_minimum_length.'}\ze ', ' ', 'g')
endif
else
let syn_list = ''
@ -751,5 +805,6 @@ function! OmniSyntaxShowChars(spec)
endfor
return join(map(result, 'nr2char(v:val)'), ', ')
endfunction
let &cpo = s:cpo_save
unlet s:cpo_save

View File

@ -1,6 +1,6 @@
" Vim autoload file for the tohtml plugin.
" Maintainer: Ben Fritz <fritzophrenic@gmail.com>
" Last Change: 2018 Nov 11
" Last Change: 2019 Aug 16
"
" Additional contributors:
"
@ -364,6 +364,7 @@ func! tohtml#Diff2HTML(win_list, buf_list) "{{{
let body_line = ''
let html = []
let s:html5 = 0
if s:settings.use_xhtml
call add(html, xml_line)
endif
@ -371,8 +372,9 @@ func! tohtml#Diff2HTML(win_list, buf_list) "{{{
call add(html, "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">")
call add(html, '<html xmlns="http://www.w3.org/1999/xhtml">')
elseif s:settings.use_css && !s:settings.no_pre
call add(html, "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">")
call add(html, "<!DOCTYPE html>")
call add(html, '<html>')
let s:html5 = 1
else
call add(html, '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"')
call add(html, ' "http://www.w3.org/TR/html4/loose.dtd">')
@ -383,7 +385,11 @@ func! tohtml#Diff2HTML(win_list, buf_list) "{{{
" include encoding as close to the top as possible, but only if not already
" contained in XML information
if s:settings.encoding != "" && !s:settings.use_xhtml
call add(html, "<meta http-equiv=\"content-type\" content=\"text/html; charset=" . s:settings.encoding . '"' . tag_close)
if s:html5
call add(html, '<meta charset="' . s:settings.encoding . '"' . tag_close)
else
call add(html, "<meta http-equiv=\"content-type\" content=\"text/html; charset=" . s:settings.encoding . '"' . tag_close)
endif
endif
call add(html, '<title>diff</title>')
@ -392,6 +398,7 @@ func! tohtml#Diff2HTML(win_list, buf_list) "{{{
call add(html, '<meta name="settings" content="'.
\ join(filter(keys(s:settings),'s:settings[v:val]'),',').
\ ',prevent_copy='.s:settings.prevent_copy.
\ ',use_input_for_pc='.s:settings.use_input_for_pc.
\ '"'.tag_close)
call add(html, '<meta name="colorscheme" content="'.
\ (exists('g:colors_name')
@ -400,16 +407,8 @@ func! tohtml#Diff2HTML(win_list, buf_list) "{{{
call add(html, '</head>')
let body_line_num = len(html)
if !empty(s:settings.prevent_copy)
call add(html, "<body onload='FixCharWidth();".(s:settings.line_ids ? " JumpToLine();" : "")."'>")
call add(html, "<!-- hidden divs used by javascript to get the width of a char -->")
call add(html, "<div id='oneCharWidth'>0</div>")
call add(html, "<div id='oneInputWidth'><input size='1' value='0'".tag_close."</div>")
call add(html, "<div id='oneEmWidth' style='width: 1em;'></div>")
else
call add(html, '<body'.(s:settings.line_ids ? ' onload="JumpToLine();"' : '').'>')
endif
call add(html, "<table border='1' width='100%' id='vimCodeElement".s:settings.id_suffix."'>")
call add(html, '<body'.(s:settings.line_ids ? ' onload="JumpToLine();"' : '').'>')
call add(html, "<table ".(s:settings.use_css? "" : "border='1' width='100%' ")."id='vimCodeElement".s:settings.id_suffix."'>")
call add(html, '<tr>')
for buf in a:win_list
@ -443,7 +442,7 @@ func! tohtml#Diff2HTML(win_list, buf_list) "{{{
" Grab the style information. Some of this will be duplicated so only insert
" it if it's not already there. {{{
1
let style_start = search('^<style type="text/css">')
let style_start = search('^<style\( type="text/css"\)\?>')
1
let style_end = search('^</style>')
if style_start > 0 && style_end > 0
@ -481,7 +480,7 @@ func! tohtml#Diff2HTML(win_list, buf_list) "{{{
" TODO: restore using grabbed lines if undolevel is 1?
normal! 2u
if s:settings.use_css
call add(html, '<td valign="top"><div>')
call add(html, '<td><div>')
elseif s:settings.use_xhtml
call add(html, '<td nowrap="nowrap" valign="top"><div>')
else
@ -515,7 +514,13 @@ func! tohtml#Diff2HTML(win_list, buf_list) "{{{
let name = substitute(name, '\d*\.x\?html$', '', '') . i . '.' . fnamemodify(copy(name), ":t:e")
let i += 1
endwhile
let s:ei_sav = &eventignore
set eventignore+=FileType
exe "topleft new " . name
let &eventignore=s:ei_sav
unlet s:ei_sav
setlocal modifiable
" just in case some user autocmd creates content in the new buffer, make sure
@ -544,7 +549,7 @@ func! tohtml#Diff2HTML(win_list, buf_list) "{{{
" add required javascript in reverse order so we can just call append again
" and again without adjusting {{{
let s:uses_script = s:settings.dynamic_folds || s:settings.line_ids || !empty(s:settings.prevent_copy)
let s:uses_script = s:settings.dynamic_folds || s:settings.line_ids
" insert script closing tag if needed
if s:uses_script
@ -555,31 +560,6 @@ func! tohtml#Diff2HTML(win_list, buf_list) "{{{
\ ])
endif
" insert script which corrects the size of small input elements in
" prevent_copy mode. See 2html.vim for details on why this is needed and how
" it works.
if !empty(s:settings.prevent_copy)
call append(style_start, [
\ '',
\ '/* simulate a "ch" unit by asking the browser how big a zero character is */',
\ 'function FixCharWidth() {',
\ ' /* get the hidden element which gives the width of a single character */',
\ ' var goodWidth = document.getElementById("oneCharWidth").clientWidth;',
\ ' /* get all input elements, we''ll filter on class later */',
\ ' var inputTags = document.getElementsByTagName("input");',
\ ' var ratio = 5;',
\ ' var inputWidth = document.getElementById("oneInputWidth").clientWidth;',
\ ' var emWidth = document.getElementById("oneEmWidth").clientWidth;',
\ ' if (inputWidth > goodWidth) {',
\ ' while (ratio < 100*goodWidth/emWidth && ratio < 100) {',
\ ' ratio += 5;',
\ ' }',
\ ' document.getElementById("vimCodeElement'.s:settings.id_suffix.'").className = "em"+ratio;',
\ ' }',
\ '}'
\ ])
endif
" insert javascript to get IDs from line numbers, and to open a fold before
" jumping to any lines contained therein
if s:settings.line_ids
@ -659,10 +639,9 @@ func! tohtml#Diff2HTML(win_list, buf_list) "{{{
endif
if s:uses_script
" insert script tag; javascript is always needed for the line number
" normalization for URL hashes
" insert script tag if needed
call append(style_start, [
\ "<script type='text/javascript'>",
\ "<script" . (s:html5 ? "" : " type='text/javascript'") . ">",
\ s:settings.use_xhtml ? '//<![CDATA[' : "<!--"])
endif
@ -673,11 +652,13 @@ func! tohtml#Diff2HTML(win_list, buf_list) "{{{
" is pretty useless for really long lines. {{{
if s:settings.use_css
call append(style_start,
\ ['<style type="text/css">']+
\ ['<style' . (s:html5 ? '' : 'type="text/css"') . '>']+
\ style+
\ [ s:settings.use_xhtml ? '' : '<!--',
\ 'table { table-layout: fixed; }',
\ 'html, body, table, tbody { width: 100%; margin: 0; padding: 0; }',
\ 'table, td, th { border: 1px solid; }',
\ 'td { vertical-align: top; }',
\ 'th, td { width: '.printf("%.1f",100.0/len(a:win_list)).'%; }',
\ 'td div { overflow: auto; }',
\ s:settings.use_xhtml ? '' : '-->',
@ -720,21 +701,22 @@ func! tohtml#GetUserSettings() "{{{
endif
" get current option settings with appropriate defaults {{{
call tohtml#GetOption(user_settings, 'no_progress', !has("statusline") )
call tohtml#GetOption(user_settings, 'diff_one_file', 0 )
call tohtml#GetOption(user_settings, 'number_lines', &number )
call tohtml#GetOption(user_settings, 'pre_wrap', &wrap )
call tohtml#GetOption(user_settings, 'use_css', 1 )
call tohtml#GetOption(user_settings, 'ignore_conceal', 0 )
call tohtml#GetOption(user_settings, 'ignore_folding', 0 )
call tohtml#GetOption(user_settings, 'dynamic_folds', 0 )
call tohtml#GetOption(user_settings, 'no_foldcolumn', user_settings.ignore_folding)
call tohtml#GetOption(user_settings, 'hover_unfold', 0 )
call tohtml#GetOption(user_settings, 'no_pre', 0 )
call tohtml#GetOption(user_settings, 'no_invalid', 0 )
call tohtml#GetOption(user_settings, 'whole_filler', 0 )
call tohtml#GetOption(user_settings, 'use_xhtml', 0 )
call tohtml#GetOption(user_settings, 'line_ids', user_settings.number_lines )
call tohtml#GetOption(user_settings, 'no_progress', !has("statusline") )
call tohtml#GetOption(user_settings, 'diff_one_file', 0 )
call tohtml#GetOption(user_settings, 'number_lines', &number )
call tohtml#GetOption(user_settings, 'pre_wrap', &wrap )
call tohtml#GetOption(user_settings, 'use_css', 1 )
call tohtml#GetOption(user_settings, 'ignore_conceal', 0 )
call tohtml#GetOption(user_settings, 'ignore_folding', 0 )
call tohtml#GetOption(user_settings, 'dynamic_folds', 0 )
call tohtml#GetOption(user_settings, 'no_foldcolumn', user_settings.ignore_folding)
call tohtml#GetOption(user_settings, 'hover_unfold', 0 )
call tohtml#GetOption(user_settings, 'no_pre', 0 )
call tohtml#GetOption(user_settings, 'no_invalid', 0 )
call tohtml#GetOption(user_settings, 'whole_filler', 0 )
call tohtml#GetOption(user_settings, 'use_xhtml', 0 )
call tohtml#GetOption(user_settings, 'line_ids', user_settings.number_lines )
call tohtml#GetOption(user_settings, 'use_input_for_pc', 'fallback')
" }}}
" override those settings that need it {{{
@ -868,6 +850,16 @@ func! tohtml#GetUserSettings() "{{{
let user_settings.no_invalid = 0
endif
" enforce valid values for use_input_for_pc
if user_settings.use_input_for_pc !~# 'fallback\|none\|all'
let user_settings.use_input_for_pc = 'fallback'
echohl WarningMsg
echomsg '2html: "' . g:html_use_input_for_pc . '" is not valid for g:html_use_input_for_pc'
echomsg '2html: defaulting to "' . user_settings.use_input_for_pc . '"'
echohl None
sleep 3
endif
if exists('g:html_id_expr')
let user_settings.id_suffix = eval(g:html_id_expr)
if user_settings.id_suffix !~ '^[-_:.A-Za-z0-9]*$'

View File

@ -1,10 +1,10 @@
" zip.vim: Handles browsing zipfiles
" AUTOLOAD PORTION
" Date: Sep 13, 2016
" Version: 28
" Maintainer: Charles E Campbell <NdrOchip@ScampbellPfamily.AbizM-NOSPAM>
" Date: Jan 07, 2020
" Version: 31
" Maintainer: Charles E Campbell <NcampObell@SdrPchip.AorgM-NOSPAM>
" License: Vim License (see vim's :help license)
" Copyright: Copyright (C) 2005-2013 Charles E. Campbell {{{1
" Copyright: Copyright (C) 2005-2019 Charles E. Campbell {{{1
" Permission is hereby granted to use and distribute this code,
" with or without modifications, provided that this copyright
" notice is copied with it. Like anything else that's free,
@ -20,7 +20,7 @@
if &cp || exists("g:loaded_zip")
finish
endif
let g:loaded_zip= "v28"
let g:loaded_zip= "v31"
if v:version < 702
echohl WarningMsg
echo "***warning*** this version of zip needs vim 7.2 or later"
@ -65,10 +65,10 @@ endif
" zip#Browse: {{{2
fun! zip#Browse(zipfile)
" call Dfunc("zip#Browse(zipfile<".a:zipfile.">)")
" sanity check: ensure that the zipfile has "PK" as its first two letters
" sanity check: insure that the zipfile has "PK" as its first two letters
" (zipped files have a leading PK as a "magic cookie")
if !filereadable(a:zipfile) || readfile(a:zipfile, "", 1)[0] !~ '^PK'
exe "noautocmd e ".fnameescape(a:zipfile)
exe "noswapfile noautocmd noswapfile e ".fnameescape(a:zipfile)
" call Dret("zip#Browse : not a zipfile<".a:zipfile.">")
return
" else " Decho
@ -141,8 +141,11 @@ fun! zip#Browse(zipfile)
" Maps associated with zip plugin
setlocal noma nomod ro
noremap <silent> <buffer> <cr> :call <SID>ZipBrowseSelect()<cr>
noremap <silent> <buffer> x :call zip#Extract()<cr>
noremap <silent> <buffer> <cr> :call <SID>ZipBrowseSelect()<cr>
noremap <silent> <buffer> x :call zip#Extract()<cr>
if &mouse != ""
noremap <silent> <buffer> <leftmouse> <leftmouse>:call <SID>ZipBrowseSelect()<cr>
endif
let &report= repkeep
" call Dret("zip#Browse")
@ -175,17 +178,17 @@ fun! s:ZipBrowseSelect()
" get zipfile to the new-window
let zipfile = b:zipfile
let curfile= expand("%")
let curfile = expand("%")
" call Decho("zipfile<".zipfile.">")
" call Decho("curfile<".curfile.">")
new
noswapfile new
if !exists("g:zip_nomax") || g:zip_nomax == 0
wincmd _
endif
let s:zipfile_{winnr()}= curfile
" call Decho("exe e ".fnameescape("zipfile:".zipfile.'::'.fname))
exe "e ".fnameescape("zipfile:".zipfile.'::'.fname)
exe "noswapfile e ".fnameescape("zipfile:".zipfile.'::'.fname)
filetype detect
let &report= repkeep
@ -339,7 +342,7 @@ fun! zip#Write(fname)
let binkeep= &binary
let eikeep = &ei
set binary ei=all
exe "e! ".fnameescape(zipfile)
exe "noswapfile e! ".fnameescape(zipfile)
call netrw#NetWrite(netzipfile)
let &ei = eikeep
let &binary = binkeep

View File

@ -67,7 +67,7 @@ You can use ":highlight" to find out the current colors. Exception: the
ctermfg and ctermbg values are numbers, which are only valid for the current
terminal. Use the color names instead. See ":help cterm-colors".
The default color settings can be found in the source file src/syntax.c.
The default color settings can be found in the source file src/highlight.c.
Search for "highlight_init".
If you think you have a color scheme that is good enough to be used by others,

View File

@ -1,7 +1,7 @@
" Vim compiler file
" Compiler: Checkstyle
" Maintainer: Doug Kearns <dougkearns@gmail.com>
" Last Change: 2013 Jun 26
" Last Change: 2020 Aug 2
if exists("current_compiler")
finish
@ -12,8 +12,18 @@ if exists(":CompilerSet") != 2 " older Vim always used :setlocal
command -nargs=* CompilerSet setlocal <args>
endif
CompilerSet makeprg=java\ com.puppycrawl.tools.checkstyle.Main\ -f\ plain
let s:cpo_save = &cpo
set cpo&vim
" sample error: WebTable.java:282: '+=' is not preceded with whitespace.
" WebTable.java:201:1: '{' should be on the previous line.
CompilerSet errorformat=%f:%l:%v:\ %m,%f:%l:\ %m,%-G%.%#
" CompilerSet makeprg=java\ com.puppycrawl.tools.checkstyle.Main\ -f\ plain\ -c\ /sun_checks.xml
" CompilerSet makeprg=java\ -jar\ checkstyle-X.XX-all.jar\ -f\ plain\ -c\ /sun_checks.xml
CompilerSet makeprg=checkstyle\ -f\ plain
CompilerSet errorformat=[%tRROR]\ %f:%l:%v:\ %m,
\[%tARN]\ %f:%l:%v:\ %m,
\[%tRROR]\ %f:%l:\ %m,
\[%tARN]\ %f:%l:\ %m,
\%-G%.%#
let &cpo = s:cpo_save
unlet s:cpo_save

26
runtime/compiler/cm3.vim Normal file
View File

@ -0,0 +1,26 @@
" Vim compiler file
" Compiler: Critical Mass Modula-3 Compiler
" Maintainer: Doug Kearns <dougkearns@gmail.com>
" Last Change: 2021 Apr 08
if exists("current_compiler")
finish
endif
let current_compiler = "cm3"
if exists(":CompilerSet") != 2 " older Vim always used :setlocal
command -nargs=* CompilerSet setlocal <args>
endif
let s:cpo_save = &cpo
set cpo&vim
" TODO: better handling of Quake errors
CompilerSet makeprg=cm3
CompilerSet errorformat=%D---\ building\ in\ %f\ ---,
\%W\"%f\"\\,\ line\ %l:\ warning:\ %m,
\%E\"%f\"\\,\ line\ %l:\ %m,
\%-G%.%#
let &cpo = s:cpo_save
unlet s:cpo_save

26
runtime/compiler/dart.vim Normal file
View File

@ -0,0 +1,26 @@
" Vim compiler file
" Compiler: Dart VM
" Maintainer: Doug Kearns <dougkearns@gmail.com>
" Last Change: 2019 May 08
if exists("current_compiler")
finish
endif
let current_compiler = "dart"
if exists(":CompilerSet") != 2 " older Vim always used :setlocal
command -nargs=* CompilerSet setlocal <args>
endif
let s:cpo_save = &cpo
set cpo&vim
CompilerSet makeprg=dart
CompilerSet errorformat=%E%f:%l:%c:\ Error:\ %m,
\%CTry\ %.%#,
\%Z\ %#^%\\+,
\%C%.%#,
\%-G%.%#
let &cpo = s:cpo_save
unlet s:cpo_save

View File

@ -0,0 +1,28 @@
" Vim compiler file
" Compiler: Dart to JavaScript Compiler
" Maintainer: Doug Kearns <dougkearns@gmail.com>
" Last Change: 2019 May 08
if exists("current_compiler")
finish
endif
let current_compiler = "dart2js"
if exists(":CompilerSet") != 2 " older Vim always used :setlocal
command -nargs=* CompilerSet setlocal <args>
endif
let s:cpo_save = &cpo
set cpo&vim
CompilerSet makeprg=dart2js
CompilerSet errorformat=%E%f:%l:%c:,
\%-GError:\ Compilation\ failed.,
\%CError:\ %m,
\%Z\ %#^%\\+,
\%C%.%#,
\%trror:\ %m,
\%-G%.%#
let &cpo = s:cpo_save
unlet s:cpo_save

View File

@ -0,0 +1,28 @@
" Vim compiler file
" Compiler: Dart to Native Compiler
" Maintainer: Doug Kearns <dougkearns@gmail.com>
" Last Change: 2019 May 08
if exists("current_compiler")
finish
endif
let current_compiler = "dart2native"
if exists(":CompilerSet") != 2 " older Vim always used :setlocal
command -nargs=* CompilerSet setlocal <args>
endif
let s:cpo_save = &cpo
set cpo&vim
CompilerSet makeprg=dart2native
CompilerSet errorformat=%E%f:%l:%c:\ Error:\ %m,
\%CTry\ %.%#,
\%Z\ %#^%\\+,
\%Z%$,
\%C%.%#,
\%E%f:\ %trror:\ %m,
\%-G%.%#
let &cpo = s:cpo_save
unlet s:cpo_save

View File

@ -0,0 +1,23 @@
" Vim compiler file
" Compiler: Dart Analyzer
" Maintainer: Doug Kearns <dougkearns@gmail.com>
" Last Change: 2019 May 08
if exists("current_compiler")
finish
endif
let current_compiler = "dartanalyzer"
if exists(":CompilerSet") != 2 " older Vim always used :setlocal
command -nargs=* CompilerSet setlocal <args>
endif
let s:cpo_save = &cpo
set cpo&vim
CompilerSet makeprg=dartanalyzer\ --format\ machine
CompilerSet errorformat=%t%\\w%\\+\|%\\w%\\+\|%\\w%\\+\|%f\|%l\|%c\|%\\d%\\+\|%m,
\%-G%.%#
let &cpo = s:cpo_save
unlet s:cpo_save

View File

@ -0,0 +1,28 @@
" Vim compiler file
" Compiler: Dart Development Compiler
" Maintainer: Doug Kearns <dougkearns@gmail.com>
" Last Change: 2019 May 08
if exists("current_compiler")
finish
endif
let current_compiler = "dartdevc"
if exists(":CompilerSet") != 2 " older Vim always used :setlocal
command -nargs=* CompilerSet setlocal <args>
endif
let s:cpo_save = &cpo
set cpo&vim
CompilerSet makeprg=dartdevc
CompilerSet errorformat=%E%f:%l:%c:\ Error:\ %m,
\%CTry\ %.%#,
\%Z\ %#^%\\+,
\%Z%$,
\%C%.%#,
\%E%f:\ %trror:\ %m,
\%-G%.%#
let &cpo = s:cpo_save
unlet s:cpo_save

View File

@ -0,0 +1,26 @@
" Vim compiler file
" Compiler: Dart Documentation Generator
" Maintainer: Doug Kearns <dougkearns@gmail.com>
" Last Change: 2019 May 08
if exists("current_compiler")
finish
endif
let current_compiler = "dartdoc"
if exists(":CompilerSet") != 2 " older Vim always used :setlocal
command -nargs=* CompilerSet setlocal <args>
endif
let s:cpo_save = &cpo
set cpo&vim
CompilerSet makeprg=dartdoc
CompilerSet errorformat=\ \ %tarning:\ %m,
\\ \ %trror:\ %m,
\%+EGeneration\ failed:\ %m,
\%+ISuccess!\ Docs\ generated\ into\ %f,
\%-G%.%#
let &cpo = s:cpo_save
unlet s:cpo_save

View File

@ -0,0 +1,25 @@
" Vim compiler file
" Compiler: Dart Formatter
" Maintainer: Doug Kearns <dougkearns@gmail.com>
" Last Change: 2019 May 08
if exists("current_compiler")
finish
endif
let current_compiler = "dartfmt"
if exists(":CompilerSet") != 2 " older Vim always used :setlocal
command -nargs=* CompilerSet setlocal <args>
endif
let s:cpo_save = &cpo
set cpo&vim
CompilerSet makeprg=dartfmt
CompilerSet errorformat=%Eline\ %l\\,\ column\ %c\ of\ %f:\ %m,
\%Z\ %\\{3}│\ %\\+^%\\+,
\%C%.%#,
\%-G%.%#
let &cpo = s:cpo_save
unlet s:cpo_save

View File

@ -0,0 +1,16 @@
" Vim compiler file
" Compiler: ESLint for JavaScript
" Maintainer: Romain Lafourcade <romainlafourcade@gmail.com>
" Last Change: 2020 August 20
if exists("current_compiler")
finish
endif
let current_compiler = "eslint"
if exists(":CompilerSet") != 2
command -nargs=* CompilerSet setlocal <args>
endif
CompilerSet makeprg=npx\ eslint\ --format\ compact
CompilerSet errorformat=%f:\ line\ %l\\,\ col\ %c\\,\ %m,%-G%.%#

27
runtime/compiler/fbc.vim Normal file
View File

@ -0,0 +1,27 @@
" Vim compiler file
" Compiler: FreeBASIC Compiler
" Maintainer: Doug Kearns <dougkearns@gmail.com>
" Last Change: 2015 Jan 10
if exists("current_compiler")
finish
endif
let current_compiler = "fbc"
if exists(":CompilerSet") != 2 " older Vim always used :setlocal
command -nargs=* CompilerSet setlocal <args>
endif
let s:cpo_save = &cpo
set cpo&vim
CompilerSet makeprg=fbc
CompilerSet errorformat=%-G%.%#Too\ many\ errors\\,\ exiting,
\%f(%l)\ %tarning\ %n(%\\d%\\+):\ %m,
\%E%f(%l)\ error\ %n:\ %m,
\%-Z%p^,
\%-C%.%#,
\%-G%.%#
let &cpo = s:cpo_save
unlet s:cpo_save

34
runtime/compiler/gawk.vim Normal file
View File

@ -0,0 +1,34 @@
" Vim compiler file
" Compiler: GNU Awk
" Maintainer: Doug Kearns <dougkearns@gmail.com>
" Last Change: 2020 Feb 10
if exists("current_compiler")
finish
endif
let current_compiler = "gawk"
if exists(":CompilerSet") != 2 " older Vim always used :setlocal
command -nargs=* CompilerSet setlocal <args>
endif
let s:cpo_save = &cpo
set cpo&vim
CompilerSet makeprg=gawk
CompilerSet errorformat=%Z%.awk:\ %f:%l:\ %p^\ %m,
\%Eg%\\=awk:\ %f:%l:\ fatal:\ %m,
\%Egawk:\ %f:%l:\ error:\ %m,
\%Wgawk:\ %f:%l:\ warning:\ %m,
\%Egawk:\ %f:%l:\ %.%#,
\gawk:\ %f:%l:\ %tatal:\ %m,
\gawk:\ %f:%l:\ %trror:\ %m,
\gawk:\ %f:%l:\ %tarning:\ %m,
\gawk:\ %tatal:\ %m,
\gawk:\ %trror:\ %m,
\gawk:\ %tarning:\ %m,
\%+C%.%#,
\%-G%.%#
let &cpo = s:cpo_save
unlet s:cpo_save

25
runtime/compiler/gjs.vim Normal file
View File

@ -0,0 +1,25 @@
" Vim compiler file
" Compiler: GJS (Gnome JavaScript Bindings)
" Maintainer: Doug Kearns <dougkearns@gmail.com>
" Last Change: 2019 Jul 10
if exists("current_compiler")
finish
endif
let current_compiler = "gjs"
if exists(":CompilerSet") != 2 " older Vim always used :setlocal
command -nargs=* CompilerSet setlocal <args>
endif
let s:cpo_save = &cpo
set cpo&vim
CompilerSet makeprg=gjs
CompilerSet errorformat=%.%#JS\ %tRROR:\ %m\ @\ %f:%c,
\%E%.%#JS\ ERROR:\ %m,
\%Z@%f:%l:%c,
\%-G%.%#
let &cpo = s:cpo_save
unlet s:cpo_save

View File

@ -1,7 +1,7 @@
" Vim compiler file
" Compiler: javac
" Compiler: Java Development Kit Compiler
" Maintainer: Doug Kearns <dougkearns@gmail.com>
" Last Change: 2004 Nov 27
" Last Change: 2019 Oct 21
if exists("current_compiler")
finish
@ -12,6 +12,15 @@ if exists(":CompilerSet") != 2 " older Vim always used :setlocal
command -nargs=* CompilerSet setlocal <args>
endif
CompilerSet makeprg=javac
let s:cpo_save = &cpo
set cpo&vim
CompilerSet errorformat=%E%f:%l:\ %m,%-Z%p^,%-C%.%#,%-G%.%#
CompilerSet makeprg=javac
CompilerSet errorformat=%E%f:%l:\ error:\ %m,
\%W%f:%l:\ warning:\ %m,
\%-Z%p^,
\%-C%.%#,
\%-G%.%#
let &cpo = s:cpo_save
unlet s:cpo_save

30
runtime/compiler/jest.vim Normal file
View File

@ -0,0 +1,30 @@
" Vim compiler file
" Compiler: Jest
" Maintainer: Doug Kearns <dougkearns@gmail.com>
" Last Change: 2018 May 15
if exists("current_compiler")
finish
endif
let current_compiler = "jest"
if exists(":CompilerSet") != 2 " older Vim always used :setlocal
command -nargs=* CompilerSet setlocal <args>
endif
let s:cpo_save = &cpo
set cpo&vim
" CompilerSet makeprg=npx\ jest\ --no-colors
CompilerSet makeprg=jest\ --no-colors
CompilerSet errorformat=%E\ \ ●\ %m,
\%Z\ %\\{4}%.%#Error:\ %f:\ %m\ (%l:%c):%\\=,
\%Z\ %\\{6}at\ %\\S%#\ (%f:%l:%c),
\%+C\ %\\{4}%\\w%.%#,
\%+C\ %\\{4}%[-+]%.%#,
\%-C%.%#,
\%-G%.%#
let &cpo = s:cpo_save
unlet s:cpo_save

24
runtime/compiler/jjs.vim Normal file
View File

@ -0,0 +1,24 @@
" Vim compiler file
" Compiler: Nashorn Shell
" Maintainer: Doug Kearns <dougkearns@gmail.com>
" Last Change: 2018 Jan 9
if exists("current_compiler")
finish
endif
let current_compiler = "jjs"
if exists(":CompilerSet") != 2 " older Vim always used :setlocal
command -nargs=* CompilerSet setlocal <args>
endif
let s:cpo_save = &cpo
set cpo&vim
CompilerSet makeprg=jjs
CompilerSet errorformat=%f:%l:%c\ %m,
\%f:%l\ %m,
\%-G%.%#
let &cpo = s:cpo_save
unlet s:cpo_save

View File

@ -0,0 +1,25 @@
" Vim compiler file
" Compiler: JSHint
" Maintainer: Doug Kearns <dougkearns@gmail.com>
" Last Change: 2019 Jul 10
if exists("current_compiler")
finish
endif
let current_compiler = "jshint"
if exists(":CompilerSet") != 2 " older Vim always used :setlocal
command -nargs=* CompilerSet setlocal <args>
endif
let s:cpo_save = &cpo
set cpo&vim
" CompilerSet makeprg=npx\ jshint\ --verbose
CompilerSet makeprg=jshint\ --verbose
CompilerSet errorformat=%f:\ line\ %l\\,\ col\ %c\\,\ %m\ (%t%n),
\%-G%.%#
let &cpo = s:cpo_save
unlet s:cpo_save

View File

@ -0,0 +1,25 @@
" Vim compiler file
" Compiler: JSON Lint
" Maintainer: Doug Kearns <dougkearns@gmail.com>
" Last Change: 2019 Jul 10
if exists("current_compiler")
finish
endif
let current_compiler = "jsonlint"
if exists(":CompilerSet") != 2 " older Vim always used :setlocal
command -nargs=* CompilerSet setlocal <args>
endif
let s:cpo_save = &cpo
set cpo&vim
" CompilerSet makeprg=npx\ jsonlint\ --compact\ --quiet
CompilerSet makeprg=jsonlint\ --compact\ --quiet
CompilerSet errorformat=%f:\ line\ %l\\,\ col\ %c\\,\ found:\ %m,
\%-G%.%#
let &cpo = s:cpo_save
unlet s:cpo_save

View File

@ -1,11 +1,11 @@
" Vim Compiler File
" Compiler: ocaml
" Maintainer: Markus Mottl <markus.mottl@gmail.com>
" URL: https://github.com/rgrinberg/vim-ocaml
" URL: https://github.com/ocaml/vim-ocaml
" Last Change:
" 2020 Mar 28 - Improved error format (Thomas Leonard)
" 2017 Nov 26 - Improved error format (Markus Mottl)
" 2013 Aug 27 - Added a new OCaml error format (Markus Mottl)
" 2013 Jun 30 - Initial version (Marc Weber)
"
" Marc Weber's comments:
" Setting makeprg doesn't make sense, because there is ocamlc, ocamlopt,
@ -21,6 +21,7 @@
"
" So having it here makes people opt-in
if exists("current_compiler")
finish
endif
@ -30,6 +31,7 @@ let s:cpo_save = &cpo
set cpo&vim
CompilerSet errorformat =
\%EFile\ \"%f\"\\,\ lines\ %*\\d-%l\\,\ characters\ %c-%*\\d:,
\%EFile\ \"%f\"\\,\ line\ %l\\,\ characters\ %c-%*\\d:,
\%EFile\ \"%f\"\\,\ line\ %l\\,\ characters\ %c-%*\\d\ %.%#,
\%EFile\ \"%f\"\\,\ line\ %l\\,\ character\ %c:%m,

View File

@ -0,0 +1,84 @@
" Vim compiler file
" Compiler: powershell
" URL: https://github.com/PProvost/vim-ps1
" Last Change: 2020 Mar 30
if exists("current_compiler")
finish
endif
let current_compiler = "powershell"
if exists(":CompilerSet") != 2 " older Vim always used :setlocal
command -nargs=* CompilerSet setlocal <args>
endif
let s:cpo_save = &cpo
set cpo-=C
if !exists("g:ps1_makeprg_cmd")
if executable('pwsh')
" pwsh is the future
let g:ps1_makeprg_cmd = 'pwsh'
elseif executable('pwsh.exe')
let g:ps1_makeprg_cmd = 'pwsh.exe'
elseif executable('powershell.exe')
let g:ps1_makeprg_cmd = 'powershell.exe'
else
let g:ps1_makeprg_cmd = ''
endif
endif
if !executable(g:ps1_makeprg_cmd)
echoerr "To use the powershell compiler, please set g:ps1_makeprg_cmd to the powershell executable!"
endif
" Show CategoryInfo, FullyQualifiedErrorId, etc?
let g:ps1_efm_show_error_categories = get(g:, 'ps1_efm_show_error_categories', 0)
" Use absolute path because powershell requires explicit relative paths
" (./file.ps1 is okay, but # expands to file.ps1)
let &l:makeprg = g:ps1_makeprg_cmd .' %:p:S'
" Parse file, line, char from callstacks:
" Write-Ouput : The term 'Write-Ouput' is not recognized as the name of a
" cmdlet, function, script file, or operable program. Check the spelling
" of the name, or if a path was included, verify that the path is correct
" and try again.
" At C:\script.ps1:11 char:5
" + Write-Ouput $content
" + ~~~~~~~~~~~
" + CategoryInfo : ObjectNotFound: (Write-Ouput:String) [], CommandNotFoundException
" + FullyQualifiedErrorId : CommandNotFoundException
" Showing error in context with underlining.
CompilerSet errorformat=%+G+%m
" Error summary.
CompilerSet errorformat+=%E%*\\S\ :\ %m
" Error location.
CompilerSet errorformat+=%CAt\ %f:%l\ char:%c
" Errors that span multiple lines (may be wrapped to width of terminal).
CompilerSet errorformat+=%C%m
" Ignore blank/whitespace-only lines.
CompilerSet errorformat+=%Z\\s%#
if g:ps1_efm_show_error_categories
CompilerSet errorformat^=%+G\ \ \ \ +\ %.%#\\s%#:\ %m
else
CompilerSet errorformat^=%-G\ \ \ \ +\ %.%#\\s%#:\ %m
endif
" Parse file, line, char from of parse errors:
" At C:\script.ps1:22 char:16
" + Stop-Process -Name "invalidprocess
" + ~~~~~~~~~~~~~~~
" The string is missing the terminator: ".
" + CategoryInfo : ParserError: (:) [], ParseException
" + FullyQualifiedErrorId : TerminatorExpectedAtEndOfString
CompilerSet errorformat+=At\ %f:%l\ char:%c
let &cpo = s:cpo_save
unlet s:cpo_save
" vim:set sw=2 sts=2:

View File

@ -0,0 +1,30 @@
" Vim compiler file
" Compiler: Rhino Shell (JavaScript in Java)
" Maintainer: Doug Kearns <dougkearns@gmail.com>
" Last Change: 2019 Jul 10
if exists("current_compiler")
finish
endif
let current_compiler = "rhino"
if exists(":CompilerSet") != 2 " older Vim always used :setlocal
command -nargs=* CompilerSet setlocal <args>
endif
let s:cpo_save = &cpo
set cpo&vim
" CompilerSet makeprg=java\ -jar\ lib/rhino-X.X.XX.jar\ -w\ -strict
CompilerSet makeprg=rhino
CompilerSet errorformat=%-Gjs:\ %.%#Compilation\ produced%.%#,
\%Ejs:\ \"%f\"\\,\ line\ %l:\ %m,
\%Ejs:\ uncaught\ JavaScript\ runtime\ exception:\ %m,
\%Wjs:\ warning:\ \"%f\"\\,\ line\ %l:\ %m,
\%Zjs:\ %p^,
\%Cjs:\ %.%#,
\%-G%.%#
let &cpo = s:cpo_save
unlet s:cpo_save

View File

@ -0,0 +1,23 @@
" Vim compiler file
" Compiler: RuboCop
" Maintainer: Doug Kearns <dougkearns@gmail.com>
" Last Change: 2019 Jul 10
if exists("current_compiler")
finish
endif
let current_compiler = "rubocop"
if exists(":CompilerSet") != 2 " older Vim always used :setlocal
command -nargs=* CompilerSet setlocal <args>
endif
let s:cpo_save = &cpo
set cpo&vim
CompilerSet makeprg=rubocop\ --format\ emacs
CompilerSet errorformat=%f:%l:%c:\ %t:\ %m,
\%-G%.%#
let &cpo = s:cpo_save
unlet s:cpo_save

View File

@ -0,0 +1,25 @@
" Vim compiler file
" Compiler: ShellCheck
" Maintainer: Doug Kearns <dougkearns@gmail.com>
" Last Change: 2020 Sep 4
if exists("current_compiler")
finish
endif
let current_compiler = "shellcheck"
if exists(":CompilerSet") != 2 " older Vim always used :setlocal
command -nargs=* CompilerSet setlocal <args>
endif
let s:cpo_save = &cpo
set cpo&vim
CompilerSet makeprg=shellcheck\ -f\ gcc
CompilerSet errorformat=%f:%l:%c:\ %trror:\ %m\ [SC%n],
\%f:%l:%c:\ %tarning:\ %m\ [SC%n],
\%f:%l:%c:\ %tote:\ %m\ [SC%n],
\%-G%.%#
let &cpo = s:cpo_save
unlet s:cpo_save

28
runtime/compiler/sml.vim Normal file
View File

@ -0,0 +1,28 @@
" Vim compiler file
" Compiler: SML/NJ Compiler
" Maintainer: Doug Kearns <dougkearns@gmail.com>
" Last Change: 2020 Feb 10
if exists("current_compiler")
finish
endif
let current_compiler = "sml"
if exists(":CompilerSet") != 2 " older Vim always used :setlocal
command -nargs=* CompilerSet setlocal <args>
endif
let s:cpo_save = &cpo
set cpo&vim
CompilerSet makeprg=sml
CompilerSet errorformat=%f:%l.%c-%\\d%\\+.%\\d%\\+\ %trror:\ %m,
\%f:%l.%c\ %trror:\ %m,
\%trror:\ %m
\%f:%l.%c-%\\d%\\+.%\\d%\\+\ %tarning:\ %m,
\%f:%l.%c\ %tarning:\ %m,
\%tarning:\ %m,
\%-G%.%#
let &cpo = s:cpo_save
unlet s:cpo_save

View File

@ -0,0 +1,16 @@
" Vim compiler file
" Compiler: Standard for JavaScript
" Maintainer: Romain Lafourcade <romainlafourcade@gmail.com>
" Last Change: 2020 August 20
if exists("current_compiler")
finish
endif
let current_compiler = "standard"
if exists(":CompilerSet") != 2
command -nargs=* CompilerSet setlocal <args>
endif
CompilerSet makeprg=npx\ standard
CompilerSet errorformat=%f:%l:%c:\ %m,%-G%.%#

View File

@ -0,0 +1,26 @@
" Vim compiler file
" Compiler: Stylelint
" Maintainer: Doug Kearns <dougkearns@gmail.com>
" Last Change: 2020 Jun 10
if exists("current_compiler")
finish
endif
let current_compiler = "stylelint"
if exists(":CompilerSet") != 2 " older Vim always used :setlocal
command -nargs=* CompilerSet setlocal <args>
endif
let s:cpo_save = &cpo
set cpo&vim
" CompilerSet makeprg=npx\ stylelint\ --formatter\ compact
CompilerSet makeprg=stylelint\ --formatter\ compact
CompilerSet errorformat=%f:\ line\ %l\\,\ col\ %c\\,\ %trror\ -\ %m,
\%f:\ line\ %l\\,\ col\ %c\\,\ %tarning\ -\ %m,
\%-G%.%#
let &cpo = s:cpo_save
unlet s:cpo_save

View File

@ -1,7 +1,7 @@
" Vim compiler file
" Compiler: HTML Tidy
" Maintainer: Doug Kearns <dougkearns@gmail.com>
" Last Change: 2016 Apr 21
" Last Change: 2020 Sep 4
if exists("current_compiler")
finish
@ -12,8 +12,15 @@ if exists(":CompilerSet") != 2 " older Vim always used :setlocal
command -nargs=* CompilerSet setlocal <args>
endif
CompilerSet makeprg=tidy\ -quiet\ -errors\ --gnu-emacs\ yes\ %:S
let s:cpo_save = &cpo
set cpo&vim
" foo.html:8:1: Warning: inserting missing 'foobar' element
" foo.html:9:2: Error: <foobar> is not recognized!
CompilerSet errorformat=%f:%l:%c:\ %trror:%m,%f:%l:%c:\ %tarning:%m,%-G%.%#
CompilerSet makeprg=tidy\ -quiet\ -errors\ --gnu-emacs\ yes
CompilerSet errorformat=%f:%l:%c:\ %trror:\ %m,
\%f:%l:%c:\ %tarning:\ %m,
\%f:%l:%c:\ %tnfo:\ %m,
\%f:%l:%c:\ %m,
\%-G%.%#
let &cpo = s:cpo_save
unlet s:cpo_save

View File

@ -0,0 +1,28 @@
" Vim compiler file
" Compiler: TypeDoc
" Maintainer: Doug Kearns <dougkearns@gmail.com>
" Last Change: 2020 Feb 10
if exists("current_compiler")
finish
endif
let current_compiler = "typedoc"
if exists(":CompilerSet") != 2 " older Vim always used :setlocal
command -nargs=* CompilerSet setlocal <args>
endif
let s:cpo_save = &cpo
set cpo&vim
" CompilerSet makeprg=npx\ typedoc
CompilerSet makeprg=typedoc
CompilerSet errorformat=%EError:\ %f(%l),
\%WWarning:\ %f(%l),
\%+IDocumentation\ generated\ at\ %f,
\%Z\ %m,
\%-G%.%#
let &cpo = s:cpo_save
unlet s:cpo_save

View File

@ -72,7 +72,7 @@ Arabic requires ISO-8859-6 as well as Presentation Form-B fonts
(without Form-B, Arabic will _NOT_ be usable). It is highly
recommended that users search for so-called 'ISO-10646-1' fonts.
Do an Internet search or check www.arabeyes.org for further
info on where to attain the necessary Arabic fonts.
info on where to obtain the necessary Arabic fonts.
Font Installation
@ -118,7 +118,7 @@ o Setting the appropriate character Encoding
>
:set encoding=utf-8
<
to your vimrc file (entering the command manually into you VIM
to your vimrc file (entering the command manually into your Vim
window is highly discouraged). In short, include ':set
encoding=utf-8' to your vimrc file.

View File

@ -215,6 +215,8 @@ BufAdd Just after creating a new buffer which is
added to the buffer list, or adding a buffer
to the buffer list, a buffer in the buffer
list was renamed.
Not triggered for the initial buffers created
during startup.
Before |BufEnter|.
NOTE: Current buffer "%" may be different from
the buffer being created "<afile>".
@ -461,7 +463,7 @@ CompleteDone After Insert mode completion is done. Either
*CursorHold*
CursorHold When the user doesn't press a key for the time
specified with 'updatetime'. Not re-triggered
specified with 'updatetime'. Not triggered
until the user has pressed a key (i.e. doesn't
fire every 'updatetime' ms if you leave Vim to
make some coffee. :) See |CursorHold-example|
@ -707,7 +709,7 @@ InsertEnter Just before starting Insert mode. Also for
string.
*InsertLeavePre*
InsertLeavePre Just before leaving Insert mode. Also when
using CTRL-O |i_CTRL-O|. Be caseful not to
using CTRL-O |i_CTRL-O|. Be careful not to
change mode or use `:normal`, it will likely
cause trouble.
*InsertLeave*
@ -1207,8 +1209,8 @@ name!
:aug[roup]! {name} Delete the autocmd group {name}. Don't use
this if there is still an autocommand using
this group! You will get a warning if doing
it anyway. when the group is the current group
you will get error E936.
it anyway. When the group is the current
group you will get error E936.
To enter autocommands for a specific group, use this method:
1. Select the group with ":augroup {name}".
@ -1267,9 +1269,18 @@ option will not cause any commands to be executed.
*:doautoa* *:doautoall*
:doautoa[ll] [<nomodeline>] [group] {event} [fname]
Like ":doautocmd", but apply the autocommands to each
loaded buffer. Note that [fname] is used to select
the autocommands, not the buffers to which they are
applied.
loaded buffer. The current buffer is done last.
Note that [fname] is used to select the autocommands,
not the buffers to which they are applied. Example: >
augroup mine
autocmd!
autocmd FileType * echo expand('<amatch>')
augroup END
doautoall mine FileType Loaded-Buffer
< Sourcing this script, you'll see as many
"Loaded-Buffer" echoed as there are loaded buffers.
Careful: Don't use this for autocommands that delete a
buffer, change to another buffer or change the
contents of a buffer; the result is unpredictable.

View File

@ -141,7 +141,7 @@ commands, except "gJ", delete any leading white space on the next line. If
the 'joinspaces' option is on, these commands insert two spaces after a '.',
'!' or '?'.
The 'B' and 'M' flags in 'formatoptions' change the behavior for inserting
spaces before and after a multi-byte character |fo-table|.
spaces before and after a multibyte character |fo-table|.
The '[ mark is set at the end of the first line that was joined, '] at the end
of the resulting line.
@ -197,7 +197,7 @@ gR Enter Virtual Replace mode: Each character you type
start insert (for {Visual} see |Visual-mode|).
*v_r*
{Visual}["x]r{char} Replace all selected characters by {char}.
{Visual}r{char} Replace all selected characters by {char}.
*v_C*
{Visual}["x]C Delete the highlighted lines [into register x] and
@ -610,6 +610,8 @@ Directory for temporary files is created in the first suitable directory of:
|cmdline-ranges|.
See |:s_flags| for [flags].
The delimiter doesn't need to be /, see
|pattern-delimiter|.
:[range]s[ubstitute] [flags] [count]
:[range]&[&][flags] [count] *:&*
@ -621,6 +623,8 @@ Directory for temporary files is created in the first suitable directory of:
The space between `:substitute` and the 'c', 'g',
'i', 'I' and 'r' flags isn't required, but in scripts
it's a good idea to keep it to avoid confusion.
Also see the two and three letter commands to repeat
:substitute below |:substitute-repeat|.
:[range]~[&][flags] [count] *:~*
Repeat last substitute with same substitute string
@ -744,7 +748,7 @@ This deletes "TESTING" from all lines, but only one per line.
For compatibility with Vi these two exceptions are allowed:
"\/{string}/" and "\?{string}?" do the same as "//{string}/r".
"\&{string}&" does the same as "//{string}/".
*E146*
*pattern-delimiter* *E146*
Instead of the '/' which surrounds the pattern and replacement string, you
can use any other single-byte character, but not an alphanumeric character,
'\', '"' or '|'. This is useful if you want to include a '/' in the search
@ -841,20 +845,26 @@ either the first or second pattern in parentheses did not match, so either
*:sge* *:sgi* *:sgI* *:sgl* *:sgn* *:sgp* *:sgr* *:sI* *:si*
*:sic* *:sIc* *:sie* *:sIe* *:sIg* *:sIl* *:sin* *:sIn* *:sIp*
*:sip* *:sIr* *:sir* *:sr* *:src* *:srg* *:sri* *:srI* *:srl*
*:srn* *:srp*
*:srn* *:srp* *:substitute-repeat*
2-letter and 3-letter :substitute commands ~
These commands repeat the previous `:substitute` command with the given flags.
The first letter is always "s", followed by one or two of the possible flag
characters. For example `:sce` works like `:s///ce`. The table lists the
possible combinations, not all flags are possible, because the command is
short for another command.
List of :substitute commands
| c e g i I n p l r
| c :sc :sce :scg :sci :scI :scn :scp :scl ---
| c :sc :sce :scg :sci :scI :scn :scp :scl
| e
| g :sgc :sge :sg :sgi :sgI :sgn :sgp :sgl :sgr
| i :sic :sie --- :si :siI :sin :sip --- :sir
| i :sic :sie :si :siI :sin :sip :sir
| I :sIc :sIe :sIg :sIi :sI :sIn :sIp :sIl :sIr
| n
| p
| l
| r :src --- :srg :sri :srI :srn :srp :srl :sr
| r :src :srg :sri :srI :srn :srp :srl :sr
Exceptions:
:scr is `:scriptnames`
@ -959,9 +969,9 @@ inside of strings can change! Also see 'softtabstop' option. >
5. Copying and moving text *copy-move*
*quote*
"{a-zA-Z0-9.%#:-"} Use register {a-zA-Z0-9.%#:-"} for next delete, yank
or put (use uppercase character to append with
delete and yank) ({.%#:} only work with put).
"{register} Use {register} for next delete, yank or put. Use
an uppercase character to append with delete and yank.
Registers ".", "%", "#" and ":" only work with put.
*:reg* *:registers*
:reg[isters] Display the type and contents of all numbered and
@ -1140,7 +1150,7 @@ Rationale: In Vi the "y" command followed by a backwards motion would
With a linewise yank command the cursor is put in the first line, but the
column is unmodified, thus it may not be on the first yanked character.
There are ten types of registers: *registers* *E354*
There are ten types of registers: *registers* *{register}* *E354*
1. The unnamed register ""
2. 10 numbered registers "0 to "9
3. The small delete register "-
@ -1400,7 +1410,7 @@ text. Put it in your autoload directory, e.g. ~/.vim/autoload/format.vim: >
func! format#Format()
" only reformat on explicit gq command
if mode() != 'n'
" fall back to Vims internal reformatting
" fall back to Vim's internal reformatting
return 1
endif
let lines = getline(v:lnum, v:lnum + v:count - 1)
@ -1573,23 +1583,31 @@ can separate the option letters with commas for readability.
letter meaning when present in 'formatoptions' ~
*fo-t*
t Auto-wrap text using textwidth
*fo-c*
c Auto-wrap comments using textwidth, inserting the current comment
leader automatically.
*fo-r*
r Automatically insert the current comment leader after hitting
<Enter> in Insert mode.
*fo-o*
o Automatically insert the current comment leader after hitting 'o' or
'O' in Normal mode.
*fo-q*
q Allow formatting of comments with "gq".
Note that formatting will not change blank lines or lines containing
only the comment leader. A new paragraph starts after such a line,
or when the comment leader changes.
*fo-w*
w Trailing white space indicates a paragraph continues in the next line.
A line that ends in a non-white character ends a paragraph.
*fo-a*
a Automatic formatting of paragraphs. Every time text is inserted or
deleted the paragraph will be reformatted. See |auto-format|.
When the 'c' flag is present this only happens for recognized
comments.
*fo-n*
n When formatting text, recognize numbered lists. This actually uses
the 'formatlistpat' option, thus any kind of list can be used. The
indent of the text after the number is used for the next line. The
@ -1600,6 +1618,7 @@ n When formatting text, recognize numbered lists. This actually uses
1. the first item
wraps
2. the second item
< *fo-2*
2 When formatting text, use the indent of the second line of a paragraph
for the rest of the paragraph, instead of the indent of the first
line. This supports paragraphs in which the first line has a
@ -1609,36 +1628,46 @@ n When formatting text, recognize numbered lists. This actually uses
second line of the same paragraph
third line.
< This also works inside comments, ignoring the comment leader.
*fo-v*
v Vi-compatible auto-wrapping in insert mode: Only break a line at a
blank that you have entered during the current insert command. (Note:
this is not 100% Vi compatible. Vi has some "unexpected features" or
bugs in this area. It uses the screen column instead of the line
column.)
*fo-b*
b Like 'v', but only auto-wrap if you enter a blank at or before
the wrap margin. If the line was longer than 'textwidth' when you
started the insert, or you do not enter a blank in the insert before
reaching 'textwidth', Vim does not perform auto-wrapping.
*fo-l*
l Long lines are not broken in insert mode: When a line was longer than
'textwidth' when the insert command started, Vim does not
automatically format it.
m Also break at a multi-byte character above 255. This is useful for
*fo-m*
m Also break at a multibyte character above 255. This is useful for
Asian text where every character is a word on its own.
M When joining lines, don't insert a space before or after a multi-byte
*fo-M*
M When joining lines, don't insert a space before or after a multibyte
character. Overrules the 'B' flag.
B When joining lines, don't insert a space between two multi-byte
*fo-B*
B When joining lines, don't insert a space between two multibyte
characters. Overruled by the 'M' flag.
*fo-1*
1 Don't break a line after a one-letter word. It's broken before it
instead (if possible).
*fo-]*
] Respect textwidth rigorously. With this flag set, no line can be
longer than textwidth, unless line-break-prohibition rules make this
impossible. Mainly for CJK scripts and works only if 'encoding' is
"utf-8".
*fo-j*
j Where it makes sense, remove a comment leader when joining lines. For
example, joining:
int i; // the index ~
// in the list ~
Becomes:
int i; // the index in the list ~
*fo-p*
p Don't break lines at single spaces that follow periods. This is
intended to complement 'joinspaces' and |cpo-J|, for prose with
sentences separated by two spaces. For example, with 'textwidth' set
@ -1696,7 +1725,7 @@ Some examples:
Automatic formatting *auto-format* *autoformat*
When the 'a' flag is present in 'formatoptions' text is formatted
automatically when inserting text or deleting text. This works nice for
automatically when inserting text or deleting text. This works nicely for
editing text paragraphs. A few hints on how to use this:
- You need to properly define paragraphs. The simplest is paragraphs that are
@ -1783,6 +1812,8 @@ found here: |sort()|, |uniq()|.
When /{pattern}/ is specified and there is no [r] flag
the text matched with {pattern} is skipped, so that
you sort on what comes after the match.
'ignorecase' applies to the pattern, but 'smartcase'
is not used.
Instead of the slash any non-letter can be used.
For example, to sort on the second comma-separated
field: >

View File

@ -119,7 +119,7 @@ CTRL-K {char1} {char2} *c_CTRL-K*
enter digraph (see |digraphs|). When {char1} is a special
key, the code for that key is inserted in <> form.
CTRL-R {0-9a-z"%#:-=.} *c_CTRL-R* *c_<C-R>*
CTRL-R {register} *c_CTRL-R* *c_<C-R>*
Insert the contents of a numbered or named register. Between
typing CTRL-R and the second character '"' will be displayed
to indicate that you are expected to enter the name of a
@ -178,8 +178,8 @@ CTRL-R CTRL-L *c_CTRL-R_CTRL-L* *c_<C-R>_<C-L>*
*c_CTRL-R_CTRL-R* *c_<C-R>_<C-R>*
*c_CTRL-R_CTRL-O* *c_<C-R>_<C-O>*
CTRL-R CTRL-R {0-9a-z"%#:-=. CTRL-F CTRL-P CTRL-W CTRL-A CTRL-L}
CTRL-R CTRL-O {0-9a-z"%#:-=. CTRL-F CTRL-P CTRL-W CTRL-A CTRL-L}
CTRL-R CTRL-R {register CTRL-F CTRL-P CTRL-W CTRL-A CTRL-L}
CTRL-R CTRL-O {register CTRL-F CTRL-P CTRL-W CTRL-A CTRL-L}
Insert register or object under the cursor. Works like
|c_CTRL-R| but inserts the text literally. For example, if
register a contains "xy^Hz" (where ^H is a backspace),
@ -443,6 +443,10 @@ emulate it. For example, this mimics autolist=ambiguous:
This will find the longest match with the first 'wildchar', then list all
matching files with the next.
*complete-script-local-functions*
When completing user function names, prepend "s:" to find script-local
functions.
*suffixes*
For file name completion you can use the 'suffixes' option to set a priority
between files with almost the same name. If there are multiple matches,
@ -553,14 +557,17 @@ followed by another Vim command:
:command
:cscope
:debug
:eval
:folddoopen
:folddoclosed
:function
:global
:help
:helpgrep
:lcscope
:ldo
:lfdo
:lhelpgrep
:make
:normal
:perlfile
@ -572,6 +579,7 @@ followed by another Vim command:
:read !
:scscope
:sign
:terminal
:vglobal
:windo
:write !
@ -752,7 +760,7 @@ three lines: >
<
Visual Mode and Range *v_:*
*:star-visual-range*
{Visual}: Starts a command-line with the Visual selected lines as a
range. The code `:'<,'>` is used for this range, which makes
it possible to select a similar line from the command-line
@ -824,34 +832,37 @@ it, no matter how many backslashes.
\\# \#
Also see |`=|.
*:<cword>* *<cword>* *:<cWORD>* *<cWORD>*
*:<cexpr>* *<cexpr>* *:<cfile>* *<cfile>*
*:<afile>* *<afile>* *:<abuf>* *<abuf>*
*:<amatch>* *<amatch>*
*:<sfile>* *<sfile>* *:<slnum>* *<slnum>*
*:<sflnum>* *<sflnum>* *E499* *E500*
*E499* *E500*
Note: these are typed literally, they are not special keys!
*:<cword>* *<cword>*
<cword> is replaced with the word under the cursor (like |star|)
*:<cWORD>* *<cWORD>*
<cWORD> is replaced with the WORD under the cursor (see |WORD|)
*:<cexpr>* *<cexpr>*
<cexpr> is replaced with the word under the cursor, including more
to form a C expression. E.g., when the cursor is on "arg"
of "ptr->arg" then the result is "ptr->arg"; when the
cursor is on "]" of "list[idx]" then the result is
"list[idx]". This is used for |v:beval_text|.
*:<cfile>* *<cfile>*
<cfile> is replaced with the path name under the cursor (like what
|gf| uses)
*:<afile>* *<afile>*
<afile> When executing autocommands, is replaced with the file name
of the buffer being manipulated, or the file for a read or
write. *E495*
*:<abuf>* *<abuf>*
<abuf> When executing autocommands, is replaced with the currently
effective buffer number (for ":r file" and ":so file" it is
the current buffer, the file being read/sourced is not in a
buffer). *E496*
*:<amatch>* *<amatch>*
<amatch> When executing autocommands, is replaced with the match for
which this autocommand was executed. *E497*
It differs from <afile> only when the file name isn't used
to match with (for FileType, Syntax and SpellFileMissing
events).
*:<sfile>* *<sfile>*
<sfile> When executing a ":source" command, is replaced with the
file name of the sourced file. *E498*
When executing a function, is replaced with:
@ -860,10 +871,12 @@ Note: these are typed literally, they are not special keys!
"function {function-name1}[{lnum}]..{function-name2}[{lnum}]"
Note that filename-modifiers are useless when <sfile> is
used inside a function.
*:<slnum>* *<slnum>*
<slnum> When executing a ":source" command, is replaced with the
line number. *E842*
When executing a function it's the line number relative to
the start of the function.
*:<sflnum>* *<sflnum>*
<sflnum> When executing a script, is replaced with the line number.
It differs from <slnum> in that <sflnum> is replaced with
the script line number in any situation. *E961*
@ -898,7 +911,7 @@ These modifiers can be given, in this order:
separator is removed. Thus ":p:h" on a directory name results
on the directory name itself (without trailing slash).
When the file name is an absolute path (starts with "/" for
Unix; "x:\" for Windows), that part is not removed.
Unix; "x:\" for Win32), that part is not removed.
When there is no head (path is relative to current directory)
the result is empty.
:t Tail of the file name (last component of the name). Must
@ -1074,7 +1087,8 @@ CTRL-C Continue in Command-line mode. The command-line under the
in Normal mode. There is no redraw, thus the window will
remain visible.
:quit Discard the command line and go back to Normal mode.
":close", ":exit", ":xit" and CTRL-\ CTRL-N also work.
":close", CTRL-W c, ":exit", ":xit" and CTRL-\ CTRL-N also
work.
:qall Quit Vim, unless there are changes in some buffer.
:qall! Quit Vim, discarding changes to any buffer.

View File

@ -57,11 +57,12 @@ reset to the global value.
The options can still be overruled from a modeline when re-editing the file.
However, 'foldmethod' and 'wrap' won't be set from a modeline when 'diff' is
set.
See `:diffoff` for an easy way to revert the options.
The differences shown are actually the differences in the buffer. Thus if you
make changes after loading a file, these will be included in the displayed
diffs. You might have to do ":diffupdate" now and then, not all changes are
immediately taken into account.
immediately taken into account, especially when using an external diff command.
In your vimrc file you could do something special when Vim was started in
diff mode. You could use a construct like this: >

View File

@ -30,6 +30,8 @@ An alternative is using the 'keymap' option.
it is the Unicode character, see |digraph-encoding|.
Example: >
:digr e: 235 a: 228
< You can use `:exe` to enter a hex number: >
:exe 'digr += ' .. 0x2A72
< Avoid defining a digraph with '_' (underscore) as the
first character, it has a special meaning in the
future.

View File

@ -63,10 +63,14 @@ g CTRL-G Prints the current position of the cursor in five
ways: Column, Line, Word, Character and Byte. If the
number of Characters and Bytes is the same then the
Character position is omitted.
If there are characters in the line that take more
than one position on the screen (<Tab> or special
character), both the "real" column and the screen
column are shown, separated with a dash.
character), or characters using more than one byte per
column (characters above 0x7F when 'encoding' is
utf-8), both the byte column and the screen column are
shown, separated by a dash.
Also see the 'ruler' option and the |wordcount()|
function.
@ -298,10 +302,13 @@ CTRL-^ Edit the alternate file. Mostly the alternate file is
*gF*
[count]gF Same as "gf", except if a number follows the file
name, then the cursor is positioned on that line in
the file. The file name and the number must be
separated by a non-filename (see 'isfname') and
non-numeric character. White space between the
filename, the separator and the number are ignored.
the file.
The file name and the number must be separated by a
non-filename (see 'isfname') and non-numeric
character. " line " is also recognized, like it is
used in the output of `:verbose command UserCmd`
White space between the filename, the separator and
the number are ignored.
Examples:
eval.c:10 ~
eval.c @ 20 ~
@ -439,6 +446,9 @@ This edits the same file again with 'fileformat' set to "unix". >
:w ++enc=latin1 newfile
This writes the current buffer to "newfile" in latin1 format.
The message given when writing a file will show "[converted]" when
'fileencoding' or the value specified with ++enc differs from 'encoding'.
There may be several ++opt arguments, separated by white space. They must all
appear before any |+cmd| argument.
@ -508,15 +518,16 @@ If you start editing a new file and the 'fileformats' option is not empty
(which is the default), Vim will try to detect whether the lines in the file
are separated by the specified formats. When set to "unix,dos", Vim will
check for lines with a single <NL> (as used on Unix) or by a <CR><NL> pair
(Windows). Only when ALL lines end in <CR><NL>, 'fileformat' is set to "dos",
otherwise it is set to "unix". When 'fileformats' includes "mac", and no <NL>
characters are found in the file, 'fileformat' is set to "mac".
(MS-Windows). Only when ALL lines end in <CR><NL>, 'fileformat' is
set to "dos", otherwise it is set to "unix". When 'fileformats' includes
"mac", and no <NL> characters are found in the file, 'fileformat' is set to
"mac".
If the 'fileformat' option is set to "dos" on non-Windows systems the message
"[dos format]" is shown to remind you that something unusual is happening. On
Windows systems you get the message "[unix format]" if 'fileformat' is set to
"unix". On all systems but the Macintosh you get the message "[mac format]"
if 'fileformat' is set to "mac".
If the 'fileformat' option is set to "dos" on non-MS-Windows systems the
message "[dos format]" is shown to remind you that something unusual is
happening. On MS-Windows systems you get the message "[unix format]" if
'fileformat' is set to "unix". On all systems but the Macintosh you get the
message "[mac format]" if 'fileformat' is set to "mac".
If the 'fileformats' option is empty and DOS format is used, but while reading
a file some lines did not end in <CR><NL>, "[CR missing]" will be included in
@ -607,7 +618,7 @@ list of the current window.
:args ## x
< This will add the "x" item and sort the new list.
:argd[elete] {pattern} .. *:argd* *:argdelete* *E480*
:argd[elete] {pattern} .. *:argd* *:argdelete* *E480* *E610*
Delete files from the argument list that match the
{pattern}s. {pattern} is used like a file pattern,
see |file-pattern|. "%" can be used to delete the
@ -617,7 +628,7 @@ list of the current window.
Example: >
:argdel *.obj
:[range]argd[elete] Delete the {range} files from the argument list.
:[range]argd[elete] Delete the [range] files from the argument list.
Example: >
:10,$argdel
< Deletes arguments 10 and further, keeping 1-9. >
@ -965,7 +976,7 @@ to write anyway add a '!' to the command.
*write-permissions*
When writing a new file the permissions are read-write. For unix the mask is
0666 with additionally umask applied. When writing a file that was read Vim
0o666 with additionally umask applied. When writing a file that was read Vim
will preserve the permissions, but clear the s-bit.
*write-readonly*
@ -984,7 +995,7 @@ original file fails, there will be an error message telling you that you
lost the original file.
*DOS-format-write*
If the 'fileformat' is "dos", <CR> <NL> is used for <EOL>. This is default
If the 'fileformat' is "dos", <CR><NL> is used for <EOL>. This is default
for Windows. On other systems the message "[dos format]" is shown to
remind you that an unusual <EOL> was used.
*Unix-format-write*
@ -1018,11 +1029,11 @@ When the file name is actually a device name, Vim will not make a backup (that
would be impossible). You need to use "!", since the device already exists.
Example for Unix: >
:w! /dev/lpt0
and Windows: >
and MS-Windows: >
:w! lpt0
For Unix a device is detected when the name doesn't refer to a normal file or
a directory. A fifo or named pipe also looks like a device to Vim.
For Windows the device is detected by its name:
For MS-Windows the device is detected by its name:
CON
CLOCK$
NUL
@ -1036,9 +1047,9 @@ The names can be in upper- or lowercase.
*:q* *:quit*
:q[uit] Quit the current window. Quit Vim if this is the last
window. This fails when changes have been made and
Vim refuses to |abandon| the current buffer, and when
the last file in the argument list has not been
|edit-window|. This fails when changes have been made
and Vim refuses to |abandon| the current buffer, and
when the last file in the argument list has not been
edited.
If there are other tab pages and quitting the last
window in the current tab page the current tab page is
@ -1063,18 +1074,22 @@ The names can be in upper- or lowercase.
code. See |:cq|.
*:wq*
:wq [++opt] Write the current file and quit. Writing fails when
the file is read-only or the buffer does not have a
name. Quitting fails when the last file in the
argument list has not been edited.
:wq [++opt] Write the current file and close the window. If this
was the last |edit-window| Vim quits.
Writing fails when the file is read-only or the buffer
does not have a name. Quitting fails when the last
file in the argument list has not been edited.
:wq! [++opt] Write the current file and quit. Writing fails when
the current buffer does not have a name.
:wq! [++opt] Write the current file and close the window. If this
was the last |edit-window| Vim quits. Writing fails
when the current buffer does not have a name.
:wq [++opt] {file} Write to {file} and quit. Quitting fails when the
:wq [++opt] {file} Write to {file} and close the window. If this was the
last |edit-window| Vim quits. Quitting fails when the
last file in the argument list has not been edited.
:wq! [++opt] {file} Write to {file} and quit.
:wq! [++opt] {file} Write to {file} and close the current window. Quit
Vim if this was the last |edit-window|.
:[range]wq[!] [++opt] [file]
Same as above, but only write the lines in [range].
@ -1091,10 +1106,10 @@ The names can be in upper- or lowercase.
Same as :xit.
*ZZ*
ZZ Write current file, if modified, and quit (same as
":x"). (Note: If there are several windows for the
current file, the file is written if it was modified
and the window is closed).
ZZ Write current file, if modified, and close the current
window (same as ":x").
If there are several windows for the current file,
only the current window is closed.
*ZQ*
ZQ Quit without checking for changes (same as ":q!").
@ -1195,13 +1210,13 @@ For versions of Vim where browsing is not supported, the command is executed
unmodified.
*browsefilter*
For Windows you can modify the filters that are used in the browse dialog. By
setting the g:browsefilter or b:browsefilter variables, you can change the
filters globally or locally to the buffer. The variable is set to a string in
the format "{filter label}\t{pattern};{pattern}\n" where {filter label} is the
text that appears in the "Files of Type" comboBox, and {pattern} is the
pattern which filters the filenames. Several patterns can be given, separated
by ';'.
For MS-Windows you can modify the filters that are used in the browse
dialog. By setting the g:browsefilter or b:browsefilter variables, you can
change the filters globally or locally to the buffer. The variable is set to
a string in the format "{filter label}\t{pattern};{pattern}\n" where {filter
label} is the text that appears in the "Files of Type" comboBox, and {pattern}
is the pattern which filters the filenames. Several patterns can be given,
separated by ';'.
For example, to have only Vim files in the dialog, you could use the following
command: >
@ -1248,7 +1263,7 @@ exist, the next-higher scope in the hierarchy applies.
Does not change the meaning of an already opened file,
because its full path name is remembered. Files from
the |arglist| may change though!
On Windows this also changes the active drive.
On MS-Windows this also changes the active drive.
To change to the directory of the current file: >
:cd %:h
<
@ -1279,7 +1294,7 @@ exist, the next-higher scope in the hierarchy applies.
*:lch* *:lchdir*
:lch[dir][!] Same as |:lcd|.
*:lcd-*
*:lcd-*
:lc[d][!] - Change to the previous current directory (before the
previous ":lcd {path}" command).
@ -1323,7 +1338,7 @@ to 0, 'modeline' off, 'expandtab' off). Setting the 'binary' option has the
same effect. Don't forget to do this before reading the file.
There are a few things to remember when editing binary files:
- When editing executable files the number of characters must not change.
- When editing executable files the number of bytes must not change.
Use only the "R" or "r" command to change text. Do not delete characters
with "x" or by backspacing.
- Set the 'textwidth' option to 0. Otherwise lines will unexpectedly be
@ -1335,8 +1350,8 @@ There are a few things to remember when editing binary files:
It is also possible that you get an "out of memory" error when reading the
file.
- Make sure the 'binary' option is set BEFORE loading the
file. Otherwise both <CR> <NL> and <NL> are considered to end a line
and when the file is written the <NL> will be replaced with <CR> <NL>.
file. Otherwise both <CR><NL> and <NL> are considered to end a line
and when the file is written the <NL> will be replaced with <CR><NL>.
- <Nul> characters are shown on the screen as ^@. You can enter them with
"CTRL-V CTRL-@" or "CTRL-V 000".
- To insert a <NL> character in the file split a line. When writing the
@ -1372,7 +1387,7 @@ focus.
If you want to automatically reload a file when it has been changed outside of
Vim, set the 'autoread' option. This doesn't work at the moment you write the
file though, only when the file wasn't changed inside of Vim.
*ignore-timestamp*
If you do not want to be asked or automatically reload the file, you can use
this: >
set buftype=nofile

File diff suppressed because it is too large Load Diff

View File

@ -136,6 +136,7 @@ can be used to overrule the filetype used for certain extensions:
*.w g:filetype_w |ft-cweb-syntax|
*.i g:filetype_i |ft-progress-syntax|
*.p g:filetype_p |ft-pascal-syntax|
*.pp g:filetype_pp |ft-pascal-syntax|
*.sh g:bash_is_sh |ft-sh-syntax|
*.tex g:tex_flavor |ft-tex-plugin|
@ -263,13 +264,13 @@ all loaded. For example, if this command: >
produces this output:
runtimepath=/etc/vim,~/.config/nvim,/usr/local/share/vim/vim60 ~
runtimepath=/etc/vim,~/.config/nvim,/usr/local/share/vim/vim82 ~
then Vim will load all plugins in these directories and below:
/etc/vim/plugin/ ~
~/.config/nvim/plugin/ ~
/usr/local/share/vim/vim60/plugin/ ~
/usr/local/share/vim/vim82/plugin/ ~
Note that the last one is the value of $VIMRUNTIME which has been expanded.
@ -353,6 +354,13 @@ ways to change this:
3. Docs for the default filetype plugins. *ftplugin-docs*
AWK *ft-awk-plugin*
Support for features specific to GNU Awk, like @include, can be enabled by
setting: >
let g:awk_is_gawk = 1
CHANGELOG *ft-changelog-plugin*
Allows for easy entrance of Changelog entries in Changelog files. There are
@ -568,6 +576,13 @@ So `groff`'s pre-formatting output will be the same as with `g:man_hardwrap=0` i
To disable bold highlighting: >
:highlight link manBold Normal
MARKDOWN *ft-markdown-plugin*
To enable folding use this: >
let g:markdown_folding = 1
<
PDF *ft-pdf-plugin*
Two maps, <C-]> and <C-T>, are provided to simulate a tag stack for navigating

64
runtime/doc/ft_ps1.txt Normal file
View File

@ -0,0 +1,64 @@
*ps1.txt* A Windows PowerShell syntax plugin for Vim
Author: Peter Provost <https://www.github.com/PProvost>
License: Apache 2.0
URL: https://github.com/PProvost/vim-ps1
INTRODUCTION *ps1-syntax*
This plugin provides Vim syntax, indent and filetype detection for Windows
PowerShell scripts, modules, and XML configuration files.
ABOUT *ps1-about*
Grab the latest version or report a bug on GitHub:
https://github.com/PProvost/vim-ps1
FOLDING *ps1-folding*
The ps1 syntax file provides syntax folding (see |:syn-fold|) for script blocks
and digital signatures in scripts.
When 'foldmethod' is set to "syntax" then function script blocks will be
folded unless you use the following in your .vimrc or before opening a script: >
:let g:ps1_nofold_blocks = 1
<
Digital signatures in scripts will also be folded unless you use: >
:let g:ps1_nofold_sig = 1
<
Note: syntax folding might slow down syntax highlighting significantly,
especially for large files.
COMPILER *ps1-compiler*
The powershell `:compiler` script configures |:make| to execute the script in
PowerShell.
It tries to pick a smart default PowerShell command: `pwsh` if available and
`powershell` otherwise, but you can customize the command: >
:let g:ps1_makeprg_cmd = '/path/to/pwsh'
<
To configure whether to show the exception type information: >
:let g:ps1_efm_show_error_categories = 1
<
KEYWORD LOOKUP *ps1-keyword*
To look up keywords using PowerShell's Get-Help, press the |K| key. For more
convenient paging, the pager `less` should be installed, which is included in
many Linux distributions and in macOS.
Many other distributions are available for Windows like
https://chocolatey.org/packages/less/. Make sure `less` is in a directory
listed in the `PATH` environment variable, which chocolatey above does.
------------------------------------------------------------------------------
vim:ft=help:

126
runtime/doc/ft_raku.txt Normal file
View File

@ -0,0 +1,126 @@
*vim-raku.txt* The Raku programming language filetype
*vim-raku*
Vim-raku provides syntax highlighting, indentation, and other support for
editing Raku programs.
1. Using Unicode in your Raku files |raku-unicode|
==============================================================================
1. Using Unicode in your Raku files *raku-unicode*
Defining new operators using Unicode symbols is a good way to make your
Raku program easy to read. See:
https://perl6advent.wordpress.com/2012/12/18/day-18-formulas-resistance-is-futile/
While Raku does define ASCII alternatives for some common operators (see
https://docs.raku.org/language/unicode_ascii), using the full range of
Unicode operators is highly desirable. Your operating system provides input
facilities, but using the features built in to Vim may be preferable.
The natural way to produce these symbols in Vim is to use digraph shortcuts
(:help |digraphs-use|). Many of them are defined; type `:digraphs` to get
the list. A convenient way to read the list of digraphs is to save them in a
file. From the shell: >
vim +'redir >/tmp/vim-digraphs-listing.txt' +digraphs +'redir END' +q
Some of them are available with standard Vim digraphs:
<< « /0 ∅ !< ≮ ~
>> » Ob ∘ !> ≯ ~
., … 00 ∞ (C ⊂ ~
(U ∩ -: ÷ )C ⊃ ~
)U (_ ⊆ >= ≥ ~
?= ≅ )_ ⊇ =< ≤ ~
(- ∈ ?= ≅ != ≠ ~
-) ∋ ?- ≃ ~
The Greek alphabet is available with '*' followed by a similar Latin symbol:
*p π ~
*t τ ~
*X × ~
Numbers, subscripts and superscripts are available with 's' and 'S':
0s ₀ 0S ⁰ ~
1s ₁ 1S ¹ ~
2s ₂ 9S ⁹ ~
But some don´t come defined by default. Those are digraph definitions you can
add in your ~/.vimrc file. >
exec 'digraph \\ '.char2nr('')
exec 'digraph \< '.char2nr('≼')
exec 'digraph \> '.char2nr('≽')
exec 'digraph (L '.char2nr('⊈')
exec 'digraph )L '.char2nr('⊉')
exec 'digraph (/ '.char2nr('⊄')
exec 'digraph )/ '.char2nr('⊅')
exec 'digraph )/ '.char2nr('⊅')
exec 'digraph U+ '.char2nr('⊎')
exec 'digraph 0- '.char2nr('⊖')
" Euler's constant
exec 'digraph ne '.char2nr('𝑒')
" Raku's atomic operations marker
exec 'digraph @@ '.char2nr('⚛')
Alternatively, you can write Insert mode abbreviations that convert ASCII-
based operators into their single-character Unicode equivalent. >
iabbrev <buffer> !(<) ⊄
iabbrev <buffer> !(<=) ⊈
iabbrev <buffer> !(>) ⊅
iabbrev <buffer> !(>=) ⊉
iabbrev <buffer> !(cont) ∌
iabbrev <buffer> !(elem) ∉
iabbrev <buffer> != ≠
iabbrev <buffer> (&) ∩
iabbrev <buffer> (+) ⊎
iabbrev <buffer> (-)
iabbrev <buffer> (.) ⊍
iabbrev <buffer> (<) ⊂
iabbrev <buffer> (<+) ≼
iabbrev <buffer> (<=) ⊆
iabbrev <buffer> (>) ⊃
iabbrev <buffer> (>+) ≽
iabbrev <buffer> (>=) ⊇
iabbrev <buffer> (\|)
iabbrev <buffer> (^) ⊖
iabbrev <buffer> (atomic) ⚛
iabbrev <buffer> (cont) ∋
iabbrev <buffer> (elem) ∈
iabbrev <buffer> * ×
iabbrev <buffer> **0 ⁰
iabbrev <buffer> **1 ¹
iabbrev <buffer> **2 ²
iabbrev <buffer> **3 ³
iabbrev <buffer> **4 ⁴
iabbrev <buffer> **5 ⁵
iabbrev <buffer> **6 ⁶
iabbrev <buffer> **7 ⁷
iabbrev <buffer> **8 ⁸
iabbrev <buffer> **9 ⁹
iabbrev <buffer> ... …
iabbrev <buffer> / ÷
iabbrev <buffer> << «
iabbrev <buffer> <<[=]<< «=«
iabbrev <buffer> <<[=]>> «=»
iabbrev <buffer> <= ≤
iabbrev <buffer> =~= ≅
iabbrev <buffer> >= ≥
iabbrev <buffer> >> »
iabbrev <buffer> >>[=]<< »=«
iabbrev <buffer> >>[=]>> »=»
iabbrev <buffer> Inf ∞
iabbrev <buffer> atomic-add-fetch ⚛+=
iabbrev <buffer> atomic-assign ⚛=
iabbrev <buffer> atomic-fetch ⚛
iabbrev <buffer> atomic-dec-fetch --⚛
iabbrev <buffer> atomic-fetch-dec ⚛--
iabbrev <buffer> atomic-fetch-inc ⚛++
iabbrev <buffer> atomic-inc-fetch ++⚛
iabbrev <buffer> atomic-sub-fetch ⚛−=
iabbrev <buffer> e 𝑒
iabbrev <buffer> o ∘
iabbrev <buffer> pi π
iabbrev <buffer> set() ∅
iabbrev <buffer> tau τ
<
vim:tw=78:ts=8:noet:ft=help:norl:

View File

@ -308,7 +308,7 @@ can create any of the following: >
~/.config/nvim/indent/sqlite.vim
No changes are necessary to the SQLSetType function. It will automatically
pickup the new SQL files and load them when you issue the SQLSetType command.
pick up the new SQL files and load them when you issue the SQLSetType command.
==============================================================================
@ -338,8 +338,8 @@ The defaults static maps are: >
imap <buffer> <C-C>T <C-\><C-O>:call sqlcomplete#Map('sqlType')<CR><C-X><C-O>
imap <buffer> <C-C>s <C-\><C-O>:call sqlcomplete#Map('sqlStatement')<CR><C-X><C-O>
The use of "<C-C>" can be user chosen by using the following in your
|init.vim| as it may not work properly on all platforms: >
The use of "<C-C>" can be user chosen by using the following in your |init.vim|
as it may not work properly on all platforms: >
let g:ftplugin_sql_omni_key = '<C-C>'
>
The static maps (which are based on the syntax highlight groups) follow this
@ -515,10 +515,10 @@ beginning with those characters. >
4.3.2 Column Completion: *sql-completion-columns*
The SQL completion plugin can also display a list of columns for particular
tables. The column completion is trigger via <C-C>c.
tables. The column completion is triggered via <C-C>c.
NOTE: The following example uses <Right> to trigger a column list while
the popup window is active.
the popup window is active.
Example of using column completion:
- Press <C-C>t again to display the list of tables.
@ -723,7 +723,7 @@ your platform (often a case on *nix) you define the following variable in
your |init.vim|: >
let g:omni_sql_no_default_maps = 1
Do no edit ftplugin/sql.vim directly! If you change this file your changes
Do not edit ftplugin/sql.vim directly! If you change this file your changes
will be over written on future updates. Vim has a special directory structure
which allows you to make customizations without changing the files that are
included with the Vim distribution. If you wish to customize the maps

View File

@ -180,19 +180,12 @@ This does require the |+menu| feature enabled at compile time.
Creating New Menus *creating-menus*
*:me* *:menu* *:noreme* *:noremenu*
*:am* *:amenu* *:an* *:anoremenu*
*:nme* *:nmenu* *:nnoreme* *:nnoremenu*
*:ome* *:omenu* *:onoreme* *:onoremenu*
*:vme* *:vmenu* *:vnoreme* *:vnoremenu*
*:xme* *:xmenu* *:xnoreme* *:xnoremenu*
*:sme* *:smenu* *:snoreme* *:snoremenu*
*:ime* *:imenu* *:inoreme* *:inoremenu*
*:cme* *:cmenu* *:cnoreme* *:cnoremenu*
*E330* *E327* *E331* *E336* *E333*
*E328* *E329* *E337* *E792*
To create a new menu item, use the ":menu" commands. They are mostly like
the ":map" set of commands but the first argument is a menu item name, given
as a path of menus and submenus with a '.' between them, e.g.: >
the ":map" set of commands (see |map-modes|), but the first argument is a menu
item name, given as a path of menus and submenus with a '.' between them,
e.g.: >
:menu File.Save :w<CR>
:inoremenu File.Save <C-O>:w<CR>
@ -221,6 +214,7 @@ With the shortcut "F" (while keeping the <Alt> key pressed), and then "O",
this menu can be used. The second part is shown as "Open :e". The ":e"
is right aligned, and the "O" is underlined, to indicate it is the shortcut.
*:am* *:amenu* *:an* *:anoremenu*
The ":amenu" command can be used to define menu entries for all modes at once.
To make the command work correctly, a character is automatically inserted for
some modes:
@ -253,9 +247,38 @@ expression register: >
:amenu Insert.foobar "='foobar'<CR>P
The special text <Cmd> begins a "command menu", it executes the command
directly without changing modes. Where you might use ":...<CR>" you can
instead use "<Cmd>...<CR>". See |<Cmd>| for more info. Example: >
anoremenu File.Next <Cmd>next<CR>
Note that <Esc> in Cmdline mode executes the command, like in a mapping. This
is Vi compatible. Use CTRL-C to quit Cmdline mode.
*:nme* *:nmenu* *:nnoreme* *:nnoremenu* *:nunme* *:nunmenu*
Menu commands starting with "n" work in Normal mode. |mapmode-n|
*:ome* *:omenu* *:onoreme* *:onoremenu* *:ounme* *:ounmenu*
Menu commands starting with "o" work in Operator-pending mode. |mapmode-o|
*:vme* *:vmenu* *:vnoreme* *:vnoremenu* *:vunme* *:vunmenu*
Menu commands starting with "v" work in Visual mode. |mapmode-v|
*:xme* *:xmenu* *:xnoreme* *:xnoremenu* *:xunme* *:xunmenu*
Menu commands starting with "x" work in Visual and Select mode. |mapmode-x|
*:sme* *:smenu* *:snoreme* *:snoremenu* *:sunme* *:sunmenu*
Menu commands starting with "s" work in Select mode. |mapmode-s|
*:ime* *:imenu* *:inoreme* *:inoremenu* *:iunme* *:iunmenu*
Menu commands starting with "i" work in Insert mode. |mapmode-i|
*:cme* *:cmenu* *:cnoreme* *:cnoremenu* *:cunme* *:cunmenu*
Menu commands starting with "c" work in Cmdline mode. |mapmode-c|
*:tlm* *:tlmenu* *:tln* *:tlnoremenu* *:tlu* *:tlunmenu*
Menu commands starting with "tl" work in Terminal mode. |mapmode-t|
*:menu-<silent>* *:menu-silent*
To define a menu which will not be echoed on the command line, add
"<silent>" as the first argument. Example: >
@ -431,6 +454,8 @@ Special characters in the list, just before the rhs:
* The menu was defined with "nore" to disallow remapping.
& The menu was defined with "<script>" to allow remapping script-local
mappings only.
s The menu was defined with "<silent>" to avoid showing what it is
mapped to when triggered.
- The menu was disabled.
Note that hitting <Tab> while entering a menu name after a menu command may
@ -461,13 +486,6 @@ Deleting Menus *delete-menus*
*:unme* *:unmenu*
*:aun* *:aunmenu*
*:nunme* *:nunmenu*
*:ounme* *:ounmenu*
*:vunme* *:vunmenu*
*:xunme* *:xunmenu*
*:sunme* *:sunmenu*
*:iunme* *:iunmenu*
*:cunme* *:cunmenu*
To delete a menu item or a whole submenu, use the unmenu commands, which are
analogous to the unmap commands. Eg: >
:unmenu! Edit.Paste

View File

@ -30,7 +30,7 @@ Get specific help: It is possible to go directly to whatever you want help
help entries for "word".
Or use ":helpgrep word". |:helpgrep|
Getting started: Do the Vim tutor, a 20 minute interactive training for the
Getting started: Do the Vim tutor, a 30-minute interactive course for the
basic commands, see |vimtutor|.
Read the user manual from start to end: |usr_01.txt|
@ -40,7 +40,7 @@ through the help of many others. See |credits|.
*doc-file-list* *Q_ct*
BASIC:
|quickref| Overview of the most common commands you will use
|tutor| 20 minutes training course for beginners
|tutor| 30-minute interactive course for beginners
|copying| About copyrights
|iccf| Helping poor children in Uganda
|sponsor| Sponsor Vim development, become a registered Vim user
@ -132,6 +132,7 @@ Advanced editing ~
|lua.txt| Lua API
Special issues ~
|testing.txt| testing Vim and Vim scripts
|print.txt| printing
|remote.txt| using Vim as a server or client
@ -147,7 +148,7 @@ Programming language support ~
Language support ~
|digraph.txt| list of available digraphs
|mbyte.txt| multi-byte text support
|mbyte.txt| multibyte text support
|mlang.txt| non-English language support
|rileft.txt| right-to-left editing mode
|arabic.txt| Arabic language support and editing

View File

@ -92,9 +92,9 @@ Help on help files *helphelp*
:help k| only
< Note that a space before the '|' is seen as part of
the ":help" argument.
You can also use <LF> or <CR> to separate the help
You can also use <NL> or <CR> to separate the help
command from a following command. You need to type
CTRL-V first to insert the <LF> or <CR>. Example: >
CTRL-V first to insert the <NL> or <CR>. Example: >
:help so<C-V><CR>only
<
@ -103,7 +103,11 @@ Help on help files *helphelp*
current file. See |help-translated|.
*:helpc* *:helpclose*
:helpc[lose] Close one help window, if there is one.
:helpc[lose] Close one help window, if there is one.
Vim will try to restore the window layout (including
cursor position) to the same layout it was before
opening the help window initially. This might cause
triggering several autocommands.
*:helpg* *:helpgrep*
:helpg[rep] {pattern}[@xx]
@ -155,9 +159,31 @@ When no argument is given to |:help| the file given with the 'helpfile' option
will be opened. Otherwise the specified tag is searched for in all "doc/tags"
files in the directories specified in the 'runtimepath' option.
If you would like to open the help in the current window, see this tip:
|help-curwin|.
The initial height of the help window can be set with the 'helpheight' option
(default 20).
When the help buffer is created, several local options are set to make sure
the help text is displayed as it was intended:
'iskeyword' nearly all ASCII chars except ' ', '*', '"' and '|'
'foldmethod' "manual"
'tabstop' 8
'arabic' off
'binary' off
'buflisted' off
'cursorbind' off
'diff' off
'foldenable' off
'list' off
'modifiable' off
'number' off
'relativenumber' off
'rightleft' off
'scrollbind' off
'spell' off
Jump to specific subjects by using tags. This can be done in two ways:
- Use the "CTRL-]" command while standing on the name of a command or option.
This only works when the tag is a keyword. "<C-Leftmouse>" and
@ -364,4 +390,17 @@ highlighting. So do these:
You can find the details in $VIMRUNTIME/syntax/help.vim
*inclusion*
Vim is for everybody, no matter race, gender or anything. Some people make a
big deal about using "he" or "his" when referring to the user, thinking it
means we assume the user is male. That is not the case, it's just a habit of
writing help text, which quite often is many years old. Also, a lot of the
text is written by contributors for whom English is not their first language.
We do not make any assumptions about the gender of the user, no matter how the
text is phrased. Some people have suggested using "they", but that is not
regular English. We do not want to spend much time on this discussion. The
goal is that the reader understands how Vim works, the exact wording is
secondary.
vim:tw=78:ts=8:noet:ft=help:norl:

View File

@ -22,14 +22,15 @@ See |provider-perl| for more information.
:[range]perl << [endmarker]
{script}
{endmarker}
Execute perl script {script}. Useful for including
perl code in Vim scripts. Requires perl, see
|script-here|.
Execute perl script {script}.
The {endmarker} after {script} must NOT be preceded by
any white space.
The {endmarker} below the {script} must NOT be preceded by any white space.
If [endmarker] is omitted, it defaults to a dot '.'
like for the |:append| and |:insert| commands.
If [endmarker] is omitted from after the "<<", a dot '.' must be used after
{script}, like for the |:append| and |:insert| commands.
Useful for including perl code in Vim scripts.
Requires perl, see |script-here|.
Example: >
function! MyVimMethod()

View File

@ -189,20 +189,20 @@ vim.eval(str) *python-eval*
# a number.
vim.strwidth(str) *python-strwidth*
Like |strwidth()|: returns number of display cells str occupies, tab
Like |strwidth()|: returns number of display cells str occupies, tab
is counted as one cell.
vim.foreach_rtp(callable) *python-foreach_rtp*
Call the given callable for each path in 'runtimepath' until either
callable returns something but None, the exception is raised or there
are no longer paths. If stopped in case callable returned non-None,
Call the given callable for each path in 'runtimepath' until either
callable returns something but None, the exception is raised or there
are no longer paths. If stopped in case callable returned non-None,
vim.foreach_rtp function returns the value returned by callable.
vim.chdir(*args, **kwargs) *python-chdir*
vim.fchdir(*args, **kwargs) *python-fchdir*
Run os.chdir or os.fchdir, then all appropriate vim stuff.
Note: you should not use these functions directly, use os.chdir and
os.fchdir instead. Behavior of vim.fchdir is undefined in case
Note: you should not use these functions directly, use os.chdir and
os.fchdir instead. Behavior of vim.fchdir is undefined in case
os.fchdir does not exist.
Error object of the "vim" module
@ -237,15 +237,15 @@ vim.windows *python-windows*
:py w in vim.windows # Membership test
:py n = len(vim.windows) # Number of elements
:py for w in vim.windows: # Sequential access
< Note: vim.windows object always accesses current tab page.
|python-tabpage|.windows objects are bound to parent |python-tabpage|
object and always use windows from that tab page (or throw vim.error
in case tab page was deleted). You can keep a reference to both
without keeping a reference to vim module object or |python-tabpage|,
< Note: vim.windows object always accesses current tab page.
|python-tabpage|.windows objects are bound to parent |python-tabpage|
object and always use windows from that tab page (or throw vim.error
in case tab page was deleted). You can keep a reference to both
without keeping a reference to vim module object or |python-tabpage|,
they will not lose their properties in this case.
vim.tabpages *python-tabpages*
A sequence object providing access to the list of vim tab pages. The
A sequence object providing access to the list of vim tab pages. The
object supports the following operations: >
:py t = vim.tabpages[i] # Indexing (read-only)
:py t in vim.tabpages # Membership test
@ -266,12 +266,12 @@ vim.current *python-current*
"current range". A range is a bit like a buffer, but with all access
restricted to a subset of lines. See |python-range| for more details.
Note: When assigning to vim.current.{buffer,window,tabpage} it expects
valid |python-buffer|, |python-window| or |python-tabpage| objects
respectively. Assigning triggers normal (with |autocommand|s)
switching to given buffer, window or tab page. It is the only way to
switch UI objects in python: you can't assign to
|python-tabpage|.window attribute. To switch without triggering
Note: When assigning to vim.current.{buffer,window,tabpage} it expects
valid |python-buffer|, |python-window| or |python-tabpage| objects
respectively. Assigning triggers normal (with |autocommand|s)
switching to given buffer, window or tab page. It is the only way to
switch UI objects in python: you can't assign to
|python-tabpage|.window attribute. To switch without triggering
autocommands use >
py << EOF
saved_eventignore = vim.options['eventignore']
@ -284,11 +284,11 @@ vim.current *python-current*
<
vim.vars *python-vars*
vim.vvars *python-vvars*
Dictionary-like objects holding dictionaries with global (|g:|) and
Dictionary-like objects holding dictionaries with global (|g:|) and
vim (|v:|) variables respectively.
vim.options *python-options*
Object partly supporting mapping protocol (supports setting and
Object partly supporting mapping protocol (supports setting and
getting items) providing a read-write access to global options.
Note: unlike |:set| this provides access only to global options. You
cannot use this object to obtain or set local options' values or
@ -299,7 +299,7 @@ vim.options *python-options*
buffer-local options and |python-window| objects to access to
window-local options.
Type of this object is available via "Options" attribute of vim
Type of this object is available via "Options" attribute of vim
module.
Output from Python *python-output*
@ -320,10 +320,10 @@ Output from Python *python-output*
*python2-directory* *python3-directory* *pythonx-directory*
Python 'runtimepath' handling *python-special-path*
In python vim.VIM_SPECIAL_PATH special directory is used as a replacement for
the list of paths found in 'runtimepath': with this directory in sys.path and
vim.path_hooks in sys.path_hooks python will try to load module from
{rtp}/python2 (or python3) and {rtp}/pythonx (for both python versions) for
In python vim.VIM_SPECIAL_PATH special directory is used as a replacement for
the list of paths found in 'runtimepath': with this directory in sys.path and
vim.path_hooks in sys.path_hooks python will try to load module from
{rtp}/python2 (or python3) and {rtp}/pythonx (for both python versions) for
each {rtp} found in 'runtimepath'.
Implementation is similar to the following, but written in C: >
@ -351,8 +351,8 @@ Implementation is similar to the following, but written in C: >
fmr = find_module(fullname, path)
return load_module(fullname, *fmr)
# It uses vim module itself in place of VimPathFinder class: it does not
# matter for python which object has find_module function attached to as
# It uses vim module itself in place of VimPathFinder class: it does not
# matter for python which object has find_module function attached to as
# an attribute.
class VimPathFinder(object):
@classmethod
@ -375,28 +375,28 @@ Implementation is similar to the following, but written in C: >
sys.path_hooks.append(hook)
vim.VIM_SPECIAL_PATH *python-VIM_SPECIAL_PATH*
String constant used in conjunction with vim path hook. If path hook
installed by vim is requested to handle anything but path equal to
vim.VIM_SPECIAL_PATH constant it raises ImportError. In the only other
String constant used in conjunction with vim path hook. If path hook
installed by vim is requested to handle anything but path equal to
vim.VIM_SPECIAL_PATH constant it raises ImportError. In the only other
case it uses special loader.
Note: you must not use value of this constant directly, always use
Note: you must not use value of this constant directly, always use
vim.VIM_SPECIAL_PATH object.
vim.find_module(...) *python-find_module*
vim.path_hook(path) *python-path_hook*
Methods or objects used to implement path loading as described above.
You should not be using any of these directly except for vim.path_hook
in case you need to do something with sys.meta_path. It is not
guaranteed that any of the objects will exist in the future vim
Methods or objects used to implement path loading as described above.
You should not be using any of these directly except for vim.path_hook
in case you need to do something with sys.meta_path. It is not
guaranteed that any of the objects will exist in the future vim
versions.
vim._get_paths *python-_get_paths*
Methods returning a list of paths which will be searched for by path
hook. You should not rely on this method being present in future
Methods returning a list of paths which will be searched for by path
hook. You should not rely on this method being present in future
versions, but can use it for debugging.
It returns a list of {rtp}/python2 (or {rtp}/python3) and
It returns a list of {rtp}/python2 (or {rtp}/python3) and
{rtp}/pythonx directories for each {rtp} in 'runtimepath'.
==============================================================================
@ -425,21 +425,21 @@ line numbers, which start from 1. This is particularly relevant when dealing
with marks (see below) which use vim line numbers.
The buffer object attributes are:
b.vars Dictionary-like object used to access
b.vars Dictionary-like object used to access
|buffer-variable|s.
b.options Mapping object (supports item getting, setting and
deleting) that provides access to buffer-local options
and buffer-local values of |global-local| options. Use
|python-window|.options if option is window-local,
this object will raise KeyError. If option is
|global-local| and local value is missing getting it
b.options Mapping object (supports item getting, setting and
deleting) that provides access to buffer-local options
and buffer-local values of |global-local| options. Use
|python-window|.options if option is window-local,
this object will raise KeyError. If option is
|global-local| and local value is missing getting it
will return None.
b.name String, RW. Contains buffer name (full path).
Note: when assigning to b.name |BufFilePre| and
Note: when assigning to b.name |BufFilePre| and
|BufFilePost| autocommands are launched.
b.number Buffer number. Can be used as |python-buffers| key.
Read-only.
b.valid True or False. Buffer object becomes invalid when
b.valid True or False. Buffer object becomes invalid when
corresponding buffer is wiped out.
The buffer object methods are:
@ -527,16 +527,16 @@ Window attributes are:
This is a tuple, (row,col).
height (read-write) The window height, in rows
width (read-write) The window width, in columns
vars (read-only) The window |w:| variables. Attribute is
unassignable, but you can change window
vars (read-only) The window |w:| variables. Attribute is
unassignable, but you can change window
variables this way
options (read-only) The window-local options. Attribute is
unassignable, but you can change window
options this way. Provides access only to
window-local options, for buffer-local use
|python-buffer| and for global ones use
|python-options|. If option is |global-local|
and local value is missing getting it will
options (read-only) The window-local options. Attribute is
unassignable, but you can change window
options this way. Provides access only to
window-local options, for buffer-local use
|python-buffer| and for global ones use
|python-options|. If option is |global-local|
and local value is missing getting it will
return None.
number (read-only) Window number. The first window has number 1.
This is zero in case it cannot be determined
@ -545,7 +545,7 @@ Window attributes are:
row, col (read-only) On-screen window position in display cells.
First position is zero.
tabpage (read-only) Window tab page.
valid (read-write) True or False. Window object becomes invalid
valid (read-write) True or False. Window object becomes invalid
when corresponding window is closed.
The height attribute is writable only if the screen is split horizontally.
@ -556,21 +556,21 @@ Window object type is available using "Window" attribute of vim module.
==============================================================================
Tab page objects *python-tabpage*
Tab page objects represent vim tab pages. You can obtain them in a number of
Tab page objects represent vim tab pages. You can obtain them in a number of
ways:
- via vim.current.tabpage (|python-current|)
- from indexing vim.tabpages (|python-tabpages|)
You can use this object to access tab page windows. They have no methods and
You can use this object to access tab page windows. They have no methods and
no sequence or other interfaces.
Tab page attributes are:
number The tab page number like the one returned by
number The tab page number like the one returned by
|tabpagenr()|.
windows Like |python-windows|, but for current tab page.
vars The tab page |t:| variables.
window Current tabpage window.
valid True or False. Tab page object becomes invalid when
valid True or False. Tab page object becomes invalid when
corresponding tab page is closed.
TabPage object type is available using "TabPage" attribute of vim module.
@ -578,7 +578,7 @@ TabPage object type is available using "TabPage" attribute of vim module.
==============================================================================
pyeval() and py3eval() Vim functions *python-pyeval*
To facilitate bi-directional interface, you can use |pyeval()| and |py3eval()|
To facilitate bi-directional interface, you can use |pyeval()| and |py3eval()|
functions to evaluate Python expressions and pass their values to Vim script.
|pyxeval()| is also available.
@ -586,17 +586,28 @@ functions to evaluate Python expressions and pass their values to Vim script.
Python 3 *python3*
*:py3* *:python3*
The `:py3` and `:python3` commands work similar to `:python`. A simple check
if the `:py3` command is working: >
:py3 print("Hello")
:[range]py3 {stmt}
:[range]py3 << [endmarker]
{script}
{endmarker}
To see what version of Python you have: >
:py3 import sys
:py3 print(sys.version)
:[range]python3 {stmt}
:[range]python3 << [endmarker]
{script}
{endmarker}
The `:py3` and `:python3` commands work similar to `:python`. A
simple check if the `:py3` command is working: >
:py3 print("Hello")
<
To see what version of Python you have: >
:py3 import sys
:py3 print(sys.version)
< *:py3file*
The `:py3file` command works similar to `:pyfile`.
:[range]py3f[ile] {file}
The `:py3file` command works similar to `:pyfile`.
*:py3do*
The `:py3do` command works similar to `:pydo`.
:[range]py3do {body}
The `:py3do` command works similar to `:pydo`.
*E880*
Raising SystemExit exception in python isn't endorsed way to quit vim, use: >

View File

@ -19,14 +19,14 @@ downloading Ruby there.
:rub[y] {cmd} Execute Ruby command {cmd}. A command to try it out: >
:ruby print "Hello"
:rub[y] << [endpattern]
:rub[y] << [endmarker]
{script}
{endpattern}
{endmarker}
Execute Ruby script {script}.
The {endpattern} after {script} must NOT be preceded
by any white space.
The {endmarker} after {script} must NOT be preceded by
any white space.
If [endpattern] is omitted, it defaults to a dot '.'
If [endmarker] is omitted, it defaults to a dot '.'
like for the |:append| and |:insert| commands.
This form of the |:ruby| command is mainly useful for

View File

@ -410,11 +410,11 @@ The examples below assume a 'shiftwidth' of 4.
<
*cino-(*
(N When in unclosed parentheses, indent N characters from the line
with the unclosed parentheses. Add a 'shiftwidth' for every
with the unclosed parenthesis. Add a 'shiftwidth' for every
extra unclosed parentheses. When N is 0 or the unclosed
parentheses is the first non-white character in its line, line
parenthesis is the first non-white character in its line, line
up with the next non-white character after the unclosed
parentheses. (default 'shiftwidth' * 2).
parenthesis. (default 'shiftwidth' * 2).
cino= cino=(0 >
if (c1 && (c2 || if (c1 && (c2 ||
@ -435,7 +435,7 @@ The examples below assume a 'shiftwidth' of 4.
<
*cino-U*
UN When N is non-zero, do not ignore the indenting specified by
( or u in case that the unclosed parentheses is the first
( or u in case that the unclosed parenthesis is the first
non-white character in its line. (default 0).
cino= or cino=(s cino=(s,U1 >
@ -448,8 +448,8 @@ The examples below assume a 'shiftwidth' of 4.
*cino-w*
wN When in unclosed parentheses and N is non-zero and either
using "(0" or "u0", respectively, or using "U0" and the unclosed
parentheses is the first non-white character in its line, line
up with the character immediately after the unclosed parentheses
parenthesis is the first non-white character in its line, line
up with the character immediately after the unclosed parenthesis
rather than the first non-white character. (default 0).
cino=(0 cino=(0,w1 >
@ -460,11 +460,11 @@ The examples below assume a 'shiftwidth' of 4.
<
*cino-W*
WN When in unclosed parentheses and N is non-zero and either
using "(0" or "u0", respectively and the unclosed parentheses is
using "(0" or "u0", respectively and the unclosed parenthesis is
the last non-white character in its line and it is not the
closing parentheses, indent the following line N characters
closing parenthesis, indent the following line N characters
relative to the outer context (i.e. start of the line or the
next unclosed parentheses). (default: 0).
next unclosed parenthesis). (default: 0).
cino=(0 cino=(0,W4 >
a_long_line( a_long_line(
@ -491,8 +491,8 @@ The examples below assume a 'shiftwidth' of 4.
<
*cino-m*
mN When N is non-zero, line up a line starting with a closing
parentheses with the first character of the line with the
matching opening parentheses. (default 0).
parenthesis with the first character of the line with the
matching opening parenthesis. (default 0).
cino=(s cino=(s,m1 >
c = c1 && ( c = c1 && (
@ -506,7 +506,7 @@ The examples below assume a 'shiftwidth' of 4.
<
*cino-M*
MN When N is non-zero, line up a line starting with a closing
parentheses with the first character of the previous line.
parenthesis with the first character of the previous line.
(default 0).
cino= cino=M1 >
@ -528,7 +528,7 @@ The examples below assume a 'shiftwidth' of 4.
<
*javascript-cinoptions* *javascript-indenting* *cino-J*
JN Indent JavaScript object declarations correctly by not confusing
them with labels. The value 'N' is currently unused but must be
them with labels. The value 'N' is currently unused but must be
non-zero (e.g. 'J1'). If you enable this you probably also want
to set |cino-j|. >
@ -537,7 +537,7 @@ The examples below assume a 'shiftwidth' of 4.
that: this,
some: ok,
},
"bar":{
"bar":{
a : 2,
b: "123abc",
x: 4,
@ -565,7 +565,7 @@ The examples below assume a 'shiftwidth' of 4.
recognize preprocessor lines; right-shifting lines that start
with "#" does not work.
*cino-P*
PN When N is non-zero recognize C pragmas, and indent them like any
other code; does not concern other preprocessor directives.
When N is zero (default): don't recognize C pragmas, treating
@ -606,14 +606,14 @@ the use of square and curly brackets, and otherwise by community convention.
These conventions are not universally followed, so the Clojure indent script
offers a few configurable options, listed below.
If the current vim does not include |searchpairpos()|, the indent script falls
If the current vim does not include searchpairpos(), the indent script falls
back to normal 'lisp' indenting, and the following options are ignored.
*g:clojure_maxlines*
Set maximum scan distance of |searchpairpos()|. Larger values trade
performance for correctness when dealing with very long forms. A value of 0
will scan without limits.
Set maximum scan distance of searchpairpos(). Larger values trade performance
for correctness when dealing with very long forms. A value of 0 will scan
without limits.
>
" Default
let g:clojure_maxlines = 100
@ -814,6 +814,16 @@ Detail:
<!-- --> : -1
MATLAB *ft-matlab-indent* *matlab-indent* *matlab-indenting*
The setting Function indenting format in MATLAB Editor/Debugger Language
Preferences corresponds to: >
:let g:MATLAB_function_indent = {0, 1 or 2 (default)}
Where 0 is for Classic, 1 for Indent nested functions and 2 for Indent all
functions.
PHP *ft-php-indent* *php-indent* *php-indenting*
NOTE: PHP files will be indented correctly only if PHP |syntax| is active.
@ -887,7 +897,7 @@ To automatically remove '\r' characters when the 'fileformat' is set to Unix: >
*PHP_BracesAtCodeLevel*
To indent braces at the same level than the code they contain: >
:let g:PHP_BracesAtCodeLevel = 1
This will give the following result: >
if ($foo)
{
@ -951,10 +961,12 @@ Function call arguments will indent 1 extra level. For two-space indentation: >
-------------
*PHP_IndentFunctionDeclarationParameters*
Extra indentation levels to add to arguments in multi-line function definitions. >
Extra indentation levels to add to arguments in multi-line function
definitions. >
let g:PHP_IndentFunctionDeclarationParameters = 1
Function arguments in declarations will indent 1 extra level. For two-space indentation: >
Function arguments in declarations will indent 1 extra level. For two-space
indentation: >
function call_the_thing(
$with_this,
@ -980,7 +992,7 @@ Indent after a nested paren: >
Indent for a continuation line: >
let g:pyindent_continue = 'shiftwidth() * 2'
The method uses |searchpair()| to look back for unclosed parenthesis. This
The method uses |searchpair()| to look back for unclosed parentheses. This
can sometimes be slow, thus it timeouts after 150 msec. If you notice the
indenting isn't correct, you can set a larger timeout in msec: >
let g:pyindent_searchpair_timeout = 500

View File

@ -61,22 +61,26 @@ tag char action in Insert mode ~
the cursor
|i_CTRL-Q| CTRL-Q same as CTRL-V, unless used for terminal
control flow
|i_CTRL-R| CTRL-R {0-9a-z"%#*:=}
|i_CTRL-SHIFT-Q| CTRL-SHIFT-Q {char}
like CTRL-Q unless |modifyOtherKeys| is active
|i_CTRL-R| CTRL-R {register}
insert the contents of a register
|i_CTRL-R_CTRL-R| CTRL-R CTRL-R {0-9a-z"%#*:=}
|i_CTRL-R_CTRL-R| CTRL-R CTRL-R {register}
insert the contents of a register literally
|i_CTRL-R_CTRL-O| CTRL-R CTRL-O {0-9a-z"%#*:=}
|i_CTRL-R_CTRL-O| CTRL-R CTRL-O {register}
insert the contents of a register literally
and don't auto-indent
|i_CTRL-R_CTRL-P| CTRL-R CTRL-P {0-9a-z"%#*:=}
|i_CTRL-R_CTRL-P| CTRL-R CTRL-P {register}
insert the contents of a register literally
and fix indent.
CTRL-S (used for terminal control flow)
CTRL-S not used or used for terminal control flow
|i_CTRL-T| CTRL-T insert one shiftwidth of indent in current
line
|i_CTRL-U| CTRL-U delete all entered characters in the current
line
|i_CTRL-V| CTRL-V {char} insert next non-digit literally
|i_CTRL-SHIFT-V| CTRL-SHIFT-V {char}
like CTRL-V unless |modifyOtherKeys| is active
|i_CTRL-V_digit| CTRL-V {number} insert three digit decimal number as a single
byte.
|i_CTRL-W| CTRL-W delete word before the cursor
@ -203,9 +207,9 @@ tag char note action in Normal mode ~
|CTRL-N| CTRL-N 1 same as "j"
|CTRL-O| CTRL-O 1 go to N older entry in jump list
|CTRL-P| CTRL-P 1 same as "k"
CTRL-Q (used for terminal control flow)
CTRL-Q not used, or used for terminal control flow
|CTRL-R| CTRL-R 2 redo changes which were undone with 'u'
CTRL-S (used for terminal control flow)
CTRL-S not used, or used for terminal control flow
|CTRL-T| CTRL-T jump to N older Tag in tag list
|CTRL-U| CTRL-U scroll N lines Upwards (default: half a
screen)
@ -231,8 +235,7 @@ tag char note action in Normal mode ~
2 filter Nmove text through the {filter}
command
|!!| !!{filter} 2 filter N lines through the {filter} command
|quote| "{a-zA-Z0-9.%#:-"} use register {a-zA-Z0-9.%#:-"} for next
delete, yank or put (uppercase to append)
|quote| "{register} use {register} for next delete, yank or put
({.%#:} only work with put)
|#| # 1 search backward for the Nth occurrence of
the ident under the cursor
@ -350,8 +353,8 @@ tag char note action in Normal mode ~
register x]
|Y| ["x]Y yank N lines [into register x]; synonym for
"yy"
|ZZ| ZZ store current file if modified, and exit
|ZQ| ZQ exit current file always
|ZZ| ZZ write if buffer changed and close window
|ZQ| ZQ close window without writing
|[| [{char} square bracket command (see |[| below)
\ not used
|]| ]{char} square bracket command (see |]| below)
@ -768,10 +771,10 @@ tag char note action in Normal mode ~
lines down
|gk| gk 1 like "k", but when 'wrap' on go N screen
lines up
|gn| gn 1,2 find the next match with the last used
search pattern and Visually select it
|gm| gm 1 go to character at middle of the screenline
|gM| gM 1 go to character at middle of the text line
|gn| gn 1,2 find the next match with the last used
search pattern and Visually select it
|go| go 1 cursor to byte N in the buffer
|gp| ["x]gp 2 put the text [from register x] after the
cursor N times, leave the cursor after it
@ -816,7 +819,7 @@ tag char note action in Normal mode ~
|zD| zD delete folds recursively
|zE| zE eliminate all folds
|zF| zF create a fold for N lines
|zG| zG mark word as good spelled word
|zG| zG temporarily mark word as correctly spelled
|zH| zH when 'wrap' off scroll half a screenwidth
to the right
|zL| zL when 'wrap' off scroll half a screenwidth
@ -825,7 +828,7 @@ tag char note action in Normal mode ~
|zN| zN set 'foldenable'
|zO| zO open folds recursively
|zR| zR set 'foldlevel' to the deepest fold
|zW| zW mark word as wrong (bad) spelled word
|zW| zW temporarily mark word as incorrectly spelled
|zX| zX re-apply 'foldlevel'
|z^| z^ cursor on line N (default line above
window), otherwise like "z-"
@ -837,7 +840,7 @@ tag char note action in Normal mode ~
position the cursor at the end (right side)
of the screen
|zf| zf{motion} create a fold for Nmove text
|zg| zg mark word as good spelled word
|zg| zg permanently mark word as correctly spelled
|zh| zh when 'wrap' off scroll screen N characters
to the right
|zi| zi toggle 'foldenable'
@ -858,7 +861,7 @@ tag char note action in Normal mode ~
|zuW| zuW undo |zW|
|zuG| zuG undo |zG|
|zv| zv open enough folds to view the cursor line
|zw| zw mark word as wrong (bad) spelled word
|zw| zw permanently mark word as incorrectly spelled
|zx| zx re-apply 'foldlevel' and do "zv"
|zz| zz redraw, cursor line at center of window
|z<Left>| z<Left> same as "zh"
@ -1044,7 +1047,7 @@ tag command action in Command-line editing mode ~
|c_CTRL-R_CTRL-O| CTRL-R CTRL-O {regname}
insert the contents of a register or object
under the cursor literally
CTRL-S (used for terminal control flow)
CTRL-S not used, or used for terminal control flow
|c_CTRL-T| CTRL-T previous match when 'incsearch' is active
|c_CTRL-U| CTRL-U remove all characters
|c_CTRL-V| CTRL-V insert next non-digit literally, insert three
@ -1232,11 +1235,11 @@ tag command action ~
|:cunmenu| :cunme[nu] remove menu for Command-line mode
|:cwindow| :cw[indow] open or close quickfix window
|:delete| :d[elete] delete lines
|:delmarks| :delm[arks] delete marks
|:debug| :deb[ug] run a command in debugging mode
|:debuggreedy| :debugg[reedy] read debug mode commands from normal input
|:delcommand| :delc[ommand] delete user-defined command
|:delfunction| :delf[unction] delete a user function
|:delmarks| :delm[arks] delete marks
|:diffupdate| :dif[fupdate] update 'diff' buffers
|:diffget| :diffg[et] remove differences in current buffer
|:diffoff| :diffo[ff] switch off diff mode
@ -1248,7 +1251,6 @@ tag command action ~
|:display| :di[splay] display registers
|:djump| :dj[ump] jump to #define
|:dl| :dl short for |:delete| with the 'l' flag
|:del| :del[ete]l short for |:delete| with the 'l' flag
|:dlist| :dli[st] list #defines
|:doautocmd| :do[autocmd] apply autocommands to current buffer
|:doautoall| :doautoa[ll] apply autocommands for all loaded buffers
@ -1269,7 +1271,7 @@ tag command action ~
|:emenu| :em[enu] execute a menu by name
|:endif| :en[dif] end previous :if
|:endfor| :endfo[r] end previous :for
|:endfunction| :endf[unction] end of a user function
|:endfunction| :endf[unction] end of a user function started with :function
|:endtry| :endt[ry] end previous :try
|:endwhile| :endw[hile] end previous :while
|:enew| :ene[w] edit a new, unnamed buffer
@ -1674,7 +1676,7 @@ tag command action ~
|:wqall| :wqa[ll] write all changed buffers and quit Vim
|:wshada| :wsh[ada] write to ShaDa file
|:wundo| :wu[ndo] write undo information to a file
|:xit| :x[it] write if buffer changed and quit window or Vim
|:xit| :x[it] write if buffer changed and close window
|:xall| :xa[ll] same as ":wqall"
|:xmapclear| :xmapc[lear] remove all mappings for Visual mode
|:xmap| :xm[ap] like ":map" but for Visual mode

View File

@ -95,7 +95,7 @@ CTRL-K {char1} [char2]
CTRL-N Find next keyword (see |i_CTRL-N|).
CTRL-P Find previous keyword (see |i_CTRL-P|).
CTRL-R {0-9a-z"%#*+:.-=} *i_CTRL-R*
CTRL-R {register} *i_CTRL-R*
Insert the contents of a register. Between typing CTRL-R and
the second character, '"' will be displayed to indicate that
you are expected to enter the name of a register.
@ -132,7 +132,7 @@ CTRL-R {0-9a-z"%#*+:.-=} *i_CTRL-R*
sequence will be broken.
See |registers| about registers.
CTRL-R CTRL-R {0-9a-z"%#*+/:.-=} *i_CTRL-R_CTRL-R*
CTRL-R CTRL-R {register} *i_CTRL-R_CTRL-R*
Insert the contents of a register. Works like using a single
CTRL-R, but the text is inserted literally, not as if typed.
This differs when the register contains characters like <BS>.
@ -143,8 +143,10 @@ CTRL-R CTRL-R {0-9a-z"%#*+/:.-=} *i_CTRL-R_CTRL-R*
you also want to avoid these, use CTRL-R CTRL-O, see below.
The '.' register (last inserted text) is still inserted as
typed.
After this command, the '.' register contains the text from
the register as if it was inserted by typing it.
CTRL-R CTRL-O {0-9a-z"%#*+/:.-=} *i_CTRL-R_CTRL-O*
CTRL-R CTRL-O {register} *i_CTRL-R_CTRL-O*
Insert the contents of a register literally and don't
auto-indent. Does the same as pasting with the mouse
|<MiddleMouse>|. When the register is linewise this will
@ -152,13 +154,19 @@ CTRL-R CTRL-O {0-9a-z"%#*+/:.-=} *i_CTRL-R_CTRL-O*
Does not replace characters!
The '.' register (last inserted text) is still inserted as
typed.
After this command, the '.' register contains the command
typed and not the text. I.e., the literals "^R^O" and not the
text from the register.
CTRL-R CTRL-P {0-9a-z"%#*+/:.-=} *i_CTRL-R_CTRL-P*
CTRL-R CTRL-P {register} *i_CTRL-R_CTRL-P*
Insert the contents of a register literally and fix the
indent, like |[<MiddleMouse>|.
Does not replace characters!
The '.' register (last inserted text) is still inserted as
typed.
After this command, the '.' register contains the command
typed and not the text. I.e., the literals "^R^P" and not the
text from the register.
*i_CTRL-T*
CTRL-T Insert one shiftwidth of indent at the start of the current
@ -284,6 +292,7 @@ If you enter a value of 10, it will end up in the file as a 0. The 10 is a
the buffer to a file, the <NL> character is translated into <Nul>. The <NL>
character is written at the end of each line. Thus if you want to insert a
<NL> character in a file you will have to make a line break.
Also see 'fileformat'.
*i_CTRL-X* *insert_expand*
CTRL-X enters a sub-mode where several commands can be used. Most of these
@ -358,7 +367,7 @@ CTRL-\ CTRL-O like CTRL-O but don't move the cursor *i_CTRL-\_CTRL-O*
CTRL-L when 'insertmode' is set: go to Normal mode *i_CTRL-L*
CTRL-G u break undo sequence, start new change *i_CTRL-G_u*
CTRL-G U don't break undo with next left/right cursor *i_CTRL-G_U*
movement, if the cursor stays within
movement, if the cursor stays within the
same the line
-----------------------------------------------------------------------
@ -1760,6 +1769,7 @@ a Append text after the cursor [count] times. If the
*A*
A Append text at the end of the line [count] times.
For using "A" in Visual block mode see |v_b_A|.
<insert> or *i* *insert* *<Insert>*
i Insert text before the cursor [count] times.
@ -1772,6 +1782,7 @@ I Insert text before the first non-blank in the line
When the 'H' flag is present in 'cpoptions' and the
line only contains blanks, insert start just before
the last blank.
For using "I" in Visual block mode see |v_b_I|.
*gI*
gI Insert text in column 1 [count] times.
@ -1937,11 +1948,11 @@ If the 'fileformats' option is not empty Vim tries to recognize the type of
changed, the detected format is only used while reading the file.
A similar thing happens with 'fileencodings'.
On non-Windows systems the message "[dos format]" is shown if
a file is read in DOS format, to remind you that something unusual is done.
On Macintosh and Windows the message "[unix format]" is shown if
a file is read in Unix format.
On non-Macintosh systems, the message "[Mac format]" is shown if a file is
On non-Win32 systems the message "[dos format]" is shown if a file is read in
DOS format, to remind you that something unusual is done.
On Macintosh and Win32 the message "[unix format]" is shown if a file is read
in Unix format.
On non-Macintosh systems, the message "[mac format]" is shown if a file is
read in Mac format.
An example on how to use ":r !": >

View File

@ -139,11 +139,11 @@ Vim would never have become what it is now, without the help of these people!
Flemming Madsen X11 client-server, various features and patches
Tony Mechelynck answers many user questions
Paul Moore Python interface extensions, many patches
Katsuhito Nagano Work on multi-byte versions
Sung-Hyun Nam Work on multi-byte versions
Katsuhito Nagano Work on multibyte versions
Sung-Hyun Nam Work on multibyte versions
Vince Negri Win32 GUI and generic console enhancements
Steve Oualline Author of the first Vim book |frombook|
Dominique Pelle valgrind reports and many fixes
Dominique Pelle Valgrind reports and many fixes
A.Politz Many bug reports and some fixes
George V. Reilly Win32 port, Win32 GUI start-off
Stephen Riehm bug collector
@ -324,7 +324,7 @@ notation meaning equivalent decimal value(s) ~
<CSI> command sequence intro ALT-Esc 155 *<CSI>*
<xCSI> CSI when typed in the GUI *<xCSI>*
<EOL> end-of-line (can be <CR>, <LF> or <CR><LF>,
<EOL> end-of-line (can be <CR>, <NL> or <CR><NL>,
depends on system and 'fileformat') *<EOL>*
<Ignore> cancel wait-for-character *<Ignore>*
<NOP> no-op: do nothing (useful in mappings) *<Nop>*

View File

@ -65,7 +65,7 @@ substr($0,length($0),1) == "~" { print "<B><FONT COLOR=\"PURPLE\">" substr($0,1,
#
#ad hoc code
#
/^"\|\& / {gsub(/\|/,"\\&#124;"); }
/^"\|& / {gsub(/\|/,"\\&#124;"); }
/ = b / {gsub(/ b /," \\&#98; "); }
#
# one letter tag

View File

@ -176,6 +176,12 @@ whether to use the "," mapping or the longer one. To avoid this add the
<nowait> argument. Then the mapping will be used when it matches, Vim does
not wait for more characters to be typed. However, if the characters were
already typed they are used.
Note that this works when the <nowait> mapping fully matches and is found
before any partial matches. This works when:
- There is only one matching buffer-local mapping, since these are always
found before global mappings.
- There is another buffer-local mapping that partly matches, but it is
defined earlier (last defined mapping is found first).
*:map-<silent>* *:map-silent*
To define a mapping which will not be echoed on the command line, add
@ -217,14 +223,23 @@ have a look at |maparg()|.
If the first argument to one of these commands is "<expr>" and it is used to
define a new mapping or abbreviation, the argument is an expression. The
expression is evaluated to obtain the {rhs} that is used. Example: >
:inoremap <expr> . InsertDot()
The result of the InsertDot() function will be inserted. It could check the
:inoremap <expr> . <SID>InsertDot()
The result of the s:InsertDot() function will be inserted. It could check the
text before the cursor and start omni completion when some condition is met.
Using a script-local function is preferred, to avoid polluting the global
namespace. Use <SID> in the RHS so that the script that the mapping was
defined in can be found.
For abbreviations |v:char| is set to the character that was typed to trigger
the abbreviation. You can use this to decide how to expand the {lhs}. You
should not either insert or change the v:char.
In case you want the mapping to not do anything, you can have the expression
evaluate to an empty string. If something changed that requires Vim to
go through the main loop (e.g. to update the display), return "\<Ignore>".
This is similar to "nothing" but makes Vim return from the loop that waits for
input.
Also, keep in mind that the expression may be evaluated when looking for
typeahead, before the previous command has been executed. For example: >
func StoreColumn()
@ -233,8 +248,8 @@ typeahead, before the previous command has been executed. For example: >
endfunc
nnoremap <expr> x StoreColumn()
nmap ! f!x
You will notice that g:column has the value from before executing "fx",
because "z" is evaluated before "fx" is executed.
You will notice that g:column has the value from before executing "f!",
because "x" is evaluated before "f!" is executed.
This can be solved by inserting <Ignore> before the character that is
expression-mapped: >
nmap ! f!<Ignore>x
@ -277,15 +292,8 @@ Here is an example that inserts a list number that increases: >
CTRL-L inserts the next number, CTRL-R resets the count. CTRL-R returns an
empty string, so that nothing is inserted.
Note that there are some tricks to make special keys work and escape CSI bytes
in the text. The |:map| command also does this, thus you must avoid that it
is done twice. This does not work: >
:imap <expr> <F3> "<Char-0x611B>"
Because the <Char- sequence is escaped for being a |:imap| argument and then
again for using <expr>. This does work: >
:imap <expr> <F3> "\u611B"
Using 0x80 as a single byte before other text does not work, it will be seen
as a special key.
Note that using 0x80 as a single byte before other text does not work, it will
be seen as a special key.
*<Cmd>* *:map-cmd*
The <Cmd> pseudokey begins a "command mapping", which executes the command
@ -301,14 +309,17 @@ preserved, so tricks with |gv| are not needed. Commands can be invoked
directly in cmdline-mode (which would otherwise require timer hacks).
Unlike <expr> mappings, there are no special restrictions on the <Cmd>
command: it is executed as if an (unrestricted) |autocmd| was invoked or an
async event event was processed.
command: it is executed as if an (unrestricted) |autocommand| was invoked
or an async event event was processed.
Note:
- Because <Cmd> avoids mode-changes (unlike ":") it does not trigger
|CmdlineEnter| and |CmdlineLeave| events. This helps performance.
- For the same reason, |keycodes| like <C-R><C-W> are interpreted as plain,
unmapped keys.
- The command is not echo'ed, no need for <silent>.
- In Visual mode you can use `line('v')` and `col('v')` to get one end of the
Visual area, the cursor is at the other end.
- In select-mode, |:map| and |:vmap| command mappings are executed in
visual-mode. Use |:smap| to handle select-mode.
@ -382,6 +393,8 @@ Some commands work both in Insert mode and Command-line mode, some not:
:cmap :cnoremap :cunmap :cmapclear - yes -
:lmap :lnoremap :lunmap :lmapclear yes* yes* yes*
* If 'iminsert' is 1, see |language-mapping| below.
The original Vi did not have separate mappings for
Normal/Visual/Operator-pending mode and for Insert/Command-line mode.
Therefore the ":map" and ":map!" commands enter and display mappings for
@ -599,7 +612,7 @@ construct can be used:
<Char-033> character 27
<Char-0x7f> character 127
<S-Char-114> character 114 ('r') shifted ('R')
This is useful to specify a (multi-byte) character in a 'keymap' file.
This is useful to specify a (multibyte) character in a 'keymap' file.
Upper and lowercase differences are ignored.
*map-comments*
@ -788,7 +801,7 @@ otherwise it is interpreted as two key presses:
1.11 MAPPING AN OPERATOR *:map-operator*
An operator is used before a {motion} command. To define your own operator
you must create mapping that first sets the 'operatorfunc' option and then
you must create a mapping that first sets the 'operatorfunc' option and then
invoke the |g@| operator. After the user types the {motion} command the
specified function will be called.
@ -806,35 +819,47 @@ g@{motion} Call the function set by the 'operatorfunc' option.
Here is an example that counts the number of spaces with <F4>: >
nmap <silent> <F4> :set opfunc=CountSpaces<CR>g@
vmap <silent> <F4> :<C-U>call CountSpaces(visualmode(), 1)<CR>
nnoremap <expr> <F4> CountSpaces()
xnoremap <expr> <F4> CountSpaces()
" doubling <F4> works on a line
nnoremap <expr> <F4><F4> CountSpaces() .. '_'
function! CountSpaces(type, ...)
let sel_save = &selection
let &selection = "inclusive"
let reg_save = @@
if a:0 " Invoked from Visual mode, use gv command.
silent exe "normal! gvy"
elseif a:type == 'line'
silent exe "normal! '[V']y"
else
silent exe "normal! `[v`]y"
function CountSpaces(type = '') abort
if a:type == ''
set opfunc=CountSpaces
return 'g@'
endif
echomsg strlen(substitute(@@, '[^ ]', '', 'g'))
let sel_save = &selection
let reg_save = getreginfo('"')
let cb_save = &clipboard
let visual_marks_save = [getpos("'<"), getpos("'>")]
let &selection = sel_save
let @@ = reg_save
try
set clipboard= selection=inclusive
let commands = #{line: "'[V']y", char: "`[v`]y", block: "`[\<c-v>`]y"}
silent exe 'noautocmd keepjumps normal! ' .. get(commands, a:type, '')
echom getreg('"')->count(' ')
finally
call setreg('"', reg_save)
call setpos("'<", visual_marks_save[0])
call setpos("'>", visual_marks_save[1])
let &clipboard = cb_save
let &selection = sel_save
endtry
endfunction
An <expr> mapping is used to be able to fetch any prefixed count and register.
This also avoids using a command line, which would trigger CmdlineEnter and
CmdlineLeave autocommands.
Note that the 'selection' option is temporarily set to "inclusive" to be able
to yank exactly the right text by using Visual mode from the '[ to the ']
mark.
Also note that there is a separate mapping for Visual mode. It removes the
"'<,'>" range that ":" inserts in Visual mode and invokes the function with
visualmode() and an extra argument.
Also note that the 'clipboard' option is temporarily emptied to avoid
clobbering the `"*` or `"+` registers, if its value contains the item `unnamed`
or `unnamedplus`.
==============================================================================
2. Abbreviations *abbreviations* *Abbreviations*
@ -973,7 +998,8 @@ See |:verbose-cmd| for more information.
See |:map-<buffer>| for the optional <buffer> argument.
*:una* *:unabbreviate*
:una[bbreviate] {lhs} Remove abbreviation for {lhs} from the list. If none
:una[bbreviate] [<buffer>] {lhs}
Remove abbreviation for {lhs} from the list. If none
is found, remove abbreviations in which {lhs} matches
with the {rhs}. This is done so that you can even
remove abbreviations after expansion. To avoid
@ -988,7 +1014,8 @@ See |:verbose-cmd| for more information.
same as ":ab", but for Command-line mode only.
*:cuna* *:cunabbrev*
:cuna[bbrev] {lhs} same as ":una", but for Command-line mode only.
:cuna[bbrev] [<buffer>] {lhs}
Same as ":una", but for Command-line mode only.
*:cnorea* *:cnoreabbrev*
:cnorea[bbrev] [<expr>] [<buffer>] [lhs] [rhs]
@ -1000,7 +1027,8 @@ See |:verbose-cmd| for more information.
same as ":ab", but for Insert mode only.
*:iuna* *:iunabbrev*
:iuna[bbrev] {lhs} same as ":una", but for insert mode only.
:iuna[bbrev] [<buffer>] {lhs}
Same as ":una", but for insert mode only.
*:inorea* *:inoreabbrev*
:inorea[bbrev] [<expr>] [<buffer>] [lhs] [rhs]
@ -1100,9 +1128,9 @@ Otherwise, using "<SID>" outside of a script context is an error.
If you need to get the script number to use in a complicated script, you can
use this function: >
function s:SID()
return matchstr(expand('<sfile>'), '<SNR>\zs\d\+\ze_SID$')
endfun
func s:ScriptNumber()
return matchstr(expand('<SID>'), '<SNR>\zs\d\+\ze_')
endfunc
The "<SNR>" will be shown when listing functions and mappings. This is useful
to find out what they are defined to.
@ -1175,15 +1203,15 @@ last defined. Example: >
See |:verbose-cmd| for more information.
*E174* *E182*
:com[mand][!] [{attr}...] {cmd} {rep}
:com[mand][!] [{attr}...] {cmd} {repl}
Define a user command. The name of the command is
{cmd} and its replacement text is {rep}. The command's
attributes (see below) are {attr}. If the command
already exists, an error is reported, unless a ! is
specified, in which case the command is redefined.
There is one exception: When sourcing a script again,
a command that was previously defined in that script
will be silently replaced.
{cmd} and its replacement text is {repl}. The
command's attributes (see below) are {attr}. If the
command already exists, an error is reported, unless a
! is specified, in which case the command is
redefined. There is one exception: When sourcing a
script again, a command that was previously defined in
that script will be silently replaced.
:delc[ommand] {cmd} *:delc* *:delcommand* *E184*
@ -1390,11 +1418,11 @@ feature. Use the full name for new scripts.
Replacement text ~
The replacement text for a user defined command is scanned for special escape
sequences, using <...> notation. Escape sequences are replaced with values
from the entered command line, and all other text is copied unchanged. The
resulting string is executed as an Ex command. To avoid the replacement use
<lt> in place of the initial <. Thus to include "<bang>" literally use
The replacement text {repl} for a user defined command is scanned for special
escape sequences, using <...> notation. Escape sequences are replaced with
values from the entered command line, and all other text is copied unchanged.
The resulting string is executed as an Ex command. To avoid the replacement
use <lt> in place of the initial <. Thus to include "<bang>" literally use
"<lt>bang>".
The valid escape sequences are
@ -1412,7 +1440,7 @@ The valid escape sequences are
<bang> (See the '-bang' attribute) Expands to a ! if the
command was executed with a ! modifier, otherwise
expands to nothing.
*<mods>*
*<mods>* *<q-mods>* *:command-modifiers*
<mods> The command modifiers, if specified. Otherwise, expands to
nothing. Supported modifiers are |:aboveleft|, |:belowright|,
|:botright|, |:browse|, |:confirm|, |:hide|, |:keepalt|,

View File

@ -22,7 +22,7 @@ Getting started *mbyte-first*
This is a summary of the multibyte features in Vim. If you are lucky it works
as described and you can start using Vim without much trouble. If something
doesn't work you will have to read the rest. Don't be surprised if it takes
quite a bit of work and experimenting to make Vim use all the multi-byte
quite a bit of work and experimenting to make Vim use all the multibyte
features. Unfortunately, every system has its own way to deal with multibyte
languages and it is quite complicated.
@ -85,12 +85,12 @@ You can also set 'guifont' alone, the Nvim GUI will try to find a matching
INPUT
There are several ways to enter multi-byte characters:
There are several ways to enter multibyte characters:
- For X11 XIM can be used. See |XIM|.
- For MS-Windows IME can be used. See |IME|.
- For all systems keymaps can be used. See |mbyte-keymap|.
The options 'iminsert', 'imsearch' and 'imcmdline' can be used to chose
The options 'iminsert', 'imsearch' and 'imcmdline' can be used to choose
the different input methods or disable them temporarily.
==============================================================================
@ -103,8 +103,8 @@ in, or just use a certain locale inside Vim.
WHAT IS A LOCALE? *locale*
There are many of languages in the world. And there are different cultures
and environments at least as much as the number of languages. A linguistic
There are many languages in the world. And there are different cultures and
environments at least as many as the number of languages. A linguistic
environment corresponding to an area is called "locale". This includes
information about the used language, the charset, collating order for sorting,
date format, currency format and so on. For Vim only the language and charset
@ -198,11 +198,11 @@ encoded with one byte, we call this a single-byte encoding. The most often
used one is called "latin1". This limits the number of characters to 256.
Some of these are control characters, thus even fewer can be used for text.
When some characters use two or more bytes, we call this a multi-byte
When some characters use two or more bytes, we call this a multibyte
encoding. This allows using much more than 256 characters, which is required
for most East Asian languages.
Most multi-byte encodings use one byte for the first 127 characters. These
Most multibyte encodings use one byte for the first 127 characters. These
are equal to ASCII, which makes it easy to exchange plain-ASCII text, no
matter what language is used. Thus you might see the right text even when the
encoding was set wrong.
@ -400,7 +400,7 @@ is suitable for complex input, such as CJK.
of the two ways: FrontEnd system and BackEnd system. In the FrontEnd
system, input events are snatched by the |IM-server| first, then |IM-server|
give the application the result of input. On the other hand, the BackEnd
system works reverse order. MS Windows adopt BackEnd system. In X, most of
system works reverse order. MS-Windows adopt BackEnd system. In X, most of
|IM-server|s adopt FrontEnd system. The demerit of BackEnd system is the
large overhead in communication, but it provides safe synchronization with
no restrictions on applications.
@ -512,7 +512,7 @@ input_server_name is your |IM-server| name (check your |IM-server|
your_input_style is one of |OverTheSpot|, |OffTheSpot|, |Root|. See
also |xim-input-style|.
*international may not necessary if you use X11R6.
*international may not be necessary if you use X11R6.
*.inputMethod and *.preeditType are optional if you use X11R6.
For example, when you are using kinput2 as |IM-server|, >
@ -921,7 +921,7 @@ not everybody is able to type a composing character.
==============================================================================
Overview of options *mbyte-options*
These options are relevant for editing multi-byte files.
These options are relevant for editing multibyte files.
'fileencoding' Encoding of a file. When it's different from "utf-8"
conversion is done when reading or writing the file.
@ -941,7 +941,7 @@ These options are relevant for editing multi-byte files.
==============================================================================
Contributions specifically for the multi-byte features by:
Contributions specifically for the multibyte features by:
Chi-Deok Hwang <hwang@mizi.co.kr>
SungHyun Nam <goweol@gmail.com>
K.Nagano <nagano@atese.advantest.co.jp>

View File

@ -17,13 +17,14 @@ The ":messages" command can be used to view previously given messages. This
is especially useful when messages have been overwritten or truncated. This
depends on the 'shortmess' option.
:messages Show all messages.
:mes[sages] Show all messages.
:{count}messages Show the {count} most recent messages.
:{count}mes[sages] Show the {count} most recent messages.
:messages clear Clear all messages.
:mes[sages] clear Clear all messages.
:{count}messages clear Clear messages, keeping only the {count} most
:{count}mes[sages] clear
Clear messages, keeping only the {count} most
recent ones.
The number of remembered messages is fixed at 20 for the tiny version and 200
@ -67,7 +68,7 @@ Or view a list of recent messages with: >
See `:messages` above.
LIST OF MESSAGES
*E222* *E228* *E232* *E256* *E293* *E298* *E304* *E317*
*E222* *E228* *E232* *E293* *E298* *E304* *E317*
*E318* *E356* *E438* *E439* *E440* *E316* *E320* *E322*
*E323* *E341* *E473* *E570* *E685* *E292* >
Add to read buffer
@ -761,6 +762,9 @@ and the screen is about to be redrawn:
-> Press <Enter> or <Space> to redraw the screen and continue, without that
key being used otherwise.
-> Press ':' or any other Normal mode command character to start that command.
Note that after an external command some special keys, such as the cursor
keys, may not work normally, because the terminal is still set to a state
for executing the external command.
-> Press 'k', <Up>, 'u', 'b' or 'g' to scroll back in the messages. This
works the same way as at the |more-prompt|. Only works when 'more' is on.
-> Pressing 'j', 'f', 'd' or <Down> is ignored when messages scrolled off the

View File

@ -7,7 +7,7 @@
Multi-language features *multilang* *multi-lang*
This is about using messages and menus in various languages. For editing
multi-byte text see |multibyte|.
multibyte text see |multibyte|.
The basics are explained in the user manual: |usr_45.txt|.

View File

@ -182,11 +182,14 @@ l or *l*
*^*
^ To the first non-blank character of the line.
|exclusive| motion.
|exclusive| motion. Any count is ignored.
*$* *<End>* *<kEnd>*
$ or <End> To the end of the line. When a count is given also go
[count - 1] lines downward. |inclusive| motion.
[count - 1] lines downward, or as far is possible.
|inclusive| motion. If a count of 2 of larger is
given and the cursor is on the last line, that is an
error an the cursor doesn't move.
In Visual mode the cursor goes to just after the last
character in the line.
When 'virtualedit' is active, "$" may move the cursor
@ -478,10 +481,11 @@ a set of section macros, specified by the pairs of characters in the
'sections' option. The default is "SHNHH HUnhsh", which defines a section to
start at the nroff macros ".SH", ".NH", ".H", ".HU", ".nh" and ".sh".
The "]" and "[" commands stop at the '{' or '}' in the first column. This is
useful to find the start or end of a function in a C program. Note that the
first character of the command determines the search direction and the
second character the type of brace found.
The "]]" and "[[" commands stop at the '{' in the first column. This is
useful to find the start of a function in a C program. To search for a '}' in
the first column, the end of a C function, use "][" (forward) or "[]"
(backward). Note that the first character of the command determines the
search direction.
If your '{' or '}' are not in the first column, and you would like to use "[["
and "]]" anyway, try these mappings: >
@ -944,6 +948,7 @@ These commands are not marks themselves, but jump to a mark:
- numbered marks '0 - '9
- last insert position '^
- last change position '.
- last affected text area '[ and ']
- the Visual area '< and '>
- line numbers in placed signs
- line numbers in quickfix positions
@ -1024,11 +1029,11 @@ The maximum number of entries is fixed at 100.
For example, after three jump commands you have this jump list:
jump line col file/text ~
3 1 0 some text ~
2 70 0 another line ~
1 1154 23 end. ~
> ~
jump line col file/text ~
3 1 0 some text ~
2 70 0 another line ~
1 1154 23 end. ~
> ~
The "file/text" column shows the file name, or the text at the jump if it is
in the current file (an indent is removed and a long line is truncated to fit
@ -1037,11 +1042,11 @@ in the window).
You are currently in line 1167. If you then use the CTRL-O command, the
cursor is put in line 1154. This results in:
jump line col file/text ~
2 1 0 some text ~
1 70 0 another line ~
> 0 1154 23 end. ~
1 1167 0 foo bar ~
jump line col file/text ~
2 1 0 some text ~
1 70 0 another line ~
> 0 1154 23 end. ~
1 1167 0 foo bar ~
The pointer will be set at the last used jump position. The next CTRL-O
command will use the entry above it, the next CTRL-I command will use the
@ -1068,12 +1073,12 @@ that calling setpos() does not do this.
After the CTRL-O command that got you into line 1154 you could give another
jump command (e.g., "G"). The jump list would then become:
jump line col file/text ~
4 1 0 some text ~
3 70 0 another line ~
2 1167 0 foo bar ~
1 1154 23 end. ~
> ~
jump line col file/text ~
4 1 0 some text ~
3 70 0 another line ~
2 1167 0 foo bar ~
1 1154 23 end. ~
> ~
The line numbers will be adjusted for deleted and inserted lines. This fails
if you stop editing a file without writing, like with ":n!".
@ -1168,13 +1173,13 @@ sequence of small changes in a line, for example "xxxxx", adds many positions
to the change list. When 'textwidth' is zero 'wrapmargin' is used. When that
also isn't set a fixed number of 79 is used. Detail: For the computations
bytes are used, not characters, to avoid a speed penalty (this only matters
for multi-byte encodings).
for multibyte encodings).
Note that when text has been inserted or deleted the cursor position might be
a bit different from the position of the change. Especially when lines have
been deleted.
When the |:keepjumps| command modifier is used the position of a change is not
When the `:keepjumps` command modifier is used the position of a change is not
remembered.
*:changes*
@ -1215,7 +1220,7 @@ remembered.
#if, #ifdef, #else, #elif, #endif
C preprocessor conditionals (when the
cursor is on the # or no ([{
following)
is following)
For other items the matchit plugin can be used, see
|matchit|. This plugin also helps to skip matches in
comments.
@ -1244,19 +1249,19 @@ remembered.
#if/#else/#endif makes the movement linewise.
*[(*
[( go to [count] previous unmatched '('.
[( Go to [count] previous unmatched '('.
|exclusive| motion.
*[{*
[{ go to [count] previous unmatched '{'.
[{ Go to [count] previous unmatched '{'.
|exclusive| motion.
*])*
]) go to [count] next unmatched ')'.
]) Go to [count] next unmatched ')'.
|exclusive| motion.
*]}*
]} go to [count] next unmatched '}'.
]} Go to [count] next unmatched '}'.
|exclusive| motion.
The above four commands can be used to go to the start or end of the current
@ -1304,17 +1309,21 @@ file looks like this: >
body_two();
}
}
[To try this out copy the text and put it in a new buffer, the help text above
confuses the jump commands]
Starting with the cursor on "body_two()", using "[m" will jump to the '{' at
the start of "method_two()" (obviously this is much more useful when the
method is long!). Using "2[m" will jump to the start of "method_one()".
Using "3[m" will jump to the start of the class.
*[#*
[# go to [count] previous unmatched "#if" or "#else".
[# Go to [count] previous unmatched "#if" or "#else".
|exclusive| motion.
*]#*
]# go to [count] next unmatched "#else" or "#endif".
]# Go to [count] next unmatched "#else" or "#endif".
|exclusive| motion.
These two commands work in C programs that contain #if/#else/#endif
@ -1322,11 +1331,11 @@ constructs. It brings you to the start or end of the #if/#else/#endif where
the current line is included. You can then use "%" to go to the matching line.
*[star* *[/*
[* or [/ go to [count] previous start of a C comment "/*".
[* or [/ Go to [count] previous start of a C comment "/*".
|exclusive| motion.
*]star* *]/*
]* or ]/ go to [count] next end of a C comment "*/".
]* or ]/ Go to [count] next end of a C comment "*/".
|exclusive| motion.

View File

@ -144,11 +144,11 @@ the option value, use '\"' instead. This example sets the 'titlestring'
option to 'hi "there"': >
:set titlestring=hi\ \"there\"
For Windows backslashes in file names are mostly not removed. More
precise: For options that expect a file name (those where environment
variables are expanded) a backslash before a normal file name character is not
removed. But a backslash before a special character (space, backslash, comma,
etc.) is used like explained above.
For Win32 backslashes in file names are mostly not removed. More precise: For
options that expect a file name (those where environment variables are
expanded) a backslash before a normal file name character is not removed. But
a backslash before a special character (space, backslash, comma, etc.) is used
like explained above.
There is one special situation, when the value starts with "\\": >
:set dir=\\machine\path results in "\\machine\path"
:set dir=\\\\machine\\path results in "\\machine\path"
@ -394,10 +394,11 @@ to set options automatically for one or more files:
*modeline* *vim:* *vi:* *ex:* *E520*
There are two forms of modelines. The first form:
[text]{white}{vi:|vim:|ex:}[white]{options}
[text{white}]{vi:|vim:|ex:}[white]{options}
[text] any text or empty
{white} at least one blank character (<Space> or <Tab>)
[text{white}] empty or any text followed by at least one blank
character (<Space> or <Tab>); "ex:" always requires at
least one blank character
{vi:|vim:|ex:} the string "vi:", "vim:" or "ex:"
[white] optional white space
{options} a list of option settings, separated with white space
@ -410,10 +411,11 @@ Examples:
The second form (this is compatible with some versions of Vi):
[text]{white}{vi:|vim:|Vim:|ex:}[white]se[t] {options}:[text]
[text{white}]{vi:|vim:|Vim:|ex:}[white]se[t] {options}:[text]
[text] any text or empty
{white} at least one blank character (<Space> or <Tab>)
[text{white}] empty or any text followed by at least one blank
character (<Space> or <Tab>); "ex:" always requires at
least one blank character
{vi:|vim:|Vim:|ex:} the string "vi:", "vim:", "Vim:" or "ex:"
[white] optional white space
se[t] the string "set " or "se " (note the space); When
@ -474,9 +476,9 @@ If an error is detected the rest of the line is skipped.
If you want to include a ':' in a set command precede it with a '\'. The
backslash in front of the ':' will be removed. Example:
/* vi:set dir=c\:\tmp: */ ~
This sets the 'dir' option to "c:\tmp". Only a single backslash before the
':' is removed. Thus to include "\:" you have to specify "\\:".
/* vi:set fillchars=stl\:^,vert\:\|: */ ~
This sets the 'fillchars' option to "stl:^,vert:\|". Only a single backslash
before the ':' is removed. Thus to include "\:" you have to specify "\\:".
*E992*
No other commands than "set" are supported, for security reasons (somebody
might create a Trojan horse text file with modelines). And not all options
@ -589,9 +591,9 @@ A jump table for the options with a short description can be found at |Q_op|.
(or Vim is run inside an xterm invoked with "-cjkwidth" option.),
this option should be set to "double" to match the width perceived
by Vim with the width of glyphs in the font. Perhaps it also has
to be set to "double" under CJK Windows XP when the system locale is
set to one of CJK locales.
See Unicode Standard Annex #11 (http://www.unicode.org/reports/tr11).
to be set to "double" under CJK MS-Windows when the system locale is
set to one of CJK locales. See Unicode Standard Annex #11
(http://www.unicode.org/reports/tr11).
Vim may set this option automatically at startup time when Vim is
compiled with the |+termresponse| feature and if t_u7 is set to the
@ -836,9 +838,9 @@ A jump table for the options with a short description can be found at |Q_op|.
impossible!). Writing may fail because of this.
- A directory "." means to put the backup file in the same directory
as the edited file.
- A directory starting with "./" (or ".\" for Windows) means to
put the backup file relative to where the edited file is. The
leading "." is replaced with the path name of the edited file.
- A directory starting with "./" (or ".\" for MS-Windows) means to put
the backup file relative to where the edited file is. The leading
"." is replaced with the path name of the edited file.
("." inside a directory name has no special meaning).
- Spaces after the comma are ignored, other spaces are considered part
of the directory name. To have a space at the start of a directory
@ -944,7 +946,7 @@ A jump table for the options with a short description can be found at |Q_op|.
(mostly used in |Normal-mode| or |Cmdline-mode|).
esc hitting <Esc> in |Normal-mode|.
ex In |Visual-mode|, hitting |Q| results in an error.
hangul Error occurred when using hangul input.
hangul Ignored.
insertmode Pressing <Esc> in 'insertmode'.
lang Calling the beep module for Lua/Mzscheme/TCL.
mess No output available for |g<|.
@ -1100,6 +1102,7 @@ A jump table for the options with a short description can be found at |Q_op|.
This option is used together with 'bufhidden' and 'swapfile' to
specify special kinds of buffers. See |special-buffers|.
Also see |win_gettype()|, which returns the type of the window.
Be careful with changing this option, it can have many side effects!
@ -1392,7 +1395,7 @@ A jump table for the options with a short description can be found at |Q_op|.
*'completeslash'* *'csl'*
'completeslash' 'csl' string (default: "")
local to buffer
{not in Vi} {only for MS-Windows}
{only for MS-Windows}
When this option is set it overrules 'shellslash' for completion:
- When this option is set to "slash", a forward slash is used for path
completion in insert mode. This is useful when editing HTML tag, or
@ -1855,7 +1858,7 @@ A jump table for the options with a short description can be found at |Q_op|.
"x" delete each combining character on its own. When it is off (the
default) the character along with its combining characters are
deleted.
Note: When 'delcombine' is set "xx" may work different from "2x"!
Note: When 'delcombine' is set "xx" may work differently from "2x"!
This is useful for Arabic, Hebrew and many other languages where one
may have combining characters overtop of base characters, and want
@ -2009,6 +2012,8 @@ A jump table for the options with a short description can be found at |Q_op|.
'directory' 'dir' string (default "$XDG_DATA_HOME/nvim/swap//")
global
List of directory names for the swap file, separated with commas.
Possible items:
- The swap file will be created in the first directory where this is
possible. If it is not possible in any directory, but last
directory listed in the option does not exist, it is created.
@ -2018,13 +2023,14 @@ A jump table for the options with a short description can be found at |Q_op|.
the edited file. On Unix, a dot is prepended to the file name, so
it doesn't show in a directory listing. On MS-Windows the "hidden"
attribute is set and a dot prepended if possible.
- A directory starting with "./" (or ".\" for Windows) means to
put the swap file relative to where the edited file is. The leading
"." is replaced with the path name of the edited file.
- A directory starting with "./" (or ".\" for MS-Windows) means to put
the swap file relative to where the edited file is. The leading "."
is replaced with the path name of the edited file.
- For Unix and Win32, if a directory ends in two path separators "//",
the swap file name will be built from the complete path to the file
with all path separators substituted to percent '%' signs. This will
ensure file name uniqueness in the preserve directory.
with all path separators replaced by percent '%' signs (including
the colon following the drive letter on Win32). This will ensure
file name uniqueness in the preserve directory.
On Win32, it is also possible to end with "\\". However, When a
separating comma is following, you must use "//", since "\\" will
include the comma in the file name. Therefore it is recommended to
@ -2044,9 +2050,10 @@ A jump table for the options with a short description can be found at |Q_op|.
the same file twice will result in a warning. Using "/tmp" on Unix is
discouraged: When the system crashes you lose the swap file.
"/var/tmp" is often not cleared when rebooting, thus is a better
choice than "/tmp". But it can contain a lot of files, your swap
files get lost in the crowd. That is why a "tmp" directory in your
home directory is tried first.
choice than "/tmp". But others on the computer may be able to see the
files, and it can contain a lot of files, your swap files get lost in
the crowd. That is why a "tmp" directory in your home directory is
tried first.
The use of |:set+=| and |:set-=| is preferred when adding or removing
directories from the list. This avoids problems when a future version
uses another default.
@ -2086,7 +2093,9 @@ A jump table for the options with a short description can be found at |Q_op|.
'emoji' 'emo' boolean (default: on)
global
When on all Unicode emoji characters are considered to be full width.
This excludes "text emoji" characters, which are normally displayed as
single width. Unfortunately there is no good specification for this
and it has been determined on trial-and-error basis.
*'encoding'* *'enc'* *E543*
'encoding' 'enc'
@ -2283,7 +2292,7 @@ A jump table for the options with a short description can be found at |Q_op|.
local to buffer
This gives the <EOL> of the current buffer, which is used for
reading/writing the buffer from/to a file:
dos <CR> <NL>
dos <CR><NL>
unix <NL>
mac <CR>
When "dos" is used, CTRL-Z at the end of a file is ignored.
@ -2970,7 +2979,7 @@ A jump table for the options with a short description can be found at |Q_op|.
*'go-v'*
'v' Use a vertical button layout for dialogs. When not included,
a horizontal layout is preferred, but when it doesn't fit a
vertical layout is used anyway.
vertical layout is used anyway. Not supported in GTK 3.
*'go-p'*
'p' Use Pointer callbacks for X11 GUI. This is required for some
window managers. If the cursor is not blinking or hollow at
@ -3013,7 +3022,7 @@ A jump table for the options with a short description can be found at |Q_op|.
<
*'helpfile'* *'hf'*
'helpfile' 'hf' string (default (MSDOS) "$VIMRUNTIME\doc\help.txt"
'helpfile' 'hf' string (default (MS-Windows) "$VIMRUNTIME\doc\help.txt"
(others) "$VIMRUNTIME/doc/help.txt")
global
Name of the main help file. All distributed help files should be
@ -3420,7 +3429,8 @@ A jump table for the options with a short description can be found at |Q_op|.
Keywords are used in searching and recognizing with many commands:
"w", "*", "[i", etc. It is also used for "\k" in a |pattern|. See
'isfname' for a description of the format of this option. For '@'
characters above 255 check the "word" character class.
characters above 255 check the "word" character class (any character
that is not white space or punctuation).
For C programs you could use "a-z,A-Z,48-57,_,.,-,>".
For a help file it is set to all non-blank printable characters except
'*', '"' and '|' (so that CTRL-] on a command finds the help for that
@ -3527,8 +3537,8 @@ A jump table for the options with a short description can be found at |Q_op|.
be able to execute Normal mode commands.
This is the opposite of the 'keymap' option, where characters are
mapped in Insert mode.
Also consider resetting 'langremap' to avoid 'langmap' applies to
characters resulting from a mapping.
Also consider setting 'langremap' to off, to prevent 'langmap' from
applying to characters resulting from a mapping.
This option cannot be set from a |modeline| or in the |sandbox|, for
security reasons.
@ -3545,7 +3555,7 @@ A jump table for the options with a short description can be found at |Q_op|.
characters. Example: "abc;ABC"
Example: "aA,fgh;FGH,cCdDeE"
Special characters need to be preceded with a backslash. These are
";", ',' and backslash itself.
";", ',', '"', '|' and backslash itself.
This will allow you to activate vim actions without having to switch
back and forth between the languages. Your language characters will
@ -3719,8 +3729,10 @@ A jump table for the options with a short description can be found at |Q_op|.
*lcs-lead*
lead:c Character to show for leading spaces. When omitted,
leading spaces are blank. Overrides the "space"
setting for leading spaces.
*lcs-trail*
setting for leading spaces. You can combine it with
"tab:", for example: >
:set listchars+=tab:>-,lead:.
< *lcs-trail*
trail:c Character to show for trailing spaces. When omitted,
trailing spaces are blank. Overrides the "space"
setting for trailing spaces.
@ -3769,6 +3781,8 @@ A jump table for the options with a short description can be found at |Q_op|.
Only switch it off when working with old Vi scripts. In any other
situation write patterns that work when 'magic' is on. Include "\M"
when you want to |/\M|.
In |Vim9| script the value of 'magic' is ignored, patterns behave like
it is always set.
*'makeef'* *'mef'*
'makeef' 'mef' string (default: "")
@ -3827,7 +3841,7 @@ A jump table for the options with a short description can be found at |Q_op|.
jump between two double quotes.
The characters must be separated by a colon.
The pairs must be separated by a comma. Example for including '<' and
'>' (HTML): >
'>' (for HTML): >
:set mps+=<:>
< A more exotic example, to jump between the '=' and ';' in an
@ -3994,7 +4008,7 @@ A jump table for the options with a short description can be found at |Q_op|.
the |more-prompt|. When this option is off there are no pauses, the
listing continues until finished.
*'mouse'* *E538*
*'mouse'*
'mouse' string (default "")
global
@ -4205,6 +4219,15 @@ A jump table for the options with a short description can be found at |Q_op|.
bin If included, numbers starting with "0b" or "0B" will be
considered to be binary. Example: Using CTRL-X on
"0b1000" subtracts one, resulting in "0b0111".
unsigned If included, numbers are recognized as unsigned. Thus a
leading dash or negative sign won't be considered as part of
the number. Examples:
Using CTRL-X on "2020" in "9-2020" results in "9-2019"
(without "unsigned" it would become "9-2021").
Using CTRL-A on "2020" in "9-2020" results in "9-2021"
(without "unsigned" it would become "9-2019").
Using CTRL-X on "0" or CTRL-A on "18446744073709551615"
(2^64 - 1) has no effect, overflow is prevented.
Numbers which simply begin with a digit in the range 1-9 are always
considered decimal. This also happens for numbers that are not
recognized as octal or hex.
@ -4747,7 +4770,7 @@ A jump table for the options with a short description can be found at |Q_op|.
screen. If the statusline is given by 'statusline' (i.e. not empty),
this option takes precedence over 'ruler' and 'rulerformat'
If the number of characters displayed is different from the number of
bytes in the text (e.g., for a TAB or a multi-byte character), both
bytes in the text (e.g., for a TAB or a multibyte character), both
the text column (byte number) and the screen column are shown,
separated with a dash.
For an empty line "0-1" is shown.
@ -5166,8 +5189,7 @@ A jump table for the options with a short description can be found at |Q_op|.
security reasons.
*'shell'* *'sh'* *E91*
'shell' 'sh' string (default $SHELL or "sh",
Windows: "cmd.exe")
'shell' 'sh' string (default $SHELL or "sh", Win32: "cmd.exe")
global
Name of the shell to use for ! and :! commands. When changing the
value also check these options: 'shellpipe', 'shellslash'
@ -5176,8 +5198,8 @@ A jump table for the options with a short description can be found at |Q_op|.
See |option-backslash| about including spaces and backslashes.
Environment variables are expanded |:set_env|.
If the name of the shell contains a space, you might need to enclose
it in quotes. Example: >
If the name of the shell contains a space, you need to enclose it in
quotes. Example with quotes: >
:set shell=\"c:\program\ files\unix\sh.exe\"\ -f
< Note the backslash before each quote (to avoid starting a comment) and
each space (to avoid ending the option value), so better use |:let-&|
@ -5218,9 +5240,9 @@ A jump table for the options with a short description can be found at |Q_op|.
'shellcmdflag' 'shcf' string (default: "-c"; Windows: "/s /c")
global
Flag passed to the shell to execute "!" and ":!" commands; e.g.,
`bash.exe -c ls` or `cmd.exe /s /c "dir"`. For Windows
systems, the default is set according to the value of 'shell', to
reduce the need to set this option by the user.
`bash.exe -c ls` or `cmd.exe /s /c "dir"`. For MS-Windows, the
default is set according to the value of 'shell', to reduce the need
to set this option by the user.
On Unix it can have more than one flag. Each white space separated
part is passed as an argument to the shell command.
See |option-backslash| about including spaces and backslashes.
@ -5230,7 +5252,8 @@ A jump table for the options with a short description can be found at |Q_op|.
security reasons.
*'shellpipe'* *'sp'*
'shellpipe' 'sp' string (default ">", "| tee", "|& tee" or "2>&1| tee")
'shellpipe' 'sp' string (default ">", ">%s 2>&1", "| tee", "|& tee" or
"2>&1| tee")
global
String to be used to put the output of the ":make" command in the
error file. See also |:make_makeprg|. See |option-backslash| about
@ -5238,15 +5261,15 @@ A jump table for the options with a short description can be found at |Q_op|.
The name of the temporary file can be represented by "%s" if necessary
(the file name is appended automatically if no %s appears in the value
of this option).
For Windows the default is ">". The output is directly saved in a file
and not echoed to the screen.
For Unix the default it "| tee". The stdout of the compiler is saved
For MS-Windows the default is ">%s 2>&1". The output is directly
saved in a file and not echoed to the screen.
For Unix the default is "| tee". The stdout of the compiler is saved
in a file and echoed to the screen. If the 'shell' option is "csh" or
"tcsh" after initializations, the default becomes "|& tee". If the
'shell' option is "sh", "ksh", "mksh", "pdksh", "zsh" or "bash" the
default becomes "2>&1| tee". This means that stderr is also included.
Before using the 'shell' option a path is removed, thus "/bin/sh" uses
"sh".
'shell' option is "sh", "ksh", "mksh", "pdksh", "zsh", "zsh-beta",
"bash" or "fish" the default becomes "2>&1| tee". This means that
stderr is also included. Before using the 'shell' option a path is
removed, thus "/bin/sh" uses "sh".
The initialization of this option is done after reading the vimrc
and the other initializations, so that when the 'shell' option is set
there, the 'shellpipe' option changes automatically, unless it was
@ -5286,13 +5309,13 @@ A jump table for the options with a short description can be found at |Q_op|.
The name of the temporary file can be represented by "%s" if necessary
(the file name is appended automatically if no %s appears in the value
of this option).
The default is ">". For Unix, if the 'shell' option is "csh", "tcsh"
or "zsh" during initializations, the default becomes ">&". If the
'shell' option is "sh", "ksh" or "bash" the default becomes
">%s 2>&1". This means that stderr is also included.
For Win32, the Unix checks are done and additionally "cmd" is checked
for, which makes the default ">%s 2>&1". Also, the same names with
".exe" appended are checked for.
The default is ">". For Unix, if the 'shell' option is "csh" or
"tcsh" during initializations, the default becomes ">&". If the
'shell' option is "sh", "ksh", "mksh", "pdksh", "zsh", "zsh-beta",
"bash" or "fish", the default becomes ">%s 2>&1". This means that
stderr is also included. For Win32, the Unix checks are done and
additionally "cmd" is checked for, which makes the default ">%s 2>&1".
Also, the same names with ".exe" appended are checked for.
The initialization of this option is done after reading the vimrc
and the other initializations, so that when the 'shell' option is set
there, the 'shellredir' option changes automatically unless it was
@ -5305,11 +5328,11 @@ A jump table for the options with a short description can be found at |Q_op|.
*'shellslash'* *'ssl'* *'noshellslash'* *'nossl'*
'shellslash' 'ssl' boolean (default off)
global
{only for Windows}
{only for MS-Windows}
When set, a forward slash is used when expanding file names. This is
useful when a Unix-like shell is used instead of command.com or
cmd.exe. Backward slashes can still be typed, but they are changed to
forward slashes by Vim.
useful when a Unix-like shell is used instead of cmd.exe. Backward
slashes can still be typed, but they are changed to forward slashes by
Vim.
Note that setting or resetting this option has no effect for some
existing file names, thus this option needs to be set before opening
any file for best results. This might change in the future.
@ -5887,8 +5910,8 @@ A jump table for the options with a short description can be found at |Q_op|.
N N Printer page number. (Only works in the 'printheader' option.)
l N Line number.
L N Number of lines in buffer.
c N Column number.
v N Virtual column number.
c N Column number (byte index).
v N Virtual column number (screen column).
V N Virtual column number as -{num}. Not displayed if equal to 'c'.
p N Percentage through file in lines as in |CTRL-G|.
P S Percentage through file of displayed window. This is like the
@ -5897,7 +5920,9 @@ A jump table for the options with a short description can be found at |Q_op|.
a S Argument list status as in default title. ({current} of {max})
Empty if the argument file count is zero or one.
{ NF Evaluate expression between '%{' and '}' and substitute result.
Note that there is no '%' before the closing '}'.
Note that there is no '%' before the closing '}'. The
expression cannot contain a '}' character, call a function to
work around that. See |stl-%{| below.
( - Start of item group. Can be used for setting the width and
alignment of a section. Must be followed by %) somewhere.
) - End of item group. No width fields allowed.
@ -5960,13 +5985,13 @@ A jump table for the options with a short description can be found at |Q_op|.
:set statusline=...%(\ [%M%R%H]%)...
< Beware that an expression is evaluated each and every time the status
line is displayed.
*g:actual_curbuf* *g:actual_curwin*
The current buffer and current window will be set temporarily to that
of the window (and buffer) whose statusline is currently being drawn.
The expression will evaluate in this context. The variable
"g:actual_curbuf" is set to the `bufnr()` number of the real current
buffer and "g:actual_curwin" to the |window-ID| of the real current
window. These values are strings.
*stl-%{* *g:actual_curbuf* *g:actual_curwin*
While evaluating %{} the current buffer and current window will be set
temporarily to that of the window (and buffer) whose statusline is
currently being drawn. The expression will evaluate in this context.
The variable "g:actual_curbuf" is set to the `bufnr()` number of the
real current buffer and "g:actual_curwin" to the |window-ID| of the
real current window. These values are strings.
The 'statusline' option will be evaluated in the |sandbox| if set from
a modeline, see |sandbox-option|.
@ -6504,8 +6529,8 @@ A jump table for the options with a short description can be found at |Q_op|.
'undolevels' 'ul' number (default 1000)
global or local to buffer |global-local|
Maximum number of changes that can be undone. Since undo information
is kept in memory, higher numbers will cause more memory to be used
(nevertheless, a single change can use an unlimited amount of memory).
is kept in memory, higher numbers will cause more memory to be used.
Nevertheless, a single change can already use a large amount of memory.
Set to 0 for Vi compatibility: One level of undo and "u" undoes
itself: >
set ul=0
@ -6608,7 +6633,7 @@ A jump table for the options with a short description can be found at |Q_op|.
>= 14 Anything pending in a ":finally" clause.
>= 15 Every executed Ex command from a script (truncated at 200
characters).
>= 16 Every executed Ex command
>= 16 Every executed Ex command.
This option can also be set with the "-V" argument. See |-V|.
This option is also set by the |:verbose| command.
@ -6713,8 +6738,8 @@ A jump table for the options with a short description can be found at |Q_op|.
":map <BS> X" to make backspace delete the character in front of the
cursor.
When 'l' is included and it is used after an operator at the end of a
line then it will not move to the next line. This makes "dl", "cl",
"yl" etc. work normally.
line (not an empty line) then it will not move to the next line. This
makes "dl", "cl", "yl" etc. work normally.
*'wildchar'* *'wc'*
'wildchar' 'wc' number (Vim default: <Tab>, Vi default: CTRL-E)
@ -6808,23 +6833,31 @@ A jump table for the options with a short description can be found at |Q_op|.
part specifies what to do for each consecutive use of 'wildchar'. The
first part specifies the behavior for the first use of 'wildchar',
The second part for the second use, etc.
These are the possible values for each part:
Each part consists of a colon separated list consisting of the
following possible values:
"" Complete only the first match.
"full" Complete the next full match. After the last match,
the original string is used and then the first match
again.
again. Will also start 'wildmenu' if it is enabled.
"longest" Complete till longest common string. If this doesn't
result in a longer string, use the next part.
"longest:full" Like "longest", but also start 'wildmenu' if it is
enabled.
"list" When more than one match, list all matches.
"lastused" When completing buffer names and more than one buffer
matches, sort buffers by time last used (other than
the current buffer).
When there is only a single match, it is fully completed in all cases.
Examples of useful colon-separated values:
"longest:full" Like "longest", but also start 'wildmenu' if it is
enabled. Will not complete to the next full match.
"list:full" When more than one match, list all matches and
complete first match.
"list:longest" When more than one match, list all matches and
complete till longest common string.
"list:lastused" When more than one buffer matches, sort buffers
by time last used (other than the current buffer).
When there is only a single match, it is fully completed in all cases.
"list:lastused" When more than one buffer matches, list all matches
and sort buffers by time last used (other than the
current buffer).
Examples: >
:set wildmode=full
@ -6882,15 +6915,15 @@ A jump table for the options with a short description can be found at |Q_op|.
*'window'* *'wi'*
'window' 'wi' number (default screen height - 1)
global
Window height. Do not confuse this with the height of the Vim window,
use 'lines' for that.
Used for |CTRL-F| and |CTRL-B| when there is only one window and the
value is smaller than 'lines' minus one. The screen will scroll
'window' minus two lines, with a minimum of one.
Window height used for |CTRL-F| and |CTRL-B| when there is only one
window and the value is smaller than 'lines' minus one. The screen
will scroll 'window' minus two lines, with a minimum of one.
When 'window' is equal to 'lines' minus one CTRL-F and CTRL-B scroll
in a much smarter way, taking care of wrapping lines.
When resizing the Vim window, the value is smaller than 1 or more than
or equal to 'lines' it will be set to 'lines' minus 1.
Note: Do not confuse this with the height of the Vim window, use
'lines' for that.
*'winheight'* *'wh'* *E591*
'winheight' 'wh' number (default 1)
@ -7049,6 +7082,8 @@ A jump table for the options with a short description can be found at |Q_op|.
fail (and make sure not to exit Vim until the write was successful).
See |backup-table| for another explanation.
When the 'backupskip' pattern matches, a backup is not made anyway.
Depending on 'backupcopy' the backup is a new file or the original
file renamed (and a new file is written).
*'writedelay'* *'wd'*
'writedelay' 'wd' number (default 0)

View File

@ -219,7 +219,7 @@ This is like executing two search commands after each other, except that:
*last-pattern*
The last used pattern and offset are remembered. They can be used to repeat
the search, possibly in another direction or with another count. Note that
two patterns are remembered: One for 'normal' search commands and one for the
two patterns are remembered: One for "normal" search commands and one for the
substitute command ":s". Each time an empty pattern is given, the previously
used pattern is used. However, if there is no previous search command, a
previous substitute pattern is used, if possible.
@ -351,8 +351,8 @@ For starters, read chapter 27 of the user manual |usr_27.txt|.
*/atom*
5. An atom can be one of a long list of items. Many atoms match one character
in the text. It is often an ordinary character or a character class.
Braces can be used to make a pattern into an atom. The "\z(\)" construct
is only for syntax highlighting.
Parentheses can be used to make a pattern into an atom. The "\z(\)"
construct is only for syntax highlighting.
atom ::= ordinary-atom |/ordinary-atom|
or \( pattern \) |/\(|
@ -384,15 +384,19 @@ the pattern will not match. This is only useful when debugging Vim.
==============================================================================
3. Magic */magic*
Some characters in the pattern are taken literally. They match with the same
character in the text. When preceded with a backslash however, these
characters get a special meaning.
Some characters in the pattern, such as letters, are taken literally. They
match exactly the same character in the text. When preceded with a backslash
however, these characters may get a special meaning. For example, "a" matches
the letter "a", while "\a" matches any alphabetic character.
Other characters have a special meaning without a backslash. They need to be
preceded with a backslash to match literally.
preceded with a backslash to match literally. For example "." matches any
character while "\." matches a dot.
If a character is taken literally or not depends on the 'magic' option and the
items mentioned next.
items in the pattern mentioned next. The 'magic' option should always be set,
but it can be switched off for Vi compatibility. We mention the effect of
'nomagic' here for completeness, but we recommend against using that.
*/\m* */\M*
Use of "\m" makes the pattern after it be interpreted as if 'magic' is set,
ignoring the actual value of the 'magic' option.
@ -401,30 +405,28 @@ Use of "\M" makes the pattern after it be interpreted as if 'nomagic' is used.
Use of "\v" means that after it, all ASCII characters except '0'-'9', 'a'-'z',
'A'-'Z' and '_' have special meaning: "very magic"
Use of "\V" means that after it, only a backslash and terminating character
(usually / or ?) have special meaning: "very nomagic"
Use of "\V" means that after it, only a backslash and the terminating
character (usually / or ?) have special meaning: "very nomagic"
Examples:
after: \v \m \M \V matches ~
'magic' 'nomagic'
$ $ $ \$ matches end-of-line
. . \. \. matches any character
a a a a literal 'a'
\a \a \a \a any alphabetic character
. . \. \. any character
\. \. . . literal dot
$ $ $ \$ end-of-line
* * \* \* any number of the previous atom
~ ~ \~ \~ latest substitute string
() \(\) \(\) \(\) grouping into an atom
| \| \| \| separating alternatives
\a \a \a \a alphabetic character
() \(\) \(\) \(\) group as an atom
| \| \| \| nothing: separates alternatives
\\ \\ \\ \\ literal backslash
\. \. . . literal dot
\{ { { { literal '{'
a a a a literal 'a'
\{ { { { literal curly brace
{only Vim supports \m, \M, \v and \V}
It is recommended to always keep the 'magic' option at the default setting,
which is 'magic'. This avoids portability problems. To make a pattern immune
to the 'magic' option being set or not, put "\m" or "\M" at the start of the
pattern.
If you want to you can make a pattern immune to the 'magic' option being set
or not by putting "\m" or "\M" at the start of the pattern.
==============================================================================
4. Overview of pattern items *pattern-overview*
@ -666,7 +668,7 @@ overview.
Note that using "\&" works the same as using "\@=": "foo\&.." is the
same as "\(foo\)\@=..". But using "\&" is easier, you don't need the
braces.
parentheses.
*/\@!*
@ -787,11 +789,12 @@ An ordinary atom can be:
^beep( the start of the C function "beep" (probably).
*/\^*
\^ Matches literal '^'. Can be used at any position in the pattern.
\^ Matches literal '^'. Can be used at any position in the pattern, but
not inside [].
*/\_^*
\_^ Matches start-of-line. |/zero-width| Can be used at any position in
the pattern.
the pattern, but not inside [].
Example matches ~
\_s*\_^foo white space and blank lines and then "foo" at
start-of-line
@ -802,12 +805,13 @@ $ At end of pattern or in front of "\|", "\)" or "\n" ('magic' on):
|/zero-width|
*/\$*
\$ Matches literal '$'. Can be used at any position in the pattern.
\$ Matches literal '$'. Can be used at any position in the pattern, but
not inside [].
*/\_$*
\_$ Matches end-of-line. |/zero-width| Can be used at any position in the
pattern. Note that "a\_$b" never matches, since "b" cannot match an
end-of-line. Use "a\nb" instead |/\n|.
pattern, but not inside []. Note that "a\_$b" never matches, since
"b" cannot match an end-of-line. Use "a\nb" instead |/\n|.
Example matches ~
foo\_$\_s* "foo" at end-of-line and following white space and
blank lines
@ -830,8 +834,9 @@ $ At end of pattern or in front of "\|", "\)" or "\n" ('magic' on):
|/zero-width|
*/\zs*
\zs Matches at any position, and sets the start of the match there: The
next char is the first char of the whole match. |/zero-width|
\zs Matches at any position, but not inside [], and sets the start of the
match there: The next char is the first char of the whole match.
|/zero-width|
Example: >
/^\s*\zsif
< matches an "if" at the start of a line, ignoring white space.
@ -842,8 +847,9 @@ $ At end of pattern or in front of "\|", "\)" or "\n" ('magic' on):
This cannot be followed by a multi. *E888*
*/\ze*
\ze Matches at any position, and sets the end of the match there: The
previous char is the last char of the whole match. |/zero-width|
\ze Matches at any position, but not inside [], and sets the end of the
match there: The previous char is the last char of the whole match.
|/zero-width|
Can be used multiple times, the last one encountered in a matching
branch is used.
Example: "end\ze\(if\|for\)" matches the "end" in "endif" and
@ -928,7 +934,7 @@ $ At end of pattern or in front of "\|", "\)" or "\n" ('magic' on):
These three can be used to match specific columns in a buffer or
string. The "23" can be any column number. The first column is 1.
Actually, the column is the byte number (thus it's not exactly right
for multi-byte characters).
for multibyte characters).
WARNING: When inserting or deleting text Vim does not automatically
update the matches. This means Syntax highlighting quickly becomes
wrong.
@ -983,7 +989,7 @@ Character classes:
\p printable character (see 'isprint' option) */\p*
\P like "\p", but excluding digits */\P*
NOTE: the above also work for multi-byte characters. The ones below only
NOTE: the above also work for multibyte characters. The ones below only
match ASCII characters, as indicated by the range.
*whitespace* *white-space*
@ -1054,8 +1060,8 @@ x A single character, with no special meaning, matches itself
[] (with 'nomagic': \[]) */[]* */\[]* */\_[]* */collection*
\_[]
A collection. This is a sequence of characters enclosed in brackets.
It matches any single character in the collection.
A collection. This is a sequence of characters enclosed in square
brackets. It matches any single character in the collection.
Example matches ~
[xyz] any 'x', 'y' or 'z'
[a-zA-Z]$ any alphabetic character at the end of a line
@ -1114,15 +1120,16 @@ x A single character, with no special meaning, matches itself
*[:ident:]* [:ident:] identifier character (same as "\i")
*[:keyword:]* [:keyword:] keyword character (same as "\k")
*[:fname:]* [:fname:] file name character (same as "\f")
The brackets in character class expressions are additional to the
brackets delimiting a collection. For example, the following is a
plausible pattern for a Unix filename: "[-./[:alnum:]_~]\+" That is,
a list of at least one character, each of which is either '-', '.',
'/', alphabetic, numeric, '_' or '~'.
The square brackets in character class expressions are additional to
the square brackets delimiting a collection. For example, the
following is a plausible pattern for a UNIX filename:
"[-./[:alnum:]_~]\+". That is, a list of at least one character,
each of which is either '-', '.', '/', alphabetic, numeric, '_' or
'~'.
These items only work for 8-bit characters, except [:lower:] and
[:upper:] also work for multi-byte characters when using the new
[:upper:] also work for multibyte characters when using the new
regexp engine. See |two-engines|. In the future these items may
work for multi-byte characters. For now, to get all "alpha"
work for multibyte characters. For now, to get all "alpha"
characters you can use: [[:lower:][:upper:]].
The "Func" column shows what library function is used. The
@ -1161,7 +1168,7 @@ x A single character, with no special meaning, matches itself
\b <BS>
\n line break, see above |/[\n]|
\d123 decimal number of character
\o40 octal number of character up to 0377
\o40 octal number of character up to 0o377
\x20 hexadecimal number of character up to 0xff
\u20AC hex. number of multibyte character up to 0xffff
\U1234 hex. number of multibyte character up to 0xffffffff
@ -1198,7 +1205,8 @@ x A single character, with no special meaning, matches itself
\%d123 Matches the character specified with a decimal number. Must be
followed by a non-digit.
\%o40 Matches the character specified with an octal number up to 0377.
Numbers below 040 must be followed by a non-octal digit or a non-digit.
Numbers below 0o40 must be followed by a non-octal digit or a
non-digit.
\%x2a Matches the character specified with up to two hexadecimal characters.
\%u20AC Matches the character specified with up to four hexadecimal
characters.
@ -1245,8 +1253,8 @@ When working with expression evaluation, a <NL> character in the pattern
matches a <NL> in the string. The use of "\n" (backslash n) to match a <NL>
doesn't work there, it only works to match text in the buffer.
*pattern-multi-byte*
Patterns will also work with multi-byte characters, mostly as you would
*pattern-multi-byte* *pattern-multibyte*
Patterns will also work with multibyte characters, mostly as you would
expect. But invalid bytes may cause trouble, a pattern with an invalid byte
will probably never match.
@ -1267,7 +1275,7 @@ not match in "càt" (where the a has the composing character 0x0300), but
0xe1, it does not have a compositing character). It does match "cat" (where
the a is just an a).
When a composing character appears at the start of the pattern of after an
When a composing character appears at the start of the pattern or after an
item that doesn't include the composing character, a match is found at any
character that includes this composing character.

View File

@ -437,9 +437,13 @@ settings are described below, in |netrw-browser-options|, and in
*g:netrw_silent* =0 : transfers done normally
=1 : transfers done silently
*g:netrw_use_errorwindow* =1 : messages from netrw will use a separate one
*g:netrw_use_errorwindow* =2: messages from netrw will use a popup window
Move the mouse and pause to remove the popup window.
(default value if popup windows are availble)
=1 : messages from netrw will use a separate one
line window. This window provides reliable
delivery of messages. (default)
delivery of messages.
(default value if popup windows are not availble)
=0 : messages from netrw will use echoerr ;
messages don't always seem to show up this
way, but one doesn't have to quit the window.
@ -725,6 +729,8 @@ just as easily as if they were local files! >
See |netrw-activate| for more on how to encourage your vim to use plugins
such as netrw.
For password-free use of scp:, see |netrw-ssh-hack|.
==============================================================================
7. Ex Commands *netrw-ex* {{{1
@ -1063,7 +1069,7 @@ QUICK HELP *netrw-quickhelp* {{{2
Reverse sorting order.........................|netrw-r|
*netrw-quickmap* *netrw-quickmaps*
*netrw-quickmap* *netrw-quickmaps*
QUICK REFERENCE: MAPS *netrw-browse-maps* {{{2
>
--- ----------------- ----
@ -1080,7 +1086,7 @@ QUICK REFERENCE: MAPS *netrw-browse-maps* {{{2
a Cycles between normal display, |netrw-a|
hiding (suppress display of files matching g:netrw_list_hide)
and showing (display only files which match g:netrw_list_hide)
c Make browsing directory the current directory |netrw-c|
cd Make browsing directory the current directory |netrw-cd|
C Setting the editing window |netrw-C|
d Make a directory |netrw-d|
D Attempt to remove the file(s)/directory(ies) |netrw-D|
@ -2098,7 +2104,7 @@ the two directories the same, use the "cd" map (type cd). That map will
set Vim's notion of the current directory to netrw's current browsing
directory.
*netrw-c* : This map's name has been changed from "c" to cd (see |netrw-cd|).
|netrw-cd|: This map's name was changed from "c" to cd (see |netrw-cd|).
This change was done to allow for |netrw-cb| and |netrw-cB| maps.
Associated setting variable: |g:netrw_keepdir|
@ -2752,7 +2758,7 @@ your browsing preferences. (see also: |netrw-settings|)
=0 keep the current directory the same as the
browsing directory.
The current browsing directory is contained in
b:netrw_curdir (also see |netrw-c|)
b:netrw_curdir (also see |netrw-cd|)
*g:netrw_keepj* ="keepj" (default) netrw attempts to keep the
|:jumps| table unaffected.
@ -3053,7 +3059,7 @@ your browsing preferences. (see also: |netrw-settings|)
(see |netrw-c-tab|).
*g:netrw_xstrlen* Controls how netrw computes string lengths,
including multibyte characters' string
including multi-byte characters' string
length. (thanks to N Weibull, T Mechelynck)
=0: uses Vim's built-in strlen()
=1: number of codepoints (Latin a + combining
@ -3123,7 +3129,8 @@ a file using the local browser (by putting the cursor on it) and pressing
Related topics:
* To see what the current directory is, use |:pwd|
* To make the currently browsed directory the current directory, see |netrw-c|
* To make the currently browsed directory the current directory, see
|netrw-cd|
* To automatically make the currently browsed directory the current
directory, see |g:netrw_keepdir|.
@ -3798,9 +3805,15 @@ netrw:
or
http://vim.sourceforge.net/scripts/script.php?script_id=120
Decho.vim is provided as a "vimball"; see |vimball-intro|.
Decho.vim is provided as a "vimball"; see |vimball-intro|. You
should edit the Decho.vba.gz file and source it in: >
2. Edit the <netrw.vim> file by typing: >
vim Decho.vba.gz
:so %
:q
<
2. To turn on debug tracing in netrw, then edit the <netrw.vim>
file by typing: >
vim netrw.vim
:DechoOn
@ -3822,14 +3835,34 @@ netrw:
read/write your file over the network in a separate tab or
server vim window.
To save the file, use >
Change the netrw.vimrc file to include the Decho plugin: >
set nocp
so $HOME/.vim/plugin/Decho.vim
so $HOME/.vim/plugin/netrwPlugin.vim
<
You should continue to run vim with >
vim -u netrw.vimrc --noplugins -i NONE [some path here]
<
to avoid entanglements with options and other plugins.
To save the file: under linux, the output will be in a separate
remote server window; in it, just save the file with >
:w! DBG
< Under a vim that doesn't support clientserver, your debugging
output will appear in another tab: >
:tabnext
:set bt=
:w! DBG
<
Furthermore, it'd be helpful if you would type >
< Furthermore, it'd be helpful if you would type >
:Dsep <command>
< where <command> is the command you're about to type next,
thereby making it easier to associate which part of the
debugging trace is due to which command.
@ -3837,17 +3870,34 @@ netrw:
Please send that information to <netrw.vim>'s maintainer along
with the o/s you're using and the vim version that you're using
(see |:version|) (remove the embedded NOSPAM first) >
NcampObell@SdrPchip.AorgM-NOSPAM
<
==============================================================================
12. History *netrw-history* {{{1
v170: Mar 11, 2020 * (reported by Reiner Herrmann) netrw+tree
would not hide with the ^\..* pattern
correctly.
* (Marcin Szamotulski) NetrwOptionRestore
did not restore options correctly that
had a single quote in the option string.
Apr 13, 2020 * implemented error handling via popup
windows (see |popup_beval()|)
Apr 30, 2020 * (reported by Manatsu Takahashi) while
using Lexplore, a modified file could
be overwritten. Sol'n: will not overwrite,
but will emit an |E37| (although one cannot
add an ! to override)
Jun 07, 2020 * (reported by Jo Totland) repeatedly invoking
:Lexplore and quitting it left unused
hidden buffers. Netrw will now set netrw
buffers created by :Lexplore to |bh|=wipe.
v169: Dec 20, 2019 * (reported by amkarthik) that netrw's x
(|netrw-x|) would throw an error when
attempting to open a local directory.
v168: Dec 12, 2019 * scp timeout error message not reported,
hopefully now fixed (Shane Xb Qian)
v167: Nov 29, 2019 * netrw does a save&restore on @* and @+.
That causes problems with the clipboard.
Now restores occurs only if @* or @+ have
@ -4305,4 +4355,4 @@ netrw:
==============================================================================
Modelines: {{{1
vim:tw=78:ts=8:noet:ft=help:norl:fdm=marker
vim:tw=78:ts=8:ft=help:noet:norl:fdm=marker

View File

@ -4,7 +4,7 @@
| Zip File Interface |
+====================+
Author: Charles E. Campbell <NdrOchip@ScampbellPfamily.AbizM>
Author: Charles E. Campbell <NcampObell@SdrPchip.AorgM-NOSPAM>
(remove NOSPAM from Campbell's email first)
Copyright: Copyright (C) 2005-2015 Charles E Campbell *zip-copyright*
The VIM LICENSE (see |copyright|) applies to the files in this
@ -33,10 +33,11 @@ Copyright: Copyright (C) 2005-2015 Charles E Campbell *zip-copyright*
also write to the file. Currently, one may not make a new file in
zip archives via the plugin.
COMMANDS~
*zip-x*
x : may extract a listed file when the cursor is atop it
x : extract a listed file when the cursor is atop it
OPTIONS
OPTIONS~
*g:zip_nomax*
@ -101,6 +102,10 @@ Copyright: Copyright (C) 2005-2015 Charles E Campbell *zip-copyright*
==============================================================================
4. History *zip-history* {{{1
v29 Apr 02, 2017 * (Klartext) reported that an encrypted zip file could
opened but the swapfile held unencrypted contents.
The solution is to edit the contents of a zip file
using the |:noswapfile| modifier.
v28 Oct 08, 2014 * changed the sanity checks for executables to reflect
the command actually to be attempted in zip#Read()
and zip#Write()
@ -149,4 +154,4 @@ Copyright: Copyright (C) 2005-2015 Charles E Campbell *zip-copyright*
v1 Sep 15, 2005 * Initial release, had browsing, reading, and writing
==============================================================================
vim:tw=78:ts=8:noet:ft=help:fdm=marker
vim:tw=78:ts=8:ft=help:noet:norl:fdm=marker

View File

@ -101,7 +101,7 @@ If 'printencoding' is empty or Vim cannot find the file then it will use
encoding file. If Vim is unable to find a character encoding file then it
will use the "latin1" print character encoding file.
When 'encoding' is set to a multi-byte encoding, Vim will try to convert
When 'encoding' is set to a multibyte encoding, Vim will try to convert
characters to the printing encoding for printing (if 'printencoding' is empty
then the conversion will be to latin1). Conversion to a printing encoding
other than latin1 will require Vim to be compiled with the |+iconv| feature.
@ -251,7 +251,7 @@ Japanese text you would do the following; >
:set printmbcharset=JIS_X_1983
If 'printmbcharset' is not one of the above values then it is assumed to
specify a custom multi-byte character set and no check will be made that it is
specify a custom multibyte character set and no check will be made that it is
compatible with the value for 'printencoding'. Vim will look for a file
defining the character set in the "print" directory in 'runtimepath'.
@ -286,7 +286,7 @@ printing of characters in the ASCII code range.
a:yes Use ASCII character set for codes in the ASCII
a:no (default) code range.
The following is an example of specifying two multi-byte fonts, one for normal
The following is an example of specifying two multibyte fonts, one for normal
and italic printing and one for bold and bold-italic printing, and using
Courier to print codes in the ASCII code range but using the national
character set: >
@ -402,10 +402,10 @@ There are currently a number of limitations with PostScript printing:
possible to get all the characters in an encoding to print by installing a
new version of the Courier font family.
- Multi-byte support - Currently Vim will try to convert multi-byte characters
- Multi-byte support - Currently Vim will try to convert multibyte characters
to the 8-bit encoding specified by 'printencoding' (or latin1 if it is
empty). Any characters that are not successfully converted are shown as
unknown characters. Printing will fail if Vim cannot convert the multi-byte
unknown characters. Printing will fail if Vim cannot convert the multibyte
to the 8-bit encoding.
==============================================================================
@ -490,7 +490,7 @@ print ASCII text using the national character set you may see some unexpected
characters. If you want true ASCII code printing then you need to configure
Vim to output ASCII characters for the ASCII code range with 'printmbfont'.
It is possible to define your own multi-byte character set although this
It is possible to define your own multibyte character set although this
should not be attempted lightly. A discussion on the process if beyond the
scope of these help files. You can find details on CMap (character map) files
in the document 'Adobe CMap and CIDFont Files Specification, Version 1.0',
@ -597,22 +597,15 @@ X11
http://www.cs.wisc.edu/~ghost/gv/
Windows
MS-Windows
- GSview. Obtainable from:
http://www.cs.wisc.edu/~ghost/gsview/
DOS
- ps_view. Obtainable from:
ftp://ftp.pg.gda.pl/pub/TeX/support/ps_view/
ftp://ftp.dante.de/tex-archive/support/ps_view/
Linux
- GSview. Linux version of the popular Windows previewer.
- GSview. Linux version of the popular MS-Windows previewer.
Obtainable from:
http://www.cs.wisc.edu/~ghost/gsview/

View File

@ -225,8 +225,7 @@ processing a quickfix or location list command, it will be aborted.
e.g., a compiler will not compile the same file again,
`git commit` will abort the committing process, `fc`
(built-in for shells like bash and zsh) will not
execute the command, etc. will not compile the same
file again.
execute the command, etc.
{N} can also be zero, in which case Vim exits
normally.
WARNING: All changes in files are lost. It works like
@ -311,7 +310,7 @@ processing a quickfix or location list command, it will be aborted.
*:cex* *:cexpr* *E777*
:cex[pr][!] {expr} Create a quickfix list using the result of {expr} and
jump to the first error.
If {expr} is a String, then each new-line terminated
If {expr} is a String, then each newline terminated
line in the String is processed using the global value
of 'errorformat' and the result is added to the
quickfix list.
@ -484,7 +483,7 @@ EXECUTE A COMMAND IN ALL THE BUFFERS IN QUICKFIX OR LOCATION LIST:
etc.
< When the current file can't be |abandon|ed and the [!]
is not present, the command fails.
When an error is detected execution stops.
When going to the next entry fails execution stops.
The last buffer (or where an error occurred) becomes
the current buffer.
{cmd} can contain '|' to concatenate several commands.
@ -926,11 +925,11 @@ or simpler >
"$*" can be given multiple times, for example: >
:set makeprg=gcc\ -o\ $*\ $*
The 'shellpipe' option defaults to ">" on Windows. This means that the output
of the compiler is saved in a file and not shown on the screen directly. For
Unix "| tee" is used. The compiler output is shown on the screen and saved in
a file the same time. Depending on the shell used "|& tee" or "2>&1| tee" is
the default, so stderr output will be included.
The 'shellpipe' option defaults to ">%s 2>&1" for Win32.
This means that the output of the compiler is saved in a file and not shown on
the screen directly. For Unix "| tee" is used. The compiler output is shown
on the screen and saved in a file the same time. Depending on the shell used
"|& tee" or "2>&1| tee" is the default, so stderr output will be included.
If 'shellpipe' is empty, the {errorfile} part will be omitted. This is useful
for compilers that write to an errorfile themselves.
@ -995,8 +994,6 @@ commands can be combined to create a NewGrep command: >
the error list to the matches. Files matching
'wildignore' are ignored; files in 'suffixes' are
searched last.
Without the 'g' flag each line is added only once.
With 'g' every match is added.
{pattern} is a Vim search pattern. Instead of
enclosing it in / any non-ID character (see
@ -1007,6 +1004,28 @@ commands can be combined to create a NewGrep command: >
'smartcase' is not used.
If {pattern} is empty (e.g. // is specified), the last
used search pattern is used. |last-pattern|
Flags:
'g' Without the 'g' flag each line is added only
once. With 'g' every match is added.
'j' Without the 'j' flag Vim jumps to the first
match. With 'j' only the quickfix list is
updated. With the [!] any changes in the current
buffer are abandoned.
'f' When the 'f' flag is specified, fuzzy string
matching is used to find matching lines. In this
case, {pattern} is treated as a literal string
instead of a regular expression. See
|matchfuzzy()| for more info about fuzzy
matching.
|QuickFixCmdPre| and |QuickFixCmdPost| are triggered.
A file that is opened for matching may use a buffer
number, but it is reused if possible to avoid
consuming buffer numbers.
:{count}vim[grep] ...
When a number is put before the command this is used
as the maximum number of matches to find. Use
@ -1014,11 +1033,6 @@ commands can be combined to create a NewGrep command: >
Useful if you only want to check if there is a match
and quit quickly when it's found.
Without the 'j' flag Vim jumps to the first match.
With 'j' only the quickfix list is updated.
With the [!] any changes in the current buffer are
abandoned.
Every second or so the searched file name is displayed
to give you an idea of the progress made.
Examples: >
@ -1090,7 +1104,7 @@ id-utils) in a similar way to its compiler integration (see |:make| above).
allowed with |:bufdo|.
An example that uses the argument list and avoids
errors for files without matches: >
:silent argdo try
:silent argdo try
\ | grepadd! something %
\ | catch /E480:/
\ | endtry"
@ -1266,7 +1280,7 @@ You can force the compiler to ignore makefiles by defining
b:tex_ignore_makefile or g:tex_ignore_makefile variable (they are checked for
existence only).
If the compiler chose not to use make, it need to choose a right program for
If the compiler chose not to use make, it needs to choose a right program for
processing your input. If b:tex_flavor or g:tex_flavor (in this precedence)
variable exists, it defines TeX flavor for :make (actually, this is the name
of executed command), and if both variables do not exist, it defaults to
@ -1658,7 +1672,7 @@ special problem here is that it doesn't print information on leaving the
directory and that it doesn't print the absolute path.
To solve the problem with relative paths and missing "leave directory"
messages Vim uses following algorithm:
messages Vim uses the following algorithm:
1) Check if the given directory is a subdirectory of the current directory.
If this is true, store it as the current directory.

View File

@ -292,7 +292,7 @@ moving around:
|i_CTRL-A| CTRL-A insert previously inserted text
|i_CTRL-@| CTRL-@ insert previously inserted text and stop
Insert mode
|i_CTRL-R| CTRL-R {0-9a-z%#:.-="} insert the contents of a register
|i_CTRL-R| CTRL-R {register} insert the contents of a register
|i_CTRL-N| CTRL-N insert next match of identifier before the
cursor
@ -621,7 +621,7 @@ Short explanation of each option: *option-list*
'binary' 'bin' read/write/edit file in binary mode
'bomb' prepend a Byte Order Mark to the file
'breakat' 'brk' characters that may cause a line break
'breakindent' 'bri' wrapped line repeats indent
'breakindent' 'bri' wrapped line repeats indent
'breakindentopt' 'briopt' settings for 'breakindent'
'browsedir' 'bsdir' which directory to start browsing in
'bufhidden' 'bh' what to do when buffer is no longer in window
@ -680,7 +680,7 @@ Short explanation of each option: *option-list*
'eventignore' 'ei' autocommand events that are ignored
'expandtab' 'et' use spaces when <Tab> is inserted
'exrc' 'ex' read .nvimrc and .exrc in the current directory
'fileencoding' 'fenc' file encoding for multi-byte text
'fileencoding' 'fenc' file encoding for multibyte text
'fileencodings' 'fencs' automatically detected character encodings
'fileformat' 'ff' file format used for file I/O
'fileformats' 'ffs' automatically detected values for 'fileformat'
@ -869,6 +869,7 @@ Short explanation of each option: *option-list*
'spellcapcheck' 'spc' pattern to locate end of a sentence
'spellfile' 'spf' files where |zg| and |zw| store words
'spelllang' 'spl' language(s) to do spell checking for
'spelloptions' 'spo' options for spell checking
'spellsuggest' 'sps' method(s) used to suggest spelling corrections
'splitbelow' 'sb' new window from split is below the current one
'splitright' 'spr' new window is put right of the current one
@ -1014,8 +1015,7 @@ Short explanation of each option: *option-list*
three digits)
|c_CTRL-K| CTRL-K {char1} {char2}
enter digraph (See |Q_di|)
|c_CTRL-R| CTRL-R {0-9a-z"%#:-=}
insert the contents of a register
|c_CTRL-R| CTRL-R {register} insert the contents of a register
|c_<Left>| <Left>/<Right> cursor left/right
|c_<S-Left>| <S-Left>/<S-Right> cursor one word left/right

View File

@ -56,13 +56,13 @@ Disadvantages:
directories (although Vim tries to avoid that by comparing the path name).
This will result in bogus ATTENTION warning messages.
- When you use your home directory, and somebody else tries to edit the same
file, he will not see your swap file and will not get the ATTENTION warning
message.
file, that user will not see your swap file and will not get the ATTENTION
warning message.
If you want to put swap files in a fixed place, put a command resembling the
following ones in your vimrc:
:set dir=~/tmp (for Unix)
:set dir=c:\\tmp (for Windows)
:set dir=c:\\tmp (for Win32)
This is also very handy when editing files on floppy. Of course you will have
to create that "tmp" directory for this to work!
@ -106,8 +106,9 @@ If you want to make sure that your changes are in the swap file use this
command:
*:pre* *:preserve* *E313* *E314*
:pre[serve] Write all text for all buffers into swap file. The
original file is no longer needed for recovery.
:pre[serve] Write all text for the current buffer into its swap
file. The original file is no longer needed for
recovery. This sets a flag in the current buffer.
A Vim swap file can be recognized by the first six characters: "b0VIM ".
After that comes the version number, e.g., "3.0".

View File

@ -70,7 +70,7 @@ The default for [range] is the whole buffer (1,$). Use "CTRL-C" to interrupt
the command. If an error message is given for a line, the command for that
line is aborted and the global command continues with the next marked or
unmarked line.
*E147*
*E147*
When the command is used recursively, it only works on one line. Giving a
range is then not allowed. This is useful to find all lines that match a
pattern and do not match another pattern: >
@ -117,6 +117,11 @@ q{0-9a-zA-Z"} Record typed characters into register {0-9a-zA-Z"}
recorded macro and the yank will overwrite the
recorded macro.
Note: The recording happens while you type, replaying
the register happens as if the keys come from a
mapping. This matters, for example, for undo, which
only syncs when commands were typed.
q Stops recording.
Implementation note: The 'q' that stops recording is
not stored in the register, unless it was the result
@ -129,7 +134,7 @@ q Stops recording.
used.
The register is executed like a mapping, that means
that the difference between 'wildchar' and 'wildcharm'
applies.
applies, and undo might not be synced in the same way.
For "@=" you are prompted to enter an expression. The
result of the expression is then executed.
See also |@:|.
@ -153,7 +158,7 @@ q Stops recording.
[addr] (default is current line).
:[addr]@ *:@@*
:[addr]@@ Repeat the previous :@{0-9a-z"}. First set cursor at
:[addr]@@ Repeat the previous :@{register}. First set cursor at
line [addr] (default is current line).
==============================================================================
@ -206,10 +211,10 @@ For writing a Vim script, see chapter 41 of the user manual |usr_41.txt|.
When {file} contains wildcards it is expanded to all
matching files. Example: >
:runtime! plugin/*.vim
:runtime! plugin/**/*.vim
< This is what Vim uses to load the plugin files when
starting up. This similar command: >
:runtime plugin/*.vim
:runtime plugin/**/*.vim
< would source the first file only.
When 'verbose' is one or higher, there is a message
@ -248,6 +253,9 @@ For writing a Vim script, see chapter 41 of the user manual |usr_41.txt|.
directories are added to 'runtimepath'. This is
useful in your .vimrc. The plugins will then be
loaded during initialization, see |load-plugins|.
Note that for ftdetect scripts to be loaded
you will need to write `filetype plugin indent on`
AFTER all `packadd!` commands.
Also see |pack-add|.
@ -366,7 +374,7 @@ nested as deep as the number of files that can be opened at one time (about
You can use the "<sfile>" string (literally, this is not a special key) inside
of the sourced file, in places where a file name is expected. It will be
replaced by the file name of the sourced file. For example, if you have a
"other.vimrc" file in the same directory as your |init.vim| file, you can
"other.vimrc" file in the same directory as your |init.vim| file, you can
source it from your |init.vim| file with this command: >
:source <sfile>:h/other.vimrc
@ -388,7 +396,7 @@ because the <CR> from the first lines will be lost.
On other systems, Vim expects ":source"ed files to end in a <NL>. These
always work. If you are using a file with <CR><NL> <EOL>s (for example, a
file made on Windows), all lines will have a trailing <CR>. This may cause
file made on MS-Windows), all lines will have a trailing <CR>. This may cause
problems for some commands (e.g., mappings). There is no automatic <EOL>
detection, because it's common to start with a line that defines a mapping
that ends in a <CR>, which will confuse the automaton.
@ -505,7 +513,7 @@ When Vim starts up, after processing your .vimrc, it scans all directories in
directories are added to 'runtimepath'. Then all the plugins are loaded.
See |packload-two-steps| for how these two steps can be useful.
In the example Vim will find "pack/foo/start/foobar/plugin/foo.vim" and adds
In the example Vim will find "pack/foo/start/foobar/plugin/foo.vim" and adds
"~/.local/share/nvim/site/pack/foo/start/foobar" to 'runtimepath'.
If the "foobar" plugin kicks in and sets the 'filetype' to "some", Vim will
@ -591,8 +599,8 @@ Creating Vim packages *package-create*
This assumes you write one or more plugins that you distribute as a package.
If you have two unrelated plugins you would use two packages, so that Vim
users can chose what they include or not. Or you can decide to use one
package with optional plugins, and tell the user to add the ones he wants with
users can choose what they include or not. Or you can decide to use one
package with optional plugins, and tell the user to add the preferred ones with
`:packadd`.
Decide how you want to distribute the package. You can create an archive or
@ -613,9 +621,9 @@ Your directory layout would be like this:
opt/fooextra/doc/tags " help tags
This allows for the user to do: >
mkdir ~/.local/share/nvim/site/pack/myfoobar
cd ~/.local/share/nvim/site/pack/myfoobar
git clone https://github.com/you/foobar.git
mkdir ~/.local/share/nvim/site/pack
cd ~/.local/share/nvim/site/pack
git clone https://github.com/you/foobar.git myfoobar
Here "myfoobar" is a name that the user can choose, the only condition is that
it differs from other packages.
@ -628,7 +636,7 @@ You could add this packadd command in one of your plugins, to be executed when
the optional plugin is needed.
Run the `:helptags` command to generate the doc/tags file. Including this
generated file in the package means that the user can drop the package in his
generated file in the package means that the user can drop the package in the
pack directory and the help command works right away. Don't forget to re-run
the command after changing the plugin help: >
:helptags path/start/foobar/doc
@ -815,7 +823,7 @@ DEFINING BREAKPOINTS
valid in the script where it has been defined and if that
script is called from several other scripts, this will stop
whenever that particular variable will become visible or
unaccessible again.
inaccessible again.
The [lnum] is the line number of the breakpoint. Vim will stop at or after
this line. When omitted line 1 is used.

View File

@ -64,7 +64,7 @@ o Invocations
+ 'rightleft' ('rl') sets window orientation to right-to-left.
+ 'delcombine' ('deco'), boolean, if editing UTF-8 encoded languages,
allows one to remove a composing character which gets superimposed
on those that proceeded them (some languages require this).
on those that preceded them (some languages require this).
+ 'rightleftcmd' ('rlc') sets the command-line within certain modes
(such as search) to be utilized in right-to-left orientation as well.

View File

@ -42,8 +42,8 @@ When signs are defined for a file, Vim will automatically add a column of two
characters to display them in. When the last sign is unplaced the column
disappears again. This behavior can be changed with the 'signcolumn' option.
The color of the column is set with the SignColumn group |hl-SignColumn|.
Example to set the color: >
The color of the column is set with the SignColumn highlight group
|hl-SignColumn|. Example to set the color: >
:highlight SignColumn guibg=darkgrey
<
@ -68,9 +68,13 @@ other plugins using signs.
*sign-priority*
Each placed sign is assigned a priority value. When multiple signs are placed
on the same line, the attributes of the sign with the highest priority is used
independent of the sign group. The default priority for a sign is 10. The
independently of the sign group. The default priority for a sign is 10. The
priority is assigned at the time of placing a sign.
When two signs with the same priority are present, and one has an icon or text
in the signcolumn while the other has line highlighting, then both are
displayed.
When the line on which the sign is placed is deleted, the sign is moved to the
next line (or the last line of the buffer, if there is no next line). When
the delete is undone the sign does not move back.
@ -127,6 +131,9 @@ See |sign_define()| for the equivalent Vim script function.
texthl={group}
Highlighting group used for the text item.
Example: >
:sign define MySign text=>> texthl=Search linehl=DiffText
<
DELETING A SIGN *:sign-undefine* *E155*
@ -136,7 +143,9 @@ See |sign_undefine()| for the equivalent Vim script function.
Deletes a previously defined sign. If signs with this {name}
are still placed this will cause trouble.
Example: >
:sign undefine MySign
<
LISTING SIGNS *:sign-list* *E156*
@ -190,6 +199,10 @@ See |sign_place()| for the equivalent Vim script function.
Same, but use buffer {nr}. If the buffer argument is not
given, place the sign in the current buffer.
Example: >
:sign place 10 line=99 name=sign3
:sign place 10 line=99 name=sign3 buffer=3
<
*E885*
:sign place {id} name={name} file={fname}
Change the placed sign {id} in file {fname} to use the defined
@ -202,10 +215,17 @@ See |sign_place()| for the equivalent Vim script function.
"priority={prio}" attribute can be used to change the priority
of an existing sign.
Example: >
:sign place 23 name=sign1 file=/path/to/edit.py
<
:sign place {id} name={name} [buffer={nr}]
Same, but use buffer {nr}. If the buffer argument is not
given, use the current buffer.
Example: >
:sign place 23 name=sign1
:sign place 23 name=sign1 buffer=7
<
REMOVING SIGNS *:sign-unplace* *E159*
@ -337,4 +357,363 @@ See |sign_jump()| for the equivalent Vim script function.
Same but jump to the sign in group {group}
==============================================================================
3. Functions *sign-functions-details*
sign_define({name} [, {dict}]) *sign_define()*
sign_define({list})
Define a new sign named {name} or modify the attributes of an
existing sign. This is similar to the |:sign-define| command.
Prefix {name} with a unique text to avoid name collisions.
There is no {group} like with placing signs.
The {name} can be a String or a Number. The optional {dict}
argument specifies the sign attributes. The following values
are supported:
icon full path to the bitmap file for the sign.
linehl highlight group used for the whole line the
sign is placed in.
text text that is displayed when there is no icon
or the GUI is not being used.
texthl highlight group used for the text item
numhl highlight group used for 'number' column at the
associated line. Overrides |hl-LineNr|,
|hl-CursorLineNr|.
If the sign named {name} already exists, then the attributes
of the sign are updated.
The one argument {list} can be used to define a list of signs.
Each list item is a dictionary with the above items in {dict}
and a "name" item for the sign name.
Returns 0 on success and -1 on failure. When the one argument
{list} is used, then returns a List of values one for each
defined sign.
Examples: >
call sign_define("mySign", {
\ "text" : "=>",
\ "texthl" : "Error",
\ "linehl" : "Search"})
call sign_define([
\ {'name' : 'sign1',
\ 'text' : '=>'},
\ {'name' : 'sign2',
\ 'text' : '!!'}
\ ])
<
sign_getdefined([{name}]) *sign_getdefined()*
Get a list of defined signs and their attributes.
This is similar to the |:sign-list| command.
If the {name} is not supplied, then a list of all the defined
signs is returned. Otherwise the attribute of the specified
sign is returned.
Each list item in the returned value is a dictionary with the
following entries:
icon full path to the bitmap file of the sign
linehl highlight group used for the whole line the
sign is placed in.
name name of the sign
text text that is displayed when there is no icon
or the GUI is not being used.
texthl highlight group used for the text item
numhl highlight group used for 'number' column at the
associated line. Overrides |hl-LineNr|,
|hl-CursorLineNr|.
Returns an empty List if there are no signs and when {name} is
not found.
Examples: >
" Get a list of all the defined signs
echo sign_getdefined()
" Get the attribute of the sign named mySign
echo sign_getdefined("mySign")
<
sign_getplaced([{expr} [, {dict}]]) *sign_getplaced()*
Return a list of signs placed in a buffer or all the buffers.
This is similar to the |:sign-place-list| command.
If the optional buffer name {expr} is specified, then only the
list of signs placed in that buffer is returned. For the use
of {expr}, see |bufname()|. The optional {dict} can contain
the following entries:
group select only signs in this group
id select sign with this identifier
lnum select signs placed in this line. For the use
of {lnum}, see |line()|.
If {group} is '*', then signs in all the groups including the
global group are returned. If {group} is not supplied or is an
empty string, then only signs in the global group are
returned. If no arguments are supplied, then signs in the
global group placed in all the buffers are returned.
See |sign-group|.
Each list item in the returned value is a dictionary with the
following entries:
bufnr number of the buffer with the sign
signs list of signs placed in {bufnr}. Each list
item is a dictionary with the below listed
entries
The dictionary for each sign contains the following entries:
group sign group. Set to '' for the global group.
id identifier of the sign
lnum line number where the sign is placed
name name of the defined sign
priority sign priority
The returned signs in a buffer are ordered by their line
number and priority.
Returns an empty list on failure or if there are no placed
signs.
Examples: >
" Get a List of signs placed in eval.c in the
" global group
echo sign_getplaced("eval.c")
" Get a List of signs in group 'g1' placed in eval.c
echo sign_getplaced("eval.c", {'group' : 'g1'})
" Get a List of signs placed at line 10 in eval.c
echo sign_getplaced("eval.c", {'lnum' : 10})
" Get sign with identifier 10 placed in a.py
echo sign_getplaced("a.py", {'id' : 10})
" Get sign with id 20 in group 'g1' placed in a.py
echo sign_getplaced("a.py", {'group' : 'g1',
\ 'id' : 20})
" Get a List of all the placed signs
echo sign_getplaced()
<
*sign_jump()*
sign_jump({id}, {group}, {expr})
Open the buffer {expr} or jump to the window that contains
{expr} and position the cursor at sign {id} in group {group}.
This is similar to the |:sign-jump| command.
For the use of {expr}, see |bufname()|.
Returns the line number of the sign. Returns -1 if the
arguments are invalid.
Example: >
" Jump to sign 10 in the current buffer
call sign_jump(10, '', '')
<
*sign_place()*
sign_place({id}, {group}, {name}, {expr} [, {dict}])
Place the sign defined as {name} at line {lnum} in file or
buffer {expr} and assign {id} and {group} to sign. This is
similar to the |:sign-place| command.
If the sign identifier {id} is zero, then a new identifier is
allocated. Otherwise the specified number is used. {group} is
the sign group name. To use the global sign group, use an
empty string. {group} functions as a namespace for {id}, thus
two groups can use the same IDs. Refer to |sign-identifier|
and |sign-group| for more information.
{name} refers to a defined sign.
{expr} refers to a buffer name or number. For the accepted
values, see |bufname()|.
The optional {dict} argument supports the following entries:
lnum line number in the file or buffer
{expr} where the sign is to be placed.
For the accepted values, see |line()|.
priority priority of the sign. See
|sign-priority| for more information.
If the optional {dict} is not specified, then it modifies the
placed sign {id} in group {group} to use the defined sign
{name}.
Returns the sign identifier on success and -1 on failure.
Examples: >
" Place a sign named sign1 with id 5 at line 20 in
" buffer json.c
call sign_place(5, '', 'sign1', 'json.c',
\ {'lnum' : 20})
" Updates sign 5 in buffer json.c to use sign2
call sign_place(5, '', 'sign2', 'json.c')
" Place a sign named sign3 at line 30 in
" buffer json.c with a new identifier
let id = sign_place(0, '', 'sign3', 'json.c',
\ {'lnum' : 30})
" Place a sign named sign4 with id 10 in group 'g3'
" at line 40 in buffer json.c with priority 90
call sign_place(10, 'g3', 'sign4', 'json.c',
\ {'lnum' : 40, 'priority' : 90})
<
*sign_placelist()*
sign_placelist({list})
Place one or more signs. This is similar to the
|sign_place()| function. The {list} argument specifies the
List of signs to place. Each list item is a dict with the
following sign attributes:
buffer buffer name or number. For the accepted
values, see |bufname()|.
group sign group. {group} functions as a namespace
for {id}, thus two groups can use the same
IDs. If not specified or set to an empty
string, then the global group is used. See
|sign-group| for more information.
id sign identifier. If not specified or zero,
then a new unique identifier is allocated.
Otherwise the specified number is used. See
|sign-identifier| for more information.
lnum line number in the buffer {expr} where the
sign is to be placed. For the accepted values,
see |line()|.
name name of the sign to place. See |sign_define()|
for more information.
priority priority of the sign. When multiple signs are
placed on a line, the sign with the highest
priority is used. If not specified, the
default value of 10 is used. See
|sign-priority| for more information.
If {id} refers to an existing sign, then the existing sign is
modified to use the specified {name} and/or {priority}.
Returns a List of sign identifiers. If failed to place a
sign, the corresponding list item is set to -1.
Examples: >
" Place sign s1 with id 5 at line 20 and id 10 at line
" 30 in buffer a.c
let [n1, n2] = sign_placelist([
\ {'id' : 5,
\ 'name' : 's1',
\ 'buffer' : 'a.c',
\ 'lnum' : 20},
\ {'id' : 10,
\ 'name' : 's1',
\ 'buffer' : 'a.c',
\ 'lnum' : 30}
\ ])
" Place sign s1 in buffer a.c at line 40 and 50
" with auto-generated identifiers
let [n1, n2] = sign_placelist([
\ {'name' : 's1',
\ 'buffer' : 'a.c',
\ 'lnum' : 40},
\ {'name' : 's1',
\ 'buffer' : 'a.c',
\ 'lnum' : 50}
\ ])
<
sign_undefine([{name}]) *sign_undefine()*
sign_undefine({list})
Deletes a previously defined sign {name}. This is similar to
the |:sign-undefine| command. If {name} is not supplied, then
deletes all the defined signs.
The one argument {list} can be used to undefine a list of
signs. Each list item is the name of a sign.
Returns 0 on success and -1 on failure. For the one argument
{list} call, returns a list of values one for each undefined
sign.
Examples: >
" Delete a sign named mySign
call sign_undefine("mySign")
" Delete signs 'sign1' and 'sign2'
call sign_undefine(["sign1", "sign2"])
" Delete all the signs
call sign_undefine()
<
sign_unplace({group} [, {dict}]) *sign_unplace()*
Remove a previously placed sign in one or more buffers. This
is similar to the |:sign-unplace| command.
{group} is the sign group name. To use the global sign group,
use an empty string. If {group} is set to '*', then all the
groups including the global group are used.
The signs in {group} are selected based on the entries in
{dict}. The following optional entries in {dict} are
supported:
buffer buffer name or number. See |bufname()|.
id sign identifier
If {dict} is not supplied, then all the signs in {group} are
removed.
Returns 0 on success and -1 on failure.
Examples: >
" Remove sign 10 from buffer a.vim
call sign_unplace('', {'buffer' : "a.vim", 'id' : 10})
" Remove sign 20 in group 'g1' from buffer 3
call sign_unplace('g1', {'buffer' : 3, 'id' : 20})
" Remove all the signs in group 'g2' from buffer 10
call sign_unplace('g2', {'buffer' : 10})
" Remove sign 30 in group 'g3' from all the buffers
call sign_unplace('g3', {'id' : 30})
" Remove all the signs placed in buffer 5
call sign_unplace('*', {'buffer' : 5})
" Remove the signs in group 'g4' from all the buffers
call sign_unplace('g4')
" Remove sign 40 from all the buffers
call sign_unplace('*', {'id' : 40})
" Remove all the placed signs from all the buffers
call sign_unplace('*')
<
sign_unplacelist({list}) *sign_unplacelist()*
Remove previously placed signs from one or more buffers. This
is similar to the |sign_unplace()| function.
The {list} argument specifies the List of signs to remove.
Each list item is a dict with the following sign attributes:
buffer buffer name or number. For the accepted
values, see |bufname()|. If not specified,
then the specified sign is removed from all
the buffers.
group sign group name. If not specified or set to an
empty string, then the global sign group is
used. If set to '*', then all the groups
including the global group are used.
id sign identifier. If not specified, then all
the signs in the specified group are removed.
Returns a List where an entry is set to 0 if the corresponding
sign was successfully removed or -1 on failure.
Example: >
" Remove sign with id 10 from buffer a.vim and sign
" with id 20 from buffer b.vim
call sign_unplacelist([
\ {'id' : 10, 'buffer' : "a.vim"},
\ {'id' : 20, 'buffer' : 'b.vim'},
\ ])
<
vim:tw=78:ts=8:noet:ft=help:norl:

View File

@ -854,7 +854,7 @@ time ":mkspell" is used. Vim will then convert everything to 'encoding' and
generate a spell file for 'encoding'. If some of the used characters to not
fit in 'encoding' you will get an error message.
*spell-affix-mbyte*
When using a multi-byte encoding it's possible to use more different affix
When using a multibyte encoding it's possible to use more different affix
flags. But Myspell doesn't support that, thus you may not want to use it
anyway. For compatibility use an 8-bit encoding.
@ -1411,7 +1411,7 @@ are spelling mistakes this may not be quite right.
Common words can be specified with the COMMON item. This will give better
suggestions when editing a short file. Example:
COMMON the of to and a in is it you that he was for on are ~
COMMON the of to and a in is it you that he she was for on are ~
The words must be separated by white space, up to 25 per line.
When multiple regions are specified in a ":mkspell" command the common words

View File

@ -42,9 +42,12 @@ filename One or more file names. The first one will be the current
In most cases (except -s, -es, |--embed|, --headless) if stdin
is not a TTY then it is read as text, so "-" is implied: >
echo text | nvim file
< The buffer will be marked modified, because it contains text
that needs to be saved (except for readonly |-R| mode).
< The buffer will be marked as modified, because it contains
text that needs to be saved (except for readonly |-R| mode).
If you don't like that, put these lines in your init.vim: >
" Don't set 'modified' when reading from stdin
au StdinReadPost * set nomodified
<
To read stdin as Normal commands use |-s| with "-": >
echo "ifoo" | nvim -s -
< To read stdin as Ex commands use |-es| or |-e|: >
@ -390,7 +393,7 @@ accordingly. Vim proceeds in this order:
1. Set the 'shell' option *SHELL* *COMSPEC*
The environment variable SHELL, if it exists, is used to set the
'shell' option. On Windows, the COMSPEC variable is used
'shell' option. On Win32, the COMSPEC variable is used
if SHELL is not set.
2. Process the arguments
@ -518,7 +521,8 @@ accordingly. Vim proceeds in this order:
displayed yet).
When switching screens, it happens now. Redrawing starts.
If the "-q" flag was given to Vim, the first error is jumped to.
Buffers for all windows will be loaded.
Buffers for all windows will be loaded, without triggering |BufAdd|
autocommands.
14. Execute startup commands
If a "-t" flag was given to Vim, the tag is jumped to.
@ -621,7 +625,7 @@ Nvim will try to get the value for $VIMRUNTIME in this order:
1. Environment variable $VIMRUNTIME, if it is set.
2. Directory path "$VIM/vim{version}", if it exists, where {version} is the
Vim version number without '-' or '.'. For example: "$VIM/vim54".
Vim version number without '-' or '.'. For example: "$VIM/vim82".
3. Directory path "$VIM/runtime", if it exists.
4. Value of $VIM environment variable. This is for backwards compatibility
with older Vim versions.
@ -766,7 +770,11 @@ resulting file, when executed with a ":source" command:
"options". Script-local mappings will not be written.
2. Restores global variables that start with an uppercase letter and contain
at least one lowercase letter, if 'sessionoptions' contains "globals".
3. Unloads all currently loaded buffers.
3. Closes all windows in the current tab page, except the current one; closes
all tab pages except the current one (this results in currently loaded
buffers to be unloaded, some may become hidden if 'hidden' is set or
otherwise specified); wipes out the current buffer, if it is empty
and unnamed.
4. Restores the current directory if 'sessionoptions' contains "curdir", or
sets the current directory to where the Session file is if 'sessionoptions'
contains "sesdir".
@ -938,8 +946,8 @@ about to abandon with ":bdel", use ":wsh". The '[' and ']' marks are not
stored, but the '"' mark is. The '"' mark is very useful for jumping to the
cursor position when the file was last exited. No marks are saved for files
that start with any string given with the "r" flag in 'shada'. This can be
used to avoid saving marks for files on removable media (for Windows you would
use "ra:,rb:".
used to avoid saving marks for files on removable media (for MS-Windows you
would use "ra:,rb:").
The |v:oldfiles| variable is filled with the file names that the ShaDa file
has marks for.

View File

@ -37,14 +37,14 @@ If the VIM environment variable is not set, Vim will try to find
the path in another way (see |$VIMRUNTIME|). Usually this works just
fine. If it doesn't, try setting the VIM environment variable to the
directory where the Vim stuff is located. For example, if your syntax files
are in the "/usr/vim/vim50/syntax" directory, set $VIMRUNTIME to
"/usr/vim/vim50". You must do this in the shell, before starting Vim.
are in the "/usr/vim/vim82/syntax" directory, set $VIMRUNTIME to
"/usr/vim/vim82". You must do this in the shell, before starting Vim.
This command also sources the |menu.vim| script when the GUI is running or
will start soon. See |'go-M'| about avoiding that.
*:syn-on* *:syntax-on*
The `:syntax enable` command will keep your current color settings. This
allows using `:highlight` commands to set your preferred colors before or
The `:syntax enable` command will keep most of your current color settings.
This allows using `:highlight` commands to set your preferred colors before or
after using this command. If you want Vim to overrule your settings with the
defaults, use: >
:syntax on
@ -56,10 +56,10 @@ with: >
For a color terminal see |:hi-normal-cterm|.
For setting up your own colors syntax highlighting see |syncolor|.
NOTE: The syntax files on Windows have lines that end in <CR><NL>. The files
for Unix end in <NL>. This means you should use the right type of file for
your system. Although on Windows the right format is automatically selected
if the 'fileformats' option is not empty.
NOTE: The syntax files on MS-Windows have lines that end in <CR><NL>.
The files for Unix end in <NL>. This means you should use the right type of
file for your system. Although on MS-Windows the right format is
automatically selected if the 'fileformats' option is not empty.
NOTE: When using reverse video ("gvim -fg white -bg black"), the default value
of 'background' will not be set until the GUI window is opened, which is after
@ -194,7 +194,7 @@ The name for a highlight or syntax group must consist of ASCII letters, digits
and the underscore. As a regexp: "[a-zA-Z0-9_]*". However, Vim does not give
an error when using other characters.
To be able to allow each user to pick his favorite set of colors, there must
To be able to allow each user to pick their favorite set of colors, there must
be preferred names for highlight groups that are common for many languages.
These are the suggested group names (if syntax highlighting works properly
you can see the actual color, except for "Ignore"):
@ -453,6 +453,16 @@ conversion. See |-E| and |-s-ex| for details. It is probably best to create a
script to replace all the -c commands and use it with the -u flag instead of
specifying each command separately.
*hl-TOhtmlProgress* *TOhtml-progress-color*
When displayed, the progress bar will show colored boxes along the statusline
as the HTML conversion proceeds. By default, the background color as the
current "DiffDelete" highlight group is used. If "DiffDelete" and "StatusLine"
have the same background color, TOhtml will automatically adjust the color to
differ. If you do not like the automatically selected colors, you can define
your own highlight colors for the progress bar. Example: >
hi TOhtmlProgress guifg=#c0ffee ctermbg=7
<
*g:html_number_lines*
Default: current 'number' setting.
When 0, buffer text is displayed in the generated HTML without line numbering.
@ -484,8 +494,8 @@ For example: >
<
*g:html_use_css*
Default: 1.
When 1, generate valid HTML 4.01 markup with CSS1 styling, supported in all
modern browsers and most old browsers.
When 1, generate valid HTML 5 markup with CSS styling, supported in all modern
browsers and many old browsers.
When 0, generate <font> tags and similar outdated markup. This is not
recommended but it may work better in really old browsers, email clients,
forum posts, and similar situations where basic CSS support is unavailable.
@ -557,23 +567,43 @@ affected in this way as follows:
Example, to make the fold column and line numbers uncopyable: >
:let g:html_prevent_copy = "fn"
<
This feature is currently implemented by inserting read-only <input> elements
into the markup to contain the uncopyable areas. This does not work well in
all cases. When pasting to some applications which understand HTML, the
<input> elements also get pasted. But plain-text paste destinations should
always work.
The method used to prevent copying in the generated page depends on the value
of |g:html_use_input_for_pc|.
*g:html_use_input_for_pc*
Default: "fallback"
If |g:html_prevent_copy| is non-empty, then:
When "all", read-only <input> elements are used in place of normal text for
uncopyable regions. In some browsers, especially older browsers, after
selecting an entire page and copying the selection, the <input> tags are not
pasted with the page text. If |g:html_no_invalid| is 0, the <input> tags have
invalid type; this works in more browsers, but the page will not validate.
Note: this method does NOT work in recent versions of Chrome and equivalent
browsers; the <input> tags get pasted with the text.
When "fallback" (default value), the same <input> elements are generated for
older browsers, but newer browsers (detected by CSS feature query) hide the
<input> elements and instead use generated content in an ::before pseudoelement
to display the uncopyable text. This method should work with the largest
number of browsers, both old and new.
When "none", the <input> elements are not generated at all. Only the
generated-content method is used. This means that old browsers, notably
Internet Explorer, will either copy the text intended not to be copyable, or
the non-copyable text may not appear at all. However, this is the most
standards-based method, and there will be much less markup.
*g:html_no_invalid*
Default: 0.
When 0, if |g:html_prevent_copy| is non-empty, an invalid attribute is
intentionally inserted into the <input> element for the uncopyable areas. This
increases the number of applications you can paste to without also pasting the
<input> elements. Specifically, Microsoft Word will not paste the <input>
elements if they contain this invalid attribute.
When 1, no invalid markup is ever intentionally inserted, and the generated
page should validate. However, be careful pasting into Microsoft Word when
|g:html_prevent_copy| is non-empty; it can be hard to get rid of the <input>
elements which get pasted.
When 0, if |g:html_prevent_copy| is non-empty and |g:html_use_input_for_pc| is
not "none", an invalid attribute is intentionally inserted into the <input>
element for the uncopyable areas. This prevents pasting the <input> elements
in some applications. Specifically, some versions of Microsoft Word will not
paste the <input> elements if they contain this invalid attribute. When 1, no
invalid markup is inserted, and the generated page should validate. However,
<input> elements may be pasted into some applications and can be difficult to
remove afterward.
*g:html_hover_unfold*
Default: 0.
@ -895,7 +925,7 @@ SELECTEMPTY, ... The indentation preceding the begin/end keywords has to
match (spaces are not considered equal to a tab). >
let baan_fold_sql=1
Note: Block folding can result in many small folds. It is suggested to |:set|
the options 'foldminlines' and 'foldnestmax' in |init.vim| or use |:setlocal|
the options 'foldminlines' and 'foldnestmax' in |init.vim| or use |:setlocal|
in .../after/syntax/baan.vim (see |after-directory|). Eg: >
set foldminlines=5
set foldnestmax=6
@ -913,10 +943,12 @@ Basic.
C *c.vim* *ft-c-syntax*
A few things in C highlighting are optional. To enable them assign any value
to the respective variable. Example: >
(including zero) to the respective variable. Example: >
:let c_comment_strings = 1
To disable them use ":unlet". Example: >
:let c_no_bracket_error = 0
To disable them use `:unlet`. Example: >
:unlet c_comment_strings
Setting the value to zero doesn't work!
An alternative is to switch to the C++ highlighting: >
:set filetype=cpp
@ -932,8 +964,8 @@ Variable Highlight ~
except { and } in first column
Default is to highlight them, otherwise you
can't spot a missing ")".
*c_curly_error* highlight a missing }; this forces syncing from the
start of the file, can be slow
*c_curly_error* highlight a missing } by finding all pairs; this
forces syncing from the start of the file, can be slow
*c_no_ansi* don't do standard ANSI types and constants
*c_ansi_typedefs* ... but do standard ANSI types
*c_ansi_constants* ... but do standard ANSI constants
@ -1135,15 +1167,37 @@ startup vimrc: >
:let filetype_w = "cweb"
DART *dart.vim* *ft-dart-syntax*
Dart is an object-oriented, typed, class defined, garbage collected language
used for developing mobile, desktop, web, and back-end applications. Dart uses
a C-like syntax derived from C, Java, and JavaScript, with features adopted
from Smalltalk, Python, Ruby, and others.
More information about the language and its development environment at the
official Dart language website at https://dart.dev
dart.vim syntax detects and highlights Dart statements, reserved words,
type declarations, storage classes, conditionals, loops, interpolated values,
and comments. There is no support idioms from Flutter or any other Dart
framework.
Changes, fixes? Submit an issue or pull request via:
https://github.com/pr3d4t0r/dart-vim-syntax/
DESKTOP *desktop.vim* *ft-desktop-syntax*
Primary goal of this syntax file is to highlight .desktop and .directory files
according to freedesktop.org standard:
http://standards.freedesktop.org/desktop-entry-spec/latest/
But actually almost none implements this standard fully. Thus it will
highlight all Unix ini files. But you can force strict highlighting according
to standard by placing this in your vimrc file: >
:let enforce_freedesktop_standard = 1
https://specifications.freedesktop.org/desktop-entry-spec/latest/
To highlight nonstandard extensions that does not begin with X-, set >
let g:desktop_enable_nonstd = 1
Note that this may cause wrong highlight.
To highlight KDE-reserved features, set >
let g:desktop_enable_kde = 1
g:desktop_enable_kde follows g:desktop_enable_nonstd if not supplied
DIFF *diff.vim*
@ -1326,26 +1380,26 @@ to your startup file.
EUPHORIA *euphoria3.vim* *euphoria4.vim* *ft-euphoria-syntax*
Two syntax highlighting files exists for Euphoria. One for Euphoria
version 3.1.1, which is the default syntax highlighting file, and one for
Two syntax highlighting files exist for Euphoria. One for Euphoria
version 3.1.1, which is the default syntax highlighting file, and one for
Euphoria version 4.0.5 or later.
Euphoria version 3.1.1 (http://www.rapideuphoria.com/) is still necessary
for developing applications for the DOS platform, which Euphoria version 4
Euphoria version 3.1.1 (http://www.rapideuphoria.com/) is still necessary
for developing applications for the DOS platform, which Euphoria version 4
(http://www.openeuphoria.org/) does not support.
The following file extensions are auto-detected as Euphoria file type:
The following file extensions are auto-detected as Euphoria file type:
*.e, *.eu, *.ew, *.ex, *.exu, *.exw
*.E, *.EU, *.EW, *.EX, *.EXU, *.EXW
To select syntax highlighting file for Euphoria, as well as for
To select syntax highlighting file for Euphoria, as well as for
auto-detecting the *.e and *.E file extensions as Euphoria file type,
add the following line to your startup file: >
:let filetype_euphoria="euphoria3"
or
or
:let filetype_euphoria="euphoria4"
@ -1656,8 +1710,8 @@ The coloring scheme for tags in the HTML file works as follows.
The <> of opening tags are colored differently than the </> of a closing tag.
This is on purpose! For opening tags the 'Function' color is used, while for
closing tags the 'Type' color is used (See syntax.vim to check how those are
defined for you)
closing tags the 'Identifier' color is used (See syntax.vim to check how those
are defined for you)
Known tag names are colored the same way as statements in C. Unknown tag
names are colored with the same color as the <> or </> respectively which
@ -1852,7 +1906,7 @@ new highlightings for the following groups.:
Debug, DebugSpecial, DebugString, DebugBoolean, DebugType
which are used for the statement itself, special characters used in debug
strings, strings, boolean constants and types (this, super) respectively. I
have opted to chose another background for those statements.
have opted to choose another background for those statements.
Javadoc is a program that takes special comments out of Java program files and
creates HTML pages. The standard configuration will highlight this HTML code
@ -1892,6 +1946,16 @@ displayed line. The default value is 10. The disadvantage of using a larger
number is that redrawing can become slow.
JSON *json.vim* *ft-json-syntax*
The json syntax file provides syntax highlighting with conceal support by
default. To disable concealment: >
let g:vim_json_conceal = 0
To disable syntax highlighting of errors: >
let g:vim_json_warnings = 0
LACE *lace.vim* *ft-lace-syntax*
Lace (Language for Assembly of Classes in Eiffel) is case insensitive, but the
@ -2141,9 +2205,10 @@ can use them.
For example, Linux and BSD distributions use groff as their default text
processing package. In order to activate the extra syntax highlighting
features for groff, add the following option to your start-up files: >
features for groff, arrange for files to be recognized as groff (see
|ft-groff-syntax|) or add the following option to your start-up files: >
:let b:nroff_is_groff = 1
:let nroff_is_groff = 1
Groff is different from the old AT&T n/troff that you may still find in
Solaris. Groff macro and request names can be longer than 2 characters and
@ -2221,7 +2286,7 @@ contain very long structures that Vim does not synchronize anymore.
PAPP *papp.vim* *ft-papp-syntax*
The PApp syntax file handles .papp files and, to a lesser extend, .pxml
The PApp syntax file handles .papp files and, to a lesser extent, .pxml
and .pxsl files which are all a mixture of perl/xml/html/other using xml
as the top-level file format. By default everything inside phtml or pxml
sections is treated as a string with embedded preprocessor commands. If
@ -2239,11 +2304,12 @@ http://papp.plan9.de.
PASCAL *pascal.vim* *ft-pascal-syntax*
Files matching "*.p" could be Progress or Pascal. If the automatic detection
doesn't work for you, or you don't edit Progress at all, use this in your
startup vimrc: >
Files matching "*.p" could be Progress or Pascal and those matching "*.pp"
could be Puppet or Pascal. If the automatic detection doesn't work for you,
or you only edit Pascal files, use this in your startup vimrc: >
:let filetype_p = "pascal"
:let filetype_p = "pascal"
:let filetype_pp = "pascal"
The Pascal syntax file has been extended to take into account some extensions
provided by Turbo Pascal, Free Pascal Compiler and GNU Pascal Compiler.
@ -2593,12 +2659,12 @@ Note: only existence of these options matter, not their value. You can replace
QUAKE *quake.vim* *ft-quake-syntax*
The Quake syntax definition should work for most any FPS (First Person
Shooter) based on one of the Quake engines. However, the command names vary
a bit between the three games (Quake, Quake 2, and Quake 3 Arena) so the
syntax definition checks for the existence of three global variables to allow
users to specify what commands are legal in their files. The three variables
can be set for the following effects:
The Quake syntax definition should work for most FPS (First Person Shooter)
based on one of the Quake engines. However, the command names vary a bit
between the three games (Quake, Quake 2, and Quake 3 Arena) so the syntax
definition checks for the existence of three global variables to allow users
to specify what commands are legal in their files. The three variables can
be set for the following effects:
set to highlight commands only available in Quake: >
:let quake_is_quake1 = 1
@ -2667,6 +2733,13 @@ This will add highlighting for the commands that BASH (version 2.05a and
later, and part earlier) adds.
REGO *rego.vim* *ft-rego-syntax*
Rego is a query language developed by Styra. It is mostly used as a policy
language for kubernetes, but can be applied to almost anything. Files with
the following extensions are recognized as rego files: .rego.
RESTRUCTURED TEXT *rst.vim* *ft-rst-syntax*
Syntax highlighting is enabled for code blocks within the document for a
@ -2679,10 +2752,10 @@ To set a user-defined list of code block syntax highlighting: >
To assign multiple code block types to a single syntax, define
`rst_syntax_code_list` as a mapping: >
let rst_syntax_code_list = {
\ 'cpp' = ['cpp', 'c++'],
\ 'bash' = ['bash', 'sh'],
\ 'cpp': ['cpp', 'c++'],
\ 'bash': ['bash', 'sh'],
...
}
\ }
To use color highlighting for emphasis text: >
let rst_use_emphasis_colors = 1
@ -2903,7 +2976,7 @@ vimrc file: >
(Adapted from the html.vim help text by Claudio Fleiner <claudio@fleiner.com>)
*ft-posix-synax* *ft-dash-syntax*
*ft-posix-syntax* *ft-dash-syntax*
SH *sh.vim* *ft-sh-syntax* *ft-bash-syntax* *ft-ksh-syntax*
This covers syntax highlighting for the older Unix (Bourne) sh, and newer
@ -2927,7 +3000,7 @@ variables in your vimrc:
ksh: >
let g:is_kornshell = 1
< posix: (using this is the nearly the same as setting g:is_kornshell to 1) >
< posix: (using this is nearly the same as setting g:is_kornshell to 1) >
let g:is_posix = 1
< bash: >
let g:is_bash = 1
@ -3080,6 +3153,7 @@ redrawing can become slow.
TEX *tex.vim* *ft-tex-syntax* *latex-syntax*
*syntax-tex* *syntax-latex*
Tex Contents~
Tex: Want Syntax Folding? |tex-folding|
@ -3096,6 +3170,7 @@ TEX *tex.vim* *ft-tex-syntax* *latex-syntax*
Tex: Selective Conceal Mode |g:tex_conceal|
Tex: Controlling iskeyword |g:tex_isk|
Tex: Fine Subscript and Superscript Control |tex-supersub|
Tex: Match Check Control |tex-matchcheck|
*tex-folding* *g:tex_fold_enabled*
Tex: Want Syntax Folding? ~
@ -3316,9 +3391,25 @@ syntax highlighting script handles this with the following logic:
For example, I use Luxi Mono Bold; it doesn't support subscript
characters for "hklmnpst", so I put >
let g:tex_subscripts= "[0-9aeijoruvx,+-/().]"
< in ~/.config/nvim/ftplugin/tex/tex.vim in order to avoid having
< in ~/.config/nvim/ftplugin/tex/tex.vim in order to avoid having
inscrutable utf-8 glyphs appear.
*tex-matchcheck* *g:tex_matchcheck*
Tex: Match Check Control~
Sometimes one actually wants mismatched parentheses, square braces,
and or curly braces; for example, \text{(1,10] is a range from but
not including 1 to and including 10}. This wish, of course, conflicts
with the desire to provide delimiter mismatch detection. To
accommodate these conflicting goals, syntax/tex.vim provides >
g:tex_matchcheck = '[({[]'
< which is shown along with its default setting. So, if one doesn't
want [] and () to be checked for mismatches, try using >
let g:tex_matchcheck= '[{}]'
< If you don't want matching to occur inside bold and italicized
regions, >
let g:tex_excludematcher= 1
< will prevent the texMatcher group from being included in those regions.
TF *tf.vim* *ft-tf-syntax*
@ -3430,26 +3521,26 @@ It will look much better with a font in a quadratic cell size, e.g. for X: >
YAML *yaml.vim* *ft-yaml-syntax*
*g:yaml_schema* *b:yaml_schema*
A YAML schema is a combination of a set of tags and a mechanism for resolving
non-specific tags. For user this means that YAML parser may, depending on
plain scalar contents, treat plain scalar (which can actually be only string
and nothing else) as a value of the other type: null, boolean, floating-point,
integer. `g:yaml_schema` option determines according to which schema values
A YAML schema is a combination of a set of tags and a mechanism for resolving
non-specific tags. For user this means that YAML parser may, depending on
plain scalar contents, treat plain scalar (which can actually be only string
and nothing else) as a value of the other type: null, boolean, floating-point,
integer. `g:yaml_schema` option determines according to which schema values
will be highlighted specially. Supported schemas are
Schema Description ~
failsafe No additional highlighting.
json Supports JSON-style numbers, booleans and null.
core Supports more number, boolean and null styles.
pyyaml In addition to core schema supports highlighting timestamps,
but there are some differences in what is recognized as
numbers and many additional boolean values not present in core
pyyaml In addition to core schema supports highlighting timestamps,
but there are some differences in what is recognized as
numbers and many additional boolean values not present in core
schema.
Default schema is `core`.
Note that schemas are not actually limited to plain scalars, but this is the
only difference between schemas defined in YAML specification and the only
Note that schemas are not actually limited to plain scalars, but this is the
only difference between schemas defined in YAML specification and the only
difference defined in the syntax file.
@ -3532,7 +3623,7 @@ DEFINING FOLDLEVEL *:syn-foldlevel*
start: Use level of item containing start of line.
minimum: Use lowest local-minimum level of items on line.
The default is 'start'. Use 'minimum' to search a line horizontally
The default is "start". Use "minimum" to search a line horizontally
for the lowest level contained on the line that is followed by a
higher level. This produces more natural folds when syntax items
may close and open horizontally within a line.
@ -3569,7 +3660,7 @@ SYNTAX ISKEYWORD SETTING *:syn-iskeyword*
clear: Syntax specific iskeyword setting is disabled and the
buffer-local 'iskeyword' setting is used.
{option} Set the syntax 'iskeyword' option to a new value.
{option} Set the syntax 'iskeyword' option to a new value.
Example: >
:syntax iskeyword @,48-57,192-255,$,_
@ -3677,9 +3768,9 @@ DEFINING REGIONS *:syn-region* *:syn-start* *:syn-skip* *:syn-end*
[keepend]
[extend]
[excludenl]
start={start_pattern} ..
[skip={skip_pattern}]
end={end_pattern} ..
start={start-pattern} ..
[skip={skip-pattern}]
end={end-pattern} ..
[{options}]
This defines one region. It may span several lines.
@ -3701,12 +3792,12 @@ DEFINING REGIONS *:syn-region* *:syn-start* *:syn-skip* *:syn-end*
extend a containing match or item. Only
useful for end patterns. Must be given before
the patterns it applies to. |:syn-excludenl|
start={start_pattern} The search pattern that defines the start of
start={start-pattern} The search pattern that defines the start of
the region. See |:syn-pattern| below.
skip={skip_pattern} The search pattern that defines text inside
skip={skip-pattern} The search pattern that defines text inside
the region where not to look for the end
pattern. See |:syn-pattern| below.
end={end_pattern} The search pattern that defines the end of
end={end-pattern} The search pattern that defines the end of
the region. See |:syn-pattern| below.
Example: >
@ -4229,7 +4320,7 @@ Notes:
- A negative offset for an end pattern may not always work, because the end
pattern may be detected when the highlighting should already have stopped.
- Before Vim 7.2 the offsets were counted in bytes instead of characters.
This didn't work well for multi-byte characters, so it was changed with the
This didn't work well for multibyte characters, so it was changed with the
Vim 7.2 release.
- The start of a match cannot be in a line other than where the pattern
matched. This doesn't work: "a\nb"ms=e. You can make the highlighting
@ -4417,8 +4508,8 @@ two different ways:
(e.g., "syntax/pod.vim") the file is searched for in 'runtimepath'.
All matching files are loaded. Using a relative path is
recommended, because it allows a user to replace the included file
with his own version, without replacing the file that does the ":syn
include".
with their own version, without replacing the file that does the
":syn include".
*E847*
The maximum number of includes is 999.
@ -4538,7 +4629,7 @@ matches, nextgroup, etc. But there are a few differences:
- A line continuation pattern can be given. It is used to decide which group
of lines need to be searched like they were one line. This means that the
search for a match with the specified items starts in the first of the
consecutive that contain the continuation pattern.
consecutive lines that contain the continuation pattern.
- When using "nextgroup" or "contains", this only works within one line (or
group of continued lines).
- When using a region, it must start and end in the same line (or group of
@ -4850,8 +4941,8 @@ ctermbg={color-nr} *highlight-ctermbg*
*E419* *E420*
When Vim knows the normal foreground and background colors, "fg" and
"bg" can be used as color names. This only works after setting the
colors for the Normal group and for the Windows console. Example, for
reverse video: >
colors for the Normal group and for the MS-Windows console. Example,
for reverse video: >
:highlight Visual ctermfg=bg ctermbg=fg
< Note that the colors are used that are valid at the moment this
command are given. If the Normal group colors are changed later, the
@ -5002,9 +5093,9 @@ MsgSeparator Separator for scrolled messages, `msgsep` flag of 'display'
*hl-MoreMsg*
MoreMsg |more-prompt|
*hl-NonText*
NonText '@' at the end of the window, characters from 'showbreak'
and other characters that do not really exist in the text
(e.g., ">" displayed when a double-wide character doesn't
NonText '@' at the end of the window, characters from 'showbreak'
and other characters that do not really exist in the text
(e.g., ">" displayed when a double-wide character doesn't
fit at the end of the line). See also |hl-EndOfBuffer|.
*hl-Normal*
Normal normal text
@ -5131,6 +5222,12 @@ If you like Question highlighting for C comments, put this in your vimrc file: >
Without the "default" in the C syntax file, the highlighting would be
overruled when the syntax file is loaded.
To have a link survive `:highlight clear`, which is useful if you have
highlighting for a specific filetype and you want to keep it when selecting
another color scheme, put a command like this in the
"after/syntax/{filetype}.vim" file: >
highlight! default link cComment Question
==============================================================================
15. Cleaning up *:syn-clear* *E391*
@ -5191,7 +5288,7 @@ script file to set these colors. Put this file in a directory in
the default colors. This way these colors will be used after the ":syntax
reset" command.
For Unix you can use the file ~/.config/nvim/after/syntax/syncolor.vim.
For Unix you can use the file ~/.config/nvim/after/syntax/syncolor.vim.
Example: >
if &background == "light"

View File

@ -129,7 +129,7 @@ something else.
:+tabclose " close the next tab page
:1tabclose " close the first tab page
:$tabclose " close the last tab page
:tabclose -2 " close the two previous tab page
:tabclose -2 " close the 2nd previous tab page
:tabclose + " close the next tab page
:tabclose 3 " close the third tab page
:tabclose $ " close the last tab page

View File

@ -179,6 +179,29 @@ commands explained above the tag stack will look like this:
The |gettagstack()| function returns the tag stack of a specified window. The
|settagstack()| function modifies the tag stack of a window.
*tagstack-examples*
Write to the tag stack just like `:tag` but with a user-defined
jumper#jump_to_tag function: >
" Store where we're jumping from before we jump.
let tag = expand('<cword>')
let pos = [bufnr()] + getcurpos()[1:]
let item = {'bufnr': pos[0], 'from': pos, 'tagname': tag}
if jumper#jump_to_tag(tag)
" Jump was successful, write previous location to tag stack.
let winid = win_getid()
let stack = gettagstack(winid)
let stack['items'] = [item]
call settagstack(winid, stack, 't')
endif
<
Set current index of the tag stack to 4: >
call settagstack(1005, {'curidx' : 4})
<
Push a new item onto the tag stack: >
let pos = [bufnr('myfile.txt'), 10, 1, 0]
let newtag = [{'tagname' : 'mytag', 'from' : pos}]
call settagstack(2, {'items' : newtag}, 'a')
<
*E73*
When you try to use the tag stack while it doesn't contain anything you will
get an error message.
@ -204,14 +227,14 @@ the same entry.
Example output:
>
nr pri kind tag file
# pri kind tag file
1 F f mch_delay os_amiga.c
mch_delay(msec, ignoreinput)
> 2 F f mch_delay os_msdos.c
mch_delay(msec, ignoreinput)
3 F f mch_delay os_unix.c
mch_delay(msec, ignoreinput)
Enter nr of choice (<CR> to abort):
Type number and <Enter> (empty cancels):
<
See |tag-priority| for the "pri" column. Note that
this depends on the current file, thus using
@ -488,10 +511,13 @@ a tag for each "#defined" macro, typedefs, enums, etc.
Some programs that generate tags files:
ctags As found on most Unix systems. Only supports C. Only
does the basic work.
universal ctags A maintained version of ctags based on exuberant
ctags. See https://ctags.io.
*Exuberant_ctags*
exuberant ctags This is a very good one. It works for C, C++, Java,
Fortran, Eiffel and others. It can generate tags for
many items. See http://ctags.sourceforge.net.
No new version since 2009.
JTags For Java, in Java. It can be found at
http://www.fleiner.com/jtags/.
ptags.py For Python, in Python. Found in your Python source
@ -513,7 +539,7 @@ The first format is a normal tag, which is completely compatible with Vi. It
is the only format produced by traditional ctags implementations. This is
often used for functions that are global, also referenced in other files.
The lines in the tags file can end in <LF> or <CR><LF>. On the Macintosh <CR>
The lines in the tags file can end in <NL> or <CR><NL>. On the Macintosh <CR>
also works. The <CR> and <NL> characters can never appear inside a line.
The second format is new. It includes additional information in optional
@ -893,8 +919,8 @@ The following is a hypothetical example of a function used for 'tagfunc'. It
uses the output of |taglist()| to generate the result: a list of tags in the
inverse order of file names.
>
function! TagFunc(pattern, flags, info)
function! CompareFilenames(item1, item2)
function TagFunc(pattern, flags, info)
function CompareFilenames(item1, item2)
let f1 = a:item1['filename']
let f2 = a:item2['filename']
return f1 >=# f2 ?

View File

@ -289,7 +289,7 @@ border, the text is scrolled.
A selection can be started by pressing the left mouse button on the first
character, moving the mouse to the last character, then releasing the mouse
button. You will not always see the selection until you release the button,
only in some versions (GUI, Windows) will the dragging be shown immediately.
only in some versions (GUI, Win32) will the dragging be shown immediately.
Note that you can make the text scroll by moving the mouse at least one
character in the first/last line in the window when 'scrolloff' is non-zero.
@ -306,7 +306,7 @@ alt key is pressed (it may move the window).
*double-click*
Double, triple and quadruple clicks are supported when the GUI is active, for
Windows and for an xterm. For selecting text, extra clicks extend the
Win32 and for an xterm. For selecting text, extra clicks extend the
selection:
click select ~
double word or % match *<2-LeftMouse>*
@ -318,9 +318,8 @@ A double click on a word selects that word. 'iskeyword' is used to specify
which characters are included in a word. A double click on a character
that has a match selects until that match (like using "v%"). If the match is
an #if/#else/#endif block, the selection becomes linewise.
For MS-DOS and xterm the time for double clicking can be set with the
'mousetime' option. For the other systems this time is defined outside of
Vim.
For MS-Windows and xterm the time for double clicking can be set with the
'mousetime' option. For the other systems this time is defined outside of Vim.
An example, for using a double click to jump to the tag under the cursor: >
:map <2-LeftMouse> :exe "tag ". expand("<cword>")<CR>

169
runtime/doc/testing.txt Normal file
View File

@ -0,0 +1,169 @@
*testing.txt* Nvim
VIM REFERENCE MANUAL by Bram Moolenaar
Testing Vim and Vim script *testing-support*
Expression evaluation is explained in |eval.txt|. This file goes into details
about writing tests in Vim script. This can be used for testing Vim itself
and for testing plugins.
1. Testing Vim |testing|
2. Test functions |test-functions-details|
3. Assert funtions |assert-functions-details|
==============================================================================
1. Testing Vim *testing*
Vim can be tested after building it, usually with "make test".
The tests are located in the directory "src/testdir".
There are several types of tests added over time:
test33.in oldest, don't add any of these
test_something.in old style tests
test_something.vim new style tests
*new-style-testing*
New tests should be added as new style tests. These use functions such as
|assert_equal()| to keep the test commands and the expected result in one
place.
*old-style-testing*
In some cases an old style test needs to be used. E.g. when testing Vim
without the |+eval| feature.
Find more information in the file src/testdir/README.txt.
==============================================================================
2. Test functions *test-functions-details*
test_garbagecollect_now() *test_garbagecollect_now()*
Like garbagecollect(), but executed right away. This must
only be called directly to avoid any structure to exist
internally, and |v:testing| must have been set before calling
any function.
==============================================================================
3. Assert functions *assert-functions-details*
assert_beeps({cmd}) *assert_beeps()*
Run {cmd} and add an error message to |v:errors| if it does
NOT produce a beep or visual bell.
Also see |assert_fails()|, |assert_nobeep()| and
|assert-return|.
*assert_equal()*
assert_equal({expected}, {actual} [, {msg}])
When {expected} and {actual} are not equal an error message is
added to |v:errors| and 1 is returned. Otherwise zero is
returned |assert-return|.
There is no automatic conversion, the String "4" is different
from the Number 4. And the number 4 is different from the
Float 4.0. The value of 'ignorecase' is not used here, case
always matters.
When {msg} is omitted an error in the form "Expected
{expected} but got {actual}" is produced.
Example: >
assert_equal('foo', 'bar')
< Will result in a string to be added to |v:errors|:
test.vim line 12: Expected 'foo' but got 'bar' ~
*assert_equalfile()*
assert_equalfile({fname-one}, {fname-two})
When the files {fname-one} and {fname-two} do not contain
exactly the same text an error message is added to |v:errors|.
Also see |assert-return|.
When {fname-one} or {fname-two} does not exist the error will
mention that.
assert_exception({error} [, {msg}]) *assert_exception()*
When v:exception does not contain the string {error} an error
message is added to |v:errors|. Also see |assert-return|.
This can be used to assert that a command throws an exception.
Using the error number, followed by a colon, avoids problems
with translations: >
try
commandthatfails
call assert_false(1, 'command should have failed')
catch
call assert_exception('E492:')
endtry
assert_fails({cmd} [, {error} [, {msg}]]) *assert_fails()*
Run {cmd} and add an error message to |v:errors| if it does
NOT produce an error. Also see |assert-return|.
When {error} is given it must match in |v:errmsg|.
Note that beeping is not considered an error, and some failing
commands only beep. Use |assert_beeps()| for those.
assert_false({actual} [, {msg}]) *assert_false()*
When {actual} is not false an error message is added to
|v:errors|, like with |assert_equal()|.
Also see |assert-return|.
A value is false when it is zero. When {actual} is not a
number the assert fails.
When {msg} is omitted an error in the form
"Expected False but got {actual}" is produced.
assert_inrange({lower}, {upper}, {actual} [, {msg}]) *assert_inrange()*
This asserts number and |Float| values. When {actual} is lower
than {lower} or higher than {upper} an error message is added
to |v:errors|. Also see |assert-return|.
When {msg} is omitted an error in the form
"Expected range {lower} - {upper}, but got {actual}" is
produced.
*assert_match()*
assert_match({pattern}, {actual} [, {msg}])
When {pattern} does not match {actual} an error message is
added to |v:errors|. Also see |assert-return|.
{pattern} is used as with |=~|: The matching is always done
like 'magic' was set and 'cpoptions' is empty, no matter what
the actual value of 'magic' or 'cpoptions' is.
{actual} is used as a string, automatic conversion applies.
Use "^" and "$" to match with the start and end of the text.
Use both to match the whole text.
When {msg} is omitted an error in the form
"Pattern {pattern} does not match {actual}" is produced.
Example: >
assert_match('^f.*o$', 'foobar')
< Will result in a string to be added to |v:errors|:
test.vim line 12: Pattern '^f.*o$' does not match 'foobar' ~
assert_nobeep({cmd}) *assert_nobeep()*
Run {cmd} and add an error message to |v:errors| if it
produces a beep or visual bell.
Also see |assert_beeps()|.
*assert_notequal()*
assert_notequal({expected}, {actual} [, {msg}])
The opposite of `assert_equal()`: add an error message to
|v:errors| when {expected} and {actual} are equal.
Also see |assert-return|.
*assert_notmatch()*
assert_notmatch({pattern}, {actual} [, {msg}])
The opposite of `assert_match()`: add an error message to
|v:errors| when {pattern} matches {actual}.
Also see |assert-return|.
assert_report({msg}) *assert_report()*
Report a test failure directly, using {msg}.
Always returns one.
assert_true({actual} [, {msg}]) *assert_true()*
When {actual} is not true an error message is added to
|v:errors|, like with |assert_equal()|.
Also see |assert-return|.
A value is |TRUE| when it is a non-zero number or |v:true|.
When {actual} is not a number or |v:true| the assert fails.
When {msg} is omitted an error in the form "Expected True but
got {actual}" is produced.
vim:tw=78:ts=8:noet:ft=help:norl:

View File

@ -446,4 +446,28 @@ A slightly more advanced version is used in the |matchparen| plugin.
autocmd InsertEnter * match none
<
==============================================================================
Opening help in the current window *help-curwin*
By default, help is displayed in a split window. If you prefer it opens in
the current window, try this custom `:HelpCurwin` command:
>
command -bar -nargs=? -complete=help HelpCurwin execute s:HelpCurwin(<q-args>)
let s:did_open_help = v:false
function s:HelpCurwin(subject) abort
let mods = 'silent noautocmd keepalt'
if !s:did_open_help
execute mods .. ' help'
execute mods .. ' helpclose'
let s:did_open_help = v:true
endif
if !getcompletion(a:subject, 'help')->empty()
execute mods .. ' edit ' .. &helpfile
endif
return 'help ' .. a:subject
endfunction
<
vim:tw=78:ts=8:noet:ft=help:norl:

View File

@ -212,7 +212,7 @@ Check the ICCF web site for the latest information! See |iccf| for the URL.
USA: The methods mentioned below can be used.
Sending a check to the Nehemiah Group Outreach Society (NGOS)
is no longer possible, unfortunately. We are looking for
another way to get you an IRS tax receipt.
another way to get you an IRS tax receipt.
For sponsoring a child contact KCF in Canada (see below). US
checks can be sent to them to lower banking costs.

View File

@ -60,9 +60,9 @@ with the redo command. If you make a new change after the undo command,
the redo will not be possible anymore.
'u' included, the Vi-compatible way:
The undo command undoes the previous change, and also the previous undo command.
The redo command repeats the previous undo command. It does NOT repeat a
change command, use "." for that.
The undo command undoes the previous change, and also the previous undo
command. The redo command repeats the previous undo command. It does NOT
repeat a change command, use "." for that.
Examples Vim way Vi-compatible way ~
"uu" two times undo no-op
@ -98,7 +98,7 @@ change again. But you can do something like this: >
:undojoin | delete
After this an "u" command will undo the delete command and the previous
After this a "u" command will undo the delete command and the previous
change.
To do the opposite, break a change into two undo blocks, in Insert mode use
@ -257,7 +257,7 @@ respectively:
(the magic number at the start of the file is wrong), then
this fails, unless the ! was added.
If it exists and does look like an undo file it is
overwritten. If there is no undo-history, nothing will be
overwritten. If there is no undo-history, nothing will be
written.
Implementation detail: Overwriting happens by first deleting
the existing file and then creating a new file with the same
@ -371,7 +371,7 @@ back the text of three deletes ago with '"3P'.
*redo-register*
If you want to get back more than one part of deleted text, you can use a
special feature of the repeat command ".". It will increase the number of the
register used. So if you first do ""1P", the following "." will result in a
register used. So if you first do '"1P', the following "." will result in a
'"2P'. Repeating this will result in all numbered registers being inserted.
Example: If you deleted text with 'dd....' it can be restored with

View File

@ -41,11 +41,11 @@ the commands and options used for it. Use these two commands:
Press CTRL-O to jump back (repeat to go further back).
Many links are in vertical bars, like this: |bars|. The bars themselves may
be hidden or invisible, see below. An option name, like 'number', a command
be hidden or invisible; see below. An option name, like 'number', a command
in double quotes like ":write" and any other word can also be used as a link.
Try it out: Move the cursor to CTRL-] and press CTRL-] on it.
Other subjects can be found with the ":help" command, see |help.txt|.
Other subjects can be found with the ":help" command; see |help.txt|.
The bars and stars are usually hidden with the |conceal| feature. They also
use |hl-Ignore|, using the same color for the text as the background. You can
@ -69,7 +69,7 @@ For more info see |vimrc|.
*01.3* Using the Vim tutor *tutor* *vimtutor*
Instead of reading the text (boring!) you can use :Tutor to learn your first
Vim commands. This is a 30 minute tutorial that teaches the most basic Vim
Vim commands. This is a 30-minute tutorial that teaches the most basic Vim
functionality hands-on.
To start the tutorial, execute >

View File

@ -29,8 +29,8 @@ To start Vim, enter this command: >
gvim file.txt
On Unix you can type this at any command prompt. If you are running Windows,
open a command prompt window and enter the command. In either case, Vim
On Unix you can type this at any command prompt. If you are running Microsoft
Windows, open a Command Prompt and enter the command. In either case, Vim
starts editing a file called file.txt. Because this is a new file, you get a
blank window. This is what your screen will look like:
@ -42,7 +42,7 @@ blank window. This is what your screen will look like:
|~ |
|"file.txt" [New file] |
+---------------------------------------+
('#" is the cursor position.)
('#' is the cursor position.)
The tilde (~) lines indicate lines not in the file. In other words, when Vim
runs out of file to display, it displays tilde lines. At the bottom of the
@ -253,11 +253,11 @@ restores the character.
g intelligent turtle ~
The next u command restores the next-to-last character deleted:
The next "u" command restores the next-to-last character deleted:
ng intelligent turtle ~
The next u command gives you the u, and so on:
The next "u" command gives you the u, and so on:
ung intelligent turtle ~
oung intelligent turtle ~
@ -364,7 +364,7 @@ To exit, use the "ZZ" command. This command writes the file and exits.
Unlike many other editors, Vim does not automatically make a backup
file. If you type "ZZ", your changes are committed and there's no
turning back. You can configure the Vim editor to produce backup
files, see |07.4|.
files; see |07.4|.
DISCARDING CHANGES
@ -387,7 +387,7 @@ message and refuse to exit:
E37: No write since last change (use ! to override) ~
By specifying the override, you are in effect telling Vim, "I know that what
I'm doing looks stupid, but I'm a big boy and really want to do this."
I'm doing looks stupid, but I really want to do this."
If you want to continue editing with Vim: The ":e!" command reloads the
original version of the file.
@ -499,14 +499,14 @@ Summary: *help-summary* >
1) Use Ctrl-D after typing a topic and let Vim show all available topics.
Or press Tab to complete: >
:help some<Tab>
:help some<Tab>
< More information on how to use the help: >
:help helphelp
2) Follow the links in bars to related help. You can go from the detailed
help to the user documentation, which describes certain commands more from
a user perspective and less detailed. E.g. after: >
:help pattern.txt
:help pattern.txt
< You can see the user guide topics |03.9| and |usr_27.txt| in the
introduction.
@ -518,29 +518,29 @@ Summary: *help-summary* >
< to open the help page which describes all option handling and then search
using regular expressions, e.g. textwidth.
Certain options have their own namespace, e.g.: >
:help cpo-<letter>
:help cpo-<letter>
< for the corresponding flag of the 'cpoptions' settings, substitute <letter>
by a specific flag, e.g.: >
:help cpo-;
< And for the guioption flags: >
:help go-<letter>
:help cpo-;
< And for the 'guioptions' flags: >
:help go-<letter>
4) Normal mode commands do not have a prefix. To go to the help page for the
"gt" command: >
:help gt
:help gt
5) Insert mode commands start with i_. Help for deleting a word: >
:help i_CTRL-W
:help i_CTRL-W
6) Visual mode commands start with v_. Help for jumping to the other side of
the Visual area: >
:help v_o
:help v_o
7) Command line editing and arguments start with c_. Help for using the
command argument %: >
:help c_%
:help c_%
8) Ex-commands always start with ":", so to go to the :s command help: >
8) Ex-commands always start with ":", so to go to the ":s" command help: >
:help :s
9) Commands specifically for debugging start with ">". To go to the help
@ -549,55 +549,56 @@ Summary: *help-summary* >
10) Key combinations. They usually start with a single letter indicating
the mode for which they can be used. E.g.: >
:help i_CTRL-X
< takes you to the family of Ctrl-X commands for insert mode which can be
used to auto complete different things. Note, that certain keys will
:help i_CTRL-X
< takes you to the family of CTRL-X commands for insert mode which can be
used to auto-complete different things. Note, that certain keys will
always be written the same, e.g. Control will always be CTRL.
For normal mode commands there is no prefix and the topic is available at
:h CTRL-<Letter>. E.g. >
:help CTRL-W
:help CTRL-W
< In contrast >
:help c_CTRL-R
< will describe what the Ctrl-R does when entering commands in the Command
< will describe what the CTRL-R does when entering commands in the Command
line and >
:help v_Ctrl-A
:help v_CTRL-A
< talks about incrementing numbers in visual mode and >
:help g_CTRL-A
< talks about the g<C-A> command (e.g. you have to press "g" then <Ctrl-A>).
Here the "g" stand for the normal command "g" which always expects a second
key before doing something similar to the commands starting with "z"
< talks about the "g<C-A>" command (e.g. you have to press "g" then
<CTRL-A>). Here the "g" stands for the normal command "g" which always
expects a second key before doing something similar to the commands
starting with "z".
11) Regexp items always start with /. So to get help for the "\+" quantifier
in Vim regexes: >
:help /\+
:help /\+
< If you need to know everything about regular expressions, start reading
at: >
:help pattern.txt
:help pattern.txt
12) Registers always start with "quote". To find out about the special ":"
register: >
:help quote:
:help quote:
13) Vim Script is available at >
:help eval.txt
< Certain aspects of the language are available at :h expr-X where "X" is a
single letter. E.g. >
:help expr-!
< will take you to the topic describing the "!" (Not) operator for
VimScript.
:help expr-!
< will take you to the topic describing the "!" (Not) operator for Vim
Script.
Also important is >
:help function-list
:help function-list
< to find a short description of all functions available. Help topics for
Vim script functions always include the "()", so: >
:help append()
:help append()
< talks about the append Vim script function rather than how to append text
in the current buffer.
14) Mappings are talked about in the help page :h |map.txt|. Use >
:help mapmode-i
:help mapmode-i
< to find out about the |:imap| command. Also use :map-topic
to find out about certain subtopics particular for mappings. e.g: >
:help :map-local
:help :map-local
< for buffer-local mappings or >
:help map-bar
< for how the '|' is handled in mappings.
@ -608,7 +609,7 @@ Summary: *help-summary* >
16) Window management commands always start with CTRL-W, so you find the
corresponding help at :h CTRL-W_letter. E.g. >
:help CTRL-W_p
:help CTRL-W_p
< for moving the previous accessed window. You can also access >
:help windows.txt
< and read your way through if you are looking for window handling
@ -617,57 +618,58 @@ Summary: *help-summary* >
17) Use |:helpgrep| to search in all help pages (and also of any installed
plugins). See |:helpgrep| for how to use it.
To search for a topic: >
:helpgrep topic
:helpgrep topic
< This takes you to the first match. To go to the next one: >
:cnext
< All matches are available in the quickfix window which can be opened
with: >
:copen
:copen
< Move around to the match you like and press Enter to jump to that help.
18) The user manual. This describes help topics for beginners in a rather
friendly way. Start at |usr_toc.txt| to find the table of content (as you
might have guessed): >
:help usr_toc.txt
:help usr_toc.txt
< Skim over the contents to find interesting topics. The "Digraphs" and
"Entering special characters" items are in chapter 24, so to go to that
particular help page: >
:help usr_24.txt
:help usr_24.txt
< Also if you want to access a certain chapter in the help, the chapter
number can be accessed directly like this: >
:help 10.1
< goes to chapter 10.1 in |usr_10.txt| and talks about recording macros.
:help 10.1
< which goes to chapter 10.1 in |usr_10.txt| and talks about recording
macros.
19) Highlighting groups. Always start with hl-groupname. E.g. >
:help hl-WarningMsg
:help hl-WarningMsg
< talks about the WarningMsg highlighting group.
20) Syntax highlighting is namespaced to :syn-topic e.g. >
20) Syntax highlighting is namespaced to :syn-topic. E.g. >
:help :syn-conceal
< talks about the conceal argument for the :syn command.
< talks about the conceal argument for the ":syn" command.
21) Quickfix commands usually start with :c while location list commands
usually start with :l
22) Autocommand events can be found by their name: >
:help BufWinLeave
:help BufWinLeave
< To see all possible events: >
:help events
23) Command-line switches always start with "-". So for the help of the -f
command switch of Vim use: >
:help -f
:help -f
24) Optional features always start with "+". To find out about the
conceal feature use: >
:help +conceal
:help +conceal
25) Documentation for included filetype specific functionality is usually
available in the form ft-<filetype>-<functionality>. So >
:help ft-c-syntax
:help ft-c-syntax
< talks about the C syntax file and the option it provides. Sometimes,
additional sections for omni completion >
:help ft-php-omni
:help ft-php-omni
< or filetype plugins >
:help ft-tex-plugin
< are available.
@ -677,9 +679,9 @@ Summary: *help-summary* >
< takes you exactly to the description of the swap error message and >
:help W10
< talks about the warning "Changing a readonly file".
Sometimes however, those error codes are not described, but rather are
Sometimes, however, those error codes are not described, but rather are
listed at the Vim command that usually causes this. So: >
:help E128
:help E128
< takes you to the |:function| command

View File

@ -30,10 +30,11 @@ Table of contents: |usr_toc.txt|
To move the cursor forward one word, use the "w" command. Like most Vim
commands, you can use a numeric prefix to move past multiple words. For
example, "3w" moves three words. This figure shows how it works:
example, "3w" moves three words. This figure shows how it works (starting at
the position marked with "x"):
This is a line with example text ~
--->-->->----------------->
x-->-->->----------------->
w w w 3w
Notice that "w" moves to the start of the next word if it already is at the
@ -41,15 +42,15 @@ start of a word.
The "b" command moves backward to the start of the previous word:
This is a line with example text ~
<----<--<-<---------<---
<----<--<-<---------<--x
b b b 2b b
There is also the "e" command that moves to the next end of a word and "ge",
which moves to the previous end of a word:
This is a line with example text ~
<- <--- -----> ---->
ge ge e e
<----<----x---->------------>
2ge ge e 2e
If you are at the last word of a line, the "w" command will take you to the
first word in the next line. Thus you can use this to move through a
@ -81,13 +82,13 @@ The "$" command moves the cursor to the end of a line. If your keyboard has
an <End> key it will do the same thing.
The "^" command moves to the first non-blank character of the line. The "0"
command (zero) moves to the very first character of the line. The <Home> key
does the same thing. In a picture:
command (zero) moves to the very first character of the line, and the <Home>
key does the same thing. In a picture ("." indicates a space):
^
<------------
<-----------x
.....This is a line with example text ~
<----------------- --------------->
<----------------x x-------------->
0 $
(the "....." indicates blanks here)
@ -222,7 +223,8 @@ you can see? This figure shows the three commands you can use:
L --> | text sample text |
+---------------------------+
Hints: "H" stands for Home, "M" for Middle and "L" for Last.
Hints: "H" stands for Home, "M" for Middle and "L" for Last. Alternatively,
"H" for high, "M" for Middle and "L" for low.
==============================================================================
*03.6* Telling where you are
@ -299,22 +301,22 @@ To scroll one line at a time use CTRL-E (scroll up) and CTRL-Y (scroll down).
Think of CTRL-E to give you one line Extra. (If you use MS-Windows compatible
key mappings CTRL-Y will redo a change instead of scroll.)
To scroll forward by a whole screen (except for two lines) use CTRL-F. The
other way is backward, CTRL-B is the command to use. Fortunately CTRL-F is
Forward and CTRL-B is Backward, that's easy to remember.
To scroll forward by a whole screen (except for two lines) use CTRL-F. To
scroll backwards, use CTRL-B. These should be easy to remember: F for
Forwards and B for Backwards.
A common issue is that after moving down many lines with "j" your cursor is at
the bottom of the screen. You would like to see the context of the line with
the cursor. That's done with the "zz" command.
+------------------+ +------------------+
| some text | | some text |
| some text | | some text |
| some text | | some text |
| some text | zz --> | line with cursor |
| some text | | some text |
| some text | | some text |
| line with cursor | | some text |
| earlier text | | earlier text |
| earlier text | | earlier text |
| earlier text | | earlier text |
| earlier text | zz --> | line with cursor |
| earlier text | | later text |
| earlier text | | later text |
| line with cursor | | later text |
+------------------+ +------------------+
The "zt" command puts the cursor line at the top, "zb" at the bottom. There
@ -346,7 +348,8 @@ to find the first #include after the cursor: >
And then type "n" several times. You will move to each #include in the text.
You can also use a count if you know which match you want. Thus "3n" finds
the third match. Using a count with "/" doesn't work.
the third match. You can also use a count with "/": "4/the" goes to the
fourth match of "the".
The "?" command works like "/" but searches backwards: >
@ -354,7 +357,7 @@ The "?" command works like "/" but searches backwards: >
The "N" command repeats the last search the opposite direction. Thus using
"N" after a "/" command searches backwards, using "N" after "?" searches
forward.
forwards.
IGNORING CASE
@ -458,8 +461,8 @@ essential ones:
:set nowrapscan
This stops the search at the end of the file. Or, when you are searching
backwards, at the start of the file. The 'wrapscan' option is on by default,
thus searching wraps around the end of the file.
backwards, it stops the search at the start of the file. The 'wrapscan'
option is on by default, thus searching wraps around the end of the file.
>
:set noincsearch
@ -481,7 +484,8 @@ Vim. Example: >
Go:set hlsearch<Esc>
"G" moves to the end of the file. "o" starts a new line, where you type the
":set" command. You end insert mode with <Esc>. Then write the file: >
":set" command. You end insert mode with <Esc>. Then write and close the
file: >
ZZ
@ -495,8 +499,8 @@ Regular expressions are an extremely powerful and compact way to specify a
search pattern. Unfortunately, this power comes at a price, because regular
expressions are a bit tricky to specify.
In this section we mention only a few essential ones. More about search
patterns and commands in chapter 27 |usr_27.txt|. You can find the full
explanation here: |pattern|.
patterns and commands can be found in chapter 27 |usr_27.txt|. You can find
the full explanation here: |pattern|.
BEGINNING AND END OF A LINE
@ -522,9 +526,9 @@ And with "/^the" we find this one:
the solder holding one of the chips melted and the ~
xxx
You can try searching with "/^the$", it will only match a single line
consisting of "the". White space does matter here, thus if a line contains a
space after the word, like "the ", the pattern will not match.
You can try searching with "/^the$"; it will only match a single line
consisting entirely of "the". White space does matter here, thus if a line
contains a space after the word, like "the ", the pattern will not match.
MATCHING ANY SINGLE CHARACTER
@ -559,20 +563,20 @@ where you came from, use this command: >
This ` is a backtick or open single-quote character.
If you use the same command a second time you will jump back again. That's
because the ` command is a jump itself, and the position from before this jump
is remembered.
because the "`" command is a jump itself, and the position from before this
jump is remembered.
Generally, every time you do a command that can move the cursor further than
within the same line, this is called a jump. This includes the search
commands "/" and "n" (it doesn't matter how far away the match is). But not
the character searches with "fx" and "tx" or the word movements "w" and "e".
Also, "j" and "k" are not considered to be a jump. Even when you use a
Also, "j" and "k" are not considered to be a jump, even when you use a
count to make them move the cursor quite a long way away.
The `` command jumps back and forth, between two points. The CTRL-O command
The "``" command jumps back and forth, between two points. The CTRL-O command
jumps to older positions (Hint: O for older). CTRL-I then jumps back to newer
positions (Hint: I is just next to O on the keyboard). Consider this sequence
of commands: >
positions (Hint: for many common keyboard layouts, I is just next to O).
Consider this sequence of commands: >
33G
/^The
@ -610,9 +614,9 @@ Thus to move to the a mark:
>
`a
The command 'mark (single quotation mark, or apostrophe) moves you to the
beginning of the line containing the mark. This differs from the `mark
command, which moves you to marked column.
The command "'mark" (single quotation mark, or apostrophe) moves you to the
beginning of the line containing the mark. This differs from the "`mark"
command, which also moves you to the marked column.
The marks can be very useful when working on two related parts in a file.
Suppose you have some text near the start of the file you need to look at,

View File

@ -33,7 +33,7 @@ using a count: "4x" deletes four characters.
move word command. In fact, the "d" command may be followed by any motion
command, and it deletes from the current location to the place where the
cursor winds up.
The "4w" command, for example, moves the cursor over four words. The d4w
The "4w" command, for example, moves the cursor over four words. The "d4w"
command deletes four words.
To err is human. To really foul up you need a computer. ~
@ -91,14 +91,14 @@ This "c2wbe<Esc>" contains these bits:
be insert this text
<Esc> back to Normal mode
If you have paid attention, you will have noticed something strange: The space
before "human" isn't deleted. There is a saying that for every problem there
is an answer that is simple, clear, and wrong. That is the case with the
example used here for the "cw" command. The c operator works just like the
d operator, with one exception: "cw". It actually works like "ce", change to
end of word. Thus the space after the word isn't included. This is an
exception that dates back to the old Vi. Since many people are used to it
now, the inconsistency has remained in Vim.
You will have noticed something strange: The space before "human" isn't
deleted. There is a saying that for every problem there is an answer that is
simple, clear, and wrong. That is the case with the example used here for the
"cw" command. The c operator works just like the d operator, with one
exception: "cw". It actually works like "ce", change to end of word. Thus
the space after the word isn't included. This is an exception that dates back
to the old Vi. Since many people are used to it now, the inconsistency has
remained in Vim.
MORE CHANGES
@ -114,7 +114,7 @@ Insert mode and append new text.
SHORTCUTS
Some operator-motion commands are used so often that they have been given a
single letter command:
single-letter command:
x stands for dl (delete character under the cursor)
X stands for dh (delete character left of the cursor)
@ -138,6 +138,7 @@ REPLACING WITH ONE CHARACTER
The "r" command is not an operator. It waits for you to type a character, and
will replace the character under the cursor with it. You could do the same
with "cl" or with the "s" command, but with "r" you don't have to press <Esc>
to get back out of insert mode.
there is somerhing grong here ~
rT rt rw
@ -160,11 +161,11 @@ line break.
==============================================================================
*04.3* Repeating a change
The "." command is one of the most simple yet powerful commands in Vim. It
The "." command is one of the simplest yet powerful commands in Vim. It
repeats the last change. For instance, suppose you are editing an HTML file
and want to delete all the <B> tags. You position the cursor on the first <
and delete the <B> with the command "df>". You then go to the < of the next
</B> and kill it using the "." command. The "." command executes the last
</B> and delete it using the "." command. The "." command executes the last
change command (in this case, "df>"). To delete another tag, position the
cursor on the < and use the "." command.
@ -176,8 +177,8 @@ cursor on the < and use the "." command.
f< find next < ------------->
. repeat df> -->
The "." command works for all changes you make, except for the "u" (undo),
CTRL-R (redo) and commands that start with a colon (:).
The "." command works for all changes you make, except for "u" (undo), CTRL-R
(redo) and commands that start with a colon (:).
Another example: You want to change the word "four" to "five". It appears
several times in your text. You can do this quickly with this sequence of
@ -269,8 +270,8 @@ where they open a new line below or above the cursor.
==============================================================================
*04.5* Moving text
When you delete something with the "d", "x", or another command, the text is
saved. You can paste it back by using the p command. (The Vim name for
When you delete something with "d", "x", or another command, the text is
saved. You can paste it back by using the "p" command. (The Vim name for
this is put).
Take a look at how this works. First you will delete an entire line, by
putting the cursor on the line you want to delete and typing "dd". Now you
@ -362,11 +363,11 @@ Use "y$" to yank to the end of the line.
If you are using the GUI version of Vim (gvim), you can find the "Copy" item
in the "Edit" menu. First select some text with Visual mode, then use the
Edit/Copy menu. The selected text is now copied to the clipboard. You can
paste the text in other programs. In Vim itself too.
Edit/Copy menu item. The selected text is now copied to the clipboard. You
can paste the text in other programs. In Vim itself too.
If you have copied text to the clipboard in another application, you can paste
it in Vim with the Edit/Paste menu. This works in Normal mode and Insert
it in Vim with the Edit/Paste menu item. This works in Normal mode and Insert
mode. In Visual mode the selected text is replaced with the pasted text.
The "Cut" menu item deletes the text before it's put on the clipboard. The
@ -385,7 +386,7 @@ To put text from the clipboard back into the text: >
"*p
This only works on versions of Vim that include clipboard support. More about
the clipboard in section |09.3| and here: |clipboard|.
the clipboard can be found in section |09.3| and here: |clipboard|.
==============================================================================
*04.8* Text objects
@ -401,8 +402,8 @@ to do this: "daw".
The "d" of "daw" is the delete operator. "aw" is a text object. Hint: "aw"
stands for "A Word". Thus "daw" is "Delete A Word". To be precise, the white
space after the word is also deleted (the white space before the word at the
end of the line).
space after the word is also deleted (or the white space before the word if at
the end of the line).
Using text objects is the third way to make changes in Vim. We already had
operator-motion and Visual mode. Now we add operator-text object.
@ -429,11 +430,11 @@ sentence "Another line.":
some text. ~
"cis" consists of the "c" (change) operator and the "is" text object. This
stands for "Inner Sentence". There is also the "as" (a sentence) object. The
difference is that "as" includes the white space after the sentence and "is"
doesn't. If you would delete a sentence, you want to delete the white space
at the same time, thus use "das". If you want to type new text the white
space can remain, thus you use "cis".
stands for "Inner Sentence". There is also the "as" ("A Sentence") object.
The difference is that "as" includes the white space after the sentence and
"is" doesn't. If you would delete a sentence, you want to delete the white
space at the same time, thus use "das". If you want to type new text the
white space can remain, thus you use "cis".
You can also use text objects in Visual mode. It will include the text object
in the Visual selection. Visual mode continues, thus you can do this several
@ -462,21 +463,21 @@ of characters to replace. It will not continue on the next line.
You can switch between Insert mode and Replace mode with the <Insert> key.
When you use <BS> (backspace) to make correction, you will notice that the
old text is put back. Thus it works like an undo command for the last typed
character.
When you use <BS> (backspace) to make a correction, you will notice that the
old text is put back. Thus it works like an undo command for the previously
typed character.
==============================================================================
*04.10* Conclusion
The operators, movement commands and text objects give you the possibility to
make lots of combinations. Now that you know how it works, you can use N
make lots of combinations. Now that you know how they work, you can use N
operators with M movement commands to make N * M commands!
You can find a list of operators here: |operator|
You can find a list of operators here: |operator|.
For example, there are many other ways to delete pieces of text. Here are a
few often used ones:
few common ones:
x delete character under the cursor (short for "dl")
X delete character before the cursor (short for "dh")
@ -492,14 +493,14 @@ If you use "c" instead of "d" they become change commands. And with "y" you
yank the text. And so forth.
There are a few often used commands to make changes that didn't fit somewhere
There are a few common commands to make changes that didn't fit somewhere
else:
~ change case of the character under the cursor, and move the
~ Change case of the character under the cursor, and move the
cursor to the next character. This is not an operator (unless
'tildeop' is set), thus you can't use it with a motion
command. It does work in Visual mode and changes case for
all the selected text then.
command. It does work in Visual mode, where it changes case
for all the selected text.
I Start Insert mode after moving the cursor to the first
non-blank in the line.

View File

@ -45,8 +45,8 @@ This file is always used and is recommended:
~/AppData/Local/nvim/init.vim (Windows) ~
The vimrc file can contain all the commands that you type after a colon. The
most simple ones are for setting options. For example, if you want Vim to
always start with the 'ignorecase' option on, add this line your vimrc file: >
simplest ones are for setting options. For example, if you want Vim to always
start with the 'incsearch' option on, add this line your vimrc file: >
set ignorecase

View File

@ -227,8 +227,8 @@ the file.
FILE MARKS
In chapter 4 was explained how you can place a mark in a file with "mx" and
jump to that position with "`x". That works within one file. If you edit
In section |03.10| was explained how you can place a mark in a file with "mx"
and jump to that position with "`x". That works within one file. If you edit
another file and place marks there, these are specific for that file. Thus
each file has its own set of marks, they are local to the file.
So far we were using marks with a lowercase letter. There are also marks

View File

@ -401,7 +401,7 @@ Another way to start in diff mode can be done from inside Vim. Edit the
"main.c" file, then make a split and show the differences: >
:edit main.c
:vertical diffsplit main.c~
:vertical diffsplit main.c~
The ":vertical" command is used to make the window split vertically. If you
omit this, you will get a horizontal split.

Some files were not shown because too many files have changed in this diff Show More