summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2016-02-20 15:47:01 +0100
committerBram Moolenaar <Bram@vim.org>2016-02-20 15:47:01 +0100
commite0fa3742ead676a3074a10edadbc955e1a89153d (patch)
treeaa086b4b4afed7f5000164fc75fcf83db4e2ee92
parentc6b14f0a8346ec7ddd86f3349d0b861a1b500147 (diff)
downloadvim-git-e0fa3742ead676a3074a10edadbc955e1a89153d.tar.gz
Updated runtime files.
-rw-r--r--runtime/autoload/netrw.vim1372
-rw-r--r--runtime/doc/change.txt5
-rw-r--r--runtime/doc/channel.txt11
-rw-r--r--runtime/doc/editing.txt4
-rw-r--r--runtime/doc/eval.txt48
-rw-r--r--runtime/doc/netbeans.txt4
-rw-r--r--runtime/doc/options.txt4
-rw-r--r--runtime/doc/os_dos.txt2
-rw-r--r--runtime/doc/pi_netrw.txt142
-rw-r--r--runtime/doc/starting.txt28
-rw-r--r--runtime/doc/tags13
-rw-r--r--runtime/doc/todo.txt34
-rw-r--r--runtime/doc/various.txt4
-rw-r--r--runtime/plugin/matchparen.vim3
-rw-r--r--runtime/plugin/netrwPlugin.vim10
-rw-r--r--runtime/syntax/sh.vim9
-rw-r--r--runtime/syntax/vim.vim57
-rw-r--r--runtime/tools/demoserver.py2
18 files changed, 1069 insertions, 683 deletions
diff --git a/runtime/autoload/netrw.vim b/runtime/autoload/netrw.vim
index 53668b15b..64c08e98f 100644
--- a/runtime/autoload/netrw.vim
+++ b/runtime/autoload/netrw.vim
@@ -1,10 +1,10 @@
" netrw.vim: Handles file transfer and remote directory listing across
" AUTOLOAD SECTION
-" Date: Oct 23, 2015
-" Version: 154
+" Date: Feb 16, 2016
+" Version: 155 ASTRO-ONLY
" Maintainer: Charles E Campbell <NdrOchip@ScampbellPfamily.AbizM-NOSPAM>
" GetLatestVimScripts: 1075 1 :AutoInstall: netrw.vim
-" Copyright: Copyright (C) 1999-2015 Charles E. Campbell {{{1
+" Copyright: Copyright (C) 2016 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,
@@ -30,7 +30,7 @@ if v:version < 704 || !has("patch213")
let s:needpatch213= 1
finish
endif
-let g:loaded_netrw = "v154"
+let g:loaded_netrw = "v155"
if !exists("s:NOTE")
let s:NOTE = 0
let s:WARNING = 1
@@ -55,7 +55,7 @@ setl cpo&vim
" Usage: netrw#ErrorMsg(s:NOTE | s:WARNING | s:ERROR,"some message",error-number)
" netrw#ErrorMsg(s:NOTE | s:WARNING | s:ERROR,["message1","message2",...],error-number)
" (this function can optionally take a list of messages)
-" Oct 09, 2015 : max errnum currently is 102
+" Jan 19, 2016 : max errnum currently is 103
fun! netrw#ErrorMsg(level,msg,errnum)
" call Dfunc("netrw#ErrorMsg(level=".a:level." msg<".a:msg."> errnum=".a:errnum.") g:netrw_use_errorwindow=".g:netrw_use_errorwindow)
@@ -77,7 +77,7 @@ fun! netrw#ErrorMsg(level,msg,errnum)
" (default) netrw creates a one-line window to show error/warning
" messages (reliably displayed)
- " record current window number for NetrwRestorePosn()'s benefit
+ " record current window number
let s:winBeforeErr= winnr()
" call Decho("s:winBeforeErr=".s:winBeforeErr,'~'.expand("<slnum>"))
@@ -416,18 +416,20 @@ if !exists("g:netrw_localmovecmd")
let g:netrw_localmovecmd= ""
endif
endif
-if exists("g:netrw_local_rmdir")
- let g:netrw_localrmdir= g:netrw_local_rmdir
- call netrw#ErrorMsg(s:NOTE,"g:netrw_local_rmdir is deprecated in favor of g:netrw_localrmdir",86)
-endif
-if has("win32") || has("win95") || has("win64") || has("win16")
- if g:netrw_cygwin
- call s:NetrwInit("g:netrw_localrmdir","rmdir")
- else
- let g:netrw_localrmdir= expand("$COMSPEC")." /c rmdir"
- endif
-else
- call s:NetrwInit("g:netrw_localrmdir","rmdir")
+if v:version < 704 || !has("patch1109")
+ if exists("g:netrw_local_rmdir")
+ let g:netrw_localrmdir= g:netrw_local_rmdir
+ call netrw#ErrorMsg(s:NOTE,"g:netrw_local_rmdir is deprecated in favor of g:netrw_localrmdir",86)
+ endif
+ if has("win32") || has("win95") || has("win64") || has("win16")
+ if g:netrw_cygwin
+ call s:NetrwInit("g:netrw_localrmdir","rmdir")
+ else
+ let g:netrw_localrmdir= expand("$COMSPEC")." /c rmdir"
+ endif
+ else
+ call s:NetrwInit("g:netrw_localrmdir","rmdir")
+ endif
endif
call s:NetrwInit("g:netrw_liststyle" , s:THINLIST)
" sanity checks
@@ -489,6 +491,7 @@ endif
call s:NetrwInit("g:netrw_special_syntax" , 0)
call s:NetrwInit("g:netrw_ssh_browse_reject", '^total\s\+\d\+$')
call s:NetrwInit("g:netrw_use_noswf" , 1)
+call s:NetrwInit("g:netrw_sizestyle" ,"b")
" Default values - t-w ---------- {{{3
call s:NetrwInit("g:netrw_timefmt","%c")
if !exists("g:netrw_xstrlen")
@@ -614,7 +617,7 @@ endif
" == 4: Vexplore style == 5: Vexplore!
" == 6: Texplore
fun! netrw#Explore(indx,dosplit,style,...)
-" call Dfunc("netrw#Explore(indx=".a:indx." dosplit=".a:dosplit." style=".a:style.",a:1<".a:1.">) &modified=".&modified." modifiable=".&modifiable." a:0=".a:0." win#".winnr()." buf#".bufnr("%"))
+" call Dfunc("netrw#Explore(indx=".a:indx." dosplit=".a:dosplit." style=".a:style.",a:1<".a:1.">) &modified=".&modified." modifiable=".&modifiable." a:0=".a:0." win#".winnr()." buf#".bufnr("%")." ft=".&ft)
" call Decho("tab#".tabpagenr()." win#".winnr()." buf#".bufnr("%")."<".bufname("%")."> line#".line(".")." col#".col(".")." winline#".winline()." wincol#".wincol(),'~'.expand("<slnum>"))
if !exists("b:netrw_curdir")
let b:netrw_curdir= getcwd()
@@ -1165,7 +1168,8 @@ fun! netrw#Lexplore(count,rightside,...)
" call Decho("t:netrw_lexbufnr#".t:netrw_lexbufnr.": close down netrw window",'~'.expand("<slnum>"))
exe lexwinnr."wincmd w"
let g:netrw_winsize = -winwidth(0)
- let t:netrw_lexposn = netrw#SavePosn()
+ let t:netrw_lexposn = winsaveview()
+" call Decho("saving posn to t:netrw_lexposn<".string(t:netrw_lexposn).">",'~'.expand("<slnum>"))
" call Decho("saving t:netrw_lexposn",'~'.expand("<slnum>"))
close
if lexwinnr < curwin
@@ -1205,7 +1209,8 @@ fun! netrw#Lexplore(count,rightside,...)
let t:netrw_lexbufnr = bufnr("%")
if exists("t:netrw_lexposn")
" call Decho("restoring to t:netrw_lexposn",'~'.expand("<slnum>"))
- call netrw#RestorePosn(t:netrw_lexposn)
+" call Decho("restoring posn to t:netrw_lexposn<".string(t:netrw_lexposn).">",'~'.expand("<slnum>"))
+ call winrestview(t:netrw_lexposn)
unlet t:netrw_lexposn
endif
endif
@@ -1273,7 +1278,8 @@ endfun
fun! netrw#MakeTgt(dname)
" call Dfunc("netrw#MakeTgt(dname<".a:dname.">)")
" simplify the target (eg. /abc/def/../ghi -> /abc/ghi)
- let svpos = netrw#SavePosn()
+ let svpos = winsaveview()
+" call Decho("saving posn to svpos<".string(svpos).">",'~'.expand("<slnum>"))
let s:netrwmftgt_islocal= (a:dname !~ '^\a\{3,}://')
" call Decho("s:netrwmftgt_islocal=".s:netrwmftgt_islocal,'~'.expand("<slnum>"))
if s:netrwmftgt_islocal
@@ -1290,7 +1296,8 @@ fun! netrw#MakeTgt(dname)
if g:netrw_fastbrowse <= 1
call s:NetrwRefresh((b:netrw_curdir !~ '\a\{3,}://'),b:netrw_curdir)
endif
- call netrw#RestorePosn(svpos)
+" call Decho("restoring posn to svpos<".string(svpos).">",'~'.expand("<slnum>"))"
+ call winrestview(svpos)
" call Dret("netrw#MakeTgt")
endfun
@@ -1532,9 +1539,11 @@ endfun
" netrw#Nread: save position, call netrw#NetRead(), and restore position {{{2
fun! netrw#Nread(mode,fname)
" call Dfunc("netrw#Nread(mode=".a:mode." fname<".a:fname.">)")
- call netrw#SavePosn()
+ let svpos= winsaveview()
+" call Decho("saving posn to svpos<".string(svpos).">",'~'.expand("<slnum>"))
call netrw#NetRead(a:mode,a:fname)
- call netrw#RestorePosn()
+" call Decho("restoring posn to svpos<".string(svpos).">",'~'.expand("<slnum>"))
+ call winrestview(svpos)
if exists("w:netrw_liststyle") && w:netrw_liststyle != s:TREELIST
if exists("w:netrw_bannercnt")
@@ -1552,8 +1561,8 @@ fun! s:NetrwOptionRestore(vt)
" call Decho("settings buf#".bufnr("%")."<".bufname("%").">: ".((&l:ma == 0)? "no" : "")."ma ".((&l:mod == 0)? "no" : "")."mod ".((&l:bl == 0)? "no" : "")."bl ".((&l:ro == 0)? "no" : "")."ro fo=".&l:fo." a:vt=".a:vt,'~'.expand("<slnum>"))
if !exists("{a:vt}netrw_optionsave")
if exists("s:nbcd_curpos_{bufnr('%')}")
-" call Decho("restoring previous position (s:nbcd_curpos_".bufnr('%')." exists)",'~'.expand("<slnum>"))
- NetrwKeepj call netrw#RestorePosn(s:nbcd_curpos_{bufnr('%')})
+" call Decho("restoring posn to s:nbcd_curpos_".bufnr('%')."<".string(s:nbcd_curpos_{bufnr('%')}).">",'~'.expand("<slnum>"))
+ NetrwKeepj call winrestview(s:nbcd_curpos_{bufnr('%')})
" call Decho("win#".winnr()." buf#".bufnr("%")."<".bufname("%")."> winnr($)=".winnr("$"),'~'.expand("<slnum>"))
" call Decho("unlet s:nbcd_curpos_".bufnr('%'),'~'.expand("<slnum>"))
unlet s:nbcd_curpos_{bufnr('%')}
@@ -1629,8 +1638,10 @@ fun! s:NetrwOptionRestore(vt)
setl directory=
unlet {a:vt}netrw_swfkeep
elseif &l:swf != {a:vt}netrw_swfkeep
- " following line causes a Press ENTER in windows -- can't seem to work around it!!!
- sil! let &l:swf= {a:vt}netrw_swfkeep
+ if !g:netrw_use_noswf
+ " following line causes a Press ENTER in windows -- can't seem to work around it!!!
+ sil! let &l:swf= {a:vt}netrw_swfkeep
+ endif
unlet {a:vt}netrw_swfkeep
endif
endif
@@ -1646,8 +1657,8 @@ fun! s:NetrwOptionRestore(vt)
endif
if exists("{a:vt}netrw_regslash")|sil! let @/= {a:vt}netrw_regslash|unlet {a:vt}netrw_regslash|endif
if exists("s:nbcd_curpos_{bufnr('%')}")
-" call Decho("restoring previous position (s:nbcd_curpos_".bufnr('%')." exists)",'~'.expand("<slnum>"))
- NetrwKeepj call netrw#RestorePosn(s:nbcd_curpos_{bufnr('%')})
+" call Decho("restoring posn to s:nbcd_curpos_".bufnr('%')."<".string(s:nbcd_curpos_{bufnr('%')}).">",'~'.expand("<slnum>"))
+ NetrwKeepj call winrestview(s:nbcd_curpos_{bufnr('%')})
" call Decho("unlet s:nbcd_curpos_".bufnr('%'),'~'.expand("<slnum>"))
if exists("s:nbcd_curpos_".bufnr('%'))
unlet s:nbcd_curpos_{bufnr('%')}
@@ -1729,11 +1740,11 @@ fun! s:NetrwOptionSave(vt)
let {a:vt}netrw_rokeep = &l:ro
let {a:vt}netrw_selkeep = &l:sel
let {a:vt}netrw_spellkeep = &l:spell
- if g:netrw_use_noswf
- let {a:vt}netrw_swfkeep = &l:swf
+ if !g:netrw_use_noswf
+ let {a:vt}netrw_swfkeep = &l:swf
endif
if has("clipboard")
- let {a:vt}netrw_starkeep = @*
+ let {a:vt}netrw_starkeep = @*
endif
let {a:vt}netrw_tskeep = &l:ts
let {a:vt}netrw_twkeep = &l:tw " textwidth
@@ -2664,7 +2675,9 @@ fun! netrw#NetSource(...)
" call Decho("exe so ".fnameescape(s:netrw_tmpfile),'~'.expand("<slnum>"))
exe "so ".fnameescape(s:netrw_tmpfile)
" call Decho("delete(".s:netrw_tmpfile.")",'~'.expand("<slnum>"))
- call delete(s:netrw_tmpfile)
+ if delete(s:netrw_tmpfile)
+ call netrw#ErrorMsg(s:ERROR,"unable to delete directory <".s:netrw_tmpfile.">!",103)
+ endif
unlet s:netrw_tmpfile
else
call netrw#ErrorMsg(s:ERROR,"unable to source <".a:{i}.">!",48)
@@ -3504,7 +3517,11 @@ fun! s:NetrwBookHistSave()
let savefile= s:NetrwHome()."/.netrwhist"
1split
call s:NetrwEnew()
- setl cino= com= cpo-=a cpo-=A fo=nroql2 tw=0 report=10000 noswf
+ if g:netrw_use_noswf
+ setl cino= com= cpo-=a cpo-=A fo=nroql2 tw=0 report=10000 noswf
+ else
+ setl cino= com= cpo-=a cpo-=A fo=nroql2 tw=0 report=10000
+ endif
setl nocin noai noci magic nospell nohid wig= noaw
setl ma noro write
if exists("+acd") | setl noacd | endif
@@ -3566,6 +3583,7 @@ fun! s:NetrwBrowse(islocal,dirname)
" This is useful when one edits a local file, then :e ., then :Rex
if a:islocal && !exists("w:netrw_rexfile") && bufname("#") != ""
let w:netrw_rexfile= bufname("#")
+" call Decho("setting w:netrw_rexfile<".w:netrw_rexfile."> win#".winnr())
endif
" s:NetrwBrowse : initialize history {{{3
@@ -3683,7 +3701,8 @@ fun! s:NetrwBrowse(islocal,dirname)
" get/set-up buffer {{{3
" call Decho("saving position across a buffer refresh",'~'.expand("<slnum>"))
- let svpos = netrw#SavePosn()
+ let svpos = winsaveview()
+" call Decho("saving posn to svpos<".string(svpos).">",'~'.expand("<slnum>"))
let reusing= s:NetrwGetBuffer(a:islocal,dirname)
" maintain markfile highlighting
@@ -3792,10 +3811,18 @@ fun! s:NetrwBrowse(islocal,dirname)
NetrwKeepj call s:NetrwCommands(a:islocal)
NetrwKeepj call s:PerformListing(a:islocal)
+ " restore option(s)
+ call s:NetrwOptionRestore("w:")
+" call Decho("tab#".tabpagenr()." win#".winnr()." buf#".bufnr("%")."<".bufname("%")."> line#".line(".")." col#".col(".")." winline#".winline()." wincol#".wincol(),'~'.expand("<slnum>"))
+
" If there is a rexposn: restore position with rexposn
" Otherwise : set rexposn
if exists("s:rexposn_".bufnr("%"))
- NetrwKeepj call netrw#RestorePosn(s:rexposn_{bufnr('%')})
+" call Decho("restoring posn to s:rexposn_".bufnr('%')."<".string(s:rexposn_{bufnr('%')}).">",'~'.expand("<slnum>"))
+ NetrwKeepj call winrestview(s:rexposn_{bufnr('%')})
+ if exists("w:netrw_bannercnt") && line(".") < w:netrw_bannercnt
+ NetrwKeepj exe w:netrw_bannercnt
+ endif
else
NetrwKeepj call s:SetRexDir(a:islocal,b:netrw_curdir)
endif
@@ -3804,13 +3831,11 @@ fun! s:NetrwBrowse(islocal,dirname)
" call Decho("set up balloon help: l:bexpr=".&l:bexpr,'~'.expand("<slnum>"))
setl beval
endif
- call s:NetrwOptionRestore("w:")
-" call Decho("tab#".tabpagenr()." win#".winnr()." buf#".bufnr("%")."<".bufname("%")."> line#".line(".")." col#".col(".")." winline#".winline()." wincol#".wincol(),'~'.expand("<slnum>"))
" restore position
if reusing
-" call Decho("reusing=".reusing.": restoring position across buffer refresh",'~'.expand("<slnum>"))
- call netrw#RestorePosn(svpos)
+" call Decho("restoring posn to svpos<".string(svpos).">",'~'.expand("<slnum>"))
+ call winrestview(svpos)
endif
" The s:LocalBrowseRefresh() function is called by an autocmd
@@ -3828,7 +3853,19 @@ endfun
" differ from vim's. This function insures that netrw's idea of the current
" directory is used.
fun! s:NetrwFile(fname)
-" call Dfunc("s:NetrwFile(fname<".a:fname.">)")
+" call Dfunc("s:NetrwFile(fname<".a:fname.">) win#".winnr())
+" call Decho("g:netrw_keepdir =".(exists("g:netrw_keepdir")? g:netrw_keepdir : 'n/a'))
+" call Decho("g:netrw_cygwin =".(exists("g:netrw_cygwin")? g:netrw_cygwin : 'n/a'))
+" call Decho("g:netrw_liststyle=".(exists("g:netrw_liststyle")? g:netrw_liststyle : 'n/a'))
+" call Decho("w:netrw_liststyle=".(exists("w:netrw_liststyle")? w:netrw_liststyle : 'n/a'))
+
+ " clean up any leading treedepthstring
+ if exists("w:netrw_liststyle") && w:netrw_liststyle == s:TREELIST
+ let fname= substitute(a:fname,'^'.s:treedepthstring.'\+','','')
+" call Decho("clean up any leading treedepthstring: fname<".fname.">")
+ else
+ let fname= a:fname
+ endif
if g:netrw_keepdir
" vim's idea of the current directory possibly may differ from netrw's
@@ -3837,28 +3874,28 @@ fun! s:NetrwFile(fname)
endif
if !exists("g:netrw_cygwin") && (has("win32") || has("win95") || has("win64") || has("win16"))
- if a:fname =~ '^\' || a:fname =~ '^\a:\'
+ if fname =~ '^\' || fname =~ '^\a:\'
" windows, but full path given
- let ret= a:fname
-" call Decho("windows+full path: isdirectory(".a:fname.")",'~'.expand("<slnum>"))
+ let ret= fname
+" call Decho("windows+full path: isdirectory(".fname.")",'~'.expand("<slnum>"))
else
" windows, relative path given
- let ret= s:ComposePath(b:netrw_curdir,a:fname)
-" call Decho("windows+rltv path: isdirectory(".a:fname.")",'~'.expand("<slnum>"))
+ let ret= s:ComposePath(b:netrw_curdir,fname)
+" call Decho("windows+rltv path: isdirectory(".fname.")",'~'.expand("<slnum>"))
endif
- elseif a:fname =~ '^/'
+ elseif fname =~ '^/'
" not windows, full path given
- let ret= a:fname
-" call Decho("unix+full path: isdirectory(".a:fname.")",'~'.expand("<slnum>"))
+ let ret= fname
+" call Decho("unix+full path: isdirectory(".fname.")",'~'.expand("<slnum>"))
else
" not windows, relative path given
- let ret= s:ComposePath(b:netrw_curdir,a:fname)
-" call Decho("unix+rltv path: isdirectory(".a:fname.")",'~'.expand("<slnum>"))
+ let ret= s:ComposePath(b:netrw_curdir,fname)
+" call Decho("unix+rltv path: isdirectory(".fname.")",'~'.expand("<slnum>"))
endif
else
" vim and netrw agree on the current directory
- let ret= a:fname
+ let ret= fname
" call Decho("vim and netrw agree on current directory (g:netrw_keepdir=".g:netrw_keepdir.")",'~'.expand("<slnum>"))
endif
@@ -3872,23 +3909,29 @@ fun! s:NetrwFileInfo(islocal,fname)
" call Dfunc("s:NetrwFileInfo(islocal=".a:islocal." fname<".a:fname.">) b:netrw_curdir<".b:netrw_curdir.">")
let ykeep= @@
if a:islocal
+ let lsopt= "-lsad"
+ if g:netrw_sizestyle =~ 'H'
+ let lsopt= "-lsadh"
+ elseif g:netrw_sizestyle =~ 'h'
+ let lsopt= "-lsadh --si"
+ endif
if (has("unix") || has("macunix")) && executable("/bin/ls")
if getline(".") == "../"
- echo system("/bin/ls -lsad ".s:ShellEscape(".."))
+ echo system("/bin/ls ".lsopt." ".s:ShellEscape(".."))
" call Decho("#1: echo system(/bin/ls -lsad ".s:ShellEscape(..).")",'~'.expand("<slnum>"))
elseif w:netrw_liststyle == s:TREELIST && getline(".") !~ '^'.s:treedepthstring
- echo system("/bin/ls -lsad ".s:ShellEscape(b:netrw_curdir))
+ echo system("/bin/ls ".lsopt." ".s:ShellEscape(b:netrw_curdir))
" call Decho("#2: echo system(/bin/ls -lsad ".s:ShellEscape(b:netrw_curdir).")",'~'.expand("<slnum>"))
elseif exists("b:netrw_curdir")
- echo system("/bin/ls -lsad ".s:ShellEscape(s:ComposePath(b:netrw_curdir,a:fname)))
+ echo system("/bin/ls ".lsopt." ".s:ShellEscape(s:ComposePath(b:netrw_curdir,a:fname)))
" call Decho("#3: echo system(/bin/ls -lsad ".s:ShellEscape(b:netrw_curdir.a:fname).")",'~'.expand("<slnum>"))
else
" call Decho('using ls '.a:fname." using cwd<".getcwd().">",'~'.expand("<slnum>"))
- echo system("/bin/ls -lsad ".s:ShellEscape(s:NetrwFile(a:fname)))
+ echo system("/bin/ls ".lsopt." ".s:ShellEscape(s:NetrwFile(a:fname)))
" call Decho("#5: echo system(/bin/ls -lsad ".s:ShellEscape(a:fname).")",'~'.expand("<slnum>"))
endif
else
@@ -3901,6 +3944,9 @@ fun! s:NetrwFileInfo(islocal,fname)
endif
let t = getftime(s:NetrwFile(fname))
let sz = getfsize(s:NetrwFile(fname))
+ if g:netrw_sizestyle =~ "[hH]"
+ let sz= s:NetrwHumanReadable(sz)
+ endif
echo a:fname.": ".sz." ".strftime(g:netrw_timefmt,getftime(s:NetrwFile(fname)))
" call Decho("fname.": ".sz." ".strftime(g:netrw_timefmt,getftime(fname)),'~'.expand("<slnum>"))
endif
@@ -4029,11 +4075,15 @@ fun! s:NetrwGetBuffer(islocal,dirname)
let w:netrw_treebufnr= bufnr("%")
" call Decho(" exe sil! keepalt file NetrwTreeListing ".fnameescape(s:netrw_treelistnum),'~'.expand("<slnum>"))
exe 'sil! keepalt file NetrwTreeListing\ '.fnameescape(s:netrw_treelistnum)
- setl bt=nofile noswf
- nnoremap <silent> <buffer> [ :sil call <SID>TreeListMove('[')<cr>
- nnoremap <silent> <buffer> ] :sil call <SID>TreeListMove(']')<cr>
- nnoremap <silent> <buffer> [[ :sil call <SID>TreeListMove('[')<cr>
- nnoremap <silent> <buffer> ]] :sil call <SID>TreeListMove(']')<cr>
+ if g:netrw_use_noswf
+ setl nobl bt=nofile noswf
+ else
+ setl nobl bt=nofile
+ endif
+ nnoremap <silent> <buffer> [[ :sil call <SID>TreeListMove('[[')<cr>
+ nnoremap <silent> <buffer> ]] :sil call <SID>TreeListMove(']]')<cr>
+ nnoremap <silent> <buffer> [] :sil call <SID>TreeListMove('[]')<cr>
+ nnoremap <silent> <buffer> ][ :sil call <SID>TreeListMove('][')<cr>
" call Decho(" tree listing#".s:netrw_treelistnum." bufnr=".w:netrw_treebufnr,'~'.expand("<slnum>"))
else
" let v:errmsg = "" " Decho
@@ -4197,7 +4247,7 @@ fun! s:NetrwGetWord()
NetrwKeepj norm! 0
let dirname= substitute(getline('.'),'^\(\%(\S\+ \)*\S\+\).\{-}$','\1','e')
- elseif w:netrw_liststyle == s:TREELIST
+ elseif exists("w:netrw_liststyle") && w:netrw_liststyle == s:TREELIST
" call Decho("treelist handling",'~'.expand("<slnum>"))
let dirname= substitute(getline('.'),'^\('.s:treedepthstring.'\)*','','e')
let dirname= substitute(dirname,'\t -->.*$','','')
@@ -4286,7 +4336,8 @@ fun! s:NetrwListStyle(islocal)
let ykeep = @@
let fname = s:NetrwGetWord()
if !exists("w:netrw_liststyle")|let w:netrw_liststyle= g:netrw_liststyle|endif
- let svpos = netrw#SavePosn()
+ let svpos = winsaveview()
+" call Decho("saving posn to svpos<".string(svpos).">",'~'.expand("<slnum>"))
let w:netrw_liststyle = (w:netrw_liststyle + 1) % s:MAXLIST
" call Decho("fname<".fname.">",'~'.expand("<slnum>"))
" call Decho("chgd w:netrw_liststyle to ".w:netrw_liststyle,'~'.expand("<slnum>"))
@@ -4307,7 +4358,7 @@ fun! s:NetrwListStyle(islocal)
" call Decho("use wide list",'~'.expand("<slnum>"))
let g:netrw_list_cmd = substitute(g:netrw_list_cmd,' -l','','ge')
- elseif w:netrw_liststyle == s:TREELIST
+ elseif exists("w:netrw_liststyle") && w:netrw_liststyle == s:TREELIST
" call Decho("use tree list",'~'.expand("<slnum>"))
let g:netrw_list_cmd = substitute(g:netrw_list_cmd,' -l','','ge')
@@ -4334,7 +4385,8 @@ fun! s:NetrwListStyle(islocal)
NetrwKeepj call s:NetrwCursor()
" restore position; keep cursor on the filename
- NetrwKeepj call netrw#RestorePosn(svpos)
+" call Decho("restoring posn to svpos<".string(svpos).">",'~'.expand("<slnum>"))
+ NetrwKeepj call winrestview(svpos)
let @@= ykeep
" call Dret("NetrwListStyle".(exists("w:netrw_liststyle")? ' : w:netrw_liststyle='.w:netrw_liststyle : ""))
@@ -4350,7 +4402,8 @@ fun! s:NetrwBannerCtrl(islocal)
let g:netrw_banner= !g:netrw_banner
" refresh the listing
- let svpos= netrw#SavePosn()
+ let svpos= winsaveview()
+" call Decho("saving posn to svpos<".string(svpos).">",'~'.expand("<slnum>"))
call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./'))
" keep cursor on the filename
@@ -4385,7 +4438,8 @@ fun! s:NetrwBookmark(del,...)
if exists("s:netrwmarkfilelist_{curbufnr}")
" for every filename in the marked list
" call Decho("bookmark every filename in marked list",'~'.expand("<slnum>"))
- let svpos = netrw#SavePosn()
+ let svpos = winsaveview()
+" call Decho("saving posn to svpos<".string(svpos).">",'~'.expand("<slnum>"))
let islocal= expand("%") !~ '^\a\{3,}://'
for fname in s:netrwmarkfilelist_{curbufnr}
if a:del|call s:DeleteBookmark(fname)|else|call s:MakeBookmark(fname)|endif
@@ -4393,7 +4447,8 @@ fun! s:NetrwBookmark(del,...)
let curdir = exists("b:netrw_curdir")? b:netrw_curdir : getcwd()
call s:NetrwUnmarkList(curbufnr,curdir)
NetrwKeepj call s:NetrwRefresh(islocal,s:NetrwBrowseChgDir(islocal,'./'))
- NetrwKeepj call netrw#RestorePosn(svpos)
+" call Decho("restoring posn to svpos<".string(svpos).">",'~'.expand("<slnum>"))
+ NetrwKeepj call winrestview(svpos)
else
let fname= s:NetrwGetWord()
if a:del|call s:DeleteBookmark(fname)|else|call s:MakeBookmark(fname)|endif
@@ -4528,9 +4583,9 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...)
" call Decho("saving options",'~'.expand("<slnum>"))
NetrwKeepj call s:NetrwOptionSave("s:")
NetrwKeepj call s:NetrwSafeOptions()
- let nbcd_curpos = netrw#SavePosn()
+ let nbcd_curpos = winsaveview()
+" call Decho("saving posn to nbcd_curpos<".string(nbcd_curpos).">",'~'.expand("<slnum>"))
let s:nbcd_curpos_{bufnr('%')} = nbcd_curpos
-" call Decho("setting s:nbcd_curpos_".bufnr('%')." to SavePosn",'~'.expand("<slnum>"))
if (has("win32") || has("win95") || has("win64") || has("win16"))
let dirname = substitute(b:netrw_curdir,'\\','/','ge')
else
@@ -4553,7 +4608,8 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...)
setl ma noro nowrap
NetrwKeepj call setline(line('.'),'" Quick Help: <F1>:help '.s:QuickHelp[g:netrw_quickhelp])
setl noma nomod nowrap
- NetrwKeepj call netrw#RestorePosn(nbcd_curpos)
+" call Decho("restoring posn to nbcd_curpos<".string(nbcd_curpos).">",'~'.expand("<slnum>"))
+ NetrwKeepj call winrestview(nbcd_curpos)
NetrwKeepj call s:NetrwOptionRestore("s:")
" call Decho("ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)",'~'.expand("<slnum>"))
endif
@@ -4585,8 +4641,8 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...)
" call Decho('edit-a-file: case "handling a file": newdir<'.newdir.'> !~ dirpat<'.dirpat.">",'~'.expand("<slnum>"))
" save position for benefit of Rexplore
- let s:rexposn_{bufnr("%")}= netrw#SavePosn()
-" call Decho("edit-a-file: setting s:rexposn_".bufnr("%")."<".bufname("%")."> to SavePosn",'~'.expand("<slnum>"))
+ let s:rexposn_{bufnr("%")}= winsaveview()
+" call Decho("edit-a-file: saving posn to s:rexposn_".bufnr("%")."<".string(s:rexposn_{bufnr("%")}).">",'~'.expand("<slnum>"))
" call Decho("edit-a-file: win#".winnr()." buf#".bufnr("%")."<".bufname("%")."> ft=".&ft,'~'.expand("<slnum>"))
" call Decho("edit-a-file: w:netrw_liststyle=".(exists("w:netrw_liststyle")? w:netrw_liststyle : 'n/a')." w:netrw_treedict:".(exists("w:netrw_treedict")? "exists" : 'n/a')." newdir<".newdir.">",'~'.expand("<slnum>"))
@@ -4602,6 +4658,7 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...)
" call Decho("edit-a-file: dirname<".dirname.">",'~'.expand("<slnum>"))
" call Decho("edit-a-file: tree listing",'~'.expand("<slnum>"))
elseif newdir =~ '^\(/\|\a:\)'
+" call Decho("edit-a-file: handle an url or path starting with /: <".newdir.">")
let dirname= newdir
else
let dirname= s:ComposePath(dirname,newdir)
@@ -4609,8 +4666,9 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...)
" call Decho("edit-a-file: handling a file: dirname<".dirname."> (a:0=".a:0.")",'~'.expand("<slnum>"))
" this lets netrw#BrowseX avoid the edit
if a:0 < 1
-" call Decho("edit-a-file: set up windows for editing<".fnameescape(dirname)."> didsplit=".(exists("s:didsplit")? s:didsplit : "doesn't exist"),'~'.expand("<slnum>"))
+" call Decho("edit-a-file: (a:0=".a:0."<1) set up windows for editing<".fnameescape(dirname)."> didsplit=".(exists("s:didsplit")? s:didsplit : "doesn't exist"),'~'.expand("<slnum>"))
NetrwKeepj call s:NetrwOptionRestore("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>"))
if type(g:netrw_browse_split) == 3
@@ -4627,6 +4685,7 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...)
if !&ea
keepalt wincmd _
endif
+ call s:SetRexDir(a:islocal,b:netrw_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>"))
@@ -4634,10 +4693,12 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...)
if !&ea
keepalt wincmd |
endif
+ call s:SetRexDir(a:islocal,b:netrw_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>"))
keepalt tabnew
+ call s:SetRexDir(a:islocal,b:netrw_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>"))
@@ -4646,6 +4707,7 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...)
" call Dret("s:NetrwBrowseChgDir")
return
endif
+ call s:SetRexDir(a:islocal,b:netrw_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>"))
@@ -4663,6 +4725,7 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...)
endif
exe "NetrwKeepj keepalt ".g:netrw_chgwin."wincmd w"
endif
+ call s:SetRexDir(a:islocal,curdir)
endif
endif
@@ -4802,7 +4865,7 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...)
" call Decho("tree-list: w:netrw_treedict<".string(w:netrw_treedict).">",'~'.expand("<slnum>"))
" search treedict for tree dir as-is
-" call Decho("search treedict for tree dir as-is",'~'.expand("<slnum>"))
+" call Decho("tree-list: search treedict for tree dir as-is",'~'.expand("<slnum>"))
if has_key(w:netrw_treedict,treedir)
" call Decho('tree-list: ....searched for treedir<'.treedir.'> : found it!','~'.expand("<slnum>"))
let haskey= 1
@@ -4811,7 +4874,7 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...)
endif
" search treedict for treedir with a [/@] appended
-" call Decho("search treedict for treedir with a [/@] appended",'~'.expand("<slnum>"))
+" call Decho("tree-list: search treedict for treedir with a [/@] appended",'~'.expand("<slnum>"))
if !haskey && treedir !~ '[/@]$'
if has_key(w:netrw_treedict,treedir."/")
let treedir= treedir."/"
@@ -4823,7 +4886,7 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...)
endif
" search treedict for treedir with any trailing / elided
-" call Decho("search treedict for treedir with any trailing / elided",'~'.expand("<slnum>"))
+" call Decho("tree-list: search treedict for treedir with any trailing / elided",'~'.expand("<slnum>"))
if !haskey && treedir =~ '/$'
let treedir= substitute(treedir,'/$','','')
if has_key(w:netrw_treedict,treedir)
@@ -4967,14 +5030,15 @@ fun! netrw#BrowseX(fname,remote)
" call Dfunc("netrw#BrowseX(fname<".a:fname."> remote=".a:remote.")")
" if its really just a directory, then do a "gf" instead
- if a:fname =~ '/$'
+ if (a:remote == 0 && isdirectory(a:fname)) || (a:remote == 1 && fname =~ '/$' && fname !~ '^https\=:')
norm! gf
" call Dret("netrw#BrowseX : did gf instead")
endif
let ykeep = @@
- let screenposn = netrw#SavePosn()
+ let screenposn = winsaveview()
+" call Decho("saving posn to screenposn<".string(screenposn).">",'~'.expand("<slnum>"))
" need to save and restore aw setting as gx can invoke this function from non-netrw buffers
let awkeep = &aw
@@ -4996,7 +5060,8 @@ fun! netrw#BrowseX(fname,remote)
endif
endfor
endif
- call netrw#RestorePosn(screenposn)
+" call Decho("restoring posn to screenposn<".string(screenposn).">,'~'.expand("<slnum>"))"
+ call winrestview(screenposn)
let @@= ykeep
let &aw= awkeep
" call Dret("netrw#BrowseX : coredump handler invoked")
@@ -5167,7 +5232,8 @@ fun! netrw#BrowseX(fname,remote)
exe "sil! NetrwKeepj norm! \<c-o>"
" redraw!
endif
- call netrw#RestorePosn(screenposn)
+" call Decho("restoring posn to screenposn<".string(screenposn).">",'~'.expand("<slnum>"))
+ call winrestview(screenposn)
let @@ = ykeep
let &aw= awkeep
@@ -5310,6 +5376,32 @@ fun! s:NetrwForceChgDir(islocal,newdir)
endfun
" ---------------------------------------------------------------------
+" s:NetrwGlob: does glob() if local, remote listing otherwise {{{2
+fun! s:NetrwGlob(direntry,expr)
+" call Dfunc("s:NetrwGlob(direntry<".a:direntry."> expr<".a:expr.">)")
+ if netrw#CheckIfRemote()
+ keepalt 1sp
+ keepalt enew
+ let keep_liststyle = w:netrw_liststyle
+ let w:netrw_liststyle = s:THINLIST
+ if s:NetrwRemoteListing() == 0
+ keepj keepalt %s@/@@
+ let filelist= getline(1,$)
+ q!
+ else
+ " remote listing error -- leave treedict unchanged
+ let filelist= w:netrw_treedict[a:direntry]
+ endif
+ let w:netrw_liststyle= keep_liststyle
+ else
+ let filelist= glob(s:ComposePath(a:direntry,a:expr),0,1,1)
+ let filelist= map(filelist,'substitute(v:val, "^.*/", "", "")')
+ endif
+" call Dret("s:NetrwGlob ".string(filelist))
+ return filelist
+endfun
+
+" ---------------------------------------------------------------------
" s:NetrwForceFile: (gf support) Force treatment as a file {{{2
fun! s:NetrwForceFile(islocal,newfile)
" call Dfunc("s:NetrwForceFile(islocal=".a:islocal." newdir<".a:newfile.">)")
@@ -5336,7 +5428,8 @@ endfun
fun! s:NetrwHide(islocal)
" call Dfunc("NetrwHide(islocal=".a:islocal.") g:netrw_hide=".g:netrw_hide)
let ykeep= @@
- let svpos= netrw#SavePosn()
+ let svpos= winsaveview()
+" call Decho("saving posn to svpos<".string(svpos).">",'~'.expand("<slnum>"))
if exists("s:netrwmarkfilelist_{bufnr('%')}")
" call Decho("((g:netrw_hide == 1)? "unhide" : "hide")." files in markfilelist<".string(s:netrwmarkfilelist_{bufnr("%")}).">",'~'.expand("<slnum>"))
@@ -5378,7 +5471,8 @@ fun! s:NetrwHide(islocal)
endif
NetrwKeepj call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./'))
- NetrwKeepj call netrw#RestorePosn(svpos)
+" call Decho("restoring posn to svpos<".string(svpos).">",'~'.expand("<slnum>"))
+ NetrwKeepj call winrestview(svpos)
let @@= ykeep
" call Dret("NetrwHide")
endfun
@@ -5390,7 +5484,8 @@ fun! s:NetrwHideEdit(islocal)
let ykeep= @@
" save current cursor position
- let svpos= netrw#SavePosn()
+ let svpos= winsaveview()
+" call Decho("saving posn to svpos<".string(svpos).">",'~'.expand("<slnum>"))
" get new hiding list from user
call inputsave()
@@ -5403,7 +5498,8 @@ fun! s:NetrwHideEdit(islocal)
sil NetrwKeepj call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,"./"))
" restore cursor position
- call netrw#RestorePosn(svpos)
+" call Decho("restoring posn to svpos<".string(svpos).">",'~'.expand("<slnum>"))
+ call winrestview(svpos)
let @@= ykeep
" call Dret("NetrwHideEdit")
@@ -5415,7 +5511,8 @@ fun! s:NetrwHidden(islocal)
" call Dfunc("s:NetrwHidden()")
let ykeep= @@
" save current position
- let svpos= netrw#SavePosn()
+ let svpos= winsaveview()
+" call Decho("saving posn to svpos<".string(svpos).">",'~'.expand("<slnum>"))
if g:netrw_list_hide =~ '\(^\|,\)\\(^\\|\\s\\s\\)\\zs\\.\\S\\+'
" remove pattern from hiding list
@@ -5428,7 +5525,8 @@ fun! s:NetrwHidden(islocal)
" refresh screen and return to saved position
NetrwKeepj call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./'))
- NetrwKeepj call netrw#RestorePosn(svpos)
+" call Decho("restoring posn to svpos<".string(svpos).">",'~'.expand("<slnum>"))
+ NetrwKeepj call winrestview(svpos)
let @@= ykeep
" call Dret("s:NetrwHidden")
endfun
@@ -5540,10 +5638,10 @@ fun! s:NetrwServerEdit(islocal,fname)
if (islocal && isdirectory(s:NetrwFile(a:fname))) || (!islocal && a:fname =~ '/$')
" handle directories in the local window -- not in the remote vim server
- " user must have closed the NETRWSERVER window. Treat as a normal editing from netrw.
+ " user must have closed the NETRWSERVER window. Treat as normal editing from netrw.
" call Decho("handling directory in client window",'~'.expand("<slnum>"))
let g:netrw_browse_split= 0
- if exists("s:netrw_browse_split_".winnr())
+ if exists("s:netrw_browse_split") && exists("s:netrw_browse_split_".winnr())
let g:netrw_browse_split= s:netrw_browse_split_{winnr()}
unlet s:netrw_browse_split_{winnr()}
endif
@@ -5820,9 +5918,11 @@ fun! s:NetrwMakeDir(usrhost)
if v:shell_error == 0
" refresh listing
" call Decho("refresh listing",'~'.expand("<slnum>"))
- let svpos= netrw#SavePosn()
+ let svpos= winsaveview()
+" call Decho("saving posn to svpos<".string(svpos).">",'~'.expand("<slnum>"))
call s:NetrwRefresh(1,s:NetrwBrowseChgDir(1,'./'))
- call netrw#RestorePosn(svpos)
+" call Decho("restoring posn to svpos<".string(svpos).">",'~'.expand("<slnum>"))
+ call winrestview(svpos)
elseif !exists("g:netrw_quiet")
call netrw#ErrorMsg(s:ERROR,"unable to make directory<".newdirname.">",26)
endif
@@ -5836,9 +5936,11 @@ fun! s:NetrwMakeDir(usrhost)
call s:NetrwExe("sil! !".mkdircmd." ".s:ShellEscape(newdirname,1))
if v:shell_error == 0
" refresh listing
- let svpos= netrw#SavePosn()
+ let svpos= winsaveview()
+" call Decho("saving posn to svpos<".string(svpos).">",'~'.expand("<slnum>"))
NetrwKeepj call s:NetrwRefresh(0,s:NetrwBrowseChgDir(0,'./'))
- NetrwKeepj call netrw#RestorePosn(svpos)
+" call Decho("restoring posn to svpos<".string(svpos).">",'~'.expand("<slnum>"))
+ NetrwKeepj call winrestview(svpos)
elseif !exists("g:netrw_quiet")
NetrwKeepj call netrw#ErrorMsg(s:ERROR,"unable to make directory<".newdirname.">",27)
endif
@@ -5846,7 +5948,8 @@ fun! s:NetrwMakeDir(usrhost)
elseif b:netrw_method == 2
" Remote mkdir: using ftp+.netrc
- let svpos= netrw#SavePosn()
+ let svpos= winsaveview()
+" call Decho("saving posn to svpos<".string(svpos).">",'~'.expand("<slnum>"))
" call Decho("b:netrw_curdir<".b:netrw_curdir.">",'~'.expand("<slnum>"))
if exists("b:netrw_fname")
" call Decho("b:netrw_fname<".b:netrw_fname.">",'~'.expand("<slnum>"))
@@ -5856,11 +5959,13 @@ fun! s:NetrwMakeDir(usrhost)
endif
call s:NetrwRemoteFtpCmd(remotepath,g:netrw_remote_mkdir.' "'.newdirname.'"')
NetrwKeepj call s:NetrwRefresh(0,s:NetrwBrowseChgDir(0,'./'))
- NetrwKeepj call netrw#RestorePosn(svpos)
+" call Decho("restoring posn to svpos<".string(svpos).">",'~'.expand("<slnum>"))
+ NetrwKeepj call winrestview(svpos)
elseif b:netrw_method == 3
" Remote mkdir: using ftp + machine, id, passwd, and fname (ie. no .netrc)
- let svpos= netrw#SavePosn()
+ let svpos= winsaveview()
+" call Decho("saving posn to svpos<".string(svpos).">",'~'.expand("<slnum>"))
" call Decho("b:netrw_curdir<".b:netrw_curdir.">",'~'.expand("<slnum>"))
if exists("b:netrw_fname")
" call Decho("b:netrw_fname<".b:netrw_fname.">",'~'.expand("<slnum>"))
@@ -5870,7 +5975,8 @@ fun! s:NetrwMakeDir(usrhost)
endif
call s:NetrwRemoteFtpCmd(remotepath,g:netrw_remote_mkdir.' "'.newdirname.'"')
NetrwKeepj call s:NetrwRefresh(0,s:NetrwBrowseChgDir(0,'./'))
- NetrwKeepj call netrw#RestorePosn(svpos)
+" call Decho("restoring posn to svpos<".string(svpos).">",'~'.expand("<slnum>"))
+ NetrwKeepj call winrestview(svpos)
endif
let @@= ykeep
@@ -5884,22 +5990,30 @@ fun! s:TreeSqueezeDir(islocal)
if exists("w:netrw_liststyle") && w:netrw_liststyle == s:TREELIST && exists("w:netrw_treedict")
" its a tree-listing style
let curdepth = substitute(getline('.'),'^\(\%('.s:treedepthstring.'\)*\)[^'.s:treedepthstring.'].\{-}$','\1','e')
- let iline = line(".") - 1
let stopline = (exists("w:netrw_bannercnt")? (w:netrw_bannercnt + 1) : 1)
-" call Decho("curdepth=".curdepth,'~'.expand("<slnum>"))
+ let depth = strchars(substitute(curdepth,' ','','g'))
+ let srch = -1
+" call Decho("curdepth<".curdepth.'>','~'.expand("<slnum>"))
+" call Decho("depth =".depth,'~'.expand("<slnum>"))
" call Decho("stopline#".stopline,'~'.expand("<slnum>"))
-" call Decho("starting with line#".line(".").": ".getline('.'),'~'.expand("<slnum>"))
- while iline > stopline
- " find a line that has less depth
- let depth = substitute(getline('.'),'^\(\%('.s:treedepthstring.'\)*\)[^'.s:treedepthstring.'].\{-}$','\1','e')
-" call Decho("considering line#".line(".").": ".getline('.'),'~'.expand("<slnum>"))
- if depth < curdepth
- break
- endif
- norm! k
- endwhile
-" call Decho("squeezing at line#".line(".").": ".getline('.'),'~'.expand("<slnum>"))
- call s:NetrwBrowse(a:islocal,s:NetrwBrowseChgDir(a:islocal,s:NetrwGetWord()))
+" call Decho("curline#".line(".")."<".getline('.').'>','~'.expand("<slnum>"))
+ if depth >= 2
+ NetrwKeepj norm! 0
+ let curdepthm1= substitute(curdepth,'^'.s:treedepthstring,'','')
+ let srch = search('^'.curdepthm1.'\%('.s:treedepthstring.'\)\@!','bW',stopline)
+" call Decho("curdepthm1<".curdepthm1.'>','~'.expand("<slnum>"))
+" call Decho("case depth>=2: srch<".srch.'>','~'.expand("<slnum>"))
+ elseif depth == 1
+ NetrwKeepj norm! 0
+ let treedepthchr= substitute(s:treedepthstring,' ','','')
+ let srch = search('^[^'.treedepthchr.']','bW',stopline)
+" call Decho("case depth==1: srch<".srch.'>','~'.expand("<slnum>"))
+ endif
+ if srch > 0
+" call Decho("squeezing at line#".line(".").": ".getline('.'),'~'.expand("<slnum>"))
+ call s:NetrwBrowse(a:islocal,s:NetrwBrowseChgDir(a:islocal,s:NetrwGetWord()))
+ exe srch
+ endif
endif
" call Dret("s:TreeSqueezeDir")
endfun
@@ -5927,23 +6041,24 @@ fun! s:NetrwMaps(islocal)
if a:islocal
" call Decho("make local maps",'~'.expand("<slnum>"))
" local normal-mode maps
- nnoremap <buffer> <silent> <nowait> a :call <SID>NetrwHide(1)<cr>
- nnoremap <buffer> <silent> <nowait> % :call <SID>NetrwOpenFile(1)<cr>
- nnoremap <buffer> <silent> <nowait> c :call <SID>NetrwLcd(b:netrw_curdir)<cr>
+ nnoremap <buffer> <silent> <nowait> a :<c-u>call <SID>NetrwHide(1)<cr>
+ nnoremap <buffer> <silent> <nowait> - :<c-u>call <SID>NetrwBrowseUpDir(1)<cr>
+ nnoremap <buffer> <silent> <nowait> % :<c-u>call <SID>NetrwOpenFile(1)<cr>
+ nnoremap <buffer> <silent> <nowait> c :<c-u>call <SID>NetrwLcd(b:netrw_curdir)<cr>
nnoremap <buffer> <silent> <nowait> C :<c-u>call <SID>NetrwSetChgwin()<cr>
- nnoremap <buffer> <silent> <nowait> <cr> :call netrw#LocalBrowseCheck(<SID>NetrwBrowseChgDir(1,<SID>NetrwGetWord()))<cr>
- nnoremap <buffer> <silent> <nowait> <s-cr> :call <SID>TreeSqueezeDir(1)<cr>
- nnoremap <buffer> <silent> <nowait> <c-r> :call <SID>NetrwServerEdit(3,<SID>NetrwGetWord())<cr>
- nnoremap <buffer> <silent> <nowait> d :call <SID>NetrwMakeDir("")<cr>
- nnoremap <buffer> <silent> <nowait> - :call <SID>NetrwBrowseUpDir(1)<cr>
+ nnoremap <buffer> <silent> <nowait> <cr> :<c-u>call netrw#LocalBrowseCheck(<SID>NetrwBrowseChgDir(1,<SID>NetrwGetWord()))<cr>
+ nnoremap <buffer> <silent> <nowait> <c-r> :<c-u>call <SID>NetrwServerEdit(3,<SID>NetrwGetWord())<cr>
+ nnoremap <buffer> <silent> <nowait> d :<c-u>call <SID>NetrwMakeDir("")<cr>
nnoremap <buffer> <silent> <nowait> gb :<c-u>call <SID>NetrwBookHistHandler(1,b:netrw_curdir)<cr>
nnoremap <buffer> <silent> <nowait> gd :<c-u>call <SID>NetrwForceChgDir(1,<SID>NetrwGetWord())<cr>
nnoremap <buffer> <silent> <nowait> gf :<c-u>call <SID>NetrwForceFile(1,<SID>NetrwGetWord())<cr>
nnoremap <buffer> <silent> <nowait> gh :<c-u>call <SID>NetrwHidden(1)<cr>
nnoremap <buffer> <silent> <nowait> gn :<c-u>call netrw#SetTreetop(<SID>NetrwGetWord())<cr>
nnoremap <buffer> <silent> <nowait> gp :<c-u>call <SID>NetrwChgPerm(1,b:netrw_curdir)<cr>
- nnoremap <buffer> <silent> <nowait> I :call <SID>NetrwBannerCtrl(1)<cr>
- nnoremap <buffer> <silent> <nowait> i :call <SID>NetrwListStyle(1)<cr>
+ nnoremap <buffer> <silent> <nowait> I :<c-u>call <SID>NetrwBannerCtrl(1)<cr>
+ nnoremap <buffer> <silent> <nowait> i :<c-u>call <SID>NetrwListStyle(1)<cr>
+ nnoremap <buffer> <silent> <nowait> ma :<c-u>call <SID>NetrwMarkFileArgList(1,0)<cr>
+ nnoremap <buffer> <silent> <nowait> mA :<c-u>call <SID>NetrwMarkFileArgList(1,1)<cr>
nnoremap <buffer> <silent> <nowait> mb :<c-u>call <SID>NetrwBookHistHandler(0,b:netrw_curdir)<cr>
nnoremap <buffer> <silent> <nowait> mB :<c-u>call <SID>NetrwBookHistHandler(6,b:netrw_curdir)<cr>
nnoremap <buffer> <silent> <nowait> mc :<c-u>call <SID>NetrwMarkFileCopy(1)<cr>
@@ -5957,104 +6072,110 @@ fun! s:NetrwMaps(islocal)
nnoremap <buffer> <silent> <nowait> mp :<c-u>call <SID>NetrwMarkFilePrint(1)<cr>
nnoremap <buffer> <silent> <nowait> mr :<c-u>call <SID>NetrwMarkFileRegexp(1)<cr>
nnoremap <buffer> <silent> <nowait> ms :<c-u>call <SID>NetrwMarkFileSource(1)<cr>
- nnoremap <buffer> <silent> <nowait> mt :<c-u>call <SID>NetrwMarkFileTgt(1)<cr>
nnoremap <buffer> <silent> <nowait> mT :<c-u>call <SID>NetrwMarkFileTag(1)<cr>
+ nnoremap <buffer> <silent> <nowait> mt :<c-u>call <SID>NetrwMarkFileTgt(1)<cr>
nnoremap <buffer> <silent> <nowait> mu :<c-u>call <SID>NetrwUnMarkFile(1)<cr>
nnoremap <buffer> <silent> <nowait> mv :<c-u>call <SID>NetrwMarkFileVimCmd(1)<cr>
nnoremap <buffer> <silent> <nowait> mx :<c-u>call <SID>NetrwMarkFileExe(1,0)<cr>
nnoremap <buffer> <silent> <nowait> mX :<c-u>call <SID>NetrwMarkFileExe(1,1)<cr>
nnoremap <buffer> <silent> <nowait> mz :<c-u>call <SID>NetrwMarkFileCompress(1)<cr>
- nnoremap <buffer> <silent> <nowait> O :call <SID>NetrwObtain(1)<cr>
+ nnoremap <buffer> <silent> <nowait> O :<c-u>call <SID>NetrwObtain(1)<cr>
nnoremap <buffer> <silent> <nowait> o :call <SID>NetrwSplit(3)<cr>
- nnoremap <buffer> <silent> <nowait> p :call <SID>NetrwPreview(<SID>NetrwBrowseChgDir(1,<SID>NetrwGetWord(),1))<cr>
- nnoremap <buffer> <silent> <nowait> P :call <SID>NetrwPrevWinOpen(1)<cr>
+ nnoremap <buffer> <silent> <nowait> p :<c-u>call <SID>NetrwPreview(<SID>NetrwBrowseChgDir(1,<SID>NetrwGetWord(),1))<cr>
+ nnoremap <buffer> <silent> <nowait> P :<c-u>call <SID>NetrwPrevWinOpen(1)<cr>
nnoremap <buffer> <silent> <nowait> qb :<c-u>call <SID>NetrwBookHistHandler(2,b:netrw_curdir)<cr>
nnoremap <buffer> <silent> <nowait> qf :<c-u>call <SID>NetrwFileInfo(1,<SID>NetrwGetWord())<cr>
nnoremap <buffer> <silent> <nowait> qF :<c-u>call <SID>NetrwMarkFileQFEL(1,getqflist())<cr>
- nnoremap <buffer> <silent> <nowait> r :let g:netrw_sort_direction= (g:netrw_sort_direction =~ 'n')? 'r' : 'n'<bar>exe "norm! 0"<bar>call <SID>NetrwRefresh(1,<SID>NetrwBrowseChgDir(1,'./'))<cr>
+ nnoremap <buffer> <silent> <nowait> qL :<c-u>call <SID>NetrwMarkFileQFEL(1,getloclist(v:count))<cr>
+ nnoremap <buffer> <silent> <nowait> r :<c-u>let g:netrw_sort_direction= (g:netrw_sort_direction =~ 'n')? 'r' : 'n'<bar>exe "norm! 0"<bar>call <SID>NetrwRefresh(1,<SID>NetrwBrowseChgDir(1,'./'))<cr>
nnoremap <buffer> <silent> <nowait> s :call <SID>NetrwSortStyle(1)<cr>
- nnoremap <buffer> <silent> <nowait> S :call <SID>NetSortSequence(1)<cr>
+ nnoremap <buffer> <silent> <nowait> S :<c-u>call <SID>NetSortSequence(1)<cr>
+ nnoremap <buffer> <silent> <nowait> Tb :<c-u>call <SID>NetrwSetTgt(1,'b',v:count1)<cr>
nnoremap <buffer> <silent> <nowait> t :call <SID>NetrwSplit(4)<cr>
- nnoremap <buffer> <silent> <nowait> Tb :<c-u>call <SID>NetrwSetTgt('b',v:count1)<cr>
- nnoremap <buffer> <silent> <nowait> Th :<c-u>call <SID>NetrwSetTgt('h',v:count)<cr>
+ nnoremap <buffer> <silent> <nowait> Th :<c-u>call <SID>NetrwSetTgt(1,'h',v:count)<cr>
nnoremap <buffer> <silent> <nowait> u :<c-u>call <SID>NetrwBookHistHandler(4,expand("%"))<cr>
nnoremap <buffer> <silent> <nowait> U :<c-u>call <SID>NetrwBookHistHandler(5,expand("%"))<cr>
nnoremap <buffer> <silent> <nowait> v :call <SID>NetrwSplit(5)<cr>
- nnoremap <buffer> <silent> <nowait> x :call netrw#BrowseX(<SID>NetrwBrowseChgDir(1,<SID>NetrwGetWord(),0),0)"<cr>
- nnoremap <buffer> <silent> <nowait> X :call <SID>NetrwLocalExecute(expand("<cword>"))"<cr>
- " local insert-mode maps
- inoremap <buffer> <silent> <nowait> a <c-o>:call <SID>NetrwHide(1)<cr>
- inoremap <buffer> <silent> <nowait> c <c-o>:exe "NetrwKeepj lcd ".fnameescape(b:netrw_curdir)<cr>
- inoremap <buffer> <silent> <nowait> c <c-o>:call <SID>NetrwLcd(b:netrw_curdir)<cr>
- inoremap <buffer> <silent> <nowait> C <c-o>:call <SID>NetrwSetChgwin()<cr>
- inoremap <buffer> <silent> <nowait> % <c-o>:call <SID>NetrwOpenFile(1)<cr>
- inoremap <buffer> <silent> <nowait> - <c-o>:call <SID>NetrwBrowseUpDir(1)<cr>
- inoremap <buffer> <silent> <nowait> <cr> <c-o>:call netrw#LocalBrowseCheck(<SID>NetrwBrowseChgDir(1,<SID>NetrwGetWord()))<cr>
- inoremap <buffer> <silent> <nowait> <s-cr> <c-o>:call <SID>TreeSqueezeDir(1)<cr>
- inoremap <buffer> <silent> <nowait> d <c-o>:call <SID>NetrwMakeDir("")<cr>
- inoremap <buffer> <silent> <nowait> gb <c-o>:<c-u>call <SID>NetrwBookHistHandler(1,b:netrw_curdir)<cr>
- inoremap <buffer> <silent> <nowait> gh <c-o>:<c-u>call <SID>NetrwHidden(1)<cr>
- nnoremap <buffer> <silent> <nowait> gn :<c-u>call netrw#SetTreetop(<SID>NetrwGetWord())<cr>
- inoremap <buffer> <silent> <nowait> gp <c-o>:<c-u>call <SID>NetrwChgPerm(1,b:netrw_curdir)<cr>
- inoremap <buffer> <silent> <nowait> I <c-o>:call <SID>NetrwBannerCtrl(1)<cr>
- inoremap <buffer> <silent> <nowait> i <c-o>:call <SID>NetrwListStyle(1)<cr>
- inoremap <buffer> <silent> <nowait> mb <c-o>:<c-u>call <SID>NetrwBookHistHandler(0,b:netrw_curdir)<cr>
- inoremap <buffer> <silent> <nowait> mB <c-o>:<c-u>call <SID>NetrwBookHistHandler(6,b:netrw_curdir)<cr>
- inoremap <buffer> <silent> <nowait> mc <c-o>:<c-u>call <SID>NetrwMarkFileCopy(1)<cr>
- inoremap <buffer> <silent> <nowait> md <c-o>:<c-u>call <SID>NetrwMarkFileDiff(1)<cr>
- inoremap <buffer> <silent> <nowait> me <c-o>:<c-u>call <SID>NetrwMarkFileEdit(1)<cr>
- inoremap <buffer> <silent> <nowait> mf <c-o>:<c-u>call <SID>NetrwMarkFile(1,<SID>NetrwGetWord())<cr>
- inoremap <buffer> <silent> <nowait> mg <c-o>:<c-u>call <SID>NetrwMarkFileGrep(1)<cr>
- inoremap <buffer> <silent> <nowait> mh <c-o>:<c-u>call <SID>NetrwMarkHideSfx(1)<cr>
- inoremap <buffer> <silent> <nowait> mm <c-o>:<c-u>call <SID>NetrwMarkFileMove(1)<cr>
- inoremap <buffer> <silent> <nowait> mp <c-o>:<c-u>call <SID>NetrwMarkFilePrint(1)<cr>
- inoremap <buffer> <silent> <nowait> mr <c-o>:<c-u>call <SID>NetrwMarkFileRegexp(1)<cr>
- inoremap <buffer> <silent> <nowait> ms <c-o>:<c-u>call <SID>NetrwMarkFileSource(1)<cr>
- inoremap <buffer> <silent> <nowait> mT <c-o>:<c-u>call <SID>NetrwMarkFileTag(1)<cr>
- inoremap <buffer> <silent> <nowait> mt <c-o>:<c-u>call <SID>NetrwMarkFileTgt(1)<cr>
- inoremap <buffer> <silent> <nowait> mu <c-o>:<c-u>call <SID>NetrwUnMarkFile(1)<cr>
- inoremap <buffer> <silent> <nowait> mv <c-o>:<c-u>call <SID>NetrwMarkFileVimCmd(1)<cr>
- inoremap <buffer> <silent> <nowait> mx <c-o>:<c-u>call <SID>NetrwMarkFileExe(1,0)<cr>
- inoremap <buffer> <silent> <nowait> mX <c-o>:<c-u>call <SID>NetrwMarkFileExe(1,1)<cr>
- inoremap <buffer> <silent> <nowait> mz <c-o>:<c-u>call <SID>NetrwMarkFileCompress(1)<cr>
- inoremap <buffer> <silent> <nowait> O <c-o>:call <SID>NetrwObtain(1)<cr>
- inoremap <buffer> <silent> <nowait> o <c-o>:call <SID>NetrwSplit(3)<cr>
- inoremap <buffer> <silent> <nowait> p <c-o>:call <SID>NetrwPreview(<SID>NetrwBrowseChgDir(1,<SID>NetrwGetWord(),1))<cr>
- inoremap <buffer> <silent> <nowait> P <c-o>:call <SID>NetrwPrevWinOpen(1)<cr>
- inoremap <buffer> <silent> <nowait> qb <c-o>:<c-u>call <SID>NetrwBookHistHandler(2,b:netrw_curdir)<cr>
- inoremap <buffer> <silent> <nowait> qf <c-o>:<c-u>call <SID>NetrwFileInfo(1,<SID>NetrwGetWord())<cr>
- inoremap <buffer> <silent> <nowait> qF :<c-u>call <SID>NetrwMarkFileQFEL(1,getqflist())<cr>
- inoremap <buffer> <silent> <nowait> r <c-o>:let g:netrw_sort_direction= (g:netrw_sort_direction =~ 'n')? 'r' : 'n'<bar>exe "norm! 0"<bar>call <SID>NetrwRefresh(1,<SID>NetrwBrowseChgDir(1,'./'))<cr>
- inoremap <buffer> <silent> <nowait> s <c-o>:call <SID>NetrwSortStyle(1)<cr>
- inoremap <buffer> <silent> <nowait> S <c-o>:call <SID>NetSortSequence(1)<cr>
- inoremap <buffer> <silent> <nowait> t <c-o>:call <SID>NetrwSplit(4)<cr>
- inoremap <buffer> <silent> <nowait> Tb <c-o>:<c-u>call <SID>NetrwSetTgt('b',v:count1)<cr>
- inoremap <buffer> <silent> <nowait> Th <c-o>:<c-u>call <SID>NetrwSetTgt('h',v:count)<cr>
- inoremap <buffer> <silent> <nowait> u <c-o>:<c-u>call <SID>NetrwBookHistHandler(4,expand("%"))<cr>
- inoremap <buffer> <silent> <nowait> U <c-o>:<c-u>call <SID>NetrwBookHistHandler(5,expand("%"))<cr>
- inoremap <buffer> <silent> <nowait> v <c-o>:call <SID>NetrwSplit(5)<cr>
- inoremap <buffer> <silent> <nowait> x <c-o>:call netrw#BrowseX(<SID>NetrwBrowseChgDir(1,<SID>NetrwGetWord(),0),0)"<cr>
+ nnoremap <buffer> <silent> <nowait> x :<c-u>call netrw#BrowseX(<SID>NetrwBrowseChgDir(1,<SID>NetrwGetWord(),0),0)"<cr>
+ nnoremap <buffer> <silent> <nowait> X :<c-u>call <SID>NetrwLocalExecute(expand("<cword>"))"<cr>
+" " local insert-mode maps
+" inoremap <buffer> <silent> <nowait> a <c-o>:call <SID>NetrwHide(1)<cr>
+" inoremap <buffer> <silent> <nowait> c <c-o>:exe "NetrwKeepj lcd ".fnameescape(b:netrw_curdir)<cr>
+" inoremap <buffer> <silent> <nowait> c <c-o>:call <SID>NetrwLcd(b:netrw_curdir)<cr>
+" inoremap <buffer> <silent> <nowait> C <c-o>:call <SID>NetrwSetChgwin()<cr>
+" inoremap <buffer> <silent> <nowait> % <c-o>:call <SID>NetrwOpenFile(1)<cr>
+" inoremap <buffer> <silent> <nowait> - <c-o>:call <SID>NetrwBrowseUpDir(1)<cr>
+" inoremap <buffer> <silent> <nowait> <cr> <c-o>:call netrw#LocalBrowseCheck(<SID>NetrwBrowseChgDir(1,<SID>NetrwGetWord()))<cr>
+" inoremap <buffer> <silent> <nowait> d <c-o>:call <SID>NetrwMakeDir("")<cr>
+" inoremap <buffer> <silent> <nowait> gb <c-o>:<c-u>call <SID>NetrwBookHistHandler(1,b:netrw_curdir)<cr>
+" inoremap <buffer> <silent> <nowait> gh <c-o>:<c-u>call <SID>NetrwHidden(1)<cr>
+" nnoremap <buffer> <silent> <nowait> gn :<c-u>call netrw#SetTreetop(<SID>NetrwGetWord())<cr>
+" inoremap <buffer> <silent> <nowait> gp <c-o>:<c-u>call <SID>NetrwChgPerm(1,b:netrw_curdir)<cr>
+" inoremap <buffer> <silent> <nowait> I <c-o>:call <SID>NetrwBannerCtrl(1)<cr>
+" inoremap <buffer> <silent> <nowait> i <c-o>:call <SID>NetrwListStyle(1)<cr>
+" inoremap <buffer> <silent> <nowait> mb <c-o>:<c-u>call <SID>NetrwBookHistHandler(0,b:netrw_curdir)<cr>
+" inoremap <buffer> <silent> <nowait> mB <c-o>:<c-u>call <SID>NetrwBookHistHandler(6,b:netrw_curdir)<cr>
+" inoremap <buffer> <silent> <nowait> mc <c-o>:<c-u>call <SID>NetrwMarkFileCopy(1)<cr>
+" inoremap <buffer> <silent> <nowait> md <c-o>:<c-u>call <SID>NetrwMarkFileDiff(1)<cr>
+" inoremap <buffer> <silent> <nowait> me <c-o>:<c-u>call <SID>NetrwMarkFileEdit(1)<cr>
+" inoremap <buffer> <silent> <nowait> mf <c-o>:<c-u>call <SID>NetrwMarkFile(1,<SID>NetrwGetWord())<cr>
+" inoremap <buffer> <silent> <nowait> mg <c-o>:<c-u>call <SID>NetrwMarkFileGrep(1)<cr>
+" inoremap <buffer> <silent> <nowait> mh <c-o>:<c-u>call <SID>NetrwMarkHideSfx(1)<cr>
+" inoremap <buffer> <silent> <nowait> mm <c-o>:<c-u>call <SID>NetrwMarkFileMove(1)<cr>
+" inoremap <buffer> <silent> <nowait> mp <c-o>:<c-u>call <SID>NetrwMarkFilePrint(1)<cr>
+" inoremap <buffer> <silent> <nowait> mr <c-o>:<c-u>call <SID>NetrwMarkFileRegexp(1)<cr>
+" inoremap <buffer> <silent> <nowait> ms <c-o>:<c-u>call <SID>NetrwMarkFileSource(1)<cr>
+" inoremap <buffer> <silent> <nowait> mT <c-o>:<c-u>call <SID>NetrwMarkFileTag(1)<cr>
+" inoremap <buffer> <silent> <nowait> mt <c-o>:<c-u>call <SID>NetrwMarkFileTgt(1)<cr>
+" inoremap <buffer> <silent> <nowait> mu <c-o>:<c-u>call <SID>NetrwUnMarkFile(1)<cr>
+" inoremap <buffer> <silent> <nowait> mv <c-o>:<c-u>call <SID>NetrwMarkFileVimCmd(1)<cr>
+" inoremap <buffer> <silent> <nowait> mx <c-o>:<c-u>call <SID>NetrwMarkFileExe(1,0)<cr>
+" inoremap <buffer> <silent> <nowait> mX <c-o>:<c-u>call <SID>NetrwMarkFileExe(1,1)<cr>
+" inoremap <buffer> <silent> <nowait> mz <c-o>:<c-u>call <SID>NetrwMarkFileCompress(1)<cr>
+" inoremap <buffer> <silent> <nowait> O <c-o>:call <SID>NetrwObtain(1)<cr>
+" inoremap <buffer> <silent> <nowait> o <c-o>:call <SID>NetrwSplit(3)<cr>
+" inoremap <buffer> <silent> <nowait> p <c-o>:call <SID>NetrwPreview(<SID>NetrwBrowseChgDir(1,<SID>NetrwGetWord(),1))<cr>
+" inoremap <buffer> <silent> <nowait> P <c-o>:call <SID>NetrwPrevWinOpen(1)<cr>
+" inoremap <buffer> <silent> <nowait> qb <c-o>:<c-u>call <SID>NetrwBookHistHandler(2,b:netrw_curdir)<cr>
+" inoremap <buffer> <silent> <nowait> qf <c-o>:<c-u>call <SID>NetrwFileInfo(1,<SID>NetrwGetWord())<cr>
+" inoremap <buffer> <silent> <nowait> qF :<c-u>call <SID>NetrwMarkFileQFEL(1,getqflist())<cr>
+" inoremap <buffer> <silent> <nowait> qL :<c-u>call <SID>NetrwMarkFileQFEL(1,getloclist(v:count))<cr>
+" inoremap <buffer> <silent> <nowait> r <c-o>:let g:netrw_sort_direction= (g:netrw_sort_direction =~ 'n')? 'r' : 'n'<bar>exe "norm! 0"<bar>call <SID>NetrwRefresh(1,<SID>NetrwBrowseChgDir(1,'./'))<cr>
+" inoremap <buffer> <silent> <nowait> s <c-o>:call <SID>NetrwSortStyle(1)<cr>
+" inoremap <buffer> <silent> <nowait> S <c-o>:call <SID>NetSortSequence(1)<cr>
+" inoremap <buffer> <silent> <nowait> t <c-o>:call <SID>NetrwSplit(4)<cr>
+" inoremap <buffer> <silent> <nowait> Tb <c-o>:<c-u>call <SID>NetrwSetTgt(1,'b',v:count1)<cr>
+" inoremap <buffer> <silent> <nowait> Th <c-o>:<c-u>call <SID>NetrwSetTgt(1,'h',v:count)<cr>
+" inoremap <buffer> <silent> <nowait> u <c-o>:<c-u>call <SID>NetrwBookHistHandler(4,expand("%"))<cr>
+" inoremap <buffer> <silent> <nowait> U <c-o>:<c-u>call <SID>NetrwBookHistHandler(5,expand("%"))<cr>
+" inoremap <buffer> <silent> <nowait> v <c-o>:call <SID>NetrwSplit(5)<cr>
+" inoremap <buffer> <silent> <nowait> x <c-o>:call netrw#BrowseX(<SID>NetrwBrowseChgDir(1,<SID>NetrwGetWord(),0),0)"<cr>
if !hasmapto('<Plug>NetrwHideEdit')
nmap <buffer> <unique> <c-h> <Plug>NetrwHideEdit
- imap <buffer> <unique> <c-h> <Plug>NetrwHideEdit
+" imap <buffer> <unique> <c-h> <c-o><Plug>NetrwHideEdit
endif
- nnoremap <buffer> <silent> <Plug>NetrwHideEdit :call <SID>NetrwHideEdit(1)<cr>
+ nnoremap <buffer> <silent> <Plug>NetrwHideEdit :call <SID>NetrwHideEdit(1)<cr>
if !hasmapto('<Plug>NetrwRefresh')
nmap <buffer> <unique> <c-l> <Plug>NetrwRefresh
- imap <buffer> <unique> <c-l> <Plug>NetrwRefresh
+" imap <buffer> <unique> <c-l> <c-o><Plug>NetrwRefresh
endif
- nnoremap <buffer> <silent> <Plug>NetrwRefresh :call <SID>NetrwRefresh(1,<SID>NetrwBrowseChgDir(1,(w:netrw_liststyle == 3)? w:netrw_treetop : './'))<cr>
+ nnoremap <buffer> <silent> <Plug>NetrwRefresh <c-l>:call <SID>NetrwRefresh(1,<SID>NetrwBrowseChgDir(1,(w:netrw_liststyle == 3)? w:netrw_treetop : './'))<cr>
if s:didstarstar || !mapcheck("<s-down>","n")
nnoremap <buffer> <silent> <s-down> :Nexplore<cr>
- inoremap <buffer> <silent> <s-down> :Nexplore<cr>
+" inoremap <buffer> <silent> <s-down> <c-o>:Nexplore<cr>
endif
if s:didstarstar || !mapcheck("<s-up>","n")
nnoremap <buffer> <silent> <s-up> :Pexplore<cr>
- inoremap <buffer> <silent> <s-up> :Pexplore<cr>
+" inoremap <buffer> <silent> <s-up> <c-o>:Pexplore<cr>
+ endif
+ if !hasmapto('<Plug>NetrwTreeSqueeze')
+ nmap <buffer> <silent> <nowait> <s-cr> <Plug>NetrwTreeSqueeze
+" imap <buffer> <silent> <nowait> <s-cr> <c-o><Plug>NetrwTreeSqueeze
endif
+ nnoremap <buffer> <silent> <Plug>NetrwTreeSqueeze :call <SID>TreeSqueezeDir(1)<cr>
let mapsafecurdir = escape(b:netrw_curdir, s:netrw_map_escape)
if g:netrw_mousemaps == 1
- nmap <buffer> <leftmouse> <Plug>NetrwLeftmouse
+ nmap <buffer> <leftmouse> <Plug>NetrwLeftmouse
nno <buffer> <silent> <Plug>NetrwLeftmouse <leftmouse>:call <SID>NetrwLeftmouse(1)<cr>
nmap <buffer> <c-leftmouse> <Plug>NetrwCLeftmouse
nno <buffer> <silent> <Plug>NetrwCLeftmouse <leftmouse>:call <SID>NetrwCLeftmouse(1)<cr>
@@ -6067,14 +6188,14 @@ fun! s:NetrwMaps(islocal)
nmap <buffer> <2-leftmouse> <Plug>Netrw2Leftmouse
nmap <buffer> <silent> <Plug>Netrw2Leftmouse -
imap <buffer> <leftmouse> <Plug>ILeftmouse
- ino <buffer> <silent> <Plug>ILeftmouse <c-o><leftmouse><c-o>:call <SID>NetrwLeftmouse(1)<cr>
+" ino <buffer> <silent> <Plug>ILeftmouse <c-o><leftmouse><c-o>:call <SID>NetrwLeftmouse(1)<cr>
imap <buffer> <middlemouse> <Plug>IMiddlemouse
- ino <buffer> <silent> <Plug>IMiddlemouse <c-o><leftmouse><c-o>:call <SID>NetrwPrevWinOpen(1)<cr>
- imap <buffer> <s-leftmouse> <Plug>ISLeftmouse
- ino <buffer> <silent> <Plug>ISLeftmouse <c-o><leftmouse><c-o>:call <SID>NetrwMarkFile(1,<SID>NetrwGetWord())<cr>
+" ino <buffer> <silent> <Plug>IMiddlemouse <c-o><leftmouse><c-o>:call <SID>NetrwPrevWinOpen(1)<cr>
+" imap <buffer> <s-leftmouse> <Plug>ISLeftmouse
+" ino <buffer> <silent> <Plug>ISLeftmouse <c-o><leftmouse><c-o>:call <SID>NetrwMarkFile(1,<SID>NetrwGetWord())<cr>
exe 'nnoremap <buffer> <silent> <rightmouse> <leftmouse>:call <SID>NetrwLocalRm("'.mapsafecurdir.'")<cr>'
exe 'vnoremap <buffer> <silent> <rightmouse> <leftmouse>:call <SID>NetrwLocalRm("'.mapsafecurdir.'")<cr>'
- exe 'inoremap <buffer> <silent> <rightmouse> <c-o><leftmouse><c-o>:call <SID>NetrwLocalRm("'.mapsafecurdir.'")<cr>'
+" exe 'inoremap <buffer> <silent> <rightmouse> <c-o><leftmouse><c-o>:call <SID>NetrwLocalRm("'.mapsafecurdir.'")<cr>'
endif
exe 'nnoremap <buffer> <silent> <nowait> <del> :call <SID>NetrwLocalRm("'.mapsafecurdir.'")<cr>'
exe 'nnoremap <buffer> <silent> <nowait> D :call <SID>NetrwLocalRm("'.mapsafecurdir.'")<cr>'
@@ -6083,10 +6204,10 @@ fun! s:NetrwMaps(islocal)
exe 'vnoremap <buffer> <silent> <nowait> <del> :call <SID>NetrwLocalRm("'.mapsafecurdir.'")<cr>'
exe 'vnoremap <buffer> <silent> <nowait> D :call <SID>NetrwLocalRm("'.mapsafecurdir.'")<cr>'
exe 'vnoremap <buffer> <silent> <nowait> R :call <SID>NetrwLocalRename("'.mapsafecurdir.'")<cr>'
- exe 'inoremap <buffer> <silent> <nowait> <del> <c-o>:call <SID>NetrwLocalRm("'.mapsafecurdir.'")<cr>'
- exe 'inoremap <buffer> <silent> <nowait> D <c-o>:call <SID>NetrwLocalRm("'.mapsafecurdir.'")<cr>'
- exe 'inoremap <buffer> <silent> <nowait> R <c-o>:call <SID>NetrwLocalRename("'.mapsafecurdir.'")<cr>'
- exe 'inoremap <buffer> <silent> <nowait> d <c-o>:call <SID>NetrwMakeDir("")<cr>'
+" exe 'inoremap <buffer> <silent> <nowait> <del> <c-o>:call <SID>NetrwLocalRm("'.mapsafecurdir.'")<cr>'
+" exe 'inoremap <buffer> <silent> <nowait> D <c-o>:call <SID>NetrwLocalRm("'.mapsafecurdir.'")<cr>'
+" exe 'inoremap <buffer> <silent> <nowait> R <c-o>:call <SID>NetrwLocalRename("'.mapsafecurdir.'")<cr>'
+" exe 'inoremap <buffer> <silent> <nowait> d <c-o>:call <SID>NetrwMakeDir("")<cr>'
nnoremap <buffer> <F1> :he netrw-quickhelp<cr>
" support user-specified maps
@@ -6096,13 +6217,24 @@ fun! s:NetrwMaps(islocal)
" call Decho("make remote maps",'~'.expand("<slnum>"))
call s:RemotePathAnalysis(b:netrw_curdir)
" remote normal-mode maps
- nnoremap <buffer> <silent> <nowait> <cr> :call <SID>NetrwBrowse(0,<SID>NetrwBrowseChgDir(0,<SID>NetrwGetWord()))<cr>
- nnoremap <buffer> <silent> <nowait> <s-cr> :call <SID>TreeSqueezeDir(0)<cr>
- nnoremap <buffer> <silent> <nowait> <c-l> :call <SID>NetrwRefresh(0,<SID>NetrwBrowseChgDir(0,'./'))<cr>
- nnoremap <buffer> <silent> <nowait> <c-r> :call <SID>NetrwServerEdit(2,<SID>NetrwGetWord())<cr>
- nnoremap <buffer> <silent> <nowait> - :call <SID>NetrwBrowseUpDir(0)<cr>
- nnoremap <buffer> <silent> <nowait> a :call <SID>NetrwHide(0)<cr>
+ nnoremap <buffer> <silent> <nowait> a :<c-u>call <SID>NetrwHide(0)<cr>
+ nnoremap <buffer> <silent> <nowait> - :<c-u>call <SID>NetrwBrowseUpDir(0)<cr>
+ nnoremap <buffer> <silent> <nowait> % :<c-u>call <SID>NetrwOpenFile(0)<cr>
+ nnoremap <buffer> <silent> <nowait> C :<c-u>call <SID>NetrwSetChgwin()<cr>
+ nnoremap <buffer> <silent> <nowait> <c-l> :<c-u>call <SID>NetrwRefresh(0,<SID>NetrwBrowseChgDir(0,'./'))<cr>
+ nnoremap <buffer> <silent> <nowait> <cr> :<c-u>call <SID>NetrwBrowse(0,<SID>NetrwBrowseChgDir(0,<SID>NetrwGetWord()))<cr>
+ nnoremap <buffer> <silent> <nowait> <c-r> :<c-u>call <SID>NetrwServerEdit(2,<SID>NetrwGetWord())<cr>
+ nnoremap <buffer> <silent> <nowait> gb :<c-u>call <SID>NetrwBookHistHandler(1,b:netrw_curdir)<cr>
+ nnoremap <buffer> <silent> <nowait> gd :<c-u>call <SID>NetrwForceChgDir(0,<SID>NetrwGetWord())<cr>
+ nnoremap <buffer> <silent> <nowait> gf :<c-u>call <SID>NetrwForceFile(0,<SID>NetrwGetWord())<cr>
+ nnoremap <buffer> <silent> <nowait> gh :<c-u>call <SID>NetrwHidden(0)<cr>
+ nnoremap <buffer> <silent> <nowait> gp :<c-u>call <SID>NetrwChgPerm(0,b:netrw_curdir)<cr>
+ nnoremap <buffer> <silent> <nowait> I :<c-u>call <SID>NetrwBannerCtrl(1)<cr>
+ nnoremap <buffer> <silent> <nowait> i :<c-u>call <SID>NetrwListStyle(0)<cr>
+ nnoremap <buffer> <silent> <nowait> ma :<c-u>call <SID>NetrwMarkFileArgList(0,0)<cr>
+ nnoremap <buffer> <silent> <nowait> mA :<c-u>call <SID>NetrwMarkFileArgList(0,1)<cr>
nnoremap <buffer> <silent> <nowait> mb :<c-u>call <SID>NetrwBookHistHandler(0,b:netrw_curdir)<cr>
+ nnoremap <buffer> <silent> <nowait> mB :<c-u>call <SID>NetrwBookHistHandler(6,b:netrw_curdir)<cr>
nnoremap <buffer> <silent> <nowait> mc :<c-u>call <SID>NetrwMarkFileCopy(0)<cr>
nnoremap <buffer> <silent> <nowait> md :<c-u>call <SID>NetrwMarkFileDiff(0)<cr>
nnoremap <buffer> <silent> <nowait> me :<c-u>call <SID>NetrwMarkFileEdit(0)<cr>
@@ -6114,99 +6246,96 @@ fun! s:NetrwMaps(islocal)
nnoremap <buffer> <silent> <nowait> mp :<c-u>call <SID>NetrwMarkFilePrint(0)<cr>
nnoremap <buffer> <silent> <nowait> mr :<c-u>call <SID>NetrwMarkFileRegexp(0)<cr>
nnoremap <buffer> <silent> <nowait> ms :<c-u>call <SID>NetrwMarkFileSource(0)<cr>
- nnoremap <buffer> <silent> <nowait> mt :<c-u>call <SID>NetrwMarkFileTgt(0)<cr>
nnoremap <buffer> <silent> <nowait> mT :<c-u>call <SID>NetrwMarkFileTag(0)<cr>
+ nnoremap <buffer> <silent> <nowait> mt :<c-u>call <SID>NetrwMarkFileTgt(0)<cr>
nnoremap <buffer> <silent> <nowait> mu :<c-u>call <SID>NetrwUnMarkFile(0)<cr>
nnoremap <buffer> <silent> <nowait> mv :<c-u>call <SID>NetrwMarkFileVimCmd(0)<cr>
nnoremap <buffer> <silent> <nowait> mx :<c-u>call <SID>NetrwMarkFileExe(0,0)<cr>
nnoremap <buffer> <silent> <nowait> mX :<c-u>call <SID>NetrwMarkFileExe(0,1)<cr>
nnoremap <buffer> <silent> <nowait> mz :<c-u>call <SID>NetrwMarkFileCompress(0)<cr>
- nnoremap <buffer> <silent> <nowait> gb :<c-u>call <SID>NetrwBookHistHandler(1,b:netrw_curdir)<cr>
- nnoremap <buffer> <silent> <nowait> gd :<c-u>call <SID>NetrwForceChgDir(0,<SID>NetrwGetWord())<cr>
- nnoremap <buffer> <silent> <nowait> gf :<c-u>call <SID>NetrwForceFile(0,<SID>NetrwGetWord())<cr>
- nnoremap <buffer> <silent> <nowait> gh :<c-u>call <SID>NetrwHidden(0)<cr>
- nnoremap <buffer> <silent> <nowait> gp :<c-u>call <SID>NetrwChgPerm(0,b:netrw_curdir)<cr>
- nnoremap <buffer> <silent> <nowait> C :<c-u>call <SID>NetrwSetChgwin()<cr>
- nnoremap <buffer> <silent> <nowait> i :call <SID>NetrwListStyle(0)<cr>
- nnoremap <buffer> <silent> <nowait> I :call <SID>NetrwBannerCtrl(1)<cr>
- nnoremap <buffer> <silent> <nowait> o :call <SID>NetrwSplit(0)<cr>
- nnoremap <buffer> <silent> <nowait> O :call <SID>NetrwObtain(0)<cr>
- nnoremap <buffer> <silent> <nowait> p :call <SID>NetrwPreview(<SID>NetrwBrowseChgDir(1,<SID>NetrwGetWord(),1))<cr>
- nnoremap <buffer> <silent> <nowait> P :call <SID>NetrwPrevWinOpen(0)<cr>
+ nnoremap <buffer> <silent> <nowait> O :<c-u>call <SID>NetrwObtain(0)<cr>
+ nnoremap <buffer> <silent> <nowait> o :call <SID>NetrwSplit(0)<cr>
+ nnoremap <buffer> <silent> <nowait> p :<c-u>call <SID>NetrwPreview(<SID>NetrwBrowseChgDir(1,<SID>NetrwGetWord(),1))<cr>
+ nnoremap <buffer> <silent> <nowait> P :<c-u>call <SID>NetrwPrevWinOpen(0)<cr>
nnoremap <buffer> <silent> <nowait> qb :<c-u>call <SID>NetrwBookHistHandler(2,b:netrw_curdir)<cr>
- nnoremap <buffer> <silent> <nowait> mB :<c-u>call <SID>NetrwBookHistHandler(6,b:netrw_curdir)<cr>
nnoremap <buffer> <silent> <nowait> qf :<c-u>call <SID>NetrwFileInfo(0,<SID>NetrwGetWord())<cr>
nnoremap <buffer> <silent> <nowait> qF :<c-u>call <SID>NetrwMarkFileQFEL(0,getqflist())<cr>
- nnoremap <buffer> <silent> <nowait> r :let g:netrw_sort_direction= (g:netrw_sort_direction =~ 'n')? 'r' : 'n'<bar>exe "norm! 0"<bar>call <SID>NetrwBrowse(0,<SID>NetrwBrowseChgDir(0,'./'))<cr>
- nnoremap <buffer> <silent> <nowait> s :call <SID>NetrwSortStyle(0)<cr>
- nnoremap <buffer> <silent> <nowait> S :call <SID>NetSortSequence(0)<cr>
- nnoremap <buffer> <silent> <nowait> t :call <SID>NetrwSplit(1)<cr>
- nnoremap <buffer> <silent> <nowait> Tb :<c-u>call <SID>NetrwSetTgt('b',v:count1)<cr>
- nnoremap <buffer> <silent> <nowait> Th :<c-u>call <SID>NetrwSetTgt('h',v:count)<cr>
- nnoremap <buffer> <silent> <nowait> u :<c-u>call <SID>NetrwBookHistHandler(4,b:netrw_curdir)<cr>
- nnoremap <buffer> <silent> <nowait> U :<c-u>call <SID>NetrwBookHistHandler(5,b:netrw_curdir)<cr>
- nnoremap <buffer> <silent> <nowait> v :call <SID>NetrwSplit(2)<cr>
- nnoremap <buffer> <silent> <nowait> x :call netrw#BrowseX(<SID>NetrwBrowseChgDir(0,<SID>NetrwGetWord()),1)<cr>
- nnoremap <buffer> <silent> <nowait> % :call <SID>NetrwOpenFile(0)<cr>
- " remote insert-mode maps
- inoremap <buffer> <silent> <nowait> <cr> <c-o>:call <SID>NetrwBrowse(0,<SID>NetrwBrowseChgDir(0,<SID>NetrwGetWord()))<cr>
- inoremap <buffer> <silent> <nowait> <c-l> <c-o>:call <SID>NetrwRefresh(0,<SID>NetrwBrowseChgDir(0,'./'))<cr>
- inoremap <buffer> <silent> <nowait> <s-cr> <c-o>:call <SID>TreeSqueezeDir(0)<cr>
- inoremap <buffer> <silent> <nowait> - <c-o>:call <SID>NetrwBrowseUpDir(0)<cr>
- inoremap <buffer> <silent> <nowait> a <c-o>:call <SID>NetrwHide(0)<cr>
- inoremap <buffer> <silent> <nowait> mb <c-o>:<c-u>call <SID>NetrwBookHistHandler(0,b:netrw_curdir)<cr>
- inoremap <buffer> <silent> <nowait> mc <c-o>:<c-u>call <SID>NetrwMarkFileCopy(0)<cr>
- inoremap <buffer> <silent> <nowait> md <c-o>:<c-u>call <SID>NetrwMarkFileDiff(0)<cr>
- inoremap <buffer> <silent> <nowait> me <c-o>:<c-u>call <SID>NetrwMarkFileEdit(0)<cr>
- inoremap <buffer> <silent> <nowait> mf <c-o>:<c-u>call <SID>NetrwMarkFile(0,<SID>NetrwGetWord())<cr>
- inoremap <buffer> <silent> <nowait> mg <c-o>:<c-u>call <SID>NetrwMarkFileGrep(0)<cr>
- inoremap <buffer> <silent> <nowait> mh <c-o>:<c-u>call <SID>NetrwMarkHideSfx(0)<cr>
- inoremap <buffer> <silent> <nowait> mm <c-o>:<c-u>call <SID>NetrwMarkFileMove(0)<cr>
- inoremap <buffer> <silent> <nowait> mp <c-o>:<c-u>call <SID>NetrwMarkFilePrint(0)<cr>
- inoremap <buffer> <silent> <nowait> mr <c-o>:<c-u>call <SID>NetrwMarkFileRegexp(0)<cr>
- inoremap <buffer> <silent> <nowait> ms <c-o>:<c-u>call <SID>NetrwMarkFileSource(0)<cr>
- inoremap <buffer> <silent> <nowait> mt <c-o>:<c-u>call <SID>NetrwMarkFileTgt(0)<cr>
- inoremap <buffer> <silent> <nowait> mT <c-o>:<c-u>call <SID>NetrwMarkFileTag(0)<cr>
- inoremap <buffer> <silent> <nowait> mu <c-o>:<c-u>call <SID>NetrwUnMarkFile(0)<cr>
- nnoremap <buffer> <silent> <nowait> mv :<c-u>call <SID>NetrwMarkFileVimCmd(1)<cr>
- inoremap <buffer> <silent> <nowait> mx <c-o>:<c-u>call <SID>NetrwMarkFileExe(0,0)<cr>
- inoremap <buffer> <silent> <nowait> mX <c-o>:<c-u>call <SID>NetrwMarkFileExe(0,1)<cr>
- inoremap <buffer> <silent> <nowait> mv <c-o>:<c-u>call <SID>NetrwMarkFileVimCmd(0)<cr>
- inoremap <buffer> <silent> <nowait> mz <c-o>:<c-u>call <SID>NetrwMarkFileCompress(0)<cr>
- inoremap <buffer> <silent> <nowait> gb <c-o>:<c-u>call <SID>NetrwBookHistHandler(1,b:netrw_curdir)<cr>
- inoremap <buffer> <silent> <nowait> gh <c-o>:<c-u>call <SID>NetrwHidden(0)<cr>
- inoremap <buffer> <silent> <nowait> gp <c-o>:<c-u>call <SID>NetrwChgPerm(0,b:netrw_curdir)<cr>
- inoremap <buffer> <silent> <nowait> C <c-o>:call <SID>NetrwSetChgwin()<cr>
- inoremap <buffer> <silent> <nowait> i <c-o>:call <SID>NetrwListStyle(0)<cr>
- inoremap <buffer> <silent> <nowait> I <c-o>:call <SID>NetrwBannerCtrl(1)<cr>
- inoremap <buffer> <silent> <nowait> o <c-o>:call <SID>NetrwSplit(0)<cr>
- inoremap <buffer> <silent> <nowait> O <c-o>:call <SID>NetrwObtain(0)<cr>
- inoremap <buffer> <silent> <nowait> p <c-o>:call <SID>NetrwPreview(<SID>NetrwBrowseChgDir(1,<SID>NetrwGetWord(),1))<cr>
- inoremap <buffer> <silent> <nowait> P <c-o>:call <SID>NetrwPrevWinOpen(0)<cr>
- inoremap <buffer> <silent> <nowait> qb <c-o>:<c-u>call <SID>NetrwBookHistHandler(2,b:netrw_curdir)<cr>
- inoremap <buffer> <silent> <nowait> mB <c-o>:<c-u>call <SID>NetrwBookHistHandler(6,b:netrw_curdir)<cr>
- inoremap <buffer> <silent> <nowait> qf <c-o>:<c-u>call <SID>NetrwFileInfo(0,<SID>NetrwGetWord())<cr>
- inoremap <buffer> <silent> <nowait> qF :<c-u>call <SID>NetrwMarkFileQFEL(0,getqflist())<cr>
- inoremap <buffer> <silent> <nowait> r <c-o>:let g:netrw_sort_direction= (g:netrw_sort_direction =~ 'n')? 'r' : 'n'<bar>exe "norm! 0"<bar>call <SID>NetrwBrowse(0,<SID>NetrwBrowseChgDir(0,'./'))<cr>
- inoremap <buffer> <silent> <nowait> s <c-o>:call <SID>NetrwSortStyle(0)<cr>
- inoremap <buffer> <silent> <nowait> S <c-o>:call <SID>NetSortSequence(0)<cr>
- inoremap <buffer> <silent> <nowait> t <c-o>:call <SID>NetrwSplit(1)<cr>
- inoremap <buffer> <silent> <nowait> Tb <c-o>:<c-u>call <SID>NetrwSetTgt('b',v:count1)<cr>
- inoremap <buffer> <silent> <nowait> Th <c-o>:<c-u>call <SID>NetrwSetTgt('h',v:count)<cr>
- inoremap <buffer> <silent> <nowait> u <c-o>:<c-u>call <SID>NetrwBookHistHandler(4,b:netrw_curdir)<cr>
- inoremap <buffer> <silent> <nowait> U <c-o>:<c-u>call <SID>NetrwBookHistHandler(5,b:netrw_curdir)<cr>
- inoremap <buffer> <silent> <nowait> v <c-o>:call <SID>NetrwSplit(2)<cr>
- inoremap <buffer> <silent> <nowait> x <c-o>:call netrw#BrowseX(<SID>NetrwBrowseChgDir(0,<SID>NetrwGetWord()),1)<cr>
- inoremap <buffer> <silent> <nowait> % <c-o>:call <SID>NetrwOpenFile(0)<cr>
+ nnoremap <buffer> <silent> <nowait> qL :<c-u>call <SID>NetrwMarkFileQFEL(0,getloclist(v:count))<cr>
+ nnoremap <buffer> <silent> <nowait> r :<c-u>let g:netrw_sort_direction= (g:netrw_sort_direction =~ 'n')? 'r' : 'n'<bar>exe "norm! 0"<bar>call <SID>NetrwBrowse(0,<SID>NetrwBrowseChgDir(0,'./'))<cr>
+ nnoremap <buffer> <silent> <nowait> s :call <SID>NetrwSortStyle(0)<cr>
+ nnoremap <buffer> <silent> <nowait> S :<c-u>call <SID>NetSortSequence(0)<cr>
+ nnoremap <buffer> <silent> <nowait> Tb :<c-u>call <SID>NetrwSetTgt(0,'b',v:count1)<cr>
+ nnoremap <buffer> <silent> <nowait> t :call <SID>NetrwSplit(1)<cr>
+ nnoremap <buffer> <silent> <nowait> Th :<c-u>call <SID>NetrwSetTgt(0,'h',v:count)<cr>
+ nnoremap <buffer> <silent> <nowait> u :<c-u>call <SID>NetrwBookHistHandler(4,b:netrw_curdir)<cr>
+ nnoremap <buffer> <silent> <nowait> U :<c-u>call <SID>NetrwBookHistHandler(5,b:netrw_curdir)<cr>
+ nnoremap <buffer> <silent> <nowait> v :call <SID>NetrwSplit(2)<cr>
+ nnoremap <buffer> <silent> <nowait> x :<c-u>call netrw#BrowseX(<SID>NetrwBrowseChgDir(0,<SID>NetrwGetWord()),1)<cr>
+" " remote insert-mode maps
+" inoremap <buffer> <silent> <nowait> <cr> <c-o>:call <SID>NetrwBrowse(0,<SID>NetrwBrowseChgDir(0,<SID>NetrwGetWord()))<cr>
+" inoremap <buffer> <silent> <nowait> <c-l> <c-o>:call <SID>NetrwRefresh(0,<SID>NetrwBrowseChgDir(0,'./'))<cr>
+" inoremap <buffer> <silent> <nowait> <s-cr> <c-o>:call <SID>TreeSqueezeDir(0)<cr>
+" inoremap <buffer> <silent> <nowait> - <c-o>:call <SID>NetrwBrowseUpDir(0)<cr>
+" inoremap <buffer> <silent> <nowait> a <c-o>:call <SID>NetrwHide(0)<cr>
+" inoremap <buffer> <silent> <nowait> mb <c-o>:<c-u>call <SID>NetrwBookHistHandler(0,b:netrw_curdir)<cr>
+" inoremap <buffer> <silent> <nowait> mc <c-o>:<c-u>call <SID>NetrwMarkFileCopy(0)<cr>
+" inoremap <buffer> <silent> <nowait> md <c-o>:<c-u>call <SID>NetrwMarkFileDiff(0)<cr>
+" inoremap <buffer> <silent> <nowait> me <c-o>:<c-u>call <SID>NetrwMarkFileEdit(0)<cr>
+" inoremap <buffer> <silent> <nowait> mf <c-o>:<c-u>call <SID>NetrwMarkFile(0,<SID>NetrwGetWord())<cr>
+" inoremap <buffer> <silent> <nowait> mg <c-o>:<c-u>call <SID>NetrwMarkFileGrep(0)<cr>
+" inoremap <buffer> <silent> <nowait> mh <c-o>:<c-u>call <SID>NetrwMarkHideSfx(0)<cr>
+" inoremap <buffer> <silent> <nowait> mm <c-o>:<c-u>call <SID>NetrwMarkFileMove(0)<cr>
+" inoremap <buffer> <silent> <nowait> mp <c-o>:<c-u>call <SID>NetrwMarkFilePrint(0)<cr>
+" inoremap <buffer> <silent> <nowait> mr <c-o>:<c-u>call <SID>NetrwMarkFileRegexp(0)<cr>
+" inoremap <buffer> <silent> <nowait> ms <c-o>:<c-u>call <SID>NetrwMarkFileSource(0)<cr>
+" inoremap <buffer> <silent> <nowait> mt <c-o>:<c-u>call <SID>NetrwMarkFileTgt(0)<cr>
+" inoremap <buffer> <silent> <nowait> mT <c-o>:<c-u>call <SID>NetrwMarkFileTag(0)<cr>
+" inoremap <buffer> <silent> <nowait> mu <c-o>:<c-u>call <SID>NetrwUnMarkFile(0)<cr>
+" nnoremap <buffer> <silent> <nowait> mv :<c-u>call <SID>NetrwMarkFileVimCmd(1)<cr>
+" inoremap <buffer> <silent> <nowait> mx <c-o>:<c-u>call <SID>NetrwMarkFileExe(0,0)<cr>
+" inoremap <buffer> <silent> <nowait> mX <c-o>:<c-u>call <SID>NetrwMarkFileExe(0,1)<cr>
+" inoremap <buffer> <silent> <nowait> mv <c-o>:<c-u>call <SID>NetrwMarkFileVimCmd(0)<cr>
+" inoremap <buffer> <silent> <nowait> mz <c-o>:<c-u>call <SID>NetrwMarkFileCompress(0)<cr>
+" inoremap <buffer> <silent> <nowait> gb <c-o>:<c-u>call <SID>NetrwBookHistHandler(1,b:netrw_curdir)<cr>
+" inoremap <buffer> <silent> <nowait> gh <c-o>:<c-u>call <SID>NetrwHidden(0)<cr>
+" inoremap <buffer> <silent> <nowait> gp <c-o>:<c-u>call <SID>NetrwChgPerm(0,b:netrw_curdir)<cr>
+" inoremap <buffer> <silent> <nowait> C <c-o>:call <SID>NetrwSetChgwin()<cr>
+" inoremap <buffer> <silent> <nowait> i <c-o>:call <SID>NetrwListStyle(0)<cr>
+" inoremap <buffer> <silent> <nowait> I <c-o>:call <SID>NetrwBannerCtrl(1)<cr>
+" inoremap <buffer> <silent> <nowait> o <c-o>:call <SID>NetrwSplit(0)<cr>
+" inoremap <buffer> <silent> <nowait> O <c-o>:call <SID>NetrwObtain(0)<cr>
+" inoremap <buffer> <silent> <nowait> p <c-o>:call <SID>NetrwPreview(<SID>NetrwBrowseChgDir(1,<SID>NetrwGetWord(),1))<cr>
+" inoremap <buffer> <silent> <nowait> P <c-o>:call <SID>NetrwPrevWinOpen(0)<cr>
+" inoremap <buffer> <silent> <nowait> qb <c-o>:<c-u>call <SID>NetrwBookHistHandler(2,b:netrw_curdir)<cr>
+" inoremap <buffer> <silent> <nowait> mB <c-o>:<c-u>call <SID>NetrwBookHistHandler(6,b:netrw_curdir)<cr>
+" inoremap <buffer> <silent> <nowait> qf <c-o>:<c-u>call <SID>NetrwFileInfo(0,<SID>NetrwGetWord())<cr>
+" inoremap <buffer> <silent> <nowait> qF :<c-u>call <SID>NetrwMarkFileQFEL(0,getqflist())<cr>
+" inoremap <buffer> <silent> <nowait> qL :<c-u>call <SID>NetrwMarkFileQFEL(0,getloclist(v:count))<cr>
+" inoremap <buffer> <silent> <nowait> r <c-o>:let g:netrw_sort_direction= (g:netrw_sort_direction =~ 'n')? 'r' : 'n'<bar>exe "norm! 0"<bar>call <SID>NetrwBrowse(0,<SID>NetrwBrowseChgDir(0,'./'))<cr>
+" inoremap <buffer> <silent> <nowait> s <c-o>:call <SID>NetrwSortStyle(0)<cr>
+" inoremap <buffer> <silent> <nowait> S <c-o>:call <SID>NetSortSequence(0)<cr>
+" inoremap <buffer> <silent> <nowait> t <c-o>:call <SID>NetrwSplit(1)<cr>
+" inoremap <buffer> <silent> <nowait> Tb <c-o>:<c-u>call <SID>NetrwSetTgt('b',v:count1)<cr>
+" inoremap <buffer> <silent> <nowait> Th <c-o>:<c-u>call <SID>NetrwSetTgt('h',v:count)<cr>
+" inoremap <buffer> <silent> <nowait> u <c-o>:<c-u>call <SID>NetrwBookHistHandler(4,b:netrw_curdir)<cr>
+" inoremap <buffer> <silent> <nowait> U <c-o>:<c-u>call <SID>NetrwBookHistHandler(5,b:netrw_curdir)<cr>
+" inoremap <buffer> <silent> <nowait> v <c-o>:call <SID>NetrwSplit(2)<cr>
+" inoremap <buffer> <silent> <nowait> x <c-o>:call netrw#BrowseX(<SID>NetrwBrowseChgDir(0,<SID>NetrwGetWord()),1)<cr>
+" inoremap <buffer> <silent> <nowait> % <c-o>:call <SID>NetrwOpenFile(0)<cr>
if !hasmapto('<Plug>NetrwHideEdit')
nmap <buffer> <c-h> <Plug>NetrwHideEdit
- imap <buffer> <c-h> <Plug>NetrwHideEdit
+" imap <buffer> <c-h> <Plug>NetrwHideEdit
endif
nnoremap <buffer> <silent> <Plug>NetrwHideEdit :call <SID>NetrwHideEdit(0)<cr>
if !hasmapto('<Plug>NetrwRefresh')
nmap <buffer> <c-l> <Plug>NetrwRefresh
- imap <buffer> <c-l> <Plug>NetrwRefresh
+" imap <buffer> <c-l> <Plug>NetrwRefresh
endif
+ if !hasmapto('<Plug>NetrwTreeSqueeze')
+ nmap <buffer> <silent> <nowait> <s-cr> <Plug>NetrwTreeSqueeze
+" imap <buffer> <silent> <nowait> <s-cr> <c-o><Plug>NetrwTreeSqueeze
+ endif
+ nnoremap <buffer> <silent> <Plug>NetrwTreeSqueeze :call <SID>TreeSqueezeDir(0)<cr>
let mapsafepath = escape(s:path, s:netrw_map_escape)
let mapsafeusermach = escape(((s:user == "")? "" : s:user."@").s:machine, s:netrw_map_escape)
@@ -6226,14 +6355,14 @@ fun! s:NetrwMaps(islocal)
nmap <buffer> <2-leftmouse> <Plug>Netrw2Leftmouse
nmap <buffer> <silent> <Plug>Netrw2Leftmouse -
imap <buffer> <leftmouse> <Plug>ILeftmouse
- ino <buffer> <silent> <Plug>ILeftmouse <c-o><leftmouse><c-o>:call <SID>NetrwLeftmouse(0)<cr>
+" ino <buffer> <silent> <Plug>ILeftmouse <c-o><leftmouse><c-o>:call <SID>NetrwLeftmouse(0)<cr>
imap <buffer> <middlemouse> <Plug>IMiddlemouse
- ino <buffer> <silent> <Plug>IMiddlemouse <c-o><leftmouse><c-o>:call <SID>NetrwPrevWinOpen(0)<cr>
+" ino <buffer> <silent> <Plug>IMiddlemouse <c-o><leftmouse><c-o>:call <SID>NetrwPrevWinOpen(0)<cr>
imap <buffer> <s-leftmouse> <Plug>ISLeftmouse
- ino <buffer> <silent> <Plug>ISLeftmouse <c-o><leftmouse><c-o>:call <SID>NetrwMarkFile(0,<SID>NetrwGetWord())<cr>
+" ino <buffer> <silent> <Plug>ISLeftmouse <c-o><leftmouse><c-o>:call <SID>NetrwMarkFile(0,<SID>NetrwGetWord())<cr>
exe 'nnoremap <buffer> <silent> <rightmouse> <leftmouse>:call <SID>NetrwRemoteRm("'.mapsafeusermach.'","'.mapsafepath.'")<cr>'
exe 'vnoremap <buffer> <silent> <rightmouse> <leftmouse>:call <SID>NetrwRemoteRm("'.mapsafeusermach.'","'.mapsafepath.'")<cr>'
- exe 'inoremap <buffer> <silent> <rightmouse> <c-o><leftmouse><c-o>:call <SID>NetrwRemoteRm("'.mapsafeusermach.'","'.mapsafepath.'")<cr>'
+" exe 'inoremap <buffer> <silent> <rightmouse> <c-o><leftmouse><c-o>:call <SID>NetrwRemoteRm("'.mapsafeusermach.'","'.mapsafepath.'")<cr>'
endif
exe 'nnoremap <buffer> <silent> <nowait> <del> :call <SID>NetrwRemoteRm("'.mapsafeusermach.'","'.mapsafepath.'")<cr>'
exe 'nnoremap <buffer> <silent> <nowait> d :call <SID>NetrwMakeDir("'.mapsafeusermach.'")<cr>'
@@ -6242,12 +6371,12 @@ fun! s:NetrwMaps(islocal)
exe 'vnoremap <buffer> <silent> <nowait> <del> :call <SID>NetrwRemoteRm("'.mapsafeusermach.'","'.mapsafepath.'")<cr>'
exe 'vnoremap <buffer> <silent> <nowait> D :call <SID>NetrwRemoteRm("'.mapsafeusermach.'","'.mapsafepath.'")<cr>'
exe 'vnoremap <buffer> <silent> <nowait> R :call <SID>NetrwRemoteRename("'.mapsafeusermach.'","'.mapsafepath.'")<cr>'
- exe 'inoremap <buffer> <silent> <nowait> <del> <c-o>:call <SID>NetrwRemoteRm("'.mapsafeusermach.'","'.mapsafepath.'")<cr>'
- exe 'inoremap <buffer> <silent> <nowait> d <c-o>:call <SID>NetrwMakeDir("'.mapsafeusermach.'")<cr>'
- exe 'inoremap <buffer> <silent> <nowait> D <c-o>:call <SID>NetrwRemoteRm("'.mapsafeusermach.'","'.mapsafepath.'")<cr>'
- exe 'inoremap <buffer> <silent> <nowait> R <c-o>:call <SID>NetrwRemoteRename("'.mapsafeusermach.'","'.mapsafepath.'")<cr>'
+" exe 'inoremap <buffer> <silent> <nowait> <del> <c-o>:call <SID>NetrwRemoteRm("'.mapsafeusermach.'","'.mapsafepath.'")<cr>'
+" exe 'inoremap <buffer> <silent> <nowait> d <c-o>:call <SID>NetrwMakeDir("'.mapsafeusermach.'")<cr>'
+" exe 'inoremap <buffer> <silent> <nowait> D <c-o>:call <SID>NetrwRemoteRm("'.mapsafeusermach.'","'.mapsafepath.'")<cr>'
+" exe 'inoremap <buffer> <silent> <nowait> R <c-o>:call <SID>NetrwRemoteRename("'.mapsafeusermach.'","'.mapsafepath.'")<cr>'
nnoremap <buffer> <F1> :he netrw-quickhelp<cr>
- inoremap <buffer> <F1> <c-o>:he netrw-quickhelp<cr>
+" inoremap <buffer> <F1> <c-o>:he netrw-quickhelp<cr>
" support user-specified maps
call netrw#UserMaps(0)
@@ -6257,7 +6386,7 @@ fun! s:NetrwMaps(islocal)
endfun
" ---------------------------------------------------------------------
-" s:NetrwCommands: sets up commands {{{2
+" s:NetrwCommands: set up commands {{{2
" If -buffer, the command is only available from within netrw buffers
" Otherwise, the command is available from any window, so long as netrw
" has been used at least once in the session.
@@ -6266,7 +6395,7 @@ fun! s:NetrwCommands(islocal)
com! -nargs=* -complete=file -bang NetrwMB call s:NetrwBookmark(<bang>0,<f-args>)
com! -nargs=* NetrwC call s:NetrwSetChgwin(<q-args>)
- com! Rexplore if exists("w:netrw_rexlocal")|call s:NetrwRexplore(w:netrw_rexlocal,exists("w:netrw_rexdir")? w:netrw_rexdir : ".")|else|call netrw#ErrorMsg(s:WARNING,"not a former netrw window",79)|endif
+ com! Rexplore if exists("w:netrw_rexlocal")|call s:NetrwRexplore(w:netrw_rexlocal,exists("w:netrw_rexdir")? w:netrw_rexdir : ".")|else|call netrw#ErrorMsg(s:WARNING,"win#".winnr()." not a former netrw window",79)|endif
if a:islocal
com! -buffer -nargs=+ -complete=file MF call s:NetrwMarkFiles(1,<f-args>)
else
@@ -6319,9 +6448,11 @@ fun! s:NetrwMarkTarget(...)
let s:netrwmftgt = tgt
let s:netrwmftgt_islocal = tgt !~ '^\a\{3,}://'
let curislocal = b:netrw_curdir !~ '^\a\{3,}://'
- let svpos = netrw#SavePosn()
+ let svpos = winsaveview()
+" call Decho("saving posn to svpos<".string(svpos).">",'~'.expand("<slnum>"))
call s:NetrwRefresh(curislocal,s:NetrwBrowseChgDir(curislocal,'./'))
- call netrw#RestorePosn(svpos)
+" call Decho("restoring posn to svpos<".string(svpos).">",'~'.expand("<slnum>"))
+ call winrestview(svpos)
" call Dret("s:NetrwMarkTarget")
endfun
@@ -6460,6 +6591,48 @@ fun! s:NetrwMarkFile(islocal,fname)
endfun
" ---------------------------------------------------------------------
+" s:NetrwMarkFileArgList: ma: move the marked file list to the argument list (tomflist=0) {{{2
+" mA: move the argument list to marked file list (tomflist=1)
+" Uses the global marked file list
+fun! s:NetrwMarkFileArgList(islocal,tomflist)
+" call Dfunc("s:NetrwMarkFileArgList(islocal=".a:islocal.",tomflist=".a:tomflist.")")
+
+ let svpos = winsaveview()
+" call Decho("saving posn to svpos<".string(svpos).">",'~'.expand("<slnum>"))
+ let curdir = s:NetrwGetCurdir(a:islocal)
+ let curbufnr = bufnr("%")
+
+ if a:tomflist
+ " mA: move argument list to marked file list
+ while argc()
+ let fname= argv(0)
+" call Decho("exe argdel ".fname,'~'.expand("<slnum>"))
+ exe "argdel ".fnameescape(fname)
+ call s:NetrwMarkFile(a:islocal,fname)
+ endwhile
+
+ else
+ " ma: move marked file list to argument list
+ if exists("s:netrwmarkfilelist")
+
+ " for every filename in the marked list
+ for fname in s:netrwmarkfilelist
+" call Decho("exe argadd ".fname,'~'.expand("<slnum>"))
+ exe "argadd ".fnameescape(fname)
+ endfor " for every file in the marked list
+
+ " unmark list and refresh
+ call s:NetrwUnmarkList(curbufnr,curdir)
+ NetrwKeepj call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./'))
+" call Decho("restoring posn to svpos<".string(svpos).">",'~'.expand("<slnum>"))
+ NetrwKeepj call winrestview(svpos)
+ endif
+ endif
+
+" call Dret("s:NetrwMarkFileArgList")
+endfun
+
+" ---------------------------------------------------------------------
" s:NetrwMarkFileCompress: (invoked by mz) This function is used to {{{2
" compress/decompress files using the programs
" in g:netrw_compress and g:netrw_uncompress,
@@ -6469,7 +6642,8 @@ endfun
" g:netrw_decompress = { ".gz" : "gunzip" , ".bz2" : "bunzip2" , ".zip" : "unzip" , ".tar" : "tar -xf", ".xz" : "unxz"}
fun! s:NetrwMarkFileCompress(islocal)
" call Dfunc("s:NetrwMarkFileCompress(islocal=".a:islocal.")")
- let svpos = netrw#SavePosn()
+ let svpos = winsaveview()
+" call Decho("saving posn to svpos<".string(svpos).">",'~'.expand("<slnum>"))
let curdir = s:NetrwGetCurdir(a:islocal)
let curbufnr = bufnr("%")
@@ -6524,7 +6698,8 @@ fun! s:NetrwMarkFileCompress(islocal)
call s:NetrwUnmarkList(curbufnr,curdir)
NetrwKeepj call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./'))
- NetrwKeepj call netrw#RestorePosn(svpos)
+" call Decho("restoring posn to svpos<".string(svpos).">",'~'.expand("<slnum>"))
+ NetrwKeepj call winrestview(svpos)
endif
" call Dret("s:NetrwMarkFileCompress")
endfun
@@ -6541,6 +6716,12 @@ fun! s:NetrwMarkFileCopy(islocal,...)
let curdir = s:NetrwGetCurdir(a:islocal)
let curbufnr = bufnr("%")
+ if b:netrw_curdir !~ '/$'
+ if !exists("b:netrw_curdir")
+ let b:netrw_curdir= curdir
+ endif
+ let b:netrw_curdir= b:netrw_curdir."/"
+ endif
" sanity check
if !exists("s:netrwmarkfilelist_{curbufnr}") || empty(s:netrwmarkfilelist_{curbufnr})
@@ -6557,7 +6738,7 @@ fun! s:NetrwMarkFileCopy(islocal,...)
endif
" call Decho("sanity chk passed: s:netrwmftgt<".s:netrwmftgt.">",'~'.expand("<slnum>"))
- if a:islocal && s:netrwmftgt_islocal
+ if a:islocal && s:netrwmftgt_islocal
" Copy marked files, local directory to local directory
" call Decho("copy from local to local",'~'.expand("<slnum>"))
if !executable(g:netrw_localcopycmd) && g:netrw_localcopycmd !~ '^'.expand("$COMSPEC").'\s'
@@ -6571,12 +6752,12 @@ fun! s:NetrwMarkFileCopy(islocal,...)
if len(s:netrwmarkfilelist_{bufnr('%')}) == 1
" only one marked file
" call Decho("case: only one marked file",'~'.expand("<slnum>"))
- let args = s:ShellEscape(b:netrw_curdir."/".s:netrwmarkfilelist_{bufnr('%')}[0])
+ let args = s:ShellEscape(b:netrw_curdir.s:netrwmarkfilelist_{bufnr('%')}[0])
let oldname = s:netrwmarkfilelist_{bufnr('%')}[0]
elseif a:0 == 1
" call Decho("case: handling one input argument",'~'.expand("<slnum>"))
" this happens when the next case was used to recursively call s:NetrwMarkFileCopy()
- let args = s:ShellEscape(b:netrw_curdir."/".a:1)
+ let args = s:ShellEscape(b:netrw_curdir.a:1)
let oldname = a:1
else
" copy multiple marked files inside the same directory
@@ -6611,9 +6792,12 @@ fun! s:NetrwMarkFileCopy(islocal,...)
let args= substitute(args,'/','\\','g')
let tgt = substitute(tgt, '/','\\','g')
endif
- if args =~ "'"|let args= substitute(args,"'\\(.*\\)'",'\1','')|endif
- if tgt =~ "'"|let tgt = substitute(tgt,"'\\(.*\\)'",'\1','') |endif
- if args =~ '//$'|let args= substitute(args,'//$','/','')|endif
+ if args =~ "'" |let args= substitute(args,"'\\(.*\\)'",'\1','')|endif
+ if tgt =~ "'" |let tgt = substitute(tgt ,"'\\(.*\\)'",'\1','')|endif
+ if args =~ '//'|let args= substitute(args,'//','/','g')|endif
+ if tgt =~ '//'|let tgt = substitute(tgt ,'//','/','g')|endif
+" call Decho("args <".args.">",'~'.expand("<slnum>"))
+" call Decho("tgt <".tgt.">",'~'.expand("<slnum>"))
if isdirectory(s:NetrwFile(args))
" call Decho("args<".args."> is a directory",'~'.expand("<slnum>"))
let copycmd= g:netrw_localcopydircmd
@@ -6688,11 +6872,17 @@ fun! s:NetrwMarkFileCopy(islocal,...)
NetrwKeepj call s:NetrwDelete(fname)
endfor
call s:NetrwLcd(curdir)
- call s:NetrwExe("sil !".g:netrw_localrmdir." ".s:ShellEscape(tmpdir,1))
- if v:shell_error != 0
- call netrw#ErrorMsg(s:WARNING,"consider setting g:netrw_localrmdir<".g:netrw_localrmdir."> to something that works",80)
-" call Dret("s:NetrwMarkFileCopy : failed: sil !".g:netrw_localrmdir." ".s:ShellEscape(tmpdir,1) )
- return
+ if v:version < 704 || !has("patch1109")
+ call s:NetrwExe("sil !".g:netrw_localrmdir." ".s:ShellEscape(tmpdir,1))
+ if v:shell_error != 0
+ call netrw#ErrorMsg(s:WARNING,"consider setting g:netrw_localrmdir<".g:netrw_localrmdir."> to something that works",80)
+" " call Dret("s:NetrwMarkFileCopy : failed: sil !".g:netrw_localrmdir." ".s:ShellEscape(tmpdir,1) )
+ return
+ endif
+ else
+ if delete(tmpdir,"d")
+ call netrw#ErrorMsg(s:ERROR,"unable to delete directory <".tmpdir.">!",103)
+ endif
endif
else
call s:NetrwLcd(curdir)
@@ -6703,21 +6893,38 @@ fun! s:NetrwMarkFileCopy(islocal,...)
" -------
" cleanup
" -------
-" call Decho("cleanup",'~'.expand("<slnum>"))
- if !exists("s:recursive")
- " remove markings from local buffer
- call s:NetrwUnmarkList(curbufnr,curdir)
- endif
-
- " refresh buffers
- if !s:netrwmftgt_islocal
- call s:NetrwRefreshDir(s:netrwmftgt_islocal,s:netrwmftgt)
- endif
- if a:islocal
- NetrwKeepj call s:NetrwRefreshDir(a:islocal,curdir)
+" call Decho("cleanup",'~'.expand("<slnum>"))
+" call Decho(" g:netrw_fastbrowse =".g:netrw_fastbrowse,'~'.expand("<slnum>"))
+" call Decho(" s:netrwmftgt =".s:netrwmftgt,'~'.expand("<slnum>"))
+" call Decho(" s:netrwmftgt_islocal=".s:netrwmftgt_islocal,'~'.expand("<slnum>"))
+" call Decho(" curdir =".curdir,'~'.expand("<slnum>"))
+" call Decho(" a:islocal =".a:islocal,'~'.expand("<slnum>"))
+" call Decho(" curbufnr =".curbufnr,'~'.expand("<slnum>"))
+ if exists("s:recursive")
+" call Decho(" s:recursive =".s:recursive,'~'.expand("<slnum>"))
+ else
+" call Decho(" s:recursive =n/a",'~'.expand("<slnum>"))
endif
+ " see s:LocalFastBrowser() for g:netrw_fastbrowse interpretation (refreshing done for both slow and medium)
if g:netrw_fastbrowse <= 1
NetrwKeepj call s:LocalBrowseRefresh()
+ else
+ " refresh local and targets for fast browsing
+ if !exists("s:recursive")
+ " remove markings from local buffer
+" call Decho(" remove markings from local buffer",'~'.expand("<slnum>"))
+ NetrwKeepj call s:NetrwUnmarkList(curbufnr,curdir)
+ endif
+
+ " refresh buffers
+ if s:netrwmftgt_islocal
+" call Decho(" refresh s:netrwmftgt=".s:netrwmftgt,'~'.expand("<slnum>"))
+ NetrwKeepj call s:NetrwRefreshDir(s:netrwmftgt_islocal,s:netrwmftgt)
+ endif
+ if a:islocal && s:netrwmftgt != curdir
+" call Decho(" refresh curdir=".curdir,'~'.expand("<slnum>"))
+ NetrwKeepj call s:NetrwRefreshDir(a:islocal,curdir)
+ endif
endif
" call Dret("s:NetrwMarkFileCopy 1")
@@ -6798,7 +7005,7 @@ fun! s:NetrwMarkFileEdit(islocal)
endfun
" ---------------------------------------------------------------------
-" s:NetrwMarkFileQFEL: convert a quickfix-error list into a marked file list {{{2
+" s:NetrwMarkFileQFEL: convert a quickfix-error or location list into a marked file list {{{2
fun! s:NetrwMarkFileQFEL(islocal,qfel)
" call Dfunc("s:NetrwMarkFileQFEL(islocal=".a:islocal.",qfel)")
call s:NetrwUnmarkAll()
@@ -6834,7 +7041,8 @@ endfun
" mX enbloc=1: Uses the global marked-file list, applies command to entire list
fun! s:NetrwMarkFileExe(islocal,enbloc)
" call Dfunc("s:NetrwMarkFileExe(islocal=".a:islocal.",enbloc=".a:enbloc.")")
- let svpos = netrw#SavePosn()
+ let svpos = winsaveview()
+" call Decho("saving posn to svpos<".string(svpos).">",'~'.expand("<slnum>"))
let curdir = s:NetrwGetCurdir(a:islocal)
let curbufnr = bufnr("%")
@@ -6894,7 +7102,8 @@ fun! s:NetrwMarkFileExe(islocal,enbloc)
" refresh the listing
NetrwKeepj call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./'))
- NetrwKeepj call netrw#RestorePosn(svpos)
+" call Decho("restoring posn to svpos<".string(svpos).">",'~'.expand("<slnum>"))
+ NetrwKeepj call winrestview(svpos)
else
NetrwKeepj call netrw#ErrorMsg(s:ERROR,"no files marked!",59)
endif
@@ -6926,7 +7135,8 @@ fun! s:NetrwMarkFileExe(islocal,enbloc)
" refresh the listing
NetrwKeepj call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./'))
- NetrwKeepj call netrw#RestorePosn(svpos)
+" call Decho("restoring posn to svpos<".string(svpos).">",'~'.expand("<slnum>"))
+ NetrwKeepj call winrestview(svpos)
endif
@@ -6939,7 +7149,8 @@ endfun
" Uses the local marked file list.
fun! s:NetrwMarkHideSfx(islocal)
" call Dfunc("s:NetrwMarkHideSfx(islocal=".a:islocal.")")
- let svpos = netrw#SavePosn()
+ let svpos = winsaveview()
+" call Decho("saving posn to svpos<".string(svpos).">",'~'.expand("<slnum>"))
let curbufnr = bufnr("%")
" s:netrwmarkfilelist_{curbufnr}: the List of marked files
@@ -6982,7 +7193,8 @@ fun! s:NetrwMarkHideSfx(islocal)
" refresh the listing
NetrwKeepj call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./'))
- NetrwKeepj call netrw#RestorePosn(svpos)
+" call Decho("restoring posn to svpos<".string(svpos).">",'~'.expand("<slnum>"))
+ NetrwKeepj call winrestview(svpos)
else
NetrwKeepj call netrw#ErrorMsg(s:ERROR,"no files marked!",59)
endif
@@ -6995,7 +7207,8 @@ endfun
" Uses the local marked-file list.
fun! s:NetrwMarkFileVimCmd(islocal)
" call Dfunc("s:NetrwMarkFileVimCmd(islocal=".a:islocal.")")
- let svpos = netrw#SavePosn()
+ let svpos = winsaveview()
+" call Decho("saving posn to svpos<".string(svpos).">",'~'.expand("<slnum>"))
let curdir = s:NetrwGetCurdir(a:islocal)
let curbufnr = bufnr("%")
@@ -7039,7 +7252,8 @@ fun! s:NetrwMarkFileVimCmd(islocal)
" refresh the listing
NetrwKeepj call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./'))
- NetrwKeepj call netrw#RestorePosn(svpos)
+" call Decho("restoring posn to svpos<".string(svpos).">",'~'.expand("<slnum>"))
+ NetrwKeepj call winrestview(svpos)
else
NetrwKeepj call netrw#ErrorMsg(s:ERROR,"no files marked!",59)
endif
@@ -7053,7 +7267,8 @@ endfun
" Uses the local marked file list.
fun! s:NetrwMarkHideSfx(islocal)
" call Dfunc("s:NetrwMarkHideSfx(islocal=".a:islocal.")")
- let svpos = netrw#SavePosn()
+ let svpos = winsaveview()
+" call Decho("saving posn to svpos<".string(svpos).">",'~'.expand("<slnum>"))
let curbufnr = bufnr("%")
" s:netrwmarkfilelist_{curbufnr}: the List of marked files
@@ -7096,7 +7311,8 @@ fun! s:NetrwMarkHideSfx(islocal)
" refresh the listing
NetrwKeepj call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./'))
- NetrwKeepj call netrw#RestorePosn(svpos)
+" call Decho("restoring posn to svpos<".string(svpos).">",'~'.expand("<slnum>"))
+ NetrwKeepj call winrestview(svpos)
else
NetrwKeepj call netrw#ErrorMsg(s:ERROR,"no files marked!",59)
endif
@@ -7109,7 +7325,8 @@ endfun
" Uses the global markfilelist
fun! s:NetrwMarkFileGrep(islocal)
" call Dfunc("s:NetrwMarkFileGrep(islocal=".a:islocal.")")
- let svpos = netrw#SavePosn()
+ let svpos = winsaveview()
+" call Decho("saving posn to svpos<".string(svpos).">",'~'.expand("<slnum>"))
let curbufnr = bufnr("%")
let curdir = s:NetrwGetCurdir(a:islocal)
@@ -7150,7 +7367,8 @@ fun! s:NetrwMarkFileGrep(islocal)
echo "(use :cn, :cp to navigate, :Rex to return)"
2match none
- NetrwKeepj call netrw#RestorePosn(svpos)
+" call Decho("restoring posn to svpos<".string(svpos).">",'~'.expand("<slnum>"))
+ NetrwKeepj call winrestview(svpos)
if exists("nonisi")
" original, user-supplied pattern did not begin with a character from isident
@@ -7456,7 +7674,8 @@ endfun
" Uses the global markfilelist
fun! s:NetrwMarkFileTag(islocal)
" call Dfunc("s:NetrwMarkFileTag(islocal=".a:islocal.")")
- let svpos = netrw#SavePosn()
+ let svpos = winsaveview()
+" call Decho("saving posn to svpos<".string(svpos).">",'~'.expand("<slnum>"))
let curdir = s:NetrwGetCurdir(a:islocal)
let curbufnr = bufnr("%")
@@ -7494,7 +7713,8 @@ fun! s:NetrwMarkFileTag(islocal)
endif
2match none
call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./'))
- call netrw#RestorePosn(svpos)
+" call Decho("restoring posn to svpos<".string(svpos).">",'~'.expand("<slnum>"))
+ call winrestview(svpos)
endif
" call Dret("s:NetrwMarkFileTag")
@@ -7507,8 +7727,9 @@ endfun
" s:netrwmftgt_islocal : 0=target directory is remote
" 1=target directory is local
fun! s:NetrwMarkFileTgt(islocal)
-" call Dfunc("s:NetrwMarkFileTgt(islocal=".a:islocal.")")
- let svpos = netrw#SavePosn()
+" call Dfunc("s:NetrwMarkFileTgt(islocal=".a:islocal.")")
+ let svpos = winsaveview()
+" call Decho("saving posn to svpos<".string(svpos).">",'~'.expand("<slnum>"))
let curdir = s:NetrwGetCurdir(a:islocal)
let hadtgt = exists("s:netrwmftgt")
if !exists("w:netrw_bannercnt")
@@ -7526,7 +7747,8 @@ fun! s:NetrwMarkFileTgt(islocal)
call s:LocalBrowseRefresh()
endif
call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./'))
- call netrw#RestorePosn(svpos)
+" call Decho("restoring posn to svpos<".string(svpos).">",'~'.expand("<slnum>"))
+ call winrestview(svpos)
" call Dret("s:NetrwMarkFileTgt : removed target")
return
else
@@ -7570,12 +7792,13 @@ fun! s:NetrwMarkFileTgt(islocal)
call s:LocalBrowseRefresh()
endif
" call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./'))
- if w:netrw_liststyle == s:TREELIST
+ if exists("w:netrw_liststyle") && w:netrw_liststyle == s:TREELIST
call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,w:netrw_treetop))
else
call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./'))
endif
- call netrw#RestorePosn(svpos)
+" call Decho("restoring posn to svpos<".string(svpos).">",'~'.expand("<slnum>"))
+ call winrestview(svpos)
if !hadtgt
sil! NetrwKeepj norm! j
endif
@@ -7590,7 +7813,7 @@ endfun
fun! s:NetrwGetCurdir(islocal)
" call Dfunc("s:NetrwGetCurdir(islocal=".a:islocal.")")
- if w:netrw_liststyle == s:TREELIST
+ if exists("w:netrw_liststyle") && w:netrw_liststyle == s:TREELIST
let b:netrw_curdir = s:NetrwTreePath(w:netrw_treetop)
" call Decho("set b:netrw_curdir<".b:netrw_curdir."> (used s:NetrwTreeDir)",'~'.expand("<slnum>"))
elseif !exists("b:netrw_curdir")
@@ -7626,8 +7849,8 @@ fun! s:NetrwOpenFile(islocal)
endif
let g:netrw_quiet = 1
" save position for benefit of Rexplore
- let s:rexposn_{bufnr("%")}= netrw#SavePosn()
-" call Decho("setting s:rexposn_".bufnr("%")."<".bufname("%")."> to SavePosn",'~'.expand("<slnum>"))
+ let s:rexposn_{bufnr("%")}= winsaveview()
+" call Decho("saving posn to s:rexposn_".bufnr("%")."<".string(s:rexposn_{bufnr("%")}).">",'~'.expand("<slnum>"))
if b:netrw_curdir =~ '/$'
exe "NetrwKeepj e ".fnameescape(b:netrw_curdir.fname)
else
@@ -7702,7 +7925,8 @@ fun! s:NetSortSequence(islocal)
" call Dfunc("NetSortSequence(islocal=".a:islocal.")")
let ykeep= @@
- let svpos= netrw#SavePosn()
+ let svpos= winsaveview()
+" call Decho("saving posn to svpos<".string(svpos).">",'~'.expand("<slnum>"))
call inputsave()
let newsortseq= input("Edit Sorting Sequence: ",g:netrw_sort_sequence)
call inputrestore()
@@ -7710,7 +7934,8 @@ fun! s:NetSortSequence(islocal)
" refresh the listing
let g:netrw_sort_sequence= newsortseq
NetrwKeepj call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./'))
- NetrwKeepj call netrw#RestorePosn(svpos)
+" call Decho("restoring posn to svpos<".string(svpos).">",'~'.expand("<slnum>"))
+ NetrwKeepj call winrestview(svpos)
let @@= ykeep
" call Dret("NetSortSequence")
@@ -7785,7 +8010,8 @@ endfun
" s:netrwmarkfilemtch_# -- used with 2match to display marked files
fun! s:NetrwUnMarkFile(islocal)
" call Dfunc("s:NetrwUnMarkFile(islocal=".a:islocal.")")
- let svpos = netrw#SavePosn()
+ let svpos = winsaveview()
+" call Decho("saving posn to svpos<".string(svpos).">",'~'.expand("<slnum>"))
let curbufnr = bufnr("%")
" unmark marked file list
@@ -7806,7 +8032,8 @@ fun! s:NetrwUnMarkFile(islocal)
2match none
" call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./'))
- call netrw#RestorePosn(svpos)
+"call Decho("restoring posn to svpos<".string(svpos).">",'~'.expand("<slnum>"))
+call winrestview(svpos)
" call Dret("s:NetrwUnMarkFile")
endfun
@@ -8276,7 +8503,8 @@ fun! s:NetrwRefresh(islocal,dirname)
let ykeep = @@
" save the cursor position before refresh.
- let screenposn = netrw#SavePosn()
+ let screenposn = winsaveview()
+" call Decho("saving posn to screenposn<".string(screenposn).">",'~'.expand("<slnum>"))
" call Decho("win#".winnr().": ".winheight(0)."x".winwidth(0)." curfile<".expand("%").">",'~'.expand("<slnum>"))
" call Decho("clearing buffer prior to refresh",'~'.expand("<slnum>"))
@@ -8288,7 +8516,8 @@ fun! s:NetrwRefresh(islocal,dirname)
endif
" restore position
- NetrwKeepj call netrw#RestorePosn(screenposn)
+" call Decho("restoring posn to screenposn<".string(screenposn).">",'~'.expand("<slnum>"))
+ NetrwKeepj call winrestview(screenposn)
" restore file marks
if exists("s:netrwmarkfilemtch_{bufnr('%')}") && s:netrwmarkfilemtch_{bufnr("%")} != ""
@@ -8439,8 +8668,8 @@ endfun
" Implements [count]Tb (bookhist<b>)
" [count]Th (bookhist<h>)
" See :help netrw-qb for how to make the choice.
-fun! s:NetrwSetTgt(bookhist,choice)
-" call Dfunc("s:NetrwSetTgt(bookhist<".a:bookhist."> choice#".a:choice.")")
+fun! s:NetrwSetTgt(islocal,bookhist,choice)
+" call Dfunc("s:NetrwSetTgt(islocal=".a:islocal." bookhist<".a:bookhist."> choice#".a:choice.")")
if a:bookhist == 'b'
" supports choosing a bookmark as a target using a qb-generated list
@@ -8462,6 +8691,12 @@ fun! s:NetrwSetTgt(bookhist,choice)
endif
endif
+ " refresh the display
+ if !exists("b:netrw_curdir")
+ let b:netrw_curdir= getcwd()
+ endif
+ call s:NetrwRefresh(a:islocal,b:netrw_curdir)
+
" call Dret("s:NetrwSetTgt")
endfun
@@ -8470,12 +8705,14 @@ endfun
fun! s:NetrwSortStyle(islocal)
" call Dfunc("s:NetrwSortStyle(islocal=".a:islocal.") netrw_sort_by<".g:netrw_sort_by.">")
NetrwKeepj call s:NetrwSaveWordPosn()
- let svpos= netrw#SavePosn()
+ let svpos= winsaveview()
+" call Decho("saving posn to svpos<".string(svpos).">",'~'.expand("<slnum>"))
let g:netrw_sort_by= (g:netrw_sort_by =~ '^n')? 'time' : (g:netrw_sort_by =~ '^t')? 'size' : (g:netrw_sort_by =~ '^siz')? 'exten' : 'name'
NetrwKeepj norm! 0
NetrwKeepj call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./'))
- NetrwKeepj call netrw#RestorePosn(svpos)
+" call Decho("restoring posn to svpos<".string(svpos).">",'~'.expand("<slnum>"))
+ NetrwKeepj call winrestview(svpos)
" call Dret("s:NetrwSortStyle : netrw_sort_by<".g:netrw_sort_by.">")
endfun
@@ -8653,6 +8890,9 @@ 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("g:netrw_keepdir =".(exists("g:netrw_keepdir")? g:netrw_keepdir : 'n/a'))
+" call Decho("w:netrw_liststyle=".(exists("w:netrw_liststyle")? w:netrw_liststyle : 'n/a'))
+" call Decho("w:netrw_treetop =".(exists("w:netrw_treetop")? w:netrw_treetop : 'n/a'))
if exists("s:treedir")
" s:NetrwPrevWinOpen opens a "previous" window -- and thus needs to and does call s:NetrwTreeDir early
@@ -8665,12 +8905,13 @@ fun! s:NetrwTreeDir(islocal)
if !exists("b:netrw_curdir") || b:netrw_curdir == ""
let b:netrw_curdir= getcwd()
endif
-
let treedir = b:netrw_curdir
" call Decho("set initial treedir<".treedir.">",'~'.expand("<slnum>"))
- let s:treecurpos= netrw#SavePosn()
- if w:netrw_liststyle == s:TREELIST
+ let s:treecurpos= winsaveview()
+" call Decho("saving posn to s:treecurpos<".string(s:treecurpos).">",'~'.expand("<slnum>"))
+
+ if exists("w:netrw_liststyle") && w:netrw_liststyle == s:TREELIST
" call Decho("w:netrw_liststyle is TREELIST:",'~'.expand("<slnum>"))
" call Decho("line#".line(".")." getline(.)<".getline('.')."> treecurpos<".string(s:treecurpos).">",'~'.expand("<slnum>"))
@@ -8701,13 +8942,12 @@ fun! s:NetrwTreeDir(islocal)
" call Dret("s:NetrwTreeDir <".treedir."> : (side effect) s:treecurpos<".(exists("s:treecurpos")? string(s:treecurpos) : 'n/a').">")
return b:netrw_curdir
" else " Decho
-" call Decho(".user did not attempt to close treeroot",'~'.expand("<slnum>"))
+" call Decho(".user not attempting to close treeroot",'~'.expand("<slnum>"))
endif
" call Decho("islocal=".a:islocal." curline<".curline.">",'~'.expand("<slnum>"))
-" call Decho("after subst<".substitute(curline,'^'.s:treedepthstring.'\+ \(.*\)$','\1','').">",'~'.expand("<slnum>"))
- let potentialdir= substitute(curline,'^'.s:treedepthstring.'* \(.*\)@$','\1','')
-" call Decho("potentialdir<".potentialdir."> isdir=".isdirectory(s:NetrwFile(potentialdir)),'~'.expand("<slnum>"))
+ let potentialdir= s:NetrwFile(substitute(curline,'^'.s:treedepthstring.'\+ \(.*\)@$','\1',''))
+" call Decho("potentialdir<".potentialdir."> isdir=".isdirectory(potentialdir),'~'.expand("<slnum>"))
" COMBAK: a symbolic link may point anywhere -- so it will be used to start a new treetop
" if a:islocal && curline =~ '@$' && isdirectory(s:NetrwFile(potentialdir))
@@ -8763,9 +9003,13 @@ fun! s:NetrwTreeDisplay(dir,depth)
let depth= s:treedepthstring.a:depth
" call Decho("display subtrees with depth<".depth."> and current leaves",'~'.expand("<slnum>"))
-" call Decho("w:netrw_treedict[".dir."]=".string(w:netrw_treedict[dir]),'~'.expand("<slnum>"))
+" call Decho("for every entry in w:netrw_treedict[".dir."]=".string(w:netrw_treedict[dir]),'~'.expand("<slnum>"))
for entry in w:netrw_treedict[dir]
- let direntry= substitute(dir.'/'.entry,'[@/]$','','e')
+ if dir =~ '/$'
+ let direntry= substitute(dir.entry,'[@/]$','','e')
+ else
+ let direntry= substitute(dir.'/'.entry,'[@/]$','','e')
+ endif
" call Decho("dir<".dir."> entry<".entry."> direntry<".direntry.">",'~'.expand("<slnum>"))
if entry =~ '/$' && has_key(w:netrw_treedict,direntry)
" call Decho("<".direntry."> is a key in treedict - display subtree for it",'~'.expand("<slnum>"))
@@ -8786,10 +9030,48 @@ fun! s:NetrwTreeDisplay(dir,depth)
endfun
" ---------------------------------------------------------------------
+" s:NetrwRefreshTreeDict: updates the contents information for a tree (w:netrw_treedict) {{{2
+fun! s:NetrwRefreshTreeDict(dir)
+" call Dfunc("s:NetrwRefreshTreeDict(dir<".a:dir.">)")
+ for entry in w:netrw_treedict[a:dir]
+ let direntry= substitute(a:dir.'/'.entry,'[@/]$','','e')
+" call Decho("a:dir<".a:dir."> entry<".entry."> direntry<".direntry.">",'~'.expand("<slnum>"))
+
+ if entry =~ '/$' && has_key(w:netrw_treedict,direntry)
+" call Decho("<".direntry."> is a key in treedict - display subtree for it",'~'.expand("<slnum>"))
+ NetrwKeepj call s:NetrwRefreshTreeDict(direntry)
+ let liststar = s:NetrwGlob(direntry,'*')
+ let listdotstar = s:NetrwGlob(direntry,'.*')
+ let w:netrw_treedict[direntry] = liststar + listdotstar
+" call Decho("updating w:netrw_treedict[".direntry.']='.string(w:netrw_treedict[direntry]),'~'.expand("<slnum>"))
+
+ elseif entry =~ '/$' && has_key(w:netrw_treedict,direntry.'/')
+" call Decho("<".direntry."/> is a key in treedict - display subtree for it",'~'.expand("<slnum>"))
+ NetrwKeepj call s:NetrwRefreshTreeDict(direntry.'/')
+ let liststar = s:NetrwGlob(direntry.'/','*')
+ let listdotstar= s:NetrwGlob(direntry.'/','.*')
+ let w:netrw_treedict[direntry]= liststar + listdotstar
+" call Decho("updating w:netrw_treedict[".direntry.']='.string(w:netrw_treedict[direntry]),'~'.expand("<slnum>"))
+
+ elseif entry =~ '@$' && has_key(w:netrw_treedict,direntry.'@')
+" call Decho("<".direntry."/> is a key in treedict - display subtree for it",'~'.expand("<slnum>"))
+ NetrwKeepj call s:NetrwRefreshTreeDict(direntry.'/')
+ let liststar = s:NetrwGlob(direntry.'/','*')
+ let listdotstar= s:NetrwGlob(direntry.'/','.*')
+" call Decho("updating w:netrw_treedict[".direntry.']='.string(w:netrw_treedict[direntry]),'~'.expand("<slnum>"))
+
+ else
+" call Decho('not updating w:netrw_treedict['.direntry.'] with entry<'.entry.'> (no subtree)',,'~'.expand("<slnum>"))
+ endif
+ endfor
+" call Dret("s:NetrwRefreshTreeDict")
+endfun
+
+" ---------------------------------------------------------------------
" s:NetrwTreeListing: displays tree listing from treetop on down, using NetrwTreeDisplay() {{{2
" Called by s:PerformListing()
fun! s:NetrwTreeListing(dirname)
- if w:netrw_liststyle == s:TREELIST
+ if exists("w:netrw_liststyle") && w:netrw_liststyle == s:TREELIST
" call Dfunc("NetrwTreeListing() bufname<".expand("%").">")
" call Decho("curdir<".a:dirname.">",'~'.expand("<slnum>"))
" call Decho("win#".winnr().": w:netrw_treetop ".(exists("w:netrw_treetop")? "exists" : "doesn't exist")." w:netrw_treedict ".(exists("w:netrw_treedict")? "exists" : "doesn't exit"),'~'.expand("<slnum>"))
@@ -8811,13 +9093,13 @@ fun! s:NetrwTreeListing(dirname)
let w:netrw_treedict= {}
endif
- " update the directory listing for the current directory
-" call Decho("updating dictionary with ".a:dirname.":[..directory listing..]",'~'.expand("<slnum>"))
+ " update the dictionary for the current directory
+" call Decho("updating: w:netrw_treedict[".a:dirname.'] -> [directory listing]','~'.expand("<slnum>"))
" call Decho("w:netrw_bannercnt=".w:netrw_bannercnt." line($)=".line("$"),'~'.expand("<slnum>"))
- exe "sil! NetrwKeepj ".w:netrw_bannercnt.',$g@^\.\.\=/$@d'
+ exe "sil! NetrwKeepj ".w:netrw_bannercnt.',$g@^\.\.\=/$@d _'
let w:netrw_treedict[a:dirname]= getline(w:netrw_bannercnt,line("$"))
" call Decho("w:treedict[".a:dirname."]= ".string(w:netrw_treedict[a:dirname]),'~'.expand("<slnum>"))
- exe "sil! NetrwKeepj ".w:netrw_bannercnt.",$d"
+ exe "sil! NetrwKeepj ".w:netrw_bannercnt.",$d _"
" if past banner, record word
if exists("w:netrw_bannercnt") && line(".") > w:netrw_bannercnt
@@ -8852,6 +9134,8 @@ endfun
" wipes that out prior to calling this function
fun! s:NetrwTreePath(treetop)
" call Dfunc("s:NetrwTreePath() line#".line(".")."<".getline(".").">")
+ let svpos = winsaveview()
+" call Decho("saving posn to svpos<".string(svpos).">",'~'.expand("<slnum>"))
let depth = substitute(getline('.'),'^\(\%('.s:treedepthstring.'\)*\)[^'.s:treedepthstring.'].\{-}$','\1','e')
" call Decho("depth<".depth."> 1st subst",'~'.expand("<slnum>"))
let depth = substitute(depth,'^'.s:treedepthstring,'','')
@@ -8886,6 +9170,8 @@ fun! s:NetrwTreePath(treetop)
let treedir= a:treetop.'/'.treedir
endif
let treedir= substitute(treedir,'//$','/','')
+" call Decho("restoring posn to svpos<".string(svpos).">",'~'.expand("<slnum>"))"
+ call winrestview(svpos)
" call Dret("s:NetrwTreePath <".treedir.">")
return treedir
endfun
@@ -8930,6 +9216,7 @@ fun! s:NetrwWideListing()
" call Decho("bannercnt=".w:netrw_bannercnt." fpl=".w:netrw_fpl." fpc=".fpc." newcol[".newcolstart.",".newcolend."]",'~'.expand("<slnum>"))
if has("clipboard")
sil! let keepregstar = @*
+ sil! let keepregplus = @+
endif
while line("$") >= newcolstart
if newcolend > line("$") | let newcolend= line("$") | endif
@@ -8940,11 +9227,12 @@ fun! s:NetrwWideListing()
else
exe "sil! NetrwKeepj norm! 0\<c-v>".newcolqty.'j$hx'.w:netrw_bannercnt.'G$p'
endif
- exe "sil! NetrwKeepj ".newcolstart.','.newcolend.'d'
+ exe "sil! NetrwKeepj ".newcolstart.','.newcolend.'d _'
exe 'sil! NetrwKeepj '.w:netrw_bannercnt
endwhile
if has("clipboard")
sil! let @*= keepregstar
+ sil! let @+= keepregplus
endif
exe "sil! NetrwKeepj ".w:netrw_bannercnt.',$s/\s\+$//e'
NetrwKeepj call histdel("/",-1)
@@ -9205,7 +9493,7 @@ fun! s:PerformListing(islocal)
" call Decho("settings buf#".bufnr("%")."<".bufname("%").">: ".((&l:ma == 0)? "no" : "")."ma ".((&l:mod == 0)? "no" : "")."mod ".((&l:bl == 0)? "no" : "")."bl ".((&l:ro == 0)? "no" : "")."ro fo=".&l:fo. " (internal#3)",'~'.expand("<slnum>"))
" resolve symbolic links if local and (thin or tree)
- if a:islocal && (w:netrw_liststyle == s:THINLIST || w:netrw_liststyle == s:TREELIST)
+ if a:islocal && (w:netrw_liststyle == s:THINLIST || (exists("w:netrw_liststyle") && w:netrw_liststyle == s:TREELIST))
" call Decho("--resolve symbolic links if local and thin|tree",'~'.expand("<slnum>"))
g/@$/call s:ShowLink()
endif
@@ -9247,7 +9535,8 @@ fun! s:PerformListing(islocal)
if exists("s:treecurpos")
" call Decho("s:treecurpos exists; restore posn",'~'.expand("<slnum>"))
" call Decho("settings buf#".bufnr("%")."<".bufname("%").">: ".((&l:ma == 0)? "no" : "")."ma ".((&l:mod == 0)? "no" : "")."mod ".((&l:bl == 0)? "no" : "")."bl ".((&l:ro == 0)? "no" : "")."ro fo=".&l:fo. " (internal#8)",'~'.expand("<slnum>"))
- NetrwKeepj call netrw#RestorePosn(s:treecurpos)
+" call Decho("restoring posn to s:treecurpos<".string(s:treecurpos).">",'~'.expand("<slnum>"))
+ NetrwKeepj call winrestview(s:treecurpos)
unlet s:treecurpos
endif
@@ -9310,7 +9599,7 @@ endfun
" enforced here.
fun! s:NetrwRemoteFtpCmd(path,listcmd)
" call Dfunc("NetrwRemoteFtpCmd(path<".a:path."> listcmd<".a:listcmd.">) w:netrw_method=".(exists("w:netrw_method")? w:netrw_method : (exists("b:netrw_method")? b:netrw_method : "???")))
-" call Decho("line($)=".line("$")." w:netrw_bannercnt=".w:netrw_bannercnt,'~'.expand("<slnum>"))
+" call Decho("line($)=".line("$")." win#".winnr()." w:netrw_bannercnt=".w:netrw_bannercnt,'~'.expand("<slnum>"))
" sanity check: {{{3
if !exists("w:netrw_method")
if exists("b:netrw_method")
@@ -9329,8 +9618,8 @@ fun! s:NetrwRemoteFtpCmd(path,listcmd)
" clear off any older non-banner lines " {{{3
" note that w:netrw_bannercnt indexes the line after the banner
-" call Decho('exe sil! NetrwKeepj '.w:netrw_bannercnt.",$d (clear off old non-banner lines)",'~'.expand("<slnum>"))
- exe "sil! NetrwKeepj ".w:netrw_bannercnt.",$d"
+" call Decho('exe sil! NetrwKeepj '.w:netrw_bannercnt.",$d _ (clear off old non-banner lines)",'~'.expand("<slnum>"))
+ exe "sil! NetrwKeepj ".w:netrw_bannercnt.",$d _"
".........................................
if w:netrw_method == 2 || w:netrw_method == 5 " {{{3
@@ -9427,7 +9716,7 @@ fun! s:NetrwRemoteFtpCmd(path,listcmd)
sil! NetrwKeepj g/l\%([-r][-w][-x]\)\{3}/NetrwKeepj s/$/@/e
NetrwKeepj call histdel("/",-1)
NetrwKeepj call histdel("/",-1)
- if w:netrw_liststyle == s:THINLIST || w:netrw_liststyle == s:WIDELIST || w:netrw_liststyle == s:TREELIST
+ if w:netrw_liststyle == s:THINLIST || w:netrw_liststyle == s:WIDELIST || (exists("w:netrw_liststyle") && w:netrw_liststyle == s:TREELIST)
exe "sil! NetrwKeepj ".w:netrw_bannercnt.',$s/^\%(\S\+\s\+\)\{8}//e'
NetrwKeepj call histdel("/",-1)
endif
@@ -9451,7 +9740,7 @@ endfun
" ---------------------------------------------------------------------
" s:NetrwRemoteListing: {{{2
fun! s:NetrwRemoteListing()
-" call Dfunc("s:NetrwRemoteListing() b:netrw_curdir<".b:netrw_curdir.">)")
+" call Dfunc("s:NetrwRemoteListing() b:netrw_curdir<".b:netrw_curdir.">) win#".winnr())
if !exists("w:netrw_bannercnt") && exists("s:bannercnt")
let w:netrw_bannercnt= s:bannercnt
@@ -9515,7 +9804,7 @@ fun! s:NetrwRemoteListing()
let mesg= getline(".")
if exists("w:netrw_bannercnt")
setl ma
- exe w:netrw_bannercnt.",$d"
+ exe w:netrw_bannercnt.",$d _"
setl noma
endif
NetrwKeepj call s:NetrwOptionRestore("w:")
@@ -9524,7 +9813,7 @@ fun! s:NetrwRemoteListing()
return -1
endif
- if w:netrw_liststyle == s:THINLIST || w:netrw_liststyle == s:WIDELIST || w:netrw_liststyle == s:TREELIST
+ if w:netrw_liststyle == s:THINLIST || w:netrw_liststyle == s:WIDELIST || (exists("w:netrw_liststyle") && w:netrw_liststyle == s:TREELIST)
" shorten the listing
" call Decho("generate short listing",'~'.expand("<slnum>"))
exe "sil! keepalt NetrwKeepj ".w:netrw_bannercnt
@@ -9654,7 +9943,8 @@ endfun
fun! s:NetrwRemoteRm(usrhost,path) range
" call Dfunc("s:NetrwRemoteRm(usrhost<".a:usrhost."> path<".a:path.">) virtcol=".virtcol("."))
" call Decho("firstline=".a:firstline." lastline=".a:lastline,'~'.expand("<slnum>"))
- let svpos= netrw#SavePosn()
+ let svpos= winsaveview()
+" call Decho("saving posn to svpos<".string(svpos).">",'~'.expand("<slnum>"))
let all= 0
if exists("s:netrwmarkfilelist_{bufnr('%')}")
@@ -9696,7 +9986,8 @@ fun! s:NetrwRemoteRm(usrhost,path) range
" refresh the (remote) directory listing
" call Decho("refresh remote directory listing",'~'.expand("<slnum>"))
NetrwKeepj call s:NetrwRefresh(0,s:NetrwBrowseChgDir(0,'./'))
- NetrwKeepj call netrw#RestorePosn(svpos)
+" call Decho("restoring posn to svpos<".string(svpos).">",'~'.expand("<slnum>"))
+ NetrwKeepj call winrestview(svpos)
" call Dret("s:NetrwRemoteRm")
endfun
@@ -9736,7 +10027,7 @@ fun! s:NetrwRemoteRmFile(path,rmfile,all)
if path =~ '^\a\{3,}://'
let path= substitute(path,'^\a\{3,}://[^/]\+/','','')
endif
- sil! NetrwKeepj .,$d
+ sil! NetrwKeepj .,$d _
call s:NetrwRemoteFtpCmd(path,"delete ".'"'.a:rmfile.'"')
else
" call Decho("case ssh: g:netrw_rm_cmd<".g:netrw_rm_cmd.">",'~'.expand("<slnum>"))
@@ -9827,7 +10118,8 @@ fun! s:NetrwRemoteRename(usrhost,path) range
" call Dfunc("NetrwRemoteRename(usrhost<".a:usrhost."> path<".a:path.">)")
" preparation for removing multiple files/directories
- let svpos = netrw#SavePosn()
+ let svpos = winsaveview()
+" call Decho("saving posn to svpos<".string(svpos).">",'~'.expand("<slnum>"))
let ctr = a:firstline
let rename_cmd = s:MakeSshCmd(g:netrw_rename_cmd)
@@ -9893,7 +10185,8 @@ fun! s:NetrwRemoteRename(usrhost,path) range
" refresh the directory
NetrwKeepj call s:NetrwRefresh(0,s:NetrwBrowseChgDir(0,'./'))
- NetrwKeepj call netrw#RestorePosn(svpos)
+" call Decho("restoring posn to svpos<".string(svpos).">",'~'.expand("<slnum>"))
+ NetrwKeepj call winrestview(svpos)
" call Dret("NetrwRemoteRename")
endfun
@@ -9955,7 +10248,7 @@ endfun
" ---------------------------------------------------------------------
" netrw#LocalBrowseCheck: {{{2
fun! netrw#LocalBrowseCheck(dirname)
- " This function is called by netrwPlugin.vim's s:LocalBrowse() and by s:NetrwRexplore()
+ " This function is called by netrwPlugin.vim's s:LocalBrowse(), s:NetrwRexplore(), and by <cr> when atop listed file/directory
" unfortunate interaction -- split window debugging can't be
" used here, must use D-echoRemOn or D-echoTabOn -- the BufEnter
" event triggers another call to LocalBrowseCheck() when attempts
@@ -10074,6 +10367,9 @@ fun! s:LocalBrowseRefresh()
let g:netrw_quickhelp= g:netrw_quickhelp - 1
endif
" call Decho("#3: quickhelp=".g:netrw_quickhelp,'~'.expand("<slnum>"))
+ if exists("w:netrw_liststyle") && w:netrw_liststyle == s:TREELIST
+ NetrwKeepj call s:NetrwRefreshTreeDict(w:netrw_treetop)
+ endif
NetrwKeepj call s:NetrwRefresh(1,s:NetrwBrowseChgDir(1,'./'))
endif
let ibl= ibl + 1
@@ -10263,6 +10559,9 @@ fun! s:LocalListing()
if w:netrw_liststyle == s:LONGLIST
let sz = getfsize(filename)
+ if g:netrw_sizestyle =~ "[hH]"
+ let sz= s:NetrwHumanReadable(sz)
+ endif
let fsz = strpart(" ",1,15-strlen(sz)).sz
let pfile= pfile."\t".fsz." ".strftime(g:netrw_timefmt,getftime(filename))
" call Decho("sz=".sz." fsz=".fsz,'~'.expand("<slnum>"))
@@ -10281,6 +10580,9 @@ fun! s:LocalListing()
" sort by size (handles file sizes up to 1 quintillion bytes, US)
" call Decho("getfsize(".filename.")=".getfsize(filename),'~'.expand("<slnum>"))
let sz = getfsize(filename)
+ if g:netrw_sizestyle =~ "[hH]"
+ let sz= s:NetrwHumanReadable(sz)
+ endif
let fsz = strpart("000000000000000000",1,18-strlen(sz)).sz
" call Decho("exe NetrwKeepj put ='".fsz.'/'.filename."'",'~'.expand("<slnum>"))
let fszpfile= fsz.'/'.pfile
@@ -10339,7 +10641,8 @@ fun! s:NetrwLocalRename(path) range
" preparation for removing multiple files/directories
let ykeep = @@
let ctr = a:firstline
- let svpos = netrw#SavePosn()
+ let svpos = winsaveview()
+" call Decho("saving posn to svpos<".string(svpos).">",'~'.expand("<slnum>"))
" rename files given by the markfilelist
if exists("s:netrwmarkfilelist_{bufnr('%')}")
@@ -10405,7 +10708,8 @@ fun! s:NetrwLocalRename(path) range
" refresh the directory
" call Decho("refresh the directory listing",'~'.expand("<slnum>"))
NetrwKeepj call s:NetrwRefresh(1,s:NetrwBrowseChgDir(1,'./'))
- NetrwKeepj call netrw#RestorePosn(svpos)
+" call Decho("restoring posn to svpos<".string(svpos).">",'~'.expand("<slnum>"))
+ NetrwKeepj call winrestview(svpos)
let @@= ykeep
" call Dret("NetrwLocalRename")
@@ -10421,7 +10725,8 @@ fun! s:NetrwLocalRm(path) range
let ykeep = @@
let ret = 0
let all = 0
- let svpos = netrw#SavePosn()
+ let svpos = winsaveview()
+" call Decho("saving posn to svpos<".string(svpos).">",'~'.expand("<slnum>"))
if exists("s:netrwmarkfilelist_{bufnr('%')}")
" remove all marked files
@@ -10471,7 +10776,8 @@ fun! s:NetrwLocalRm(path) range
" call Decho("bufname<".bufname("%").">",'~'.expand("<slnum>"))
if bufname("%") != "NetrwMessage"
NetrwKeepj call s:NetrwRefresh(1,s:NetrwBrowseChgDir(1,'./'))
- NetrwKeepj call netrw#RestorePosn(svpos)
+" call Decho("restoring posn to svpos<".string(svpos).">",'~'.expand("<slnum>"))
+ NetrwKeepj call winrestview(svpos)
endif
let @@= ykeep
@@ -10533,28 +10839,34 @@ fun! s:NetrwLocalRmFile(path,fname,all)
let rmfile= substitute(rmfile,'[\/]$','','e')
if all || ok =~ 'y\%[es]' || ok == ""
-" call Decho("1st attempt: system(netrw#WinPath(".g:netrw_localrmdir.') '.s:ShellEscape(rmfile).')','~'.expand("<slnum>"))
- call system(netrw#WinPath(g:netrw_localrmdir).' '.s:ShellEscape(rmfile))
-" call Decho("v:shell_error=".v:shell_error,'~'.expand("<slnum>"))
+ if v:version < 704 || !has("patch1109")
+" " call Decho("1st attempt: system(netrw#WinPath(".g:netrw_localrmdir.') '.s:ShellEscape(rmfile).')','~'.expand("<slnum>"))
+ call system(netrw#WinPath(g:netrw_localrmdir).' '.s:ShellEscape(rmfile))
+" " call Decho("v:shell_error=".v:shell_error,'~'.expand("<slnum>"))
- if v:shell_error != 0
-" call Decho("2nd attempt to remove directory<".rmfile.">",'~'.expand("<slnum>"))
- let errcode= s:NetrwDelete(rmfile)
-" call Decho("errcode=".errcode,'~'.expand("<slnum>"))
-
- if errcode != 0
- if has("unix")
-" call Decho("3rd attempt to remove directory<".rmfile.">",'~'.expand("<slnum>"))
- call system("rm ".s:ShellEscape(rmfile))
- if v:shell_error != 0 && !exists("g:netrw_quiet")
- call netrw#ErrorMsg(s:ERROR,"unable to remove directory<".rmfile."> -- is it empty?",34)
+ if v:shell_error != 0
+" " call Decho("2nd attempt to remove directory<".rmfile.">",'~'.expand("<slnum>"))
+ let errcode= s:NetrwDelete(rmfile)
+" " call Decho("errcode=".errcode,'~'.expand("<slnum>"))
+
+ if errcode != 0
+ if has("unix")
+" " call Decho("3rd attempt to remove directory<".rmfile.">",'~'.expand("<slnum>"))
+ call system("rm ".s:ShellEscape(rmfile))
+ if v:shell_error != 0 && !exists("g:netrw_quiet")
+ call netrw#ErrorMsg(s:ERROR,"unable to remove directory<".rmfile."> -- is it empty?",34)
+ let ok="no"
+ endif
+ elseif !exists("g:netrw_quiet")
+ call netrw#ErrorMsg(s:ERROR,"unable to remove directory<".rmfile."> -- is it empty?",35)
let ok="no"
endif
- elseif !exists("g:netrw_quiet")
- call netrw#ErrorMsg(s:ERROR,"unable to remove directory<".rmfile."> -- is it empty?",35)
- let ok="no"
endif
endif
+ else
+ if delete(rmfile,"d")
+ call netrw#ErrorMsg(s:ERROR,"unable to delete directory <".rmfile.">!",103)
+ endif
endif
endif
endif
@@ -10594,81 +10906,6 @@ fun! netrw#Call(funcname,...)
endfun
" ------------------------------------------------------------------------
-" netrw#RestorePosn: restores the cursor and file position as saved by netrw#SavePosn() {{{2
-fun! netrw#RestorePosn(...)
-" call Dfunc("netrw#RestorePosn() a:0=".a:0." winnr=".(exists("w:netrw_winnr")? w:netrw_winnr : -1)." line=".(exists("w:netrw_line")? w:netrw_line : -1)." col=".(exists("w:netrw_col")? w:netrw_col : -1)." hline=".(exists("w:netrw_hline")? w:netrw_hline : -1))
- let eikeep= &ei
- setl ei=all
- if expand("%") == "NetrwMessage"
- if exists("s:winBeforeErr")
- exe s:winBeforeErr."wincmd w"
- endif
- endif
-
- if a:0 > 0
- exe "keepj ".a:1
- endif
-" "call Decho("a:1 = ".((a:0 > 0)? a:1 : 'n/a'),'~'.expand("<slnum>"))
-" "call Decho("liststyle = ".(exists("liststyle")? liststyle : 'n/a'). " w:netrw_liststyle=".(exists("w:netrw_liststyle")? w:netrw_liststyle : 'n/a'),'~'.expand("<slnum>"))
- if exists("liststyle") && exists("w:netrw_liststyle") && liststyle != w:netrw_liststyle
- let usesrch= 1
- else
- let usesrch= 0
- endif
-
-" "call Decho("winh = ".(exists("w:netrw_winh")? w:netrw_winh : -1),'~'.expand("<slnum>"))
-" "call Decho("winw = ".(exists("w:netrw_winw")? w:netrw_winw : -1),'~'.expand("<slnum>"))
-" "call Decho("cur winheight=".winheight(0)." winwidth=".winwidth(0),'~'.expand("<slnum>"))
-" "call Decho("w:netrw_winfile = ".(exists("w:netrw_winfile")? w:netrw_winfile : 'n/a'),'~'.expand("<slnum>"))
-
- " restore window
- if exists("w:netrw_winnr")
-" "call Decho("restore window: exe sil! ".w:netrw_winnr."wincmd w",'~'.expand("<slnum>"))
- exe "sil! ".w:netrw_winnr."wincmd w"
- endif
-" if v:shell_error == 0
- " as suggested by Bram M: redraw on no error
- " allows protocol error messages to remain visible
-" redraw!
-" endif
-
- " restore top-of-screen line
- if exists("w:netrw_hline")
-" "call Decho("restore topofscreen: exe keepj norm! ".w:netrw_hline."G0z",'~'.expand("<slnum>"))
- exe "keepj norm! ".w:netrw_hline."G0z\<CR>"
- endif
-
- " restore position
- " when the window's height x width has changed, the line,col is no longer useful
- if w:netrw_winh == winheight(0) && w:netrw_winw == winwidth(0) && exists("w:netrw_line") && exists("w:netrw_col") && !usesrch
-" "call Decho("using posn: exe keepj norm! ".w:netrw_line."G0".w:netrw_col."|",'~'.expand("<slnum>"))
- exe "keepj norm! ".w:netrw_line."G0".w:netrw_col."\<bar>"
-
- elseif exists("w:netrw_winfile")
- if !search('\<'.escape(w:netrw_winfile,g:netrw_fname_escape),'cw')
- if exists("w:netrw_bannercnt")
-" "call Decho("using bannercnt: win#".winnr()." ".winheight(0)."x".winwidth(0)." w:netrw_winfile<".w:netrw_winfile.">",'~'.expand("<slnum>"))
- exe "keepj ".w:netrw_bannercnt
- norm! 0
- else
- " go to upper left corner
-" "call Decho("goto ulc: win#".winnr()." ".winheight(0)."x".winwidth(0)." w:netrw_winfile<".w:netrw_winfile.">",'~'.expand("<slnum>"))
- keepj 1
- norm! 0
- endif
- else
-" "call Decho("used search: w:netrw_winfile<".w:netrw_winfile.">",'~'.expand("<slnum>"))
- endif
-
- else
-" "call Decho("goto ulc: win#".winnr()." ".winheight(0)."x".winwidth(0),'~'.expand("<slnum>"))
- keepj 1
- norm! 0
- endif
-
- let &ei= eikeep
-" call Dret("netrw#RestorePosn : line#".line(".")." col#".col(".")." winline#".winline()." wincol#".wincol())
-endfun
" ---------------------------------------------------------------------
" netrw#Expose: allows UserMaps and pchk to look at otherwise script-local variables {{{2
@@ -10713,48 +10950,6 @@ fun! netrw#RFC2396(fname)
endfun
" ---------------------------------------------------------------------
-" netrw#SavePosn: saves position of cursor on screen {{{2
-fun! netrw#SavePosn()
-" call Dfunc("netrw#SavePosn() win#".winnr()." line#".line(".")." col#".col(".")." winline#".winline()." wincol#".wincol())
- " Save current line and column
- let w:netrw_winnr= winnr()
- let w:netrw_line = line(".")
- let w:netrw_col = virtcol(".")
-" "call Decho("currently, win#".w:netrw_winnr." line#".w:netrw_line." col#".w:netrw_col,'~'.expand("<slnum>"))
-
- " save filename under cursor
-" "call Decho("line#".line(".")." w:netrw_bannercnt=".(exists("w:netrw_bannercnt")? w:netrw_bannercnt : 'n/a'),'~'.expand("<slnum>"))
- if exists("w:netrw_bannercnt") && line(".") >= w:netrw_bannercnt && &ft == "netrw"
- let winfile = "|let w:netrw_winfile=\"".fnameescape(s:NetrwGetWord())."\""
- else
- let winfile= ""
- endif
-" "call Decho("winfile<".winfile.">",'~'.expand("<slnum>"))
- if exists("w:netrw_liststyle")
- let liststyle = "|let liststyle=".w:netrw_liststyle
- else
- let liststyle= ""
- endif
-" "call Decho("liststyle=".liststyle,'~'.expand("<slnum>"))
-
- " Save top-of-screen line
- keepj norm! H0
- let w:netrw_hline= line(".")
-
- " save up alternate position information
- " use this when window height x width has changed
- let w:netrw_winh = winheight(0)
- let w:netrw_winw = winwidth(0)
-
- " set up string holding position parameters
- let ret = "let w:netrw_winnr=".w:netrw_winnr."|let w:netrw_line=".w:netrw_line."|let w:netrw_col=".w:netrw_col."|let w:netrw_hline=".w:netrw_hline."|let w:netrw_winh=".w:netrw_winh."|let w:netrw_winw=".w:netrw_winw.liststyle.winfile
-
- keepj call netrw#RestorePosn()
-" call Dret("netrw#SavePosn : win#=".(exists("w:netrw_winnr")? w:netrw_winnr : "n/a")." line=".(exists("w:netrw_line")? w:netrw_line : "n/a")." col=".(exists("w:netrw_col")? w:netrw_col : "n/a")." hline=".(exists("w:netrw_hline")? w:netrw_hline : "n/a"))
- return ret
-endfun
-
-" ---------------------------------------------------------------------
" netrw#UserMaps: supports user-specified maps {{{2
" see :help function()
"
@@ -11198,6 +11393,9 @@ fun! s:NetrwEnew(...)
NetrwKeepj call s:NetrwOptionRestore("w:")
" call Decho("generate a buffer with NetrwKeepj keepalt enew!",'~'.expand("<slnum>"))
+ " when tree listing uses file TreeListing... a new buffer is made.
+ " Want the old buffer to be unlisted.
+ setl nobl
let netrw_keepdiff= &l:diff
noswapfile NetrwKeepj keepalt enew!
let &l:diff= netrw_keepdiff
@@ -11227,8 +11425,9 @@ fun! s:NetrwEnew(...)
let b:netrw_curdir= a:1
if b:netrw_curdir =~ '/$'
if exists("w:netrw_liststyle") && w:netrw_liststyle == s:TREELIST
+ setl nobl
file NetrwTreeListing
- setl bt=nowrite noswf bh=hide
+ setl nobl bt=nowrite bh=hide
nno <silent> <buffer> [ :sil call <SID>TreeListMove('[')<cr>
nno <silent> <buffer> ] :sil call <SID>TreeListMove(']')<cr>
else
@@ -11331,6 +11530,50 @@ fun! s:NetrwSaveWordPosn()
endfun
" ---------------------------------------------------------------------
+" s:NetrwHumanReadable: takes a number and makes it "human readable" {{{2
+" 1000 -> 1K, 1000000 -> 1M, 1000000000 -> 1G
+fun! s:NetrwHumanReadable(sz)
+" call Dfunc("s:NetrwHumanReadable(sz=".a:sz.") type=".type(a:sz)." style=".g:netrw_sizestyle )
+
+ if g:netrw_sizestyle == 'h'
+ if a:sz >= 1000000000
+ let sz = printf("%.1f",a:sz/1000000000.0)."g"
+ elseif a:sz >= 10000000
+ let sz = printf("%d",a:sz/1000000)."m"
+ elseif a:sz >= 1000000
+ let sz = printf("%.1f",a:sz/1000000.0)."m"
+ elseif a:sz >= 10000
+ let sz = printf("%d",a:sz/1000)."k"
+ elseif a:sz >= 1000
+ let sz = printf("%.1f",a:sz/1000.0)."k"
+ else
+ let sz= a:sz
+ endif
+
+ elseif g:netrw_sizestyle == 'H'
+ if a:sz >= 1073741824
+ let sz = printf("%.1f",a:sz/1073741824.0)."G"
+ elseif a:sz >= 10485760
+ let sz = printf("%d",a:sz/1048576)."M"
+ elseif a:sz >= 1048576
+ let sz = printf("%.1f",a:sz/1048576.0)."M"
+ elseif a:sz >= 10240
+ let sz = printf("%d",a:sz/1024)."K"
+ elseif a:sz >= 1024
+ let sz = printf("%.1f",a:sz/1024.0)."K"
+ else
+ let sz= a:sz
+ endif
+
+ else
+ let sz= a:sz
+ endif
+
+" call Dret("s:NetrwHumanReadable ".sz)
+ return sz
+endfun
+
+" ---------------------------------------------------------------------
" s:NetrwRestoreWordPosn: used to keep cursor on same word after refresh, {{{2
" changed sorting, etc. Also see s:NetrwSaveWordPosn().
fun! s:NetrwRestoreWordPosn()
@@ -11449,7 +11692,7 @@ fun! s:NetrwRexplore(islocal,dirname)
if exists("s:netrwdrag")
return
endif
-" call Dfunc("s:NetrwRexplore() w:netrw_rexlocal=".w:netrw_rexlocal." w:netrw_rexdir<".w:netrw_rexdir.">")
+" call Dfunc("s:NetrwRexplore() w:netrw_rexlocal=".w:netrw_rexlocal." w:netrw_rexdir<".w:netrw_rexdir."> win#".winnr())
" call Decho("currently in bufname<".bufname("%").">",'~'.expand("<slnum>"))
" call Decho("ft=".&ft." win#".winnr()." w:netrw_rexfile<".(exists("w:netrw_rexfile")? w:netrw_rexfile : 'n/a').">",'~'.expand("<slnum>"))
@@ -11474,7 +11717,7 @@ fun! s:NetrwRexplore(islocal,dirname)
" call Decho("set w:netrw_rexfile<".w:netrw_rexfile."> (win#".winnr().")",'~'.expand("<slnum>"))
if !exists("w:netrw_rexlocal")
-" call Dret("s:NetrwRexplore w:netrw_rexlocal doesn't exist (".&ft.")")
+" call Dret("s:NetrwRexplore w:netrw_rexlocal doesn't exist (".&ft." win#".winnr().")")
return
endif
" call Decho("settings buf#".bufnr("%")."<".bufname("%").">: ".((&l:ma == 0)? "no" : "")."ma ".((&l:mod == 0)? "no" : "")."mod ".((&l:bl == 0)? "no" : "")."bl ".((&l:ro == 0)? "no" : "")."ro fo=".&l:fo,'~'.expand("<slnum>"))
@@ -11489,7 +11732,8 @@ fun! s:NetrwRexplore(islocal,dirname)
if exists("s:rexposn_".bufnr("%"))
" call Decho("restore posn, then unlet s:rexposn_".bufnr('%')."<".bufname("%").">",'~'.expand("<slnum>"))
" restore position in directory listing
- NetrwKeepj call netrw#RestorePosn(s:rexposn_{bufnr('%')})
+" call Decho("restoring posn to s:rexposn_".bufnr('%')."<".string(s:rexposn_{bufnr('%')}).">",'~'.expand("<slnum>"))
+ NetrwKeepj call winrestview(s:rexposn_{bufnr('%')})
if exists("s:rexposn_".bufnr('%'))
unlet s:rexposn_{bufnr('%')}
endif
@@ -11571,10 +11815,13 @@ endfun
" ---------------------------------------------------------------------
" s:SetRexDir: set directory for :Rexplore {{{2
fun! s:SetRexDir(islocal,dirname)
-" call Dfunc("s:SetRexDir(islocal=".a:islocal." dirname<".a:dirname.">)")
+" call Dfunc("s:SetRexDir(islocal=".a:islocal." dirname<".a:dirname.">) win#".winnr())
let w:netrw_rexdir = a:dirname
let w:netrw_rexlocal = a:islocal
- let s:rexposn_{bufnr("%")} = netrw#SavePosn()
+ let s:rexposn_{bufnr("%")} = winsaveview()
+" call Decho("setting w:netrw_rexdir =".w:netrw_rexdir)
+" call Decho("setting w:netrw_rexlocal=".w:netrw_rexlocal)
+" call Decho("saving posn to s:rexposn_".bufnr("%")."<".string(s:rexposn_{bufnr("%")}).">",'~'.expand("<slnum>"))
" call Decho("setting s:rexposn_".bufnr("%")."<".bufname("%")."> to SavePosn",'~'.expand("<slnum>"))
" call Dret("s:SetRexDir : win#".winnr()." ".(a:islocal? "local" : "remote")." dir: ".a:dirname)
endfun
@@ -11685,56 +11932,39 @@ fun! s:ShellEscape(s, ...)
endfun
" ---------------------------------------------------------------------
-" s:TreeListMove: {{{2
+" s:TreeListMove: supports [[, ]], [], and ][ in tree mode {{{2
fun! s:TreeListMove(dir)
" call Dfunc("s:TreeListMove(dir<".a:dir.">)")
- let curline = getline('.')
- let prvline = (line(".") > 1)? getline(line(".")-1) : ''
- let nxtline = (line(".") < line("$"))? getline(line(".")+1) : ''
- let curindent= substitute(curline,'^\([| ]*\).\{-}$','\1','')
- let indentm1 = substitute(curindent,'^'.s:treedepthstring.' ','','')
-" call Decho("prvline <".prvline."> #".line(".")-1,'~'.expand("<slnum>"))
-" call Decho("curline <".curline."> #".line("."),'~'.expand("<slnum>"))
-" call Decho("nxtline <".nxtline."> #".line(".")+1,'~'.expand("<slnum>"))
-" call Decho("curindent<".curindent.">",'~'.expand("<slnum>"))
-" call Decho("indentm1 <".indentm1.">",'~'.expand("<slnum>"))
-
+ let curline = getline('.')
+ let prvline = (line(".") > 1)? getline(line(".")-1) : ''
+ let nxtline = (line(".") < line("$"))? getline(line(".")+1) : ''
+ let curindent = substitute(getline('.'),'^\(\%('.s:treedepthstring.'\)*\)[^'.s:treedepthstring.'].\{-}$','\1','e')
+ let indentm1 = substitute(curindent,'^'.s:treedepthstring,'','')
+ let treedepthchr = substitute(s:treedepthstring,' ','','g')
+ let stopline = exists("w:netrw_bannercnt")? w:netrw_bannercnt : 1
+" call Decho("prvline <".prvline."> #".(line(".")-1), '~'.expand("<slnum>"))
+" call Decho("curline <".curline."> #".line(".") , '~'.expand("<slnum>"))
+" call Decho("nxtline <".nxtline."> #".(line(".")+1), '~'.expand("<slnum>"))
+" call Decho("curindent<".curindent.">" , '~'.expand("<slnum>"))
+" call Decho("indentm1 <".indentm1.">" , '~'.expand("<slnum>"))
+ " COMBAK : need to handle when on a directory
+ " COMBAK : need to handle ]] and ][. In general, needs work!!!
if curline !~ '/$'
-" call Decho('regfile','~'.expand("<slnum>"))
- if a:dir == '[' && prvline != ''
+ if a:dir == '[[' && prvline != ''
NetrwKeepj norm! 0
- let nl = search('^'.indentm1.'[^'.s:treedepthstring.']','bWe') " search backwards from regular file
+ let nl = search('^'.indentm1.'\%('.s:treedepthstring.'\)\@!','bWe',stopline) " search backwards
" call Decho("regfile srch back: ".nl,'~'.expand("<slnum>"))
- elseif a:dir == ']' && nxtline != ''
- NetrwKeepj norm! $
- let nl = search('^'.indentm1.'[^'.s:treedepthstring.']','We') " search forwards from regular file
-" call Decho("regfile srch fwd: ".nl,'~'.expand("<slnum>"))
- endif
-
- elseif a:dir == '[' && prvline != ''
- NetrwKeepj norm! 0
- let curline= line(".")
- let nl = search('^'.curindent.'[^'.s:treedepthstring.']','bWe') " search backwards From directory, same indentation
-" call Decho("dir srch back ind: ".nl,'~'.expand("<slnum>"))
- if nl != 0
- if line(".") == curline-1
- let nl= search('^'.indentm1.'[^'.s:treedepthstring.']','bWe') " search backwards from directory, indentation - 1
-" call Decho("dir srch back ind-1: ".nl,'~'.expand("<slnum>"))
- endif
- endif
-
- elseif a:dir == ']' && nxtline != ''
- NetrwKeepj norm! $
- let curline = line(".")
- let nl = search('^'.curindent.'[^'.s:treedepthstring.']','We') " search forwards from directory, same indentation
-" call Decho("dir srch fwd ind: ".nl,'~'.expand("<slnum>"))
- if nl != 0
- if line(".") == curline+1
- let nl= search('^'.indentm1.'[^'.s:treedepthstring.']','We') " search forwards from directory, indentation - 1
-" call Decho("dir srch fwd ind-1: ".nl,'~'.expand("<slnum>"))
+ elseif a:dir == '[]' && nxtline != ''
+ NetrwKeepj norm! 0
+" call Decho('srchpat<'.'^\%('.curindent.'\)\@!'.'>')
+ let nl = search('^\%('.curindent.'\)\@!','We') " search forwards
+ if nl != 0
+ NetrwKeepj norm! k
+ else
+ NetrwKeepj norm! G
endif
+" call Decho("regfile srch fwd: ".nl,'~'.expand("<slnum>"))
endif
-
endif
" call Dret("s:TreeListMove")
diff --git a/runtime/doc/change.txt b/runtime/doc/change.txt
index ae8f4c6e2..3f2f490df 100644
--- a/runtime/doc/change.txt
+++ b/runtime/doc/change.txt
@@ -409,6 +409,11 @@ CTRL-X Subtract [count] from the number or alphabetic
{Visual}CTRL-X Subtract [count] from the number or alphabetic
character in the highlighted text. {not in Vi}
+ On MS-Windows, this is mapped to cut Visual text
+ |dos-standard-mappings|. If you want to disable the
+ mapping, use this: >
+ silent! vunmap <C-X>
+<
*v_g_CTRL-X*
{Visual}g CTRL-X Subtract [count] from the number or alphabetic
character in the highlighted text. If several lines
diff --git a/runtime/doc/channel.txt b/runtime/doc/channel.txt
index a52c739ad..94ceafeac 100644
--- a/runtime/doc/channel.txt
+++ b/runtime/doc/channel.txt
@@ -1,4 +1,4 @@
-*channel.txt* For Vim version 7.4. Last change: 2016 Feb 16
+*channel.txt* For Vim version 7.4. Last change: 2016 Feb 20
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -155,7 +155,6 @@ When "mode" is "raw" the "msg" argument is the whole message as a string.
When "mode" is "json" or "js" the "callback" is optional. When omitted it is
only possible to receive a message after sending one.
-TODO:
To change the channel options after opening it use ch_setoptions(). The
arguments are similar to what is passed to ch_open(), but "waittime" cannot be
given, since that only applies to opening the channel.
@@ -233,8 +232,8 @@ message, it must use the number zero:
Then channel handler will then get {response} converted to Vim types. If the
channel does not have a handler the message is dropped.
-On read error or ch_close() the string "DETACH" is sent, if still possible.
-The channel will then be inactive.
+On read error or ch_close(), when using a socket, the string "DETACH" is sent,
+if still possible. The channel will then be inactive.
It is also possible to use ch_sendraw() on a JSON or JS channel. The caller
is then completely responsible for correct encoding and decoding.
@@ -295,9 +294,11 @@ Command "eval" ~
The "eval" command an be used to get the result of an expression. For
example, to get the number of lines in the current buffer:
- ["eval","line('$')"] ~
+ ["eval","line('$')", -2] ~
it will send back the result of the expression:
+ [-2, "last line"] ~
+The format is:
[{number}, {result}]
Here {number} is the same as what was in the request. Use a negative number
to avoid confusion with message that Vim sends.
diff --git a/runtime/doc/editing.txt b/runtime/doc/editing.txt
index 7fa1008bd..98a0bb982 100644
--- a/runtime/doc/editing.txt
+++ b/runtime/doc/editing.txt
@@ -1,4 +1,4 @@
-*editing.txt* For Vim version 7.4. Last change: 2016 Feb 11
+*editing.txt* For Vim version 7.4. Last change: 2016 Feb 16
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1016,7 +1016,7 @@ the newly written file (it might be there but contain bogus data). In that
case try recovery, because the swap file is synced to disk and might still be
there. |:recover|
-The directories given with the 'backupdir' option is used to put the backup
+The directories given with the 'backupdir' option are used to put the backup
file in. (default: same directory as the written file).
Whether the backup is a new file, which is a copy of the original file, or the
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt
index 9ec893f74..f5885da14 100644
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -1,4 +1,4 @@
-*eval.txt* For Vim version 7.4. Last change: 2016 Feb 16
+*eval.txt* For Vim version 7.4. Last change: 2016 Feb 19
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1793,9 +1793,9 @@ argidx() Number current index in the argument list
arglistid( [{winnr} [, {tabnr}]])
Number argument list id
argv( {nr}) String {nr} entry of the argument list
-argv( ) List the argument list
+argv() List the argument list
assert_equal( {exp}, {act} [, {msg}]) none assert {exp} equals {act}
-assert_exception({error} [, {msg}]) none assert {error} is in v:exception
+assert_exception( {error} [, {msg}]) none assert {error} is in v:exception
assert_fails( {cmd} [, {error}]) none assert {cmd} fails
assert_false( {actual} [, {msg}]) none assert {actual} is false
assert_true( {actual} [, {msg}]) none assert {actual} is true
@@ -1818,13 +1818,15 @@ call( {func}, {arglist} [, {dict}])
any call {func} with arguments {arglist}
ceil( {expr}) Float round {expr} up
ch_close( {handle}) none close a channel
+ch_log( {msg} [, {channel}]) none write {msg} in the channel log file
ch_logfile( {fname} [, {mode}]) none start logging channel activity
-ch_open( {address} [, {argdict})] Number open a channel to {address}
+ch_open( {address} [, {options}]) Channel open a channel to {address}
ch_readraw( {handle}) String read from channel {handle}
ch_sendexpr( {handle}, {expr} [, {options}])
any send {expr} over JSON channel {handle}
ch_sendraw( {handle}, {string} [, {options}])
any send {string} over raw channel {handle}
+ch_setoptions( {handle}, {options}) none set options for channel {handle}
ch_status( {handle}) String status of channel {handle}
changenr() Number current change number
char2nr( {expr}[, {utf8}]) Number ASCII/UTF8 value of first char in {expr}
@@ -1851,11 +1853,11 @@ delete( {fname} [, {flags}]) Number delete the file or directory {fname}
did_filetype() Number TRUE if FileType autocommand event used
diff_filler( {lnum}) Number diff filler lines about {lnum}
diff_hlID( {lnum}, {col}) Number diff highlighting at {lnum}/{col}
-disable_char_avail_for_testing({expr}) none test without typeahead
+disable_char_avail_for_testing( {expr}) none test without typeahead
empty( {expr}) Number TRUE if {expr} is empty
escape( {string}, {chars}) String escape {chars} in {string} with '\'
eval( {string}) any evaluate {string} into its value
-eventhandler( ) Number TRUE if inside an event handler
+eventhandler() Number TRUE if inside an event handler
executable( {expr}) Number 1 if executable {expr} exists
exepath( {expr}) String full path of the command {expr}
exists( {expr}) Number TRUE if {expr} exists
@@ -1881,9 +1883,9 @@ fnamemodify( {fname}, {mods}) String modify file name
foldclosed( {lnum}) Number first line of fold at {lnum} if closed
foldclosedend( {lnum}) Number last line of fold at {lnum} if closed
foldlevel( {lnum}) Number fold level at {lnum}
-foldtext( ) String line displayed for closed fold
+foldtext() String line displayed for closed fold
foldtextresult( {lnum}) String text for closed fold at {lnum}
-foreground( ) Number bring the Vim window to the foreground
+foreground() Number bring the Vim window to the foreground
function( {name}) Funcref reference to function {name}
garbagecollect( [{atexit}]) none free memory, breaking cyclic references
get( {list}, {idx} [, {def}]) any get item {idx} from {list} or {def}
@@ -1893,7 +1895,7 @@ getbufline( {expr}, {lnum} [, {end}])
getbufvar( {expr}, {varname} [, {def}])
any variable {varname} in buffer {expr}
getchar( [expr]) Number get one character from the user
-getcharmod( ) Number modifiers for the last typed character
+getcharmod() Number modifiers for the last typed character
getcharsearch() Dict last character search
getcmdline() String return the current command-line
getcmdpos() Number return cursor position in command-line
@@ -1935,7 +1937,7 @@ haslocaldir( [{winnr} [, {tabnr}]])
Number TRUE if the window executed |:lcd|
hasmapto( {what} [, {mode} [, {abbr}]])
Number TRUE if mapping to {what} exists
-histadd( {history},{item}) String add an item to a history
+histadd( {history}, {item}) String add an item to a history
histdel( {history} [, {item}]) String remove an item from a history
histget( {history} [, {index}]) String get the item {index} from a history
histnr( {history}) Number highest index of a history
@@ -2220,7 +2222,7 @@ argidx() The result is the current index in the argument list. 0 is
the first file. argc() - 1 is the last one. See |arglist|.
*arglistid()*
-arglistid([{winnr}, [ {tabnr} ]])
+arglistid([{winnr} [, {tabnr}]])
Return the argument list ID. This is a number which
identifies the argument list being used. Zero is used for the
global argument list. See |arglist|.
@@ -2686,7 +2688,13 @@ ch_close({handle}) *ch_close()*
Close channel {handle}. See |channel|.
{only available when compiled with the |+channel| feature}
-ch_logfile( {fname} [, {mode}]) *ch_logfile()*
+ch_log({msg} [, {channel}]) *ch_log()*
+ Write {msg} in the channel log file, if it was opened with
+ |ch_logfile()|.
+ When {channel} is passed the channel number is used for the
+ message. {channel} must be an open channel.
+
+ch_logfile({fname} [, {mode}]) *ch_logfile()*
Start logging channel activity to {fname}.
When {fname} is an empty string: stop logging.
@@ -2696,7 +2704,7 @@ ch_logfile( {fname} [, {mode}]) *ch_logfile()*
The file is flushed after every message, on Unix you can use
"tail -f" to see what is going on in real time.
-ch_open({address} [, {argdict}]) *ch_open()*
+ch_open({address} [, {options}]) *ch_open()*
Open a channel to {address}. See |channel|.
Returns the channel handle on success. Returns a negative
number for failure.
@@ -2704,7 +2712,7 @@ ch_open({address} [, {argdict}]) *ch_open()*
{address} has the form "hostname:port", e.g.,
"localhost:8765".
- If {argdict} is given it must be a |Dictionary|. The optional
+ If {options} is given it must be a |Dictionary|. The optional
items are:
mode "raw", "js" or "json".
Default "json".
@@ -2754,6 +2762,16 @@ ch_sendraw({handle}, {string} [, {options}]) *ch_sendraw()*
{only available when compiled with the |+channel| feature}
+ch_setoptions({handle}, {options}) *ch_setoptions()*
+ Set options on channel {handle}:
+ "callback" the channel callback
+ "timeout" default read timeout in msec
+ See |ch_open()| for more explanation.
+
+ These options cannot be changed:
+ "mode" cannot be changed once channel is open
+ "waittime" only applies to "ch_open()|
+
ch_status({handle}) *ch_status()*
Return the status of channel {handle}:
"fail" failed to open the channel
@@ -6005,7 +6023,7 @@ setqflist({list} [, {action}]) *setqflist()*
*setreg()*
-setreg({regname}, {value} [,{options}])
+setreg({regname}, {value} [, {options}])
Set the register {regname} to {value}.
{value} may be any value returned by |getreg()|, including
a |List|.
diff --git a/runtime/doc/netbeans.txt b/runtime/doc/netbeans.txt
index f83287020..74bdc346f 100644
--- a/runtime/doc/netbeans.txt
+++ b/runtime/doc/netbeans.txt
@@ -1,4 +1,4 @@
-*netbeans.txt* For Vim version 7.4. Last change: 2016 Jan 31
+*netbeans.txt* For Vim version 7.4. Last change: 2016 Feb 18
VIM REFERENCE MANUAL by Gordon Prieur et al.
@@ -194,6 +194,8 @@ There are two different ways to run Vim in NetBeans mode:
+ an IDE may start Vim with the |-nb| command line argument
+ NetBeans can be started from within Vim with the |:nbstart| command
+Vim uses a 3 second timeout on trying to make the connection.
+
*netbeans-parameters*
Three forms can be used to setup the NetBeans connection parameters.
When started from the command line, the |-nb| command line argument may be:
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index 9f7f50d2e..25ee6a736 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -1,4 +1,4 @@
-*options.txt* For Vim version 7.4. Last change: 2016 Feb 12
+*options.txt* For Vim version 7.4. Last change: 2016 Feb 20
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1969,7 +1969,7 @@ A jump table for the options with a short description can be found at |Q_op|.
NOTE: 'copyindent' is reset when 'compatible' is set.
Also see 'preserveindent'.
- *'cpoptions'* *'cpo'*
+ *'cpoptions'* *'cpo'* *cpo*
'cpoptions' 'cpo' string (Vim default: "aABceFs",
Vi default: all flags)
global
diff --git a/runtime/doc/os_dos.txt b/runtime/doc/os_dos.txt
index 245a31846..2e4659e65 100644
--- a/runtime/doc/os_dos.txt
+++ b/runtime/doc/os_dos.txt
@@ -94,6 +94,7 @@ Shift-Insert paste text (from clipboard) *<S-Insert>*
CTRL-Insert copy Visual text (to clipboard) *<C-Insert>*
CTRL-Del cut Visual text (to clipboard) *<C-Del>*
Shift-Del cut Visual text (to clipboard) *<S-Del>*
+CTRL-X cut Visual text (to clipboard)
These mappings accomplish this (Win32 and DJGPP versions of Vim):
@@ -102,6 +103,7 @@ Shift-Insert <M-N><M-T> "*P "-d"*P <C-R><C-O>*
CTRL-Insert <M-N><M-U> "*y
Shift-Del <M-N><M-W> "*d
CTRL-Del <M-N><M-X> "*d
+CTRL-X <C-X> "*d
Or these mappings (non-Win32 version of Vim):
diff --git a/runtime/doc/pi_netrw.txt b/runtime/doc/pi_netrw.txt
index 3ca221f0f..145c91844 100644
--- a/runtime/doc/pi_netrw.txt
+++ b/runtime/doc/pi_netrw.txt
@@ -1,4 +1,4 @@
-*pi_netrw.txt* For Vim version 7.4. Last change: 2015 Oct 31
+*pi_netrw.txt* For Vim version 7.4. Last change: 2016 Feb 16
------------------------------------------------
NETRW REFERENCE MANUAL by Charles E. Campbell
@@ -6,7 +6,7 @@
Author: Charles E. Campbell <NdrOchip@ScampbellPfamily.AbizM>
(remove NOSPAM from Campbell's email first)
-Copyright: Copyright (C) 1999-2015 Charles E Campbell *netrw-copyright*
+Copyright: Copyright (C) 2016 Charles E Campbell *netrw-copyright*
The VIM LICENSE applies to the files in this package, including
netrw.vim, pi_netrw.txt, netrwFileHandlers.vim, netrwSettings.vim, and
syntax/netrw.vim. Like anything else that's free, netrw.vim and its
@@ -48,9 +48,10 @@ Copyright: Copyright (C) 1999-2015 Charles E Campbell *netrw-copyright*
Introduction To Browsing............................|netrw-intro-browse|
Quick Reference: Maps...............................|netrw-browse-maps|
Quick Reference: Commands...........................|netrw-browse-cmds|
+ Banner Display......................................|netrw-I|
Bookmarking A Directory.............................|netrw-mb|
Browsing............................................|netrw-cr|
- Squeezing the Current Tree-Listing Directory......|:netrw-s-cr|
+ Squeezing the Current Tree-Listing Directory........|netrw-s-cr|
Browsing With A Horizontally Split Window...........|netrw-o|
Browsing With A New Tab.............................|netrw-t|
Browsing With A Vertically Split Window.............|netrw-v|
@@ -75,11 +76,13 @@ Copyright: Copyright (C) 1999-2015 Charles E Campbell *netrw-copyright*
Making The Browsing Directory The Current Directory.|netrw-c|
Marking Files.......................................|netrw-mf|
Unmarking Files.....................................|netrw-mF|
+ Marking Files By Location List......................|netrw-qL|
Marking Files By QuickFix List......................|netrw-qF|
Marking Files By Regular Expression.................|netrw-mr|
Marked Files: Arbitrary Shell Command...............|netrw-mx|
Marked Files: Arbitrary Shell Command, En Bloc......|netrw-mX|
Marked Files: Arbitrary Vim Command.................|netrw-mv|
+ Marked Files: Argument List.........................|netrw-ma| |netrw-mA|
Marked Files: Compression And Decompression.........|netrw-mz|
Marked Files: Copying...............................|netrw-mc|
Marked Files: Diff..................................|netrw-md|
@@ -1113,6 +1116,7 @@ QUICK REFERENCE: MAPS *netrw-browse-maps* {{{2
qb List bookmarked directories and history |netrw-qb|
qf Display information on file |netrw-qf|
qF Mark files using a quickfix list |netrw-qF|
+ qL Mark files using a |location-list| |netrw-qL|
r Reverse sorting order |netrw-r|
R Rename the designated file(s)/directory(ies) |netrw-R|
s Select sorting style: by name, time, or file size |netrw-s|
@@ -1162,6 +1166,14 @@ QUICK REFERENCE: COMMANDS *netrw-explore-cmds* *netrw-browse-cmds* {{{2
:Texplore[!] [dir] Tab & Explore..........................|netrw-explore|
:Vexplore[!] [dir] Vertical Split & Explore...............|netrw-explore|
+
+BANNER DISPLAY *netrw-I*
+
+One may toggle the banner display on and off by pressing "I".
+
+Also See: |g:netrw_banner|
+
+
BOOKMARKING A DIRECTORY *netrw-mb* *netrw-bookmark* *netrw-bookmarks* {{{2
One may easily "bookmark" the currently browsed directory by using >
@@ -1203,7 +1215,7 @@ Related Topics:
|g:netrw_home| controls where .netrwbook is kept
-BROWSING *netrw-cr* {{{2
+BROWSING *netrw-enter* *netrw-cr* {{{2
Browsing is simple: move the cursor onto a file or directory of interest.
Hitting the <cr> (the return key) will select the file or directory.
@@ -1244,11 +1256,21 @@ The price for such re-use is that when changes are made (such as new files
are introduced into a directory), the listing may become out-of-date. One may
always refresh directory listing buffers by pressing ctrl-L (see
|netrw-ctrl-l|).
- *:netrw-s-cr*
- Squeezing the Current Tree-Listing Directory~
- When the tree listing style is enabled (see |netrw-i|) and one is using
- gvim, then the <s-cr> mapping may be used to squeeze (close) the
- directory currently containing the cursor.
+
+ *netrw-s-cr*
+Squeezing the Current Tree-Listing Directory~
+
+When the tree listing style is enabled (see |netrw-i|) and one is using
+gvim, then the <s-cr> mapping may be used to squeeze (close) the
+directory currently containing the cursor.
+
+Otherwise, one may remap a key combination of one's own choice to get
+this effect: >
+
+ nmap <buffer> <silent> <nowait> YOURKEYCOMBO <Plug>NetrwTreeSqueeze
+<
+Put this line in $HOME/ftplugin/netrw/netrw.vim; it needs to be generated
+for netrw buffers only.
Related topics:
|netrw-ctrl-r| |netrw-o| |netrw-p|
@@ -1497,7 +1519,8 @@ One may also use visual mode (see |visual-start|) to select the text that the
special handler will use. Normally gx uses expand("<cfile>") to pick up the
text under the cursor; one may change what |expand()| uses via the
|g:netrw_gx| variable. Alternatively, one may select the text to be used by
-gx via first making a visual selection (see |visual-block|).
+gx via first making a visual selection (see |visual-block|) or by changing
+the |'isfname'| option (which is global, so netrw doesn't modify it).
Associated setting variables:
|g:netrw_gx| control how gx picks up the text under the cursor
@@ -1715,8 +1738,9 @@ Also see: |g:netrw_alto| |g:netrw_altv| |g:netrw_winsize|
EXPLORING WITH STARS AND PATTERNS {{{2
When Explore, Sexplore, Hexplore, or Vexplore are used with one of the
-following four patterns Explore generates a list of files which satisfy
-the request. >
+following four patterns Explore generates a list of files which satisfy the
+request for the local file system. These exploration patterns will not work
+with remote file browsing.
*/filepat files in current directory which satisfy filepat
**/filepat files in current directory or below which satisfy the
@@ -2081,15 +2105,22 @@ Netrw provides several ways to mark files:
:MF *.c
<
- * Note that :MF uses |<f-args>| to break the line
- at spaces.
+ (Note that :MF uses |<f-args>| to break the line
+ at spaces)
+
+ * Mark files using the |argument-list| (|netrw-mA|)
+
+ * Mark files based upon a |location-list| (|netrw-qL|)
* Mark files based upon the quickfix list (|netrw-qF|)
+ (|quickfix-error-lists|)
The following netrw maps make use of marked files:
|netrw-a| Hide marked files/directories
|netrw-D| Delete marked files/directories
+ |netrw-ma| Move marked files' names to |arglist|
+ |netrw-mA| Move |arglist| filenames to marked file list
|netrw-mb| Append marked files to bookmarks
|netrw-mB| Delete marked files from bookmarks
|netrw-mc| Copy marked files to target
@@ -2148,8 +2179,14 @@ UNMARKING FILES *netrw-mF* {{{2
The "mF" command will unmark all files in the current buffer. One may also use
mf (|netrw-mf|) on a specific, already marked, file to unmark just that file.
+MARKING FILES BY LOCATION LIST *netrw-qL* {{{2
+ (also see |netrw-mf|)
+
+One may convert |location-list|s into a marked file list using "qL".
+You may then proceed with commands such as me (|netrw-me|) to edit them.
-MARKING FILES BY QUICKFIX LIST *netrw-qF* {{{2
+
+MARKING FILES BY QUICKFIX LIST *netrw-qF* {{{2
(also see |netrw-mf|)
One may convert |quickfix-error-lists| into a marked file list using "qF".
@@ -2225,6 +2262,16 @@ The command that will be run with this example:
tar cf mynewtarball.tar 'file1' 'file2' ...
+MARKED FILES: ARGUMENT LIST *netrw-ma* *netrw-mA*
+ (See |netrw-mf| and |netrw-mr| for how to mark files)
+ (uses the global marked-file list)
+
+Using ma, one moves filenames from the marked file list to the argument list.
+Using mA, one moves filenames from the argument list to the marked file list.
+
+See Also: |netrw-qF| |argument-list| |:args|
+
+
MARKED FILES: COMPRESSION AND DECOMPRESSION *netrw-mz* {{{2
(See |netrw-mf| and |netrw-mr| for how to mark files)
(uses the local marked file list)
@@ -2234,7 +2281,7 @@ If any marked files are decompressed, then "mz" will compress them
using the command specified by |g:netrw_compress|; by default,
that's "gzip".
-For decompression, netrw provides a |Dictionary| of suffices and their
+For decompression, netrw uses a |Dictionary| of suffices and their
associated decompressing utilities; see |g:netrw_decompress|.
Remember that one can mark multiple files by regular expression
@@ -2289,7 +2336,7 @@ The command will ask for the requested pattern; one may then enter: >
pattern
<
With /pattern/, editing will start with the first item on the |quickfix| list
-that vimgrep sets up (see |:copen|, |:cnext|, |:cprevious|). The |:vimgrep|
+that vimgrep sets up (see |:copen|, |:cnext|, |:cprevious|, |:cclose|). The |:vimgrep|
command is in use, so without 'g' each line is added to quickfix list only
once; with 'g' every match is included.
@@ -2758,6 +2805,16 @@ your browsing preferences. (see also: |netrw-settings|)
evaluation will be suppressed
(see |'ballooneval'|)
+ *g:netrw_sizestyle* not defined: actual bytes (default)
+ ="b" : actual bytes (default)
+ ="h" : human-readable (ex. 5k, 4m, 3g)
+ uses 1000 base
+ ="H" : human-readable (ex. 5K, 4M, 3G)
+ uses 1024 base
+ The long listing (|netrw-i|) and query-file
+ maps (|netrw-qf|) will display file size
+ using the specified style.
+
*g:netrw_usetab* if this variable exists and is non-zero, then
the <tab> map supporting shrinking/expanding a
Lexplore or netrw window will be enabled.
@@ -3026,14 +3083,14 @@ These will:
Related: if you like this idea, you may also find :Lexplore
(|netrw-:Lexplore|) or |g:netrw_chgwin| of interest
-Also see: |g:netrw_chgwin| |netrw-P| |'previewwindow'|
+Also see: |g:netrw_chgwin| |netrw-P| |'previewwindow'| |CTRL-W_z| |:pclose|
PREVIOUS WINDOW *netrw-P* *netrw-prvwin* {{{2
-To edit a file or directory in the previously used (last accessed) window (see
-:he |CTRL-W_p|), press a "P". If there's only one window, then the one window
-will be horizontally split (by default).
+To edit a file or directory under the cursor in the previously used (last
+accessed) window (see :he |CTRL-W_p|), press a "P". If there's only one
+window, then the one window will be horizontally split (by default).
If there's more than one window, the previous window will be re-used on
the selected file/directory. If the previous window's associated buffer
@@ -3172,7 +3229,7 @@ only if your terminal supports differentiating <c-tab> from a plain
* Else bring up a |:Lexplore| window
If |g:netrw_usetab| exists or is zero, or if there is a pre-existing mapping
-for <c-tab>, then the <tab> will not be mapped. One may map something other
+for <c-tab>, then the <c-tab> will not be mapped. One may map something other
than a <c-tab>, too: (but you'll still need to have had g:netrw_usetab set) >
nmap <unique> (whatever) <Plug>NetrwShrink
@@ -3639,13 +3696,13 @@ called netrw.vimrc with the following contents: >
<
Then run netrw as follows: >
- vim -u netrw.vimrc --noplugins [some path here]
+ vim -u netrw.vimrc --noplugins -i NONE [some path here]
<
Perform whatever netrw commands you need to, and check that the problem is
still present. This procedure sidesteps any issues due to personal .vimrc
-settings and other plugins. If the problem does not appear, then you need
-to determine what setting in your .vimrc is causing the conflict with netrw
-or which plugin.
+settings, .viminfo file, and other plugins. If the problem does not appear,
+then you need to determine which setting in your .vimrc is causing the
+conflict with netrw or which plugin(s) is/are involved.
Step 3: If the problem still is present, then get a debugging trace from
netrw:
@@ -3700,6 +3757,37 @@ netrw:
==============================================================================
12. History *netrw-history* {{{1
+ v155: Oct 29, 2015 * (Timur Fayzrakhmanov) reported that netrw's
+ mapping of ctrl-l was not allowing refresh of
+ other windows when it was done in a netrw
+ window.
+ Nov 05, 2015 * Improved s:TreeSqueezeDir() to use search()
+ instead of a loop
+ * NetrwBrowse() will return line to
+ w:netrw_bannercnt if cursor ended up in
+ banner
+ Nov 16, 2015 * Added a <Plug>NetrwTreeSqueeze (|netrw-s-cr|)
+ Nov 17, 2015 * Commented out imaps -- perhaps someone can
+ tell me how they're useful and should be
+ retained?
+ Nov 20, 2015 * Added |netrw-ma| and |netrw-mA| support
+ Nov 20, 2015 * gx (|netrw-gx|) on an url downloaded the
+ file in addition to simply bringing up the
+ url in a browser. Fixed.
+ Nov 23, 2015 * Added |g:netrw_sizestyle| support
+ Nov 27, 2015 * Inserted a lot of <c-u>s into various netrw
+ maps.
+ Jan 05, 2016 * |netrw-qL| implemented to mark files based
+ upon |location-list|s; similar to |netrw-qF|.
+ Jan 19, 2016 * using - call delete(directoryname,"d") -
+ instead of using g:netrw_localrmdir if
+ v7.4 + patch#1107 is available
+ Jan 28, 2016 * changed to using |winsaveview()| and
+ |winrestview()|
+ Jan 28, 2016 * s:NetrwTreePath() now does a save and
+ restore of view
+ Feb 08, 2016 * Fixed a tree-listing problem with remote
+ directories
v154: Feb 26, 2015 * (Yuri Kanivetsky) reported a situation where
a file was not treated properly as a file
due to g:netrw_keepdir == 1
@@ -3860,7 +3948,7 @@ netrw:
handling.
* |:Lexplore| path: will be used to update
a left-side netrw browsing directory.
- Mar 12, 2014 * |:netrw-s-cr|: use <s-cr> to close
+ Mar 12, 2014 * |netrw-s-cr|: use <s-cr> to close
tree directory implemented
Mar 13, 2014 * (Tony Mechylynck) reported that using
the browser with ftp on a directory,
diff --git a/runtime/doc/starting.txt b/runtime/doc/starting.txt
index 773a3b912..bee8c80cd 100644
--- a/runtime/doc/starting.txt
+++ b/runtime/doc/starting.txt
@@ -1,4 +1,4 @@
-*starting.txt* For Vim version 7.4. Last change: 2014 Jul 09
+*starting.txt* For Vim version 7.4. Last change: 2016 Feb 18
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -12,9 +12,10 @@ Starting Vim *starting*
4. Initialization |initialization|
5. $VIM and $VIMRUNTIME |$VIM|
6. Suspending |suspend|
-7. Saving settings |save-settings|
-8. Views and Sessions |views-sessions|
-9. The viminfo file |viminfo-file|
+7. Exiting |exiting|
+8. Saving settings |save-settings|
+9. Views and Sessions |views-sessions|
+10. The viminfo file |viminfo-file|
==============================================================================
1. Vim arguments *vim-arguments*
@@ -1133,7 +1134,20 @@ can't paste it in another application (since Vim is going to sleep an attempt
to get the selection would make the program hang).
==============================================================================
-7. Saving settings *save-settings*
+7. Exiting *exiting*
+
+There are several ways to exit Vim:
+- Close the last window with `:quit`. Only when there are no changes.
+- Close the last window with `:quit!`. Also when there are changes.
+- Close all windows with `:qall`. Only when there are no changes.
+- Close all windows with `:qall!`. Also when there are changes.
+- Use `:cquit`. Also when there are changes.
+
+When using `:cquit` or when there was an error message Vim exits with exit
+code 1. Errors can be avoide by using `:silent!`.
+
+==============================================================================
+8. Saving settings *save-settings*
Mostly you will edit your vimrc files manually. This gives you the greatest
flexibility. There are a few commands to generate a vimrc file automatically.
@@ -1195,7 +1209,7 @@ option, which has several side effects. See |'compatible'|.
'compatible' option to the output file first, because of these side effects.
==============================================================================
-8. Views and Sessions *views-sessions*
+9. Views and Sessions *views-sessions*
This is introduced in sections |21.4| and |21.5| of the user manual.
@@ -1342,7 +1356,7 @@ To automatically save and restore views for *.c files: >
au BufWinEnter *.c silent loadview
==============================================================================
-9. The viminfo file *viminfo* *viminfo-file* *E136*
+10. The viminfo file *viminfo* *viminfo-file* *E136*
*E575* *E576* *E577*
If you exit Vim and later start it again, you would normally lose a lot of
information. The viminfo file can be used to remember that information, which
diff --git a/runtime/doc/tags b/runtime/doc/tags
index d07934438..a11cb2b9b 100644
--- a/runtime/doc/tags
+++ b/runtime/doc/tags
@@ -2550,7 +2550,6 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
:nbkey netbeans.txt /*:nbkey*
:nbstart netbeans.txt /*:nbstart*
:ne editing.txt /*:ne*
-:netrw-s-cr pi_netrw.txt /*:netrw-s-cr*
:new windows.txt /*:new*
:next editing.txt /*:next*
:next_f editing.txt /*:next_f*
@@ -2836,6 +2835,7 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
:sign-unplace sign.txt /*:sign-unplace*
:sil various.txt /*:sil*
:silent various.txt /*:silent*
+:silent! various.txt /*:silent!*
:sim gui_w32.txt /*:sim*
:simalt gui_w32.txt /*:simalt*
:sin change.txt /*:sin*
@@ -5168,11 +5168,13 @@ cc change.txt /*cc*
ceil() eval.txt /*ceil()*
ch.vim syntax.txt /*ch.vim*
ch_close() eval.txt /*ch_close()*
+ch_log() eval.txt /*ch_log()*
ch_logfile() eval.txt /*ch_logfile()*
ch_open() eval.txt /*ch_open()*
ch_readraw() eval.txt /*ch_readraw()*
ch_sendexpr() eval.txt /*ch_sendexpr()*
ch_sendraw() eval.txt /*ch_sendraw()*
+ch_setoptions() eval.txt /*ch_setoptions()*
ch_status() eval.txt /*ch_status()*
change-list-jumps motion.txt /*change-list-jumps*
change-name tips.txt /*change-name*
@@ -5361,6 +5363,7 @@ count-items tips.txt /*count-items*
count-variable eval.txt /*count-variable*
count1-variable eval.txt /*count1-variable*
cp-default version5.txt /*cp-default*
+cpo options.txt /*cpo*
cpo-! options.txt /*cpo-!*
cpo-# options.txt /*cpo-#*
cpo-$ options.txt /*cpo-$*
@@ -5694,6 +5697,7 @@ execute-menus gui.txt /*execute-menus*
exepath() eval.txt /*exepath()*
exim starting.txt /*exim*
exists() eval.txt /*exists()*
+exiting starting.txt /*exiting*
exp() eval.txt /*exp()*
expand() eval.txt /*expand()*
expand-env options.txt /*expand-env*
@@ -6206,6 +6210,7 @@ g:netrw_sepchr pi_netrw.txt /*g:netrw_sepchr*
g:netrw_servername pi_netrw.txt /*g:netrw_servername*
g:netrw_sftp_cmd pi_netrw.txt /*g:netrw_sftp_cmd*
g:netrw_silent pi_netrw.txt /*g:netrw_silent*
+g:netrw_sizestyle pi_netrw.txt /*g:netrw_sizestyle*
g:netrw_sort_by pi_netrw.txt /*g:netrw_sort_by*
g:netrw_sort_direction pi_netrw.txt /*g:netrw_sort_direction*
g:netrw_sort_options pi_netrw.txt /*g:netrw_sort_options*
@@ -7213,6 +7218,7 @@ netrw-:Texplore pi_netrw.txt /*netrw-:Texplore*
netrw-:Vexplore pi_netrw.txt /*netrw-:Vexplore*
netrw-C pi_netrw.txt /*netrw-C*
netrw-D pi_netrw.txt /*netrw-D*
+netrw-I pi_netrw.txt /*netrw-I*
netrw-O pi_netrw.txt /*netrw-O*
netrw-P pi_netrw.txt /*netrw-P*
netrw-P18 pi_netrw.txt /*netrw-P18*
@@ -7262,6 +7268,7 @@ netrw-dirlist pi_netrw.txt /*netrw-dirlist*
netrw-downdir pi_netrw.txt /*netrw-downdir*
netrw-edithide pi_netrw.txt /*netrw-edithide*
netrw-editwindow pi_netrw.txt /*netrw-editwindow*
+netrw-enter pi_netrw.txt /*netrw-enter*
netrw-ex pi_netrw.txt /*netrw-ex*
netrw-explore pi_netrw.txt /*netrw-explore*
netrw-explore-cmds pi_netrw.txt /*netrw-explore-cmds*
@@ -7298,10 +7305,12 @@ netrw-list pi_netrw.txt /*netrw-list*
netrw-listbookmark pi_netrw.txt /*netrw-listbookmark*
netrw-listhack pi_netrw.txt /*netrw-listhack*
netrw-login pi_netrw.txt /*netrw-login*
+netrw-mA pi_netrw.txt /*netrw-mA*
netrw-mB pi_netrw.txt /*netrw-mB*
netrw-mF pi_netrw.txt /*netrw-mF*
netrw-mT pi_netrw.txt /*netrw-mT*
netrw-mX pi_netrw.txt /*netrw-mX*
+netrw-ma pi_netrw.txt /*netrw-ma*
netrw-mb pi_netrw.txt /*netrw-mb*
netrw-mc pi_netrw.txt /*netrw-mc*
netrw-md pi_netrw.txt /*netrw-md*
@@ -7362,6 +7371,7 @@ netrw-pscp pi_netrw.txt /*netrw-pscp*
netrw-psftp pi_netrw.txt /*netrw-psftp*
netrw-putty pi_netrw.txt /*netrw-putty*
netrw-qF pi_netrw.txt /*netrw-qF*
+netrw-qL pi_netrw.txt /*netrw-qL*
netrw-qb pi_netrw.txt /*netrw-qb*
netrw-qf pi_netrw.txt /*netrw-qf*
netrw-quickcom pi_netrw.txt /*netrw-quickcom*
@@ -7378,6 +7388,7 @@ netrw-reverse pi_netrw.txt /*netrw-reverse*
netrw-rexplore pi_netrw.txt /*netrw-rexplore*
netrw-rightmouse pi_netrw.txt /*netrw-rightmouse*
netrw-s pi_netrw.txt /*netrw-s*
+netrw-s-cr pi_netrw.txt /*netrw-s-cr*
netrw-settings pi_netrw.txt /*netrw-settings*
netrw-settings-window pi_netrw.txt /*netrw-settings-window*
netrw-sexplore pi_netrw.txt /*netrw-sexplore*
diff --git a/runtime/doc/todo.txt b/runtime/doc/todo.txt
index 11ee79fbc..aece38c27 100644
--- a/runtime/doc/todo.txt
+++ b/runtime/doc/todo.txt
@@ -1,4 +1,4 @@
-*todo.txt* For Vim version 7.4. Last change: 2016 Feb 15
+*todo.txt* For Vim version 7.4. Last change: 2016 Feb 20
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -35,11 +35,8 @@ not be repeated below, unless there is extra information.
-------------------- Known bugs and current work -----------------------
+channel:
-- Move netbeans NL handling to channel.c, use it for NL mode channel
-- ch_open fails when socket isn't present yet. (Marcin Szamotulski)
- Retry when error is "connection refused".
-- channel test waittime is disabled for MS-Windows, causes a crash.
-- channel needs both stdout and stderr (GUI implementation)
+- channel needs both stdout and stderr (GUI implementation, queues)
+ - ch_read() for stderr
- implement TODO items in ":help channel":
- implement ch_setoptions(handle, {options})
- job_setoptions(job, {options})
@@ -48,7 +45,6 @@ not be repeated below, unless there is extra information.
- err-cb
- exit-cb move code from mch_clear_job()
- job argument: killonexit
- - ch_read() for stderr
- ch_getjob(handle)
- ch_read(handle [, timeout])
- ch_readall(handle [, timeout])
@@ -57,6 +53,12 @@ not be repeated below, unless there is extra information.
- job_gethandle(), job_sethandle()
- add ch_status(): Whether channel is open. Perhaps also mode, timeout.
- When channel closes invoke "close-cb".
+- Add "call" to call a function with a list of arguments. (Damien)
+ merge "expr" and "eval", send something back if there is a third arg?
+- A callback on ch_sendraw() should be put at the end of the list of callback
+ handlers. When a message arrives invoke the first one and remove it.
+- Support channel without socket support. Useful for starting a job with
+ pipes. Need another feature, +socket ?
- Move more details from eval.txt to channel.txt. Add tags in eval.txt.
- When receiving malformed json starting with a quote it doesn't get
discarded.
@@ -79,6 +81,7 @@ not be repeated below, unless there is extra information.
- json: implement UTF-16 surrogate pair.
- For connection to server, a "keep open" flag would be useful. Retry
connecting in the main loop with zero timeout.
+
More plugin support:
- Have a way to install a callback from the main loop. Called every second or
so.
@@ -102,6 +105,10 @@ This difference is unexpected:
0
It's because tv_equal() works different.
+Compiler warnings. (John Marriott, Feb 17)
+
+Compiler warnings in if_ole.cpp. Patch by Ken Takata, Feb 18.
+
Add "runtime/bundles" ?
runtime/bundles/netrw/spec.vim
runtime/bundles/netrw/autoload/netrw.vim
@@ -122,6 +129,8 @@ Add a "requires" / "provides" mechanism?
~/vim/packages/netrw/def/netrw/plugin/netrw.vim
~/vim/packages/netrw/opt/nwdebug/plugin/nwdebug.vim
+Patch to add GTK 3 support. (Kazunobu Kuriyama, 2016 Feb 13)
+
Why does this: echo "a" . 1.1
result in: a11
Should recognize float (so long as it's not ".1.1").
@@ -170,6 +179,9 @@ Regexp problems:
matches the empty string. (Dominique Pelle, 2015 Oct 2, Nov 24)
- Search for \\~ causes error E874.
+Patch to fix that folds close with autocomplete. #643
+Christian Brabandt, 2016 Feb 18.
+
Also include update_curswant() fix for getcurpos(). (Christian Brabandt, 2016
Feb 9)
@@ -275,7 +287,7 @@ With a 'cpo' flag. (Christian Brabandt, 2016 Feb 8)
Patch to add TagNotFound autocommand. (Anton Lindqvist, 2016 Feb 3)
-Patch to add Error autocommand. (Anton Lindqvist, 2016 Feb 14)
+Patch to add Error autocommand. (Anton Lindqvist, 2016 Feb 17)
Only remembers one error.
Illegal memory access, requires ASAN to see. (Dominique Pelle, 2015 Jul 28)
@@ -317,6 +329,9 @@ Half-finished patch to fix the Problem using cgn to change a search hit when
replacement includes hit. Reported by John Beckett, fix by Christian Brabandt,
2016 Jan 11.
+Patch to add :mapgroup, put mappings in a group like augroup.
+(Yasuhiro Matsumoto, 2016 Feb 19)
+
Value returned by virtcol() changes depending on how lines wrap. This is
inconsistent with the documentation.
@@ -326,9 +341,6 @@ Can we cache the syntax attributes, so that updates for 'relativenumber' and
Build with Python on Mac does not always use the right library.
(Kazunobu Kuriyama, 2015 Mar 28)
-Patch to add GTK 3 support. (Kazunobu Kuriyama, 2016 Feb 13)
-Does not fully work yet.
-
Need a Vim equivalent of Python's None and a way to test for it.
Use v:none. var == v:none
diff --git a/runtime/doc/various.txt b/runtime/doc/various.txt
index 3c2ea59a5..8fe47bb88 100644
--- a/runtime/doc/various.txt
+++ b/runtime/doc/various.txt
@@ -1,4 +1,4 @@
-*various.txt* For Vim version 7.4. Last change: 2016 Feb 15
+*various.txt* For Vim version 7.4. Last change: 2016 Feb 18
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -515,7 +515,7 @@ N *+X11* Unix only: can restore window title |X11|
:redi[r] END End redirecting messages. {not in Vi}
- *:sil* *:silent*
+ *:sil* *:silent* *:silent!*
:sil[ent][!] {command} Execute {command} silently. Normal messages will not
be given or added to the message history.
When [!] is added, error messages will also be
diff --git a/runtime/plugin/matchparen.vim b/runtime/plugin/matchparen.vim
index 5929cf371..5db1f64c7 100644
--- a/runtime/plugin/matchparen.vim
+++ b/runtime/plugin/matchparen.vim
@@ -1,6 +1,6 @@
" Vim plugin for showing matching parens
" Maintainer: Bram Moolenaar <Bram@vim.org>
-" Last Change: 2016 Feb 09
+" Last Change: 2016 Feb 16
" Exit quickly when:
" - this plugin was already loaded (or disabled)
@@ -97,7 +97,6 @@ function! s:Highlight_Matching_Pair()
if has_getcurpos
" getcurpos() is more efficient but doesn't exist before 7.4.313.
let save_cursor = getcurpos()
-let g:saved_cursor = save_cursor
else
let save_cursor = winsaveview()
endif
diff --git a/runtime/plugin/netrwPlugin.vim b/runtime/plugin/netrwPlugin.vim
index 3776ac30f..69902b1f1 100644
--- a/runtime/plugin/netrwPlugin.vim
+++ b/runtime/plugin/netrwPlugin.vim
@@ -1,6 +1,6 @@
" netrwPlugin.vim: Handles file transfer and remote directory listing across a network
" PLUGIN SECTION
-" Date: Nov 07, 2014
+" Date: Feb 08, 2016
" Maintainer: Charles E Campbell <NdrOchip@ScampbellPfamily.AbizM-NOSPAM>
" GetLatestVimScripts: 1075 1 :AutoInstall: netrw.vim
" Copyright: Copyright (C) 1999-2013 Charles E. Campbell {{{1
@@ -20,7 +20,7 @@
if &cp || exists("g:loaded_netrwPlugin")
finish
endif
-let g:loaded_netrwPlugin = "v154"
+let g:loaded_netrwPlugin = "v155"
let s:keepcpo = &cpo
set cpo&vim
"DechoRemOn
@@ -55,10 +55,10 @@ augroup Network
augroup END
" Commands: :Nread, :Nwrite, :NetUserPass {{{2
-com! -count=1 -nargs=* Nread call netrw#SavePosn()<bar>call netrw#NetRead(<count>,<f-args>)<bar>call netrw#RestorePosn()
-com! -range=% -nargs=* Nwrite call netrw#SavePosn()<bar><line1>,<line2>call netrw#NetWrite(<f-args>)<bar>call netrw#RestorePosn()
+com! -count=1 -nargs=* Nread let s:svpos= winsaveview()<bar>call netrw#NetRead(<count>,<f-args>)<bar>call winrestview(s:svpos)
+com! -range=% -nargs=* Nwrite let s:svpos= winsaveview()<bar><line1>,<line2>call netrw#NetWrite(<f-args>)<bar>call winrestview(s:svpos)
com! -nargs=* NetUserPass call NetUserPass(<f-args>)
-com! -nargs=* Nsource call netrw#SavePosn()<bar>call netrw#NetSource(<f-args>)<bar>call netrw#RestorePosn()
+com! -nargs=* Nsource let s:svpos= winsaveview()<bar>call netrw#NetSource(<f-args>)<bar>call winrestview(s:svpos)
com! -nargs=? Ntree call netrw#SetTreetop(<q-args>)
" Commands: :Explore, :Sexplore, Hexplore, Vexplore, Lexplore {{{2
diff --git a/runtime/syntax/sh.vim b/runtime/syntax/sh.vim
index 909ead81f..15a00eb51 100644
--- a/runtime/syntax/sh.vim
+++ b/runtime/syntax/sh.vim
@@ -2,8 +2,8 @@
" Language: shell (sh) Korn shell (ksh) bash (sh)
" Maintainer: Charles E. Campbell <NdrOchipS@PcampbellAfamily.Mbiz>
" Previous Maintainer: Lennart Schultz <Lennart.Schultz@ecmwf.int>
-" Last Change: Dec 11, 2015
-" Version: 143
+" Last Change: Feb 16, 2016
+" Version: 144
" URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_SH
" For options and settings, please use: :help ft-sh-syntax
" This file includes many ideas from Eric Brunet (eric.brunet@ens.fr)
@@ -85,6 +85,11 @@ if g:sh_fold_enabled && &fdm == "manual"
setl fdm=syntax
endif
+" set up the syntax-highlighting iskeyword
+if has("patch-7.4.1141")
+ exe "syn iskeyword ".&iskeyword.",-"
+endif
+
" Set up folding commands for shell {{{1
" =================================
if s:sh_fold_functions
diff --git a/runtime/syntax/vim.vim b/runtime/syntax/vim.vim
index ebed5be58..9928051c2 100644
--- a/runtime/syntax/vim.vim
+++ b/runtime/syntax/vim.vim
@@ -1,8 +1,8 @@
" Vim syntax file
" Language: Vim 7.4 script
" Maintainer: Charles E. Campbell <NdrOchipS@PcampbellAfamily.Mbiz>
-" Last Change: January 20, 2016
-" Version: 7.4-40
+" Last Change: February 17, 2016
+" Version: 7.4-43
" Automatically generated keyword lists: {{{1
" Quit when a syntax file was already loaded {{{2
@@ -18,39 +18,38 @@ syn keyword vimTodo contained COMBAK FIXME TODO XXX
syn cluster vimCommentGroup contains=vimTodo,@Spell
" regular vim commands {{{2
-syn keyword vimCommand contained a argd argu[ment] bf[irst] brea[k] buf cabc[lear] cc cfdo changes clo[se] cN[ext] colo[rscheme] con[tinue] cr[ewind] d delel deletp dep diffpu[t] dir doau ea e[dit] endfo[r] ene[w] files fini[sh] foldd[oopen] g h helpt[ags] iabc[lear] intro k l lan lc[d] le[ft] lfir[st] lh[elpgrep] lmapc[lear] lnf loadkeymap lpf[ile] luado mak[e] mes mkv mz nbs[tart] noautocmd o ownsyntax perld[o] pre[serve] promptf[ind] ptl[ast] ptr[ewind] py3do qa[ll] rec[over] reg[isters] rightb[elow] ru[ntime] sba[ll] sbp[revious] sci scr[iptnames] setl[ocal] sgi sh[ell] sIe sil[ent] sir sm[ap] sno[magic] sp spellu[ndo] sre[wind] srp star[tinsert] sun[hide] sy ta tabfir[st] tabN[ext] tags th[row] tN tr[ewind] un unl verb[ose] vimgrepa[dd] w winp[os] wqa[ll] xa[ll] xnoremenu
-syn keyword vimCommand contained ab argd[elete] as[cii] bl[ast] breaka[dd] bufdo cad[dbuffer] ccl[ose] cf[ile] chd[ir] cmapc[lear] cnf com cope[n] cs de delep delf di diffs[plit] di[splay] dp earlier el[se] endfun ex filet fir[st] foldo[pen] go[to] ha[rdcopy] hi if is[earch] keepa la lan[guage] lch[dir] lefta[bove] lgetb[uffer] l[ist] lN lNf lo[adview] lp[revious] luafile ma[rk] messages mkvie[w] mzf[ile] ne noh[lsearch] ol[dfiles] p po[p] prev[ious] promptr[epl] ptn pts[elect] pydo q[uit] red res[ize] ru rv[iminfo] sbf[irst] sbr[ewind] scI scs sf[ind] sgI si sig sim[alt] sIr sme snoreme spe spellw[rong] srg st startr[eplace] sunme syn tab tabl[ast] tabo[nly] tc[l] tj[ump] tn[ext] try una[bbreviate] unlo[ckvar] ve[rsion] vi[sual] wa[ll] win[size] w[rite] x[it] xprop
-syn keyword vimCommand contained abc[lear] argdo au bm[odified] breakd[el] b[uffer] cadde[xpr] cd cfir[st] che[ckpath] cn cNf comc[lear] co[py] cscope debug d[elete] delf[unction] dif difft[his] dj[ump] dr[op] ec elsei[f] endf[unction] exi[t] filetype fix[del] for gr[ep] h[elp] hid[e] ij[ump] isp[lit] keepalt lad la[st] lcl[ose] lex[pr] lgete[xpr] ll lne lnf[ile] loc[kmarks] lr[ewind] lv[imgrep] marks mk mkv[imrc] mz[scheme] new nor omapc[lear] pc[lose] popu p[rint] ps[earch] ptN pu[t] pyf[ile] quita[ll] redi[r] ret[ab] rub[y] sal[l] sbl[ast] sb[uffer] scl scscope sfir[st] sgl sI sIg sin sl smenu snoremenu spelld[ump] sp[lit] sri sta[g] stj[ump] sunmenu sync tabc[lose] tabm[ove] tabp[revious] tcld[o] tl[ast] tN[ext] ts[elect] u[ndo] uns[ilent] vert[ical] viu[sage] wh[ile] wn[ext] ws[verb] xmapc[lear] xunme
-syn keyword vimCommand contained abo[veleft] arge[dit] bad[d] bn[ext] breakl[ist] buffers caddf[ile] cdo cgetb[uffer] checkt[ime] cN cnf[ile] comp[iler] cpf[ile] cstag debugg[reedy] deletel dell diffg[et] dif[fupdate] dl ds[earch] echoe[rr] em[enu] en[dif] exu[sage] fin fo[ld] fu grepa[dd] helpc[lose] his[tory] il[ist] iuna[bbrev] keepj[umps] laddb[uffer] lat lcs lf lg[etfile] lla[st] lnew[er] lNf[ile] lockv[ar] ls lvimgrepa[dd] mat[ch] mk[exrc] mo n n[ext] nore on[ly] pe popu[p] pro pta[g] ptn[ext] pw[d] py[thon] r red[o] retu[rn] rubyd[o] san[dbox] sbm[odified] sc scp se[t] sg sgn sic sign sIn sla[st] sn[ext] so spe[llgood] spr[evious] srI star st[op] sus[pend] syncbind tabd[o] tabN tabr[ewind] tclf[ile] tm to[pleft] tu undoj[oin] up[date] vi vmapc[lear] win wN[ext] wundo xme xunmenu
-syn keyword vimCommand contained al[l] argg[lobal] ba[ll] bN[ext] br[ewind] bun[load] cal[l] ce[nter] cgete[xpr] cl cnew[er] cNf[ile] con cp[revious] cuna[bbrev] del deletep delm[arks] diffo[ff] dig dli[st] dsp[lit] echom[sg] en endt[ry] f fina[lly] foldc[lose] fun gui helpf[ind] i imapc[lear] j[oin] kee[pmarks] lad[dexpr] later lcscope lfdo lgr[ep] lli[st] lne[xt] lo lol[der] lt[ag] lw[indow] menut mks[ession] mod[e] nbc[lose] nmapc[lear] nos[wapfile] o[pen] ped[it] pp[op] profd[el] ptf[irst] ptN[ext] py python3 re redr[aw] rew[ind] rubyf[ile] sa[rgument] sbn[ext] sce scr setf[iletype] sgc sgp sIc sil sip sl[eep] sN[ext] sor[t] spelli[nfo] sr srl start stopi[nsert] sv[iew] syntime tabe[dit] tabnew tabs te[aroff] tm[enu] tp[revious] tu[nmenu] undol[ist] v vie[w] vne[w] winc[md] wp[revious] wv[iminfo] xmenu xwininfo
-syn keyword vimCommand contained ar argl[ocal] bd[elete] bo[tright] bro[wse] bw[ipeout] cat[ch] cex[pr] cg[etfile] cla[st] cn[ext] col[der] conf[irm] cq[uit] cw[indow] delc[ommand] deletl delp diffp[atch] dig[raphs] do e echon endf endw[hile] f[ile] fin[d] folddoc[losed] fu[nction] gvim helpg[rep] ia in ju[mps] keepp[atterns] laddf[ile] lb[uffer] ld[o] lf[ile] lgrepa[dd] lmak[e] lN[ext] loadk lop[en] lua ma menut[ranslate] mksp[ell] m[ove] nb[key] noa nu[mber] opt[ions] pe[rl] pr prof[ile] ptj[ump] ptp[revious] py3 q r[ead] redraws[tatus] ri[ght] rundo sav[eas] sbN[ext] scg scripte[ncoding] setg[lobal] sge sgr sie sIl sIp sm[agic] sni[ff] so[urce] spellr[epall] src srn startg[replace] sts[elect] sw[apname] t tabf[ind] tabn[ext] ta[g] tf[irst] tn tr u unh[ide] ve vim[grep] vs[plit] windo wq x xnoreme y[ank]
-syn keyword vimCommand contained arga[dd] ar[gs] bel[owright] bp[revious] bu c cb[uffer] cf c[hange] cl[ist]
+syn keyword vimCommand contained a arga[dd] argl[ocal] ba[ll] bn[ext] breakd[el] bufdo cabc[lear] cat[ch] ce[nter] cgetb[uffer] che[ckpath] cmapc[lear] cnf com cope[n] cs de delep delf di difft[his] dj[ump] dr[op] ec elsei[f] endf[unction] exi[t] filetype fix[del] for gr[ep] h[elp] hid[e] ij[ump] isp[lit] keepalt lad la[st] lcl[ose] lex[pr] lgete[xpr] ll lne lnf[ile] loc[kmarks] lr[ewind] lv[imgrep] marks mk mkv[imrc] mz[scheme] new noswap[file] o[pen] ped[it] pp[op] profd[el] ptf[irst] ptN[ext] py python3 re redr[aw] rew[ind] rubyf[ile] sa[rgument] sbn[ext] scripte[ncoding] setf[iletype] sh[ell] sim[alt] sm[ap] sni[ff] sor[t] spelli[nfo] spr[evious] start st[op] sunmenu syn ta tabf[ind] tabnew tabr[ewind] tcld[o] tj[ump] tN tr tu[nmenu] undoj[oin] uns[ilent] ve[rsion] vimgrepa[dd] vs[plit] winc[md] wN[ext] ws[verb] x[it] xnoremenu
+syn keyword vimCommand contained ab argd ar[gs] bd[elete] bN[ext] breakl[ist] b[uffer] cad cb[uffer] cex[pr] cgete[xpr] checkt[ime] cn cNf comc[lear] co[py] cscope debug d[elete] delf[unction] diffg[et] diffu[pdate] dl ds[earch] echoe[rr] em[enu] en[dif] exu[sage] fin fo[ld] fu grepa[dd] helpc[lose] his[tory] il[ist] iuna[bbrev] keepj[umps] laddb[uffer] lat lcs lf lg[etfile] lla[st] lnew[er] lNf[ile] lockv[ar] ls lvimgrepa[dd] mat[ch] mk[exrc] mo n n[ext] nu[mber] opt[ions] pe[rl] pr prof[ile] ptj[ump] ptp[revious] py3 q r[ead] redraws[tatus] ri[ght] rundo sav[eas] sbN[ext] scrip[tnames] setg[lobal] si sl sme sno[magic] so[urce] spellr[epall] sre[wind] startg[replace] stopi[nsert] sus[pend] sync tab tabfir[st] tabn[ext] tabs tclf[ile] tl[ast] tn[ext] tr[ewind] u undol[ist] up[date] vert[ical] vi[sual] w windo wp[revious] wundo xmapc[lear] xunme
+syn keyword vimCommand contained abc[lear] argd[elete] argu[ment] bel[owright] bo[tright] br[ewind] buffers caddb[uffer] cc cf cg[etfile] cl cN cnf[ile] comp[iler] cpf[ile] cstag debugg[reedy] deletel dell diffo[ff] dig dli[st] dsp[lit] echom[sg] en endt[ry] f fina[lly] foldc[lose] fun gui helpf[ind] i imapc[lear] j[oin] kee[pmarks] lad[dexpr] later lcscope lfdo lgr[ep] lli[st] lne[xt] lo lol[der] lt[ag] lw[indow] menut mks[ession] mod[e] nbc[lose] nmapc[lear] o ownsyntax perld[o] pre[serve] promptf[ind] ptl[ast] ptr[ewind] py3do qa[ll] rec[over] reg[isters] rightb[elow] ru[ntime] sba[ll] sbp[revious] scs setl[ocal] sig sla[st] smenu snoreme spe spellu[ndo] st star[tinsert] sts[elect] sv[iew] syncbind tabc[lose] tabl[ast] tabN[ext] ta[g] te[aroff] tm tN[ext] try un unh[ide] v vi viu[sage] wa[ll] winp[os] wq wv[iminfo] xme xunmenu
+syn keyword vimCommand contained abo[veleft] argdo as[cii] bf[irst] bp[revious] bro[wse] bun[load] cad[dexpr] ccl[ose] cfdo c[hange] cla[st] cnew[er] cNf[ile] con cp[revious] cuna[bbrev] del deletep delm[arks] diffp[atch] dig[raphs] do e echon endf endw[hile] f[ile] fin[d] folddoc[losed] fu[nction] gvim helpg[rep] ia in ju[mps] keepp[atterns] laddf[ile] lb[uffer] ld[o] lf[ile] lgrepa[dd] lmak[e] lN[ext] loadk lop[en] lua ma menut[ranslate] mksp[ell] m[ove] nb[key] noa ol[dfiles] p po[p] prev[ious] promptr[epl] ptn pts[elect] pydo q[uit] red res[ize] ru rv[iminfo] sbf[irst] sbr[ewind] scscope sf[ind] sign sl[eep] sn[ext] snoremenu spelld[ump] spellw[rong] sta[g] startr[eplace] sun[hide] sw[apname] syntime tabd[o] tabm[ove] tabo[nly] tags tf[irst] tm[enu] to[pleft] ts[elect] una[bbreviate] unl ve vie[w] vmapc[lear] wh[ile] win[size] wqa[ll] x xmenu xwininfo
+syn keyword vimCommand contained al[l] arge[dit] au bl[ast] brea[k] bu bw[ipeout] caddf[ile] cd cf[ile] changes cl[ist] cn[ext] col[der] conf[irm] cq[uit] cw[indow] delc[ommand] deletl delp diffpu[t] dir doau ea e[dit] endfo[r] ene[w] files fini[sh] foldd[oopen] g h helpt[ags] iabc[lear] intro k l lan lc[d] le[ft] lfir[st] lh[elpgrep] lmapc[lear] lnf loadkeymap lpf[ile] luado mak[e] mes mkv mz nbs[tart] noautocmd omapc[lear] pc[lose] popu p[rint] ps[earch] ptN pu[t] pyf[ile] quita[ll] redi[r] ret[ab] rub[y] sal[l] sbl[ast] sb[uffer] se[t] sfir[st] sil[ent] sm[agic] sN[ext] so spe[llgood] sp[lit] star stj[ump] sunme sy t tabe[dit] tabN tabp[revious] tc[l] th[row] tn tp[revious] tu u[ndo] unlo[ckvar] verb[ose] vim[grep] vne[w] win wn[ext] w[rite] xa[ll] xnoreme y[ank]
+syn keyword vimCommand contained ar argg[lobal] bad[d] bm[odified] breaka[dd] buf c cal[l] cdo cfir[st] chd[ir] clo[se] cN[ext] colo[rscheme] con[tinue] cr[ewind] d delel deletp dep diffs[plit] di[splay] dp earlier el[se] endfun ex filet fir[st] foldo[pen] go[to] ha[rdcopy] hi if is[earch] keepa la lan[guage] lch[dir] lefta[bove] lgetb[uffer] l[ist] lN lNf lo[adview] lp[revious] luafile ma[rk] messages mkvie[w] mzf[ile] ne noh[lsearch] on[ly] pe popu[p] pro pta[g] ptn[ext] pw[d] py[thon] r red[o] retu[rn] rubyd[o] san[dbox] sbm[odified] scrip
syn match vimCommand contained "\<z[-+^.=]\=\>"
syn keyword vimStdPlugin contained DiffOrig Man N[ext] P[rint] S TOhtml XMLent XMLns
" vimOptions are caught only when contained in a vimSet {{{2
-syn keyword vimOption contained acd ambw arshape background ballooneval bg bl brk buftype cf cinkeys cmdwinheight com conceallevel cpo cscopequickfix csqf cursorbind define diffexpr dy ef eol esckeys fcs fdn ff fileignorecase flp foldexpr foldnestmax fp gfm grepformat guifontwide helpheight highlight hlg im imd imstatusfunc indentkeys isf isprint km lazyredraw lispwords lpl macatsui maxcombine mef mls modelines mousehide mp nu omnifunc paragraphs penc pi previewwindow printmbfont pythondll redrawtime revins ro ruler scb scs sessionoptions shellquote shiftround showfulltag sidescrolloff smarttab sp spf srr startofline suffixes switchbuf ta taglength tbidi termbidi tgst titleold top ttimeoutlen ttyscroll ul ur verbosefile visualbell wcm wi wildmenu winfixwidth wm wrapscan
-syn keyword vimOption contained ai anti autochdir backspace balloonexpr bh bo browsedir casemap cfu cino cmp comments confirm cpoptions cscoperelative csre cursorcolumn delcombine diffopt ea efm ep et fdc fdo ffs filetype fml foldignore foldopen fs gfn grepprg guiheadroom helplang history hls imactivatefunc imdisable inc indk isfname joinspaces kmp lbr list ls magic maxfuncdepth menuitems mm modifiable mousem mps number opendevice paste perldll pm printdevice printoptions pythonthreedll regexpengine ri rop rulerformat scr sect sft shellredir shiftwidth showmatch siso smc spc spl ss statusline suffixesadd sws tabline tagrelative tbis termencoding thesaurus titlestring tpm ttm ttytype undodir ut vfile vop wd wic wildmode winheight wmh write
-syn keyword vimOption contained akm antialias autoindent backup bdir bin bomb bs cb ch cinoptions cms commentstring consk cpt cscopetag cst cursorline dex digraph ead ei equalalways eventignore fde fdt fic fillchars fmr foldlevel foldtext fsync gfs gtl guioptions hf hk hlsearch imactivatekey imi include inex isi js kp lcs listchars lsp makeef maxmapdepth mfd mmd modified mousemodel msm numberwidth operatorfunc pastetoggle pex pmbcs printencoding prompt qe relativenumber rightleft rs runtimepath scroll sections sh shellslash shm showmode sj smd spell splitbelow ssl stl sw sxe tabpagemax tags tbs terse tildeop tl tr tty tw undofile vb vi wa weirdinvert wig wildoptions winminheight wmnu writeany
-syn keyword vimOption contained al ar autoread backupcopy bdlay binary breakat bsdir cc charconvert cinw co compatible conskey crb cscopetagorder csto cwh dg dip eadirection ek equalprg ex fdi fen fileencoding fixendofline fo foldlevelstart formatexpr ft gfw gtt guipty hh hkmap ic imaf iminsert includeexpr inf isident key langmap linebreak lm luadll makeprg maxmem mh mmp more mouses mzq nuw opfunc patchexpr pexpr pmbfn printexpr pt quoteescape remap rightleftcmd rtp sb scrollbind secure shcf shelltemp shortmess showtabline slm sn spellcapcheck splitright ssop stmp swapfile sxq tabstop tagstack tc textauto timeout tm ts ttybuiltin tx undolevels vbs viewdir wak wfh wildchar wim winminwidth wmw writebackup
-syn keyword vimOption contained aleph arab autowrite backupdir belloff biosk breakindent bsk ccv ci cinwords cocu complete copyindent cryptmethod cscopeverbose csverb debug dict dir eb enc errorbells expandtab fdl fenc fileencodings fixeol foldclose foldmarker formatlistpat gcr ghr guicursor guitablabel hi hkmapp icon imak ims incsearch infercase isk keymap langmenu lines lmap lw mat maxmempattern mis mmt mouse mouseshape mzquantum odev osfiletype patchmode pfn popt printfont pumheight rdt renderoptions rl ru sbo scrolljump sel shell shelltype shortname shq sm so spellfile spr st sts swapsync syn tag tal tcldll textmode timeoutlen to tsl ttyfast uc undoreload vdir viewoptions warn wfw wildcharm winaltkeys winwidth wop writedelay
-syn keyword vimOption contained allowrevins arabic autowriteall backupext beval bioskey breakindentopt bt cd cin clipboard cole completefunc cot cscopepathcomp cspc cuc deco dictionary directory ed encoding errorfile exrc fdls fencs fileformat fk foldcolumn foldmethod formatoptions gd go guifont guitabtooltip hid hkp iconstring imc imsearch inde insertmode iskeyword keymodel langnoremap linespace lnr lz matchpairs maxmemtot mkspellmem mod mousef mouset nf oft pa path ph preserveindent printheader pvh re report rlc rubydll sbr scrolloff selection shellcmdflag shellxescape showbreak si smartcase softtabstop spelllang sps sta su swb synmaxcol tagbsearch tb tenc textwidth title toolbar tsr ttym udf updatecount ve viminfo wb wh wildignore window wiv wrap ws
-syn keyword vimOption contained altkeymap arabicshape aw backupskip bex bk bri bufhidden cdpath cindent cm colorcolumn completeopt cp cscopeprg csprg cul def diff display edcompatible endofline errorformat fcl fdm fex fileformats fkmap foldenable foldminlines formatprg gdefault gp guifontset helpfile hidden hl ignorecase imcmdline imsf indentexpr is isp keywordprg laststatus lisp loadplugins ma matchtime mco ml modeline mousefocus mousetime nrformats ofu para pdev pheader previewheight printmbcharset pvw readonly restorescreen rnu ruf sc scrollopt selectmode shellpipe shellxquote showcmd sidescroll smartindent sol spellsuggest sr stal sua swf syntax tagcase tbi term tf titlelen toolbariconsize ttimeout ttymouse udir updatetime verbose virtualedit wc whichwrap wildignorecase winfixheight wiw wrapmargin ww
-syn keyword vimOption contained ambiwidth ari awa balloondelay bexpr bkc briopt buflisted cedit cink cmdheight columns concealcursor
+syn keyword vimOption contained acd ambw arshape background ballooneval bg bl brk buftype cf cinkeys cmp comments conceallevel cpo cscopequickfix csqf cursorbind define diffexpr dy ef eol esckeys fcs fdn ff fileignorecase flp foldexpr foldnestmax fp gfm grepformat guifontwide helpheight highlight hlg im imd imstatusfunc indentkeys isf isprint km lazyredraw lispwords lpl macatsui maxcombine mef mls modelines mousehide mp nu omnifunc paragraphs penc pi previewwindow printmbfont pythondll redrawtime revins ro ruler scb scs sessionoptions shellquote shiftround showfulltag sidescrolloff smarttab sp spf srr startofline suffixes switchbuf ta taglength tbidi termbidi tgst titleold top ttimeoutlen ttyscroll ul ur verbosefile visualbell wcm wi wildmenu winfixwidth wm wrapscan
+syn keyword vimOption contained ai anti autochdir backspace balloonexpr bh bo browsedir casemap cfu cino cms commentstring confirm cpoptions cscoperelative csre cursorcolumn delcombine diffopt ea efm ep et fdc fdo ffs filetype fml foldignore foldopen fs gfn grepprg guiheadroom helplang history hls imactivatefunc imdisable inc indk isfname joinspaces kmp lbr list ls magic maxfuncdepth menuitems mm modifiable mousem mps number opendevice paste perldll pm printdevice printoptions pythonthreedll regexpengine ri rop rulerformat scr sect sft shellredir shiftwidth showmatch siso smc spc spl ss statusline suffixesadd sws tabline tagrelative tbis termencoding thesaurus titlestring tpm ttm ttytype undodir ut vfile vop wd wic wildmode winheight wmh write
+syn keyword vimOption contained akm antialias autoindent backup bdir bin bomb bs cb ch cinoptions co compatible consk cpt cscopetag cst cursorline dex digraph ead ei equalalways eventignore fde fdt fic fillchars fmr foldlevel foldtext fsync gfs gtl guioptions hf hk hlsearch imactivatekey imi include inex isi js kp lcs listchars lsp makeef maxmapdepth mfd mmd modified mousemodel msm numberwidth operatorfunc pastetoggle pex pmbcs printencoding prompt qe relativenumber rightleft rs runtimepath scroll sections sh shellslash shm showmode sj smd spell splitbelow ssl stl sw sxe tabpagemax tags tbs terse tildeop tl tr tty tw undofile vb vi wa weirdinvert wig wildoptions winminheight wmnu writeany
+syn keyword vimOption contained al ar autoread backupcopy bdlay binary breakat bsdir cc charconvert cinw cocu complete conskey crb cscopetagorder csto cwh dg dip eadirection ek equalprg ex fdi fen fileencoding fixendofline fo foldlevelstart formatexpr ft gfw gtt guipty hh hkmap ic imaf iminsert includeexpr inf isident key langmap linebreak lm luadll makeprg maxmem mh mmp more mouses mzq nuw opfunc patchexpr pexpr pmbfn printexpr pt quoteescape remap rightleftcmd rtp sb scrollbind secure shcf shelltemp shortmess showtabline slm sn spellcapcheck splitright ssop stmp swapfile sxq tabstop tagstack tc textauto timeout tm ts ttybuiltin tx undolevels vbs viewdir wak wfh wildchar wim winminwidth wmw writebackup
+syn keyword vimOption contained aleph arab autowrite backupdir belloff biosk breakindent bsk ccv ci cinwords cole completefunc copyindent cryptmethod cscopeverbose csverb debug dict dir eb enc errorbells expandtab fdl fenc fileencodings fixeol foldclose foldmarker formatlistpat gcr ghr guicursor guitablabel hi hkmapp icon imak ims incsearch infercase isk keymap langmenu lines lmap lw mat maxmempattern mis mmt mouse mouseshape mzquantum odev osfiletype patchmode pfn popt printfont pumheight rdt renderoptions rl ru sbo scrolljump sel shell shelltype shortname shq sm so spellfile spr st sts swapsync syn tag tal tcldll textmode timeoutlen to tsl ttyfast uc undoreload vdir viewoptions warn wfw wildcharm winaltkeys winwidth wop writedelay
+syn keyword vimOption contained allowrevins arabic autowriteall backupext beval bioskey breakindentopt bt cd cin clipboard colorcolumn completeopt cot cscopepathcomp cspc cuc deco dictionary directory ed encoding errorfile exrc fdls fencs fileformat fk foldcolumn foldmethod formatoptions gd go guifont guitabtooltip hid hkp iconstring imc imsearch inde insertmode iskeyword keymodel langnoremap linespace lnr lz matchpairs maxmemtot mkspellmem mod mousef mouset nf oft pa path ph preserveindent printheader pvh re report rlc rubydll sbr scrolloff selection shellcmdflag shellxescape showbreak si smartcase softtabstop spelllang sps sta su swb synmaxcol tagbsearch tb tenc textwidth title toolbar tsr ttym udf updatecount ve viminfo wb wh wildignore window wiv wrap ws
+syn keyword vimOption contained altkeymap arabicshape aw backupskip bex bk bri bufhidden cdpath cindent cmdheight columns concealcursor cp cscopeprg csprg cul def diff display edcompatible endofline errorformat fcl fdm fex fileformats fkmap foldenable foldminlines formatprg gdefault gp guifontset helpfile hidden hl ignorecase imcmdline imsf indentexpr is isp keywordprg laststatus lisp loadplugins ma matchtime mco ml modeline mousefocus mousetime nrformats ofu para pdev pheader previewheight printmbcharset pvw readonly restorescreen rnu ruf sc scrollopt selectmode shellpipe shellxquote showcmd sidescroll smartindent sol spellsuggest sr stal sua swf syntax tagcase tbi term tf titlelen toolbariconsize ttimeout ttymouse udir updatetime verbose virtualedit wc whichwrap wildignorecase winfixheight wiw wrapmargin ww
+syn keyword vimOption contained ambiwidth ari awa balloondelay bexpr bkc briopt buflisted cedit cink cmdwinheight com
" vimOptions: These are the turn-off setting variants {{{2
-syn keyword vimOption contained noacd noallowrevins noantialias noarabic noarshape noautoread noaw noballooneval nobinary nobk nobreakindent nocf nocindent noconsk nocp nocscopetag nocst nocul nocursorline nodg noea noedcompatible noeol noesckeys noexpandtab nofic nofixeol nofoldenable nogd nohid nohkmap nohls noicon noimc noimdisable noinfercase nojoinspaces nolangnoremap nolbr nolisp nolnr nolpl noma nomagic noml nomodeline nomodified nomousef nomousehide nonumber noopendevice nopi nopreviewwindow nopvw norelativenumber norestorescreen nori norl noro noru nosb noscb noscs nosft noshelltemp noshortname noshowfulltag noshowmode nosm nosmartindent nosmd nosol nosplitbelow nospr nossl nostartofline noswapfile nota notagrelative notbi notbs noterse notextmode notgst notimeout noto notr nottybuiltin notx noundofile novisualbell nowarn noweirdinvert nowfw nowildignorecase nowinfixheight nowiv nowrap nowrite nowritebackup
-syn keyword vimOption contained noai noaltkeymap noar noarabicshape noautochdir noautowrite noawa nobeval nobiosk nobl nobri noci nocompatible noconskey nocrb nocscopeverbose nocsverb nocursorbind nodeco nodiff noeb noek noequalalways noet noexrc nofileignorecase nofk nofs nogdefault nohidden nohkmapp nohlsearch noignorecase noimcmdline noincsearch noinsertmode nojs nolazyredraw nolinebreak nolist noloadplugins nolz nomacatsui nomh nomod nomodifiable nomore nomousefocus nonu noodev nopaste nopreserveindent noprompt noreadonly noremap norevins norightleft nornu nors noruler nosc noscrollbind nosecure noshellslash noshiftround noshowcmd noshowmatch nosi nosmartcase nosmarttab nosn nospell nosplitright nosr nosta nostmp noswf notagbsearch notagstack notbidi notermbidi notextauto notf notildeop notitle notop nottimeout nottyfast noudf novb nowa nowb nowfh nowic nowildmenu nowinfixwidth nowmnu nowrapscan nowriteany nows
-syn keyword vimOption contained noakm noanti noarab noari noautoindent noautowriteall nobackup nobin nobioskey nobomb nobuflisted nocin noconfirm nocopyindent nocscoperelative nocsre nocuc nocursorcolumn nodelcombine nodigraph noed noendofline noerrorbells noex nofen nofixendofline nofkmap nofsync noguipty nohk nohkp noic noim noimd noinf nois
+syn keyword vimOption contained noacd noallowrevins noantialias noarabic noarshape noautoread noaw noballooneval nobinary nobk nobuflisted nocin noconfirm nocopyindent nocscoperelative nocsre nocuc nocursorcolumn nodelcombine nodigraph noed noendofline noerrorbells noex nofen nofixendofline nofkmap nogdefault nohidden nohkmapp nohlsearch noicon noim noimcmdline noimdisable noinf noinsertmode nojoinspaces nolazyredraw nolinebreak nolist nolpl noma nomagic noml nomodeline nomodified nomousef nomousehide nonumber noopendevice nopi nopreviewwindow nopvw norelativenumber norestorescreen nori norl noro noru nosb noscb noscs nosft noshelltemp noshortname noshowfulltag noshowmode nosm nosmartindent nosmd nosol nosplitbelow nospr nossl nostartofline noswapfile nota notagrelative notbi notbs noterse notextmode notgst notimeout noto notr nottybuiltin notx noundofile novisualbell nowarn noweirdinvert nowfw nowildignorecase nowinfixheight nowiv nowrap nowrite nowritebackup
+syn keyword vimOption contained noai noaltkeymap noar noarabicshape noautochdir noautowrite noawa nobeval nobiosk nobl nocf nocindent noconsk nocp nocscopetag nocst nocul nocursorline nodg noea noedcompatible noeol noesckeys noexpandtab nofic nofixeol nofoldenable noguipty nohk nohkp noic noignorecase noimc noimd noincsearch noinfercase nois nojs nolbr nolisp noloadplugins nolz nomacatsui nomh nomod nomodifiable nomore nomousefocus nonu noodev nopaste nopreserveindent noprompt noreadonly noremap norevins norightleft nornu nors noruler nosc noscrollbind nosecure noshellslash noshiftround noshowcmd noshowmatch nosi nosmartcase nosmarttab nosn nospell nosplitright nosr nosta nostmp noswf notagbsearch notagstack notbidi notermbidi notextauto notf notildeop notitle notop nottimeout nottyfast noudf novb nowa nowb nowfh nowic nowildmenu nowinfixwidth nowmnu nowrapscan nowriteany nows
+syn keyword vimOption contained noakm noanti noarab noari noautoindent noautowriteall nobackup nobin nobioskey nobomb noci nocompatible noconskey nocrb nocscopeverbose nocsverb nocursorbind nodeco nodiff noeb noek noequalalways noet noexrc nofileignorecase nofk nogd nohid nohkmap nohls
" vimOptions: These are the invertible variants {{{2
-syn keyword vimOption contained invacd invallowrevins invantialias invarabic invarshape invautoread invaw invballooneval invbinary invbk invbreakindent invcf invcindent invconsk invcp invcscopetag invcst invcul invcursorline invdg invea invedcompatible inveol invesckeys invexpandtab invfic invfixeol invfoldenable invgd invhid invhkmap invhls invicon invimc invimdisable invinfercase invjoinspaces invlangnoremap invlbr invlisp invlnr invlpl invma invmagic invml invmodeline invmodified invmousef invmousehide invnumber invopendevice invpi invpreviewwindow invpvw invrelativenumber invrestorescreen invri invrl invro invru invsb invscb invscs invsft invshelltemp invshortname invshowfulltag invshowmode invsm invsmartindent invsmd invsol invsplitbelow invspr invssl invstartofline invswapfile invta invtagrelative invtbi invtbs invterse invtextmode invtgst invtimeout invto invtr invttybuiltin invtx invundofile invvisualbell invwarn invweirdinvert invwfw invwildignorecase invwinfixheight invwiv invwrap invwrite invwritebackup
-syn keyword vimOption contained invai invaltkeymap invar invarabicshape invautochdir invautowrite invawa invbeval invbiosk invbl invbri invci invcompatible invconskey invcrb invcscopeverbose invcsverb invcursorbind invdeco invdiff inveb invek invequalalways invet invexrc invfileignorecase invfk invfs invgdefault invhidden invhkmapp invhlsearch invignorecase invimcmdline invincsearch invinsertmode invjs invlazyredraw invlinebreak invlist invloadplugins invlz invmacatsui invmh invmod invmodifiable invmore invmousefocus invnu invodev invpaste invpreserveindent invprompt invreadonly invremap invrevins invrightleft invrnu invrs invruler invsc invscrollbind invsecure invshellslash invshiftround invshowcmd invshowmatch invsi invsmartcase invsmarttab invsn invspell invsplitright invsr invsta invstmp invswf invtagbsearch invtagstack invtbidi invtermbidi invtextauto invtf invtildeop invtitle invtop invttimeout invttyfast invudf invvb invwa invwb invwfh invwic invwildmenu invwinfixwidth invwmnu invwrapscan invwriteany invws
-syn keyword vimOption contained invakm invanti invarab invari invautoindent invautowriteall invbackup invbin invbioskey invbomb invbuflisted invcin invconfirm invcopyindent invcscoperelative invcsre invcuc invcursorcolumn invdelcombine invdigraph inved invendofline inverrorbells invex invfen invfixendofline invfkmap invfsync invguipty invhk invhkp invic invim invimd invinf invis
+syn keyword vimOption contained invacd invallowrevins invantialias invarabic invarshape invautoread invaw invballooneval invbinary invbk invbuflisted invcin invconfirm invcopyindent invcscoperelative invcsre invcuc invcursorcolumn invdelcombine invdigraph inved invendofline inverrorbells invex invfen invfixendofline invfkmap invgdefault invhidden invhkmapp invhlsearch invicon invim invimcmdline invimdisable invinf invinsertmode invjoinspaces invlazyredraw invlinebreak invlist invlpl invma invmagic invml invmodeline invmodified invmousef invmousehide invnumber invopendevice invpi invpreviewwindow invpvw invrelativenumber invrestorescreen invri invrl invro invru invsb invscb invscs invsft invshelltemp invshortname invshowfulltag invshowmode invsm invsmartindent invsmd invsol invsplitbelow invspr invssl invstartofline invswapfile invta invtagrelative invtbi invtbs invterse invtextmode invtgst invtimeout invto invtr invttybuiltin invtx invundofile invvisualbell invwarn invweirdinvert invwfw invwildignorecase invwinfixheight invwiv invwrap invwrite invwritebackup
+syn keyword vimOption contained invai invaltkeymap invar invarabicshape invautochdir invautowrite invawa invbeval invbiosk invbl invcf invcindent invconsk invcp invcscopetag invcst invcul invcursorline invdg invea invedcompatible inveol invesckeys invexpandtab invfic invfixeol invfoldenable invguipty invhk invhkp invic invignorecase invimc invimd invincsearch invinfercase invis invjs invlbr invlisp invloadplugins invlz invmacatsui invmh invmod invmodifiable invmore invmousefocus invnu invodev invpaste invpreserveindent invprompt invreadonly invremap invrevins invrightleft invrnu invrs invruler invsc invscrollbind invsecure invshellslash invshiftround invshowcmd invshowmatch invsi invsmartcase invsmarttab invsn invspell invsplitright invsr invsta invstmp invswf invtagbsearch invtagstack invtbidi invtermbidi invtextauto invtf invtildeop invtitle invtop invttimeout invttyfast invudf invvb invwa invwb invwfh invwic invwildmenu invwinfixwidth invwmnu invwrapscan invwriteany invws
+syn keyword vimOption contained invakm invanti invarab invari invautoindent invautowriteall invbackup invbin invbioskey invbomb invci invcompatible invconskey invcrb invcscopeverbose invcsverb invcursorbind invdeco invdiff inveb invek invequalalways invet invexrc invfileignorecase invfk invgd invhid invhkmap invhls
" termcap codes (which can also be set) {{{2
-syn keyword vimOption contained t_AB t_al t_bc t_ce t_cl t_Co t_Cs t_CV t_db t_DL t_EI t_F1 t_F2 t_F3 t_F4 t_F5 t_F6 t_F7 t_F8 t_F9 t_fs t_IE t_IS t_k1 t_K1 t_k2 t_k3 t_K3 t_k4 t_K4 t_k5 t_K5 t_k6 t_K6 t_k7 t_K7 t_k8 t_K8 t_k9 t_K9 t_KA t_kb t_kB t_KB t_KC t_kd t_kD t_KD t_ke t_KE t_KF t_KG t_kh t_KH t_kI t_KI t_KJ t_KK t_kl t_KL t_kN t_kP t_kr t_ks t_ku t_le t_mb t_md t_me t_mr t_ms t_nd t_op t_RB t_RI t_RV t_Sb t_se t_Sf t_SI t_so t_sr t_SR t_te t_ti t_ts t_u7 t_ue t_us t_ut t_vb t_ve t_vi t_vs t_WP t_WS t_xn t_xs t_ZH t_ZR
-syn keyword vimOption contained t_AF t_AL t_cd t_Ce t_cm t_cs t_CS t_da t_dl
+syn keyword vimOption contained t_AB t_al t_bc t_ce t_cl t_Co t_Cs t_CV t_db t_dl t_DL t_EI t_F1 t_F2 t_F3 t_F4 t_F5 t_F6 t_F7 t_F8 t_F9 t_fs t_IE t_IS t_k1 t_K1 t_k2 t_k3 t_K3 t_k4 t_K4 t_k5 t_K5 t_k6 t_K6 t_k7 t_K7 t_k8 t_K8 t_k9 t_K9 t_KA t_kb t_kB t_KB t_KC t_kd t_kD t_KD t_ke t_KE t_KF t_KG t_kh t_KH t_kI t_KI t_KJ t_KK t_kl t_KL t_kN t_kP t_kr t_ks t_ku t_le t_mb t_md t_me t_mr t_ms t_nd t_op t_RI t_RV t_Sb t_se t_Sf t_SI t_so t_sr t_SR t_te t_ti t_ts t_u7 t_ue t_us t_ut t_vb t_ve t_vi t_vs t_WP t_WS t_xn t_xs t_ZH t_ZR
+syn keyword vimOption contained t_AF t_AL t_cd t_Ce t_cm t_cs t_CS t_da
syn match vimOption contained "t_%1"
syn match vimOption contained "t_#2"
syn match vimOption contained "t_#4"
@@ -76,9 +75,9 @@ syn match vimHLGroup contained "Conceal"
syn case match
" Function Names {{{2
-syn keyword vimFuncName contained abs alloc_fail argc argv assert_exception assert_true browse buflisted bufnr byteidx ceil cindent complete confirm cosh cursor did_filetype empty eventhandler exists expr8 filereadable finddir floor fnamemodify foldlevel foreground get getchar getcmdline getcmdwintype getfontname getftime getloclist getpos getregtype getwinposx glob has hasmapto histget hlID indent inputdialog inputsave invert items len line localtime luaeval mapcheck matchaddpos matchend max mode nr2char perleval printf pyeval reltime remote_foreground remote_send repeat round screencol searchdecl searchpos setbufvar setline setpos settabvar sha256 simplify sort spellsuggest str2float strdisplaywidth string strridx submatch synID synIDtrans system tabpagebuflist tabpagewinnr taglist tanh tolower tr type undotree values visualmode winbufnr winheight winnr winrestview winwidth writefile
-syn keyword vimFuncName contained acos and argidx asin assert_fails atan browsedir bufloaded bufwinnr byteidxcomp changenr clearmatches complete_add copy count deepcopy diff_filler escape executable exp extend filewritable findfile fmod foldclosed foldtext function getbufline getcharmod getcmdpos getcurpos getfperm getftype getmatches getqflist gettabvar getwinposy glob2regpat has_key histadd histnr hostname index inputlist inputsecret isdirectory join libcall line2byte log map match matcharg matchlist min mzeval or pow pumvisible range reltimestr remote_peek remove resolve screenattr screenrow searchpair server2client setcharsearch setloclist setqflist settabwinvar shellescape sin soundfold split str2nr strftime strlen strtrans substitute synIDattr synstack systemlist tabpagenr tagfiles tan tempname toupper trunc undofile uniq virtcol wildmenumode wincol winline winrestcmd winsaveview wordcount xor
-syn keyword vimFuncName contained add append arglistid assert_equal assert_false atan2 bufexists bufname byte2line call char2nr col complete_check cos cscope_connection delete diff_hlID eval exepath expand feedkeys filter float2nr fnameescape foldclosedend foldtextresult garbagecollect getbufvar getcharsearch getcmdtype getcwd getfsize getline getpid getreg gettabwinvar getwinvar globpath haslocaldir histdel hlexists iconv input inputrestore insert islocked keys libcallnr lispindent log10 maparg matchadd matchdelete matchstr mkdir nextnonblank pathshorten prevnonblank py3eval readfile remote_expr remote_read rename reverse screenchar search searchpairpos serverlist setcmdpos setmatches setreg setwinvar shiftwidth sinh spellbadword sqrt strchars stridx strpart strwidth synconcealed
+syn keyword vimFuncName contained abs alloc_fail argc argv assert_exception assert_true browse buflisted bufnr byteidx ceil cindent complete confirm cos cscope_connection delete diff_hlID eval exepath expand feedkeys filter float2nr fnameescape foldclosedend foldtextresult garbagecollect getbufvar getcharsearch getcmdtype getcwd getfsize getline getpid getreg gettabwinvar getwinvar globpath haslocaldir histdel hlexists iconv input inputrestore insert islocked jsondecode len line localtime luaeval mapcheck matchaddpos matchend max mode nr2char perleval printf pyeval reltime remote_foreground remote_send repeat round screencol searchdecl searchpos server2client setcharsearch setloclist setqflist settabwinvar shellescape sin soundfold split str2nr strftime strlen strtrans substitute synIDattr system tabpagenr taglist tanh tolower tr type undotree values visualmode winbufnr winheight winnr winrestview winwidth writefile
+syn keyword vimFuncName contained acos and argidx asin assert_fails atan browsedir bufloaded bufwinnr byteidxcomp changenr clearmatches complete_add connect cosh cursor did_filetype empty eventhandler exists expr8 filereadable finddir floor fnamemodify foldlevel foreground get getchar getcmdline getcmdwintype getfontname getftime getloclist getpos getregtype getwinposx glob has hasmapto histget hlID indent inputdialog inputsave invert items jsonencode libcall line2byte log map match matcharg matchlist min mzeval or pow pumvisible range reltimestr remote_peek remove resolve screenattr screenrow searchpair sendexpr serverlist setcmdpos setmatches setreg setwinvar shiftwidth sinh spellbadword sqrt strchars stridx strpart strwidth synconcealed synIDtrans systemlist tabpagewinnr tan tempname toupper trunc undofile uniq virtcol wildmenumode wincol winline winrestcmd winsaveview wordcount xor
+syn keyword vimFuncName contained add append arglistid assert_equal assert_false atan2 bufexists bufname byte2line call char2nr col complete_check copy count deepcopy diff_filler escape executable exp extend filewritable findfile fmod foldclosed foldtext function getbufline getcharmod getcmdpos getcurpos getfperm getftype getmatches getqflist gettabvar getwinposy glob2regpat has_key histadd histnr hostname index inputlist inputsecret isdirectory join keys libcallnr lispindent log10 maparg matchadd matchdelete matchstr mkdir nextnonblank pathshorten prevnonblank py3eval readfile remote_expr remote_read rename reverse screenchar search searchpairpos sendraw setbufvar setline setpos settabvar sha256 simplify sort spellsuggest str2float strdisplaywidth string strridx submatch synID synstack tabpagebuflist tagfiles
"--- syntax here and above generated by mkvimvim ---
" Special Vim Highlighting (not automatic) {{{1
@@ -303,7 +302,7 @@ syn cluster vimSubstList contains=vimPatSep,vimPatRegion,vimPatSepErr,vimSubstTw
syn cluster vimSubstRepList contains=vimSubstSubstr,vimSubstTwoBS,vimNotation
syn cluster vimSubstList add=vimCollection
syn match vimSubst "\(:\+\s*\|^\s*\||\s*\)\<\%(s\%[ubstitute]\|sm\%[agic]\|sno\%[magic]\)[:[:alpha:]]\@!" nextgroup=vimSubstPat
-syn match vimSubst "s\%[ubstitute][:#[:alpha:]]\@!" nextgroup=vimSubstPat contained
+syn match vimSubst "\%(^\|[^\\]\)s\%[ubstitute][:#[:alpha:]]\@!" nextgroup=vimSubstPat contained
syn match vimSubst "/\zss\%[ubstitute]\ze/" nextgroup=vimSubstPat
syn match vimSubst1 contained "s\%[ubstitute]\>" nextgroup=vimSubstPat
syn region vimSubstPat contained matchgroup=vimSubstDelim start="\z([^a-zA-Z( \t[\]&]\)"rs=s+1 skip="\\\\\|\\\z1" end="\z1"re=e-1,me=e-1 contains=@vimSubstList nextgroup=vimSubstRep4 oneline
diff --git a/runtime/tools/demoserver.py b/runtime/tools/demoserver.py
index 9f22aa293..c701434b2 100644
--- a/runtime/tools/demoserver.py
+++ b/runtime/tools/demoserver.py
@@ -2,7 +2,7 @@
#
# Server that will accept connections from a Vim channel.
# Run this server and then in Vim you can open the channel:
-# :let handle = ch_open('localhost:8765', 'json')
+# :let handle = ch_open('localhost:8765')
#
# Then Vim can send requests to the server:
# :let response = ch_sendexpr(handle, 'hello!')