- changelog.vim

GetLatestVimScripts

git-svn-id: https://vimsuite.svn.sourceforge.net/svnroot/vimsuite/trunk@154 eb2d0018-73a3-4aeb-bfe9-1def61c9ec69
This commit is contained in:
stefan 2008-03-31 09:16:28 +00:00
parent 647bd57e00
commit 6673e71a02
9 changed files with 905 additions and 610 deletions

View File

@ -1,170 +0,0 @@
" ===========================================================================
" File: changelog.vim
" Author: Stefan Liebl (S.Liebl@gmx.de)
" Description: changelog for vimfiles in subversion
" Revision: $LastChangedRevision$
" ===========================================================================
" get Revision from subversion
let g:VimFilesRevision = substitute("$Rev$",'\$Rev:\s*\(\d\+\)\s*\$','\1','g')
let &titlestring = '%t - (%-F) - %=vimfiles Rev: ' . g:VimFilesRevision
if exists('nochangelog')
finish
endif
function s:ReportRev(Rev)
if a:Rev >= '148'
echo 'Neu seit Rev: 148'
echo 'BlockDiff: Commands ergänzt'
echo 'Matchit: syntax für a2l'
elseif a:Rev >= '145'
echo 'Neu seit Rev: 145'
echo 'BlockDiff: Markieren -> BlockDiff -> Markieren -> BlockDiff -> neuer Tab'
echo 'Gsub: global substitute'
echo 'gb funktioniert jetzt anders (= <c-o> bis zum letzten file)'
echo 'syntax Highliting für Lint-Kommentare'
elseif a:Rev >= '139'
echo 'Neu seit Rev: 129'
echo 'Projekt laden über project.vim'
echo 'Einstellungen bleiben gespeichert'
echo 'Session wird im Projekt gespeichert, wenn g:sessionfile von project.vim gesetzt wird'
elseif a:Rev >= '129'
echo 'Neu seit Rev: 129'
echo 'Tags für BMS-X'
echo 'Doxygen Toolkit'
echo 'Update VimScripts'
echo 'das Verzeichnis vimfiles kann ohne Anpassung verwendet werden'
elseif a:Rev >= '128'
echo 'Neu seit Rev: 128'
echo 'Vimsuite für BMS-X verbessert'
elseif a:Rev >= '123'
echo 'Neu seit Rev: 120'
echo 'Task Report'
echo 'damos als eigenes Package'
echo 'a2l indent verbessert'
echo '+scons'
echo '+Merge für Synergy/CM'
elseif a:Rev >= '120'
echo 'Neu seit Rev: 119'
echo 'Verbindung zu Projekt deutlich beschleunigt, da mehrere Variablen auf einmal gelesen werden können'
echo '+ftplugin paf.vim: Anzeiger der aktuellen Adresse in der Statuszeile'
echo 'ccm.vim: Umformatierungen für ChangeSynergy Reports'
echo 'BmskDoku im Menü und interaktiv'
echo 'Cscope Verbindung kann per Menü geschlossen werden'
echo 'Altes make.log kann per Menü geparsed werden'
elseif a:Rev >= '119'
echo 'Neu seit Rev: 118'
echo 'Befehl "Bmsk distclean" im Menü ergänzt'
elseif a:Rev >= '116'
echo 'Neu seit Rev: 116'
echo 'Einstelldialoge und Titelleiste für BMS-K verbessert'
echo 'Menüs für BMS-K verbessert'
elseif a:Rev >= '114'
echo 'Neu seit Rev: 114'
echo 'Continuus Anbindung verbessert'
echo 'Bmsk Argumen EXTRA_C_FLAGS'
elseif a:Rev >= '111'
echo 'Neu seit Rev: 111'
echo 'GetMakeVar verbessert, ccm64, +FindEEEmuFile'
elseif a:Rev >= '111'
echo 'Neu seit Rev: 100'
echo 'Befehl BmskDoku zum besseren parsen von LaTeX Fehlern'
echo 'Grep, GrepBmsk aktiviert'
echo 'CCM kann jetzt auch Subprojekte'
echo 'GetOsp... repariert'
echo 'SVNstudio verbessert'
echo 'SVNdiff auch mit Revision'
echo 'diff für unix verbessert'
echo 'MyTools heissen jetzt VimSuite'
echo 'K46 ergänzt'
echo 'Dokumentation überarbeitet'
elseif a:Rev >= '100'
echo 'Neu seit Rev: 90'
echo 'vimfiles in Unterverzeichnisse'
elseif a:Rev >= '90'
echo 'Neu seit Rev: 89'
echo 'compiler/bmsk.vim: leere Makeoptionen unterstützen, tex mit includieren'
echo 'ftplugin/latex-suite: Update von vim.org'
echo 'plugin/bmsk.vim: Makeoptionen erst leer lassen'
echo 'plugin/basics.vim: PathNormpath verbessert'
echo 'plugin/tools.vim: $VIMRUNTIME -> g:vimfiles'
echo 'plugin/visincr.vim: Update von vim.org'
echo 'after/syntax/python.vim: Update von vim.org'
elseif a:Rev >= '89'
echo 'Neu seit Rev: 79'
echo 'after/syntax/kgs.vim: + test_wert_text'
echo 'compiler/bmsk.vim : Xlint weglassen wenn leer'
echo 'doc/bmsk.txt : kleine Aktualisierungen'
echo 'tools/ctags.exe : Version ohne cygwin'
echo 'plugin/bmsk.vim : header-Verzeichnisse verbessert'
echo ' '
echo 'checkpath sollte jetzt komplett funktionierien.'
echo 'Siehe :help :checkpath'
elseif a:Rev >= '79'
echo 'Neu seit Rev: 78'
echo 'angepasst auf make-12'
echo 'ftplugins verbessert (setlocal)'
echo 'Formatierung verbessert'
echo 'Angepasst für vim 6.4'
echo 'Python-dlls integriert'
elseif a:Rev >= '78'
echo 'Neu seit Rev: 76'
echo 'Bmsk: UpdateBuffers verbessert'
echo 'cscope: find files including this file geändert'
echo '+ xml.vim'
echo '+ indent/a2l.vim'
echo 'compiler/bmsk.vim: alte Python-Meldung auskommentiert'
echo 'svn.vim: SVNtool verbessert'
elseif a:Rev >= '76'
echo 'Neu seit Rev: 72'
echo 'syntax-File für paf,daf,0pa,0da'
echo 'Diff-Tools im Menü MyTools'
echo 'Subversion-Menü'
echo 'Subversion Command SVN'
echo 'compiler/bmsk.vim unabhängig von Pfaden'
elseif a:Rev >= '72'
echo 'Neu seit Rev: 71'
echo 'cscopeprg wird mit Pfad gesetzt'
echo 'grep.exe V 2.5.1 in funktionierender Version'
echo 'neue Suchpfade für linux'
echo 'FindFile funktioniert wieder'
elseif a:Rev >= '71'
echo 'Neu seit Rev: 71'
echo 'grep.exe V 2.5.1'
echo 'basics.vim: Verbesserungen für GetOspTestValues'
echo 'syntax/c.vim: c.vim aufgenommen (hatte ich bei Rev 67 vergessen)'
elseif a:Rev >= '70'
echo 'Neu seit Rev: 70'
echo 'Make-Targets ergänzt'
echo 'Produkte in Continuus auschecken'
elseif a:Rev >= '66'
echo 'Neu seit Rev: 66'
echo 'ftplugin- und syntax-files nach after/...,'
echo ' damit sie nach den files in vim63 geladen werden'
echo 'syntax/c.vim: Verbessertes Syntax-Highliting'
echo 'colors/Stefan.vim: Neue Syntax-Groups für neues c.vim'
echo '-----------------------------------------------------'
echo 'Ich empfehle die Änderungen aus colors/Stefan.vim'
echo ' in das eigene Colorscheme zu übertragen'
elseif a:Rev == '66'
echo 'Neu in Rev: ' . g:VimFilesRevision
echo 'doc/bmsk.vim: Doku aktualisiert'
echo 'plugin/changelog.vim: neu, gibt die Änderungen beim ersten Start aus'
echo 'plugin/tComment.vim: neu, gute Kommentierfunktion, :help tComment'
echo 'plugin/visincr.vim: neu, inkrementieren von Spalten, :help visincr'
echo 'plugin/matrix.vim: neu, Bildschirmschoner, :Matrix'
echo 'ftplugin/python_fold.vim: neu, Faltungen für Python'
endif
endfunction
" uncomment next line to get changelog for the last version
execute 'call s:ReportRev(' . g:VimFilesRevision . ')'
" comment changelog after first usage
silent! new <sfile>
silent! set modifiable
silent! %substitute/^execute 'call/"execute 'call/
silent! wq!
bdelete changelog.vim

View File

@ -1,6 +1,6 @@
ScriptID SourceID Filename
--------------------------
1075 8351 netrw.vim
1075 8501 netrw.vim
1502 7078 vimball.vim
1008 3118 srec.vim (ftplugin)
1009 3119 srec.vim (syntax file)
@ -30,3 +30,4 @@ ScriptID SourceID Filename
294 8407 Align.vim
642 8136 getscript.vim
642 8136 :AutoInstall: GetLatestVimScripts.vim
1066 7618 :AutoInstall: cecutil.vim

View File

@ -1,7 +1,7 @@
" netrw.vim: Handles file transfer and remote directory listing across
" AUTOLOAD SECTION
" Date: Feb 26, 2008
" Version: 122
" Date: Mar 28, 2008
" Version: 123
" Maintainer: Charles E Campbell, Jr <NdrOchip@ScampbellPfamily.AbizM-NOSPAM>
" GetLatestVimScripts: 1075 1 :AutoInstall: netrw.vim
" Copyright: Copyright (C) 1999-2007 Charles E. Campbell, Jr. {{{1
@ -27,7 +27,7 @@ if !exists("s:NOTE")
let s:WARNING = 1
let s:ERROR = 2
endif
let g:loaded_netrw = "v122"
let g:loaded_netrw = "v123"
if v:version < 700
call netrw#ErrorMsg(s:WARNING,"you need vim version 7.0 or later for version ".g:loaded_netrw." of netrw",1)
finish
@ -360,13 +360,13 @@ if !exists("g:netrw_cd_escape")
let g:netrw_cd_escape="[]#*$%'\" ?`!&();<>\\"
endif
if !exists("g:netrw_fname_escape")
let g:netrw_fname_escape= ' ?&;'
let g:netrw_fname_escape= ' ?&;%'
endif
if !exists("g:netrw_glob_escape")
let g:netrw_glob_escape= '[]*?`{~$'
endif
if !exists("g:netrw_tmpfile_escape")
let g:netrw_tmpfile_escape= ' ?&;'
endif
if !exists("s:netrw_glob_escape")
let s:netrw_glob_escape= '[]*?`{~$'
let g:netrw_tmpfile_escape= ' &;'
endif
" BufEnter event ignored by decho when following variable is true
@ -447,8 +447,8 @@ fun! s:NetrwOptionRestore(vt)
let &l:acd = {a:vt}netrw_acdkeep
unlet {a:vt}netrw_acdkeep
if &l:acd
" call Decho("exe cd ".escape(curdir,g:netrw_fname_escape))
exe "lcd ".escape(curdir,g:netrw_fname_escape)
" call Decho("exe cd ".escape(curdir,g:netrw_cd_escape)) " NOTE: was g:netrw_fname_escape for some reason
exe "lcd ".escape(curdir,g:netrw_cd_escape)
endif
endif
endif
@ -705,8 +705,8 @@ fun! netrw#NetRead(mode,...)
let uid_machine = g:netrw_machine
endif
endif
" call Decho("executing: !".g:netrw_rcp_cmd." ".s:netrw_rcpmode." ".uid_machine.":".escape(b:netrw_fname,' ?&;')." ".tmpfile)
exe g:netrw_silentxfer."!".g:netrw_rcp_cmd." ".s:netrw_rcpmode." ".uid_machine.":".escape(b:netrw_fname,' ?&;')." ".tmpfile
" call Decho("executing: !".g:netrw_rcp_cmd." ".s:netrw_rcpmode." ".g:netrw_shq.uid_machine.":".escape(b:netrw_fname,' ?&;')." ".tmpfile.g:netrw_shq)
exe g:netrw_silentxfer."!".g:netrw_rcp_cmd." ".s:netrw_rcpmode." ".g:netrw_shq.uid_machine.":".escape(b:netrw_fname,' ?&;')." ".tmpfile.g:netrw_shq
let result = s:NetrwGetFile(readcmd, tmpfile, b:netrw_method)
let b:netrw_lastfile = choice
@ -807,7 +807,7 @@ fun! netrw#NetRead(mode,...)
else
let useport= ""
endif
" call Decho("executing: !".g:netrw_scp_cmd.useport." '".g:netrw_machine.":".escape(b:netrw_fname,g:netrw_fname_escape)."' ".tmpfile)
" call Decho("exe g:netrw_silentxfer.!".g:netrw_scp_cmd.useport." ".g:netrw_shq.g:netrw_machine.":".escape(b:netrw_fname,g:netrw_fname_escape).g:netrw_shq." ".tmpfile)
exe g:netrw_silentxfer."!".g:netrw_scp_cmd.useport." ".g:netrw_shq.g:netrw_machine.":".escape(b:netrw_fname,g:netrw_fname_escape).g:netrw_shq." ".tmpfile
let result = s:NetrwGetFile(readcmd, tmpfile, b:netrw_method)
let b:netrw_lastfile = choice
@ -824,21 +824,23 @@ fun! netrw#NetRead(mode,...)
return
endif
let netrw_fname= escape(b:netrw_fname,g:netrw_fname_escape)
if match(b:netrw_fname,"#") == -1
" simple wget
let netrw_fname= escape(b:netrw_fname,g:netrw_fname_escape)
" call Decho("executing: !".g:netrw_http_cmd." ".tmpfile." http://".g:netrw_machine.netrw_fname)
exe g:netrw_silentxfer."!".g:netrw_http_cmd." ".tmpfile." http://".g:netrw_machine.netrw_fname
" call Decho('using simple wget (# not in b:netrw_fname<'.b:netrw_fname.">)")
" call Decho("exe ".g:netrw_silentxfer."!".g:netrw_http_cmd." ".g:netrw_shq.tmpfile.g:netrw_shq." ".g:netrw_shq."http://".g:netrw_machine.netrw_fname.g:netrw_shq)
exe g:netrw_silentxfer."!".g:netrw_http_cmd." ".g:netrw_shq.tmpfile.g:netrw_shq." ".g:netrw_shq."http://".g:netrw_machine.netrw_fname.g:netrw_shq
let result = s:NetrwGetFile(readcmd, tmpfile, b:netrw_method)
else
" wget plus a jump to an in-page marker (ie. http://abc/def.html#aMarker)
" call Decho(("wget/curl plus jump (# in b:netrw_fname<".b:netrw_fname.">)")
let netrw_html= substitute(netrw_fname,"#.*$","","")
let netrw_tag = substitute(netrw_fname,"^.*#","","")
" call Decho("netrw_html<".netrw_html.">")
" call Decho("netrw_tag <".netrw_tag.">")
" call Decho("executing: !".g:netrw_http_cmd." ".tmpfile." http://".g:netrw_machine.netrw_html)
exe g:netrw_silentxfer."!".g:netrw_http_cmd." ".tmpfile." http://".g:netrw_machine.netrw_html
" call Decho("exe ".g:netrw_silentxfer."!".g:netrw_http_cmd." ".g:netrw_shq.tmpfile.g:netrw_shq." ".g:netrw_shq."http://".g:netrw_machine.netrw_html.g:netrw_shq)
exe g:netrw_silentxfer."!".g:netrw_http_cmd." ".g:netrw_shq.tmpfile.g:netrw_shq." ".g:netrw_shq."http://".g:netrw_machine.netrw_html.g:netrw_shq
let result = s:NetrwGetFile(readcmd, tmpfile, b:netrw_method)
" call Decho('<\s*a\s*name=\s*"'.netrw_tag.'"/')
exe 'norm! 1G/<\s*a\s*name=\s*"'.netrw_tag.'"/'."\<CR>"
@ -877,8 +879,8 @@ fun! netrw#NetRead(mode,...)
elseif b:netrw_method == 7
" call Decho("read via rsync (method #7)")
let netrw_fname= escape(b:netrw_fname,g:netrw_fname_escape)
" call Decho("executing: !".g:netrw_rsync_cmd." ".g:netrw_machine.":".netrw_fname." ".tmpfile)
exe g:netrw_silentxfer."!".g:netrw_rsync_cmd." ".g:netrw_machine.":".netrw_fname." ".tmpfile
" call Decho("exe ".g:netrw_silentxfer."!".g:netrw_rsync_cmd." ".g:netrw_shq.g:netrw_machine.":".netrw_fname.g:netrw_shq." ".tmpfile)
exe g:netrw_silentxfer."!".g:netrw_rsync_cmd." ".g:netrw_shq.g:netrw_machine.":".netrw_fname.g:netrw_shq." ".tmpfile
let result = s:NetrwGetFile(readcmd,tmpfile, b:netrw_method)
let b:netrw_lastfile = choice
@ -902,11 +904,11 @@ fun! netrw#NetRead(mode,...)
" call Decho("read via fetch for ".netrw_option)
if exists("g:netrw_uid") && g:netrw_uid != "" && exists("s:netrw_passwd") && s:netrw_passwd != ""
" call Decho("executing: !".g:netrw_fetch_cmd." ".tmpfile." ".netrw_option."://".g:netrw_uid.':'.s:netrw_passwd.'@'.g:netrw_machine."/".netrw_fname)
exe g:netrw_silentxfer."!".g:netrw_fetch_cmd." ".tmpfile." ".netrw_option."://".g:netrw_uid.':'.s:netrw_passwd.'@'.g:netrw_machine."/".netrw_fname
" call Decho("exe ".g:netrw_silentxfer."!".g:netrw_fetch_cmd." ".tmpfile." ".g:netrw_shq.netrw_option."://".g:netrw_uid.':'.s:netrw_passwd.'@'.g:netrw_machine."/".netrw_fname.g:netrw_shq)
exe g:netrw_silentxfer."!".g:netrw_fetch_cmd." ".tmpfile." ".g:netrw_shq.netrw_option."://".g:netrw_uid.':'.s:netrw_passwd.'@'.g:netrw_machine."/".netrw_fname.g:netrw_shq
else
" call Decho("executing: !".g:netrw_fetch_cmd." ".tmpfile." ".netrw_option."://".g:netrw_machine."/".netrw_fname)
exe g:netrw_silentxfer."!".g:netrw_fetch_cmd." ".tmpfile." ".netrw_option."://".g:netrw_machine."/".netrw_fname
" call Decho("exe ".g:netrw_silentxfer."!".g:netrw_fetch_cmd." ".tmpfile." ".g:netrw_shq.netrw_option."://".g:netrw_machine."/".netrw_fname.g:netrw_shq)
exe g:netrw_silentxfer."!".g:netrw_fetch_cmd." ".tmpfile." ".g:netrw_shq.netrw_option."://".g:netrw_machine."/".netrw_fname.g:netrw_shq
endif
let result = s:NetrwGetFile(readcmd,tmpfile, b:netrw_method)
@ -918,8 +920,8 @@ fun! netrw#NetRead(mode,...)
elseif b:netrw_method == 9
" call Decho("read via sftp (method #9)")
let netrw_fname= escape(b:netrw_fname,g:netrw_fname_escape)
" call Decho("executing: !".g:netrw_sftp_cmd." ".g:netrw_machine.":".netrw_fname." ".tmpfile)
exe g:netrw_silentxfer."!".g:netrw_sftp_cmd." ".g:netrw_machine.":".netrw_fname." ".tmpfile
" call Decho("exe ".g:netrw_silentxfer."!".g:netrw_sftp_cmd." ".g:netrw_shq.g:netrw_machine.":".netrw_fname.g:netrw_shq." ".tmpfile)
exe g:netrw_silentxfer."!".g:netrw_sftp_cmd." ".g:netrw_shq.g:netrw_machine.":".netrw_fname.g:netrw_shq." ".tmpfile
let result = s:NetrwGetFile(readcmd, tmpfile, b:netrw_method)
let b:netrw_lastfile = choice
@ -1354,7 +1356,11 @@ fun! s:NetrwGetFile(readcmd, tfile, method)
" rename buffer back to remote filename
" call Decho("exe silent! keepalt file ".escape(rfile,' '))
exe "silent! keepalt file ".escape(rfile,' ')
if a:method == 5
set ft=html
else
filetype detect
endif
" call Dredir("renamed buffer back to remote filename<".rfile."> : expand(%)<".expand("%").">","ls!")
let line1 = 1
let line2 = line("$")
@ -1386,9 +1392,9 @@ fun! s:NetrwGetFile(readcmd, tfile, method)
" call Decho("NetReadFixup() not called, doesn't exist (line1=".line1." line2=".line2.")")
endif
if has("gui") && has("menu") && has("gui_running") && &go =~ 'm'
" update the Buffers menu
if has("gui") && has("gui_running")
silent! emenu Buffers.Refresh\ menu
call s:UpdateBuffersMenu()
endif
" call Decho("readcmd<".a:readcmd."> cmdarg<".v:cmdarg."> tfile<".a:tfile."> readable=".s:FileReadable(a:tfile))
@ -1949,6 +1955,7 @@ endfun
fun! s:NetrwBrowse(islocal,dirname)
if !exists("w:netrw_liststyle")|let w:netrw_liststyle= g:netrw_liststyle|endif
" call Dfunc("s:NetrwBrowse(islocal=".a:islocal." dirname<".a:dirname.">) liststyle=".w:netrw_liststyle." ".g:loaded_netrw." buf#".bufnr("%")."<".bufname("%").">")
" call Decho("tab#".tabpagenr()." win#".winnr())
" call Dredir("ls!")
if exists("s:netrw_skipbrowse")
@ -2218,7 +2225,7 @@ fun! s:NetrwGetBuffer(islocal,dirname)
" call Decho(" findbuf1: bufnum=bufnr('".dirname."')=".bufnum." bufname(".bufnum.")<".bufname(bufnum)."> (initial)")
" note: !~ was used just below, but that means using ../ to go back would match (ie. abc/def/ and abc/ matches)
if bufnum > 0 && bufname(bufnum) != dirname
if bufnum > 0 && bufname(bufnum) != dirname && bufname(bufnum) != '.'
" handle approximate matches
" call Decho(" handling approx match: bufnum#%d<".bufname(bufnum)."> approx= dirname<".dirname.">")
let ibuf = 1
@ -2270,6 +2277,7 @@ fun! s:NetrwGetBuffer(islocal,dirname)
" call Decho(" errmsg<".v:errmsg."> bufnr(".escdirname.")=".bufnr(escdirname)."<".bufname(bufnr(escdirname)).">")
" call Decho(' exe silent! keepalt file '.escdirname)
exe 'silent! keepalt file '.escdirname
" call Decho(" errmsg<".v:errmsg."> bufnr(".escdirname.")=".bufnr(escdirname)."<".bufname(bufnr(escdirname)).">")
endif
" call Decho(" named enew buffer#".bufnr("%")."<".bufname("%").">")
@ -2284,6 +2292,9 @@ fun! s:NetrwGetBuffer(islocal,dirname)
" call Decho(" reusing buffer#".bufnum."<".((bufnum > 0)? bufname(bufnum) : "")."> using: b ".bufnum)
exe "b ".bufnum
endif
if bufname("%") == '.'
exe "silent! keepalt file ".escape(getcwd(),' ')
endif
let &ei= eikeep
if line("$") <= 1
call s:NetrwListSettings(a:islocal)
@ -2524,7 +2535,9 @@ fun! s:NetrwBookmarkMenu()
return
endif
" call Dfunc("NetrwBookmarkMenu() bookmarkcnt=".g:NETRW_BOOKMARKMAX." histcnt=".g:NETRW_DIRHIST_CNT." menucnt=".s:netrw_menucnt)
if has("menu") && has("gui_running") && &go =~ 'm'
" the following test assures that gvim is running, has menus available, and has menus enabled.
if has("gui") && has("menu") && has("gui_running") && &go =~ 'm' && g:netrw_menu
if exists("g:NetrwTopLvlMenu")
exe 'silent! unmenu '.g:NetrwTopLvlMenu.'Bookmark'
endif
@ -3603,24 +3616,28 @@ endfun
fun! s:NetrwMarkFile(islocal,fname)
" call Dfunc("s:NetrwMarkFile(islocal=".a:islocal." fname<".a:fname.">)")
let curbufnr= bufnr("%")
let curdir = b:netrw_curdir
if exists("s:netrwmarkfilelist_{curbufnr}")
" markfile list exists
" call Decho("starting s:netrwmarkfilelist_{curbufnr}<".string(s:netrwmarkfilelist_{curbufnr}).">")
" call Decho("starting s:netrwmarkfilemtch_{curbufnr}<".s:netrwmarkfilemtch_{curbufnr}.">")
if index(s:netrwmarkfilelist_{curbufnr},a:fname) == -1
" append filename to list
" call Decho("append filename<".a:fname."> to markfilelist<".string(s:netrwmarkfilelist_{curbufnr}).">")
" append filename to local-directory markfilelist
" call Decho("append filename<".a:fname."> to local markfilelist_".curbufnr."<".string(s:netrwmarkfilelist_{curbufnr}).">")
call add(s:netrwmarkfilelist_{curbufnr},a:fname)
let s:netrwmarkfilemtch_{curbufnr}= s:netrwmarkfilemtch_{curbufnr}.'\|\<'.escape(a:fname,g:netrw_markfileesc."'".g:netrw_markfileesc."'").'\>'
else
" remove filename from list
" call Decho("remove filename<".a:fname."> from markfilelist_".curbufnr."<".string(s:netrwmarkfilelist_{curbufnr}).">")
" remove filename from local markfilelist
" call Decho("remove filename<".a:fname."> from local markfilelist_".curbufnr."<".string(s:netrwmarkfilelist_{curbufnr}).">")
call filter(s:netrwmarkfilelist_{curbufnr},'v:val != a:fname')
if s:netrwmarkfilelist_{curbufnr} == []
" local markfilelist is empty; remove it entirely
" call Decho("markfile list now empty, unlet s:netrwmarkfilelist_".curbufnr." and ...mtch_".curbufnr)
unlet s:netrwmarkfilelist_{curbufnr}
unlet s:netrwmarkfilemtch_{curbufnr}
call s:NetrwUnmarkList(curbufnr,curdir)
else
" rebuild match list to display markings correctly
" call Decho("rebuild s:netrwmarkfilemtch_".curbufnr)
let s:netrwmarkfilemtch_{curbufnr}= ""
let first = 1
@ -3632,26 +3649,52 @@ fun! s:NetrwMarkFile(islocal,fname)
endif
let first= 0
endfor
" call Decho("ending s:netrwmarkfilelist_{curbufnr}<".string(s:netrwmarkfilelist_{curbufnr}).">")
" call Decho("ending s:netrwmarkfilemtch_{curbufnr}<".s:netrwmarkfilemtch_{curbufnr}.">")
" call Decho("ending s:netrwmarkfilelist_"curbufnr."<".string(s:netrwmarkfilelist_{curbufnr}).">")
" call Decho("ending s:netrwmarkfilemtch_"curbufnr."<".s:netrwmarkfilemtch_{curbufnr}.">")
endif
endif
else
" initialize new markfilelist
" call Decho("add fname<".a:fname."> to new markfilelist")
" call Decho("add fname<".a:fname."> to new markfilelist_".curbufnr)
let s:netrwmarkfilelist_{curbufnr}= []
call add(s:netrwmarkfilelist_{curbufnr},a:fname)
" call Decho("ending s:netrwmarkfilelist_{curbufnr}<".string(s:netrwmarkfilelist_{curbufnr}).">")
" build initial markfile matching pattern
if a:fname =~ '/$'
let s:netrwmarkfilemtch_{curbufnr}= '\<'.escape(a:fname,g:netrw_markfileesc)
else
let s:netrwmarkfilemtch_{curbufnr}= '\<'.escape(a:fname,g:netrw_markfileesc).'\>'
endif
" call Decho("ending s:netrwmarkfilemtch_{curbufnr}<".s:netrwmarkfilemtch_{curbufnr}.">")
" call Decho("ending s:netrwmarkfilemtch_".curbufnr."<".s:netrwmarkfilemtch_{curbufnr}.">")
endif
" handle global markfilelist
if exists("s:netrwmarkfilelist")
let dname= s:ComposePath(b:netrw_curdir,a:fname)
if index(s:netrwmarkfilelist,dname) == -1
" append new filename to global markfilelist
call add(s:netrwmarkfilelist,s:ComposePath(b:netrw_curdir,a:fname))
" call Decho("append filename<".a:fname."> to global markfilelist<".string(s:netrwmarkfilelist).">")
else
" remove new filename from global markfilelist
" call Decho("filter(".string(s:netrwmarkfilelist).",'v:val != '.".dname.")")
call filter(s:netrwmarkfilelist,'v:val != "'.dname.'"')
" call Decho("ending s:netrwmarkfilelist <".string(s:netrwmarkfilelist).">")
if s:netrwmarkfilelist == []
unlet s:netrwmarkfilelist
endif
endif
else
" initialize new global-directory markfilelist
let s:netrwmarkfilelist= []
call add(s:netrwmarkfilelist,s:ComposePath(b:netrw_curdir,a:fname))
" call Decho("init s:netrwmarkfilelist<".string(s:netrwmarkfilelist).">")
endif
" set up 2match'ing to netrwmarkfilemtch list
if exists("s:netrwmarkfilemtch_{curbufnr}") && s:netrwmarkfilemtch_{curbufnr} != ""
" call Decho("exe 2match netrwMarkFile /".s:netrwmarkfilemtch_{curbufnr}."/")
exe "2match netrwMarkFile /".s:netrwmarkfilemtch_{curbufnr}."/"
@ -3659,7 +3702,7 @@ fun! s:NetrwMarkFile(islocal,fname)
" call Decho("2match none")
2match none
endif
" call Dret("s:NetrwMarkFile : netrwmarkfilelist".(exists("s:netrwmarkfilelist_{curbufnr}")? string(s:netrwmarkfilelist_{curbufnr}) : " doesn't exist"))
" call Dret("s:NetrwMarkFile : netrwmarkfilelist_".curbufnr."<".(exists("s:netrwmarkfilelist_{curbufnr}")? string(s:netrwmarkfilelist_{curbufnr}) : " doesn't exist").">")
endfun
" ---------------------------------------------------------------------
@ -3713,9 +3756,7 @@ fun! s:NetrwMarkFileCompress(islocal)
call s:RemoteSystem(g:netrw_compress." ".fname)
endif
endfor
unlet s:netrwmarkfilelist_{curbufnr}
unlet s:netrwmarkfilemtch_{curbufnr}
2match none
call s:NetrwUnmarkList(curbufnr,curdir)
call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./'))
call netrw#NetrwRestorePosn(svpos)
endif
@ -3726,7 +3767,7 @@ endfun
" s:NetrwMarkFileCopy: (invoked by mc) copy marked files to target {{{2
" If no marked files, then set up directory as the
" target. Currently does not support copying entire
" directories.
" directories. Uses the global marked file list.
" Returns 1=success (used by NetrwMarkFileMove())
" 0=failure
fun! s:NetrwMarkFileCopy(islocal)
@ -3734,9 +3775,8 @@ fun! s:NetrwMarkFileCopy(islocal)
" s:netrwmarkfilelist_{bufnr("%")}: the List of marked files
let curbufnr= bufnr("%")
if exists("s:netrwmarkfilelist_{curbufnr}")
" call Decho("s:netrwmarkfilelist_{curbufnr}<".string(s:netrwmarkfilelist_{curbufnr}).">")
" call Decho("s:netrwmarkfilemtch_{curbufnr}<".string(s:netrwmarkfilemtch_{curbufnr}).">")
if exists("s:netrwmarkfilelist")
" call Decho("s:netrwmarkfilelist<".string(s:netrwmarkfilelist).">")
let svpos = netrw#NetrwSavePosn()
let curdir = b:netrw_curdir
@ -3747,7 +3787,7 @@ fun! s:NetrwMarkFileCopy(islocal)
" call Decho("s:netrwmftgt<".s:netrwmftgt.">")
" call Decho("s:netrwmfloc=".s:netrwmfloc)
for fname in s:netrwmarkfilelist_{curbufnr}
for fname in s:netrwmarkfilelist
" call Decho("s:NetrwMarkFileCopy: fname<".fname.">")
" sanity check
@ -3759,10 +3799,11 @@ fun! s:NetrwMarkFileCopy(islocal)
if a:islocal && s:netrwmfloc
" local to local copy
" call Decho("local to local copy: from b:netrw_curdir<".b:netrw_curdir."> fname<".fname."> to s:netrwmftgt<".s:netrwmftgt.">")
" call Decho("local to local copy")
" call Decho("from b:netrw_curdir<".b:netrw_curdir."> fname<".fname."> to s:netrwmftgt<".s:netrwmftgt.">")
if executable(g:netrw_localcopycmd)
" call Decho("let ret= system(".g:netrw_localcopycmd." ".s:ComposePath(b:netrw_curdir,fname)." ".s:netrwmftgt.")")
let ret= system(g:netrw_localcopycmd." ".s:ComposePath(curdir,fname)." ".s:netrwmftgt)
let ret= system(g:netrw_localcopycmd." "." ".s:netrwmftgt) " global markfilelist verison
if v:shell_error < 0
call netrw#ErrorMsg(s:ERROR,"command<".g:netrw_localcopycmd."> failed, aborting",54)
break
@ -3774,13 +3815,15 @@ fun! s:NetrwMarkFileCopy(islocal)
elseif !a:islocal && s:netrwmfloc
" remote to local copy
" call Decho("remote to local copy: getcwd<".getcwd()."> b:netrw_curdir<".b:netrw_curdir.">")
" call Decho("remote to local copy")
" call Decho("getcwd<".getcwd()."> b:netrw_curdir<".b:netrw_curdir.">")
call netrw#NetrwObtain(a:islocal,fname,s:netrwmftgt)
elseif a:islocal && !s:netrwmfloc
" local to remote copy
" call Decho("local to remote copy: getcwd<".getcwd()."> b:netrw_curdir<".b:netrw_curdir.">")
call s:NetrwUpload(s:ComposePath(curdir,fname),s:netrwmftgt)
" call Decho("local to remote copy")
" call Decho("getcwd<".getcwd()."> b:netrw_curdir<".b:netrw_curdir.">")
call s:NetrwUpload(fname,s:netrwmftgt)
else
" remote to remote copy
@ -3789,13 +3832,8 @@ fun! s:NetrwMarkFileCopy(islocal)
endif
endfor
" unmark marked file list (although I expect s:NetrwUpload()
" to do it, I'm just making sure)
if exists("s:netrwmarkfilelist_{curbufnr}")
unlet s:netrwmarkfilelist_{curbufnr}
unlet s:netrwmarkfilemtch_{curbufnr}
2match none
endif
" unmark all marked file lists
call s:NetrwUnmarkAll()
else
call netrw#ErrorMsg(s:ERROR,"missing a markfile copy target! (see help for netrw-mt)",56)
endif
@ -3815,6 +3853,7 @@ endfun
" s:NetrwMarkFileDiff: (invoked by md) This function is used to {{{2
" invoke vim's diff mode on the marked files.
" Either two or three files can be so handled.
" Uses the global marked file list.
fun! s:NetrwMarkFileDiff(islocal)
" call Dfunc("s:NetrwMarkFileDiff(islocal=".a:islocal.") b:netrw_curdir<".b:netrw_curdir.">")
let curbufnr= bufnr("%")
@ -3822,13 +3861,9 @@ fun! s:NetrwMarkFileDiff(islocal)
let cnt = 0
let curdir = b:netrw_curdir
for fname in s:netrwmarkfilelist_{curbufnr}
for fname in s:netrwmarkfilelist
let cnt= cnt + 1
if a:islocal
if g:netrw_keepdir
let fname= s:ComposePath(curdir,fname)
endif
else
if !a:islocal
let fname= curdir.fname
endif
if cnt == 1
@ -3845,15 +3880,14 @@ fun! s:NetrwMarkFileDiff(islocal)
break
endif
endfor
unlet s:netrwmarkfilelist_{curbufnr}
unlet s:netrwmarkfilemtch_{curbufnr}
2match none
call s:NetrwUnmarkList(curbufnr,curdir)
endif
" call Dret("s:NetrwMarkFileDiff")
endfun
" ---------------------------------------------------------------------
" s:NetrwMarkFileEdit: (invoked by me) put marked files on arg list and start editing them {{{2
" Uses global markfilelist
fun! s:NetrwMarkFileEdit(islocal)
" call Dfunc("s:NetrwMarkFileEdit(islocal=".a:islocal.")")
@ -3864,16 +3898,17 @@ fun! s:NetrwMarkFileEdit(islocal)
if a:islocal && g:netrw_keepdir
" use complete paths if its local and keepdir enabled
let flist= ""
for fname in s:netrwmarkfilelist_{curbufnr}
let flist= flist." ".s:ComposePath(curdir,fname)
for fname in s:netrwmarkfilelist
" let flist= flist." ".s:ComposePath(curdir,fname)
let flist= flist." ".fname
endfor
else
let flist= substitute(escape(join(s:netrwmarkfilelist_{curbufnr},"\t"),' '),"\t",' ','g')
" let flist= substitute(escape(join(s:netrwmarkfilelist_{curbufnr},"\t"),' '),"\t",' ','g')
let flist= substitute(escape(join(s:netrwmarkfilelist,"\t"),' '),"\t",' ','g')
endif
" unmark markedfile list
unlet s:netrwmarkfilelist_{curbufnr}
unlet s:netrwmarkfilemtch_{curbufnr}
2match none
" call s:NetrwUnmarkList(curbufnr,curdir)
call s:NetrwUnmarkAll()
" call Decho("exe silent args ".flist)
exe "silent args ".flist
endif
@ -3883,6 +3918,7 @@ endfun
" ---------------------------------------------------------------------
" s:NetrwMarkFileExe: (invoked by mx) execute arbitrary command on marked files, one at a time {{{2
" Uses the local marked-file list.
fun! s:NetrwMarkFileExe(islocal)
" call Dfunc("s:NetrwMarkFileExe(islocal=".a:islocal.")")
let svpos = netrw#NetrwSavePosn()
@ -3927,9 +3963,7 @@ fun! s:NetrwMarkFileExe(islocal)
endfor
" unmark marked file list
unlet s:netrwmarkfilelist_{curbufnr}
unlet s:netrwmarkfilemtch_{curbufnr}
2match none
call s:NetrwUnmarkList(curbufnr,curdir)
" refresh the listing
call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./'))
@ -3944,6 +3978,7 @@ endfun
" ---------------------------------------------------------------------
" s:NetrwMarkHideSfx: (invoked by mh) (un)hide files having same suffix
" as the marked file(s) (toggles suffix presence)
" Uses the local marked file list.
fun! s:NetrwMarkHideSfx(islocal)
" call Dfunc("s:NetrwMarkHideSfx(islocal=".a:islocal.")")
let svpos = netrw#NetrwSavePosn()
@ -3999,27 +4034,24 @@ endfun
" ---------------------------------------------------------------------
" s:NetrwMarkFileMove: (invoked by mm) execute arbitrary command on marked files, one at a time {{{2
" uses the global marked file list
fun! s:NetrwMarkFileMove(islocal)
" call Dfunc("s:NetrwMarkFileMove(islocal=".a:islocal.")")
let curbufnr= bufnr("%")
if exists("s:netrwmarkfilelist_{curbufnr}")
if exists("s:netrwmarkfilelist")
let svpos = netrw#NetrwSavePosn()
let curbufnr = bufnr("%")
let curdir = b:netrw_curdir
if exists("s:netrwmftgt") && exists("s:netrwmfloc")
for fname in s:netrwmarkfilelist_{curbufnr}
" call Decho("s:NetrwMarkFileMove: fname<".fname.">")
if a:islocal
if g:netrw_keepdir
let fname= s:ComposePath(curdir,fname)
endif
else
let fname= curdir.fname
endif
if a:islocal && s:netrwmfloc
for fname in s:netrwmarkfilelist
let islocal= fname !~ '^\a\+://'
" call Decho("s:NetrwMarkFileMove: fname<".fname."> islocal=".islocal)
if islocal && s:netrwmfloc
" local to local move
" s:netrwmfloc= 0: target directory is remote
" = 1: target directory is local
" call Decho("local to local move")
if executable(g:netrw_localmovecmd)
" call Decho("let ret= system(".g:netrw_localmovecmd." ".fname." ".s:netrwmftgt.")")
let ret= system(g:netrw_localmovecmd." ".fname." ".s:netrwmftgt)
@ -4031,32 +4063,36 @@ fun! s:NetrwMarkFileMove(islocal)
call netrw#ErrorMsg(s:ERROR,"command<".g:netrw_localmovecmd."> is not executable!",57)
break
endif
else
" copy file, then remove original
elseif !islocal && s:netrwmfloc
" remote to local move
" call Decho("remote to local: copy and remove")
" call Decho("islocal =".islocal)
" call Decho("fname <".fname.">")
" call Decho("s:netrwmftgt<".s:netrwmftgt.">")
call netrw#NetrwObtain(islocal,fname,s:netrwmftgt)
let path = substitute(fname,'^\(.*/\)\(.\{-}\)$','\1','')
let barefname = substitute(fname,'^\(.*/\)\(.\{-}\)$','\2','')
let ok= s:NetrwRemoteRmFile(path,barefname,1)
elseif !islocal && s:netrwmfloc
" local to remote move
" remote to remote move
let netrwmflist = s:netrwmflist
let netrwmfmtch = s:netrwmfmtch
if s:NetrwMarkFileCopy(islocal)
let s:netrwmflist= netrwmflist
let s:netrwmfmtch= netrwmfmtch
if a:islocal
call s:NetrwLocalRm("---")
" call Decho("local to remote: copy and remove")
call s:NetrwUpload(fname,s:netrwmftgt)
let path = substitute(fname,'^\(.*/\)\(.\{-}\)$','\1','')
let barefname = substitute(fname,'^\(.*/\)\(.\{-}\)$','\2','')
let ok = s:NetrwLocalRmFile(path,barefname,1)
else
call s:NetrwRemoteRm("---","---")
endif
endif
" remote to remote move
" call Decho("remote to remote: copy and remove")
call s:NetrwUpload(fname,s:netrwmftgt)
let path = substitute(fname,'^\(.*/\)\(.\{-}\)$','\1','')
let barefname = substitute(fname,'^\(.*/\)\(.\{-}\)$','\2','')
let ok = s:NetrwRemoteRmFile(path,barefname,1)
endif
endfor
endif
" unmark marked file list
if exists("s:netrwmarkfilelist_{curbufnr}")
unlet s:netrwmarkfilelist_{curbufnr}
unlet s:netrwmarkfilemtch_{curbufnr}
2match none
endif
" unmark marked file lists
call s:NetrwUnmarkAll()
" refresh the listing and restore cursor position
call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./'))
@ -4070,15 +4106,14 @@ endfun
" ---------------------------------------------------------------------
" s:NetrwMarkFilePrint: (invoked by mp) This function prints marked files {{{2
" using the hardcopy command
" using the hardcopy command. Local marked-file list only.
fun! s:NetrwMarkFilePrint(islocal)
" call Dfunc("s:NetrwMarkFilePrint(islocal=".a:islocal.")")
let curbufnr= bufnr("%")
if exists("s:netrwmarkfilelist_{curbufnr}")
let netrwmarkfilelist = s:netrwmarkfilelist_{curbufnr}
let curdir = b:netrw_curdir
unlet s:netrwmarkfilelist_{curbufnr}
unlet s:netrwmarkfilemtch_{curbufnr}
call s:NetrwUnmarkList(curbufnr,curdir)
for fname in netrwmarkfilelist
if a:islocal
if g:netrw_keepdir
@ -4113,7 +4148,7 @@ fun! s:NetrwMarkFileRegexp(islocal)
if a:islocal
" get the matching list of files using local glob()
let dirname = escape(b:netrw_curdir,s:netrw_glob_escape)
let dirname = escape(b:netrw_curdir,g:netrw_glob_escape)
let filelist = glob(s:ComposePath(dirname,regexp))
if filelist != ""
let filelist= filelist."\n"
@ -4172,14 +4207,14 @@ endfun
" ---------------------------------------------------------------------
" s:NetrwMarkFileSource: (invoked by ms) This function sources marked files {{{2
" Uses the local marked file list.
fun! s:NetrwMarkFileSource(islocal)
" call Dfunc("s:NetrwMarkFileSource(islocal=".a:islocal.")")
let curbufnr= bufnr("%")
if exists("s:netrwmarkfilelist_{curbufnr}")
let netrwmarkfilelist = s:netrwmarkfilelist_{bufnr("%")}
let curdir = b:netrw_curdir
unlet s:netrwmarkfilelist_{curbufnr}
unlet s:netrwmarkfilemtch_{curbufnr}
call s:NetrwUnmarkList(curbufnr,curdir)
for fname in netrwmarkfilelist
if a:islocal
if g:netrw_keepdir
@ -4197,28 +4232,27 @@ fun! s:NetrwMarkFileSource(islocal)
endfun
" ---------------------------------------------------------------------
" s:NetrwMarkFileTag: (invoked by mt) This function applies {{{2
" g:netrw_ctags to marked files
" s:NetrwMarkFileTag: (invoked by mT) This function applies g:netrw_ctags to marked files {{{2
" Uses the global markfilelist
fun! s:NetrwMarkFileTag(islocal)
" call Dfunc("s:NetrwMarkFileTag(islocal=".a:islocal.")")
let svpos = netrw#NetrwSavePosn()
let curdir = b:netrw_curdir
let curbufnr = bufnr("%")
if exists("s:netrwmarkfilelist_{curbufnr}")
" call Decho("s:netrwmarkfilelist_{curbufnr}<".string(s:netrwmarkfilelist_{curbufnr}).">")
if exists("s:netrwmarkfilelist")
" call Decho("s:netrwmarkfilelist".string(s:netrwmarkfilelist).">")
if a:islocal && g:netrw_keepdir
let netrwmarkfilelist= ""
for fname in s:netrwmarkfilelist_{curbufnr}
let netrwmarkfilelist= netrwmarkfilelist." ".s:ComposePath(curdir,fname)
for fname in s:netrwmarkfilelist
" let netrwmarkfilelist= netrwmarkfilelist." ".s:ComposePath(curdir,fname)
let netrwmarkfilelist= netrwmarkfilelist." ".fname
endfor
else
let netrwmarkfilelist= string(s:netrwmarkfilelist_{curbufnr})
let netrwmarkfilelist= string(s:netrwmarkfilelist)
let netrwmarkfilelist= substitute(netrwmarkfilelist,'[[\],]','','g')
endif
unlet s:netrwmarkfilelist_{curbufnr}
unlet s:netrwmarkfilemtch_{curbufnr}
" call Decho("netrwmarkfilelist<".netrwmarkfilelist.">")
call s:NetrwUnmarkAll()
if a:islocal
if executable(g:netrw_ctags)
@ -4303,6 +4337,58 @@ fun! s:NetrwMarkFileTgt(islocal)
" call Dret("s:NetrwMarkFileTgt")
endfun
" ---------------------------------------------------------------------
" s:NetrwUnmarkList: delete local marked file lists and remove their contents from the global marked-file list {{{2
fun! s:NetrwUnmarkList(curbufnr,curdir)
" call Dfunc("s:NetrwUnmarkList(curbufnr=".a:curbufnr." curdir<".a:curdir.">)")
" remove all files in local marked-file list from global list
for mfile in s:netrwmarkfilelist_{a:curbufnr}
let dfile = s:ComposePath(a:curdir,mfile) " prepend directory to mfile
let idx = index(s:netrwmarkfilelist,dfile) " get index in list of dfile
call remove(s:netrwmarkfilelist,idx) " remove from global list
endfor
if s:netrwmarkfilelist == []
unlet s:netrwmarkfilelist
endif
" getting rid of the local marked-file lists is easy
unlet s:netrwmarkfilelist_{a:curbufnr}
unlet s:netrwmarkfilemtch_{a:curbufnr}
2match none
" call Dret("s:NetrwUnmarkList")
endfun
" ---------------------------------------------------------------------
" s:NetrwUnmarkAll: remove the global marked file list and all local ones {{{2
fun! s:NetrwUnmarkAll()
" call Dfunc("s:NetrwUnmarkAll()")
if exists("s:netrwmarkfilelist")
unlet s:netrwmarkfilelist
endif
silent call s:NetrwUnmarkAll2()
2match none
" call Dret("s:NetrwUnmarkAll")
endfun
" ---------------------------------------------------------------------
" s:NetrwUnmarkAll2: {{{2
fun! s:NetrwUnmarkAll2()
" call Dfunc("s:NetrwUnmarkAll2()")
redir => netrwmarkfilelist_let
let
redir END
let netrwmarkfilelist_list= split(netrwmarkfilelist_let,'\n') " convert let string into a let list
call filter(netrwmarkfilelist_list,"v:val =~ '^s:netrwmarkfilelist_'") " retain only those vars that start as s:netrwmarkfilelist_
call map(netrwmarkfilelist_list,"substitute(v:val,'\\s.*$','','')") " remove what the entries are equal to
for flist in netrwmarkfilelist_list
let curbufnr= substitute(flist,'s:netrwmarkfilelist_','','')
unlet s:netrwmarkfilelist_{curbufnr}
unlet s:netrwmarkfilemtch_{curbufnr}
endfor
" call Dret("s:NetrwUnmarkAll2")
endfun
" ---------------------------------------------------------------------
" s:NetrwUnMarkFile: {{{2
fun! s:NetrwUnMarkFile(islocal)
@ -4314,6 +4400,7 @@ fun! s:NetrwUnMarkFile(islocal)
" to do it, I'm just making sure)
if exists("s:netrwmarkfilelist_{bufnr('%')}")
" call Decho("unlet'ing: s:netrwmarkfile[list|mtch]_".bufnr("%"))
unlet s:netrwmarkfilelist
unlet s:netrwmarkfilelist_{curbufnr}
unlet s:netrwmarkfilemtch_{curbufnr}
2match none
@ -4415,11 +4502,17 @@ fun! s:NetrwObtain(islocal)
if exists("s:netrwmarkfilelist_{bufnr('%')}")
for fname in s:netrwmarkfilelist_{bufnr("%")}
call netrw#NetrwObtain(a:islocal,fname)
let islocal= fname !~ '^\a\+://'
call netrw#NetrwObtain(islocal,fname)
endfor
unlet s:netrwmarkfilelist_{bufnr("%")}
unlet s:netrwmarkfilemtch_{bufnr("%")}
2match none
call s:NetrwUnmarkList(bufnr('%'),b:netrw_curdir)
endif
if exists("s:netrwmarkfilelist")
for fname in s:netrwmarkfilelist
let islocal= fname !~ '^\a\+://'
call netrw#NetrwObtain(islocal,fname)
endfor
call s:NetrwUnmarkAll()
else
call netrw#NetrwObtain(a:islocal,expand("<cWORD>"))
endif
@ -4436,6 +4529,7 @@ fun! netrw#NetrwObtain(islocal,fname,...)
if a:islocal
" obtain local file from getcwd() to b:netrw_curdir
" call Decho("obtain local file from ".getcwd()." to b:netrw_curdir<".b:netrw_curdir.">")
if exists("b:netrw_curdir") && getcwd() != b:netrw_curdir
let fname= expand("<cWORD>")
let fcopy= readfile(b:netrw_curdir."/".fname,"b")
@ -4449,19 +4543,20 @@ fun! netrw#NetrwObtain(islocal,fname,...)
else
" obtain a remote file to local directory (see tgtdir below)
" call Decho("obtain a remote file to local directory<".getcwd().">")
call s:SetupNetrwStatusLine('%f %h%m%r%=%9*Obtaining '.a:fname)
" set up target directory (default is vim's idea of the current directory)
if a:0 > 0
let tgtdir= a:1
else
let tgtdir= '.'
let tgtdir= getcwd()
endif
" call Decho("tgtdir<".tgtdir.">")
" call Decho("obtain a remote file<".a:fname."> to tgtdir<".tgtdir.">")
if exists("w:netrw_method") && w:netrw_method =~ '[235]'
" call Decho("method=".w:netrw_method)
if executable("ftp")
" call Decho("ftp is executable, method=".w:netrw_method)
" call Decho("using ftp, method=".w:netrw_method)
let curdir = b:netrw_curdir
let path = substitute(curdir,'ftp://[^/]\+/','','e')
let curline= line(".")
@ -4480,7 +4575,7 @@ fun! netrw#NetrwObtain(islocal,fname,...)
" ftp + <.netrc>: Method #2
setlocal ff=unix
if path != ""
put ='lcd '.path
put ='cd '.path
" call Decho("ftp: cd ".path)
endif
if tgtdir != '.'
@ -4521,11 +4616,12 @@ fun! netrw#NetrwObtain(islocal,fname,...)
endif
if path != ""
put ='lcd '.path
" call Decho('lcd '.a:path)
put ='cd '.path
" call Decho('ftp: cd '.a:path)
endif
if tgtdir != '.'
put ='lcd '.tgtdir
" call Decho('ftp: lcd '.tgtdir)
endif
put ='get '.a:fname
" call Decho("ftp: get ".a:fname)
@ -4567,18 +4663,30 @@ fun! netrw#NetrwObtain(islocal,fname,...)
".........................................
else
" scp: Method#4
" call Decho("using scp")
let curdir = b:netrw_curdir
let path = substitute(curdir,'scp://[^/]\+/','','e')
" call Decho("path<".path.">")
if exists("g:netrw_port") && g:netrw_port != ""
let useport= " ".g:netrw_scpport." ".g:netrw_port
else
let useport= ""
endif
" call Decho("pwd<".getcwd().">")
" call Decho("executing: !".g:netrw_scp_cmd.useport." ".g:netrw_machine.":".path.escape(a:fname,' ?&')." ".tgtdir)
exe g:netrw_silentxfer."!".g:netrw_scp_cmd.useport." ".g:netrw_machine.":".path.escape(a:fname,' ?&')." ".tgtdir
if a:fname =~ '^\a\+:'
let fname= substitute(a:fname,'^.*/','','')
else
let fname= a:fname
endif
if path !~ '/$'
let path= path.'/'
endif
" call Decho("using scp: curdir <".curdir.">")
" call Decho("using scp: fname <".fname.">")
" call Decho("using scp: machine<".g:netrw_machine.">")
" call Decho("using scp: path <".path.">")
" call Decho("using scp: pwd <".getcwd().">")
" call Decho("using scp: tgtdir <".tgtdir.">")
" call Decho("using scp: useport<".useport.">")
" call Decho("executing: !".g:netrw_scp_cmd.useport." ".g:netrw_machine.":".path.escape(fname,' ?&')." ".tgtdir)
exe g:netrw_silentxfer."!".g:netrw_scp_cmd.useport." ".g:netrw_machine.":".path.escape(fname,' ?&')." ".tgtdir
endif
" restore status line
@ -4704,19 +4812,23 @@ endfun
" s:NetrwUpload: load fname to tgt (used by NetrwMarkFileCopy()) {{{2
" fname may itself be a remote or local file
" tgt is assumed to be remote, so NetWrite will be used
" (indirectly an autocmd)
" (indirectly via an autocmd)
fun! s:NetrwUpload(fname,tgt)
" call Dfunc("s:NetrwUpload(fname<".a:fname."> tgt<".a:tgt.">)")
1split
" call Decho("exe e ".a:fname)
exe "e ".escape(a:fname,g:netrw_fname_escape)
let efname= escape(a:fname,g:netrw_fname_escape)
" call Decho("exe e ".efname)
exe "e ".efname
if a:tgt =~ '/$'
" call Decho("exe w ".a:tgt.a:fname)
exe "w ".escape(a:tgt.a:fname,g:netrw_fname_escape)
let wfname= substitute(a:fname,'^.*/','','')
let wfname= escape(a:tgt.wfname,g:netrw_fname_escape)
" call Decho("exe w ".wfname)
exe "w ".wfname
else
" call Decho("exe w ".a:tgt)
exe "w ".escape(a:tgt,g:netrw_fname_escape)
let wfname= escape(a:tgt,g:netrw_fname_escape)
" call Decho("exe w ".wfname)
exe "w ".wfname
endif
q!
@ -5409,7 +5521,7 @@ fun! s:SetupNetrwStatusLine(statline)
let &stl=a:statline
setlocal laststatus=2
" call Decho("stl=".&stl)
" redraw!
redraw
" call Dret("SetupNetrwStatusLine : stl=".&stl)
endfun
@ -5879,9 +5991,7 @@ fun! s:NetrwRemoteRename(usrhost,path) range
endif
endfor
2match none
unlet s:netrwmarkfilelist_{bufnr("%")}
unlet s:netrwmarkfilemtch_{bufnr("%")}
call s:NetrwUnMarkFile(1)
else
@ -5957,7 +6067,7 @@ fun! s:LocalListing()
" if exists("g:netrw_sort_by")|call Decho('g:netrw_sort_by<'.g:netrw_sort_by.">")|else|call Decho("g:netrw_sort_by doesn't exist")|endif
" get the list of files contained in the current directory
let dirname = escape(b:netrw_curdir,s:netrw_glob_escape)
let dirname = escape(b:netrw_curdir,g:netrw_glob_escape)
let dirnamelen = s:Strlen(b:netrw_curdir)
let filelist = glob(s:ComposePath(dirname,"*"))
" call Decho("glob(dirname<".dirname."/*>)=".filelist)
@ -6102,8 +6212,12 @@ endfun
" buffers to be refreshed after a user has executed some shell command,
" on the chance that s/he removed/created a file/directory with it.
fun! s:LocalBrowseShellCmdRefresh()
" call Dfunc("LocalBrowseShellCmdRefresh() browselist=".string(s:netrw_browselist)." ".tabpagenr("$")." tabs")
" call Dfunc("LocalBrowseShellCmdRefresh() browselist=".(exists("s:netrw_browselist")? string(s:netrw_browselist) : "empty")." ".tabpagenr("$")." tabs")
" determine which buffers currently reside in a tab
if !exists("s:netrw_browselist")
" call Dret("LocalBrowseShellCmdRefresh : browselist is empty")
return
endif
let itab = 1
let buftablist = []
while itab <= tabpagenr("$")
@ -6112,7 +6226,7 @@ fun! s:LocalBrowseShellCmdRefresh()
tabn
endwhile
" call Decho("buftablist".string(buftablist))
" call Decho("s:netrw_browselist<".string(s:netrw_browselist).">")
" call Decho("s:netrw_browselist<".(exists("s:netrw_browselist")? string(s:netrw_browselist) : "").">")
" GO through all buffers on netrw_browselist (ie. just local-netrw buffers):
" | refresh any netrw window
" | wipe out any non-displaying netrw buffer
@ -6160,9 +6274,7 @@ fun! s:NetrwLocalRm(path) range
let all= 1
endif
endfor
unlet s:netrwmarkfilelist_{bufnr("%")}
unlet s:netrwmarkfilemtch_{bufnr("%")}
2match none
call s:NetrwUnMarkFile(1)
else
" remove (multiple) files and directories
@ -6411,6 +6523,44 @@ endfun
" ---------------------------------------------------------------------
" Support Functions: {{{1
" ---------------------------------------------------------------------
" s:UpdateBuffersMenu: does emenu Buffers.Refresh (but due to locale, the menu item may not be called that) {{{2
" The Buffers.Refresh menu calls s:BMShow(); unfortunately, that means that that function
" can't be called except via emenu. But due to locale, that menu line may not be called
" Buffers.Refresh; hence, s:NetrwBMShow() utilizes a "cheat" to call that function anyway.
fun! s:UpdateBuffersMenu()
" call Dfunc("s:UpdateBuffersMenu()")
if has("gui") && has("menu") && has("gui_running") && &go =~ 'm'
try
silent emenu Buffers.Refresh\ menu
catch /^Vim\%((\a\+)\)\=:E/
let v:errmsg= ""
silent call s:NetrwBMShow()
endtry
endif
" call Dret("s:UpdateBuffersMenu")
endfun
" ---------------------------------------------------------------------
" s:NetrwBMShow: {{{2
fun! s:NetrwBMShow()
" call Dfunc("s:NetrwBMShow()")
redir => bmshowraw
menu
redir END
let bmshowlist = split(bmshowraw,'\n')
if bmshowlist != []
let bmshowfuncs= filter(bmshowlist,'v:val =~ "<SNR>\\d\\+_BMShow()"')
if bmshowfuncs != []
let bmshowfunc = substitute(bmshowfuncs[0],'^.*:\(call.*BMShow()\).*$','\1','')
if bmshowfunc =~ '^call.*BMShow()'
exe "silent! ".bmshowfunc
endif
endif
endif
" call Dret("s:NetrwBMShow : bmshowfunc<".bmshowfunc.">")
endfun
" ---------------------------------------------------------------------
" s:ComposePath: Appends a new part to a path taking different systems into consideration {{{2
fun! s:ComposePath(base,subdir)

View File

@ -1,5 +1,5 @@
" netrwSettings.vim: makes netrw settings simpler
" Date: Jun 04, 2007
" Date: Mar 11, 2008
" Maintainer: Charles E Campbell, Jr <drchipNOSPAM at campbellfamily dot biz>
" Version: 11
" Copyright: Copyright (C) 1999-2007 Charles E. Campbell, Jr. {{{1
@ -108,10 +108,14 @@ fun! netrwSettings#NetrwSettings()
put ='let g:netrw_decompress...'
put = 'let g:netrw_dirhistmax = '.g:netrw_dirhistmax
put = 'let g:netrw_fastbrowse = '.g:netrw_fastbrowse
let fnameescline= line("$")
put = 'let g:netrw_fname_escape...'
put = 'let g:netrw_ftp_browse_reject = '.g:netrw_ftp_browse_reject
put = 'let g:netrw_ftp_list_cmd = '.g:netrw_ftp_list_cmd
put = 'let g:netrw_ftp_sizelist_cmd = '.g:netrw_ftp_sizelist_cmd
put = 'let g:netrw_ftp_timelist_cmd = '.g:netrw_ftp_timelist_cmd
let globescline= line("$")
put ='let g:netrw_glob_escape...'
put = 'let g:netrw_hide = '.g:netrw_hide
put = 'let g:netrw_keepdir = '.g:netrw_keepdir
put = 'let g:netrw_list_cmd = '.g:netrw_list_cmd
@ -139,6 +143,8 @@ fun! netrwSettings#NetrwSettings()
put = 'let g:netrw_scpport = '.g:netrw_scpport
put = 'let g:netrw_sshport = '.g:netrw_sshport
put = 'let g:netrw_timefmt = '.g:netrw_timefmt
let tmpfileescline= line("$")
put ='let g:netrw_tmpfile_escape...'
put = 'let g:netrw_use_noswf = '.g:netrw_use_noswf
put = 'let g:netrw_winsize = '.g:netrw_winsize
@ -161,6 +167,9 @@ fun! netrwSettings#NetrwSettings()
endif
call setline(cdescline, "let g:netrw_cd_escape = ".'"'.escape(g:netrw_cd_escape,'\"').'"')
call setline(decompressline,"let g:netrw_decompress = ".substitute(string(g:netrw_decompress),"^'\\(.*\\)'$",'\1',''))
call setline(fnameescline, "let g:netrw_fname_escape = '".escape(g:netrw_fname_escape,"'")."'")
call setline(globescline, "let g:netrw_glob_escape = '".escape(g:netrw_glob_escape,"'")."'")
call setline(tmpfileescline,"let g:netrw_tmpfile_escape = '".escape(g:netrw_tmpfile_escape,"'")."'")
set nomod

204
vimfiles/doc/cecutil.txt Normal file
View File

@ -0,0 +1,204 @@
*cecutil.txt* DrChip's Utilities Sep 04, 2007
Author: Charles E. Campbell, Jr. <NdrOchip@ScampbellPfamily.AbizM>
(remove NOSPAM from Campbell's email first)
Copyright: (c) 2004-2006 by Charles E. Campbell, Jr. *cecutil-copyright*
The VIM LICENSE applies to cecutil.vim and cecutil.txt
(see |copyright|) except use "cecutil" instead of "Vim"
No warranty, express or implied. Use At-Your-Own-Risk.
==============================================================================
1. Contents *cecutil* *cecutil-contents*
1. Contents.................: |cecutil-contents|
2. Positioning..............: |cecutil-posn|
3. Marks....................: |cecutil-marks|
4. Maps.....................: |cecutil-maps|
5. History..................: |cecutil-history|
==============================================================================
2. Positioning *cecutil-posn* *cecutil-position*
let winposn= SaveWinPosn() *cecutil-savewinposn*
This operation will save window position in winposn variable and
on a (buffer local) b:winposn{} stack.
call SaveWinPosn()
This function will save window position in b:winposn{b:iwinposn}
let winposn= SaveWinPosn(0)
This operation will _only_ save the window position in winposn variable.
Ie. the window position will not appear on the b:winposn{} stack. You
will then need to use RestoreWinPosn(winposn) to restore to this window
position.
call RestoreWinPosn() *cecutil-restorewinposn*
This function call will use the local buffer b:winposn{} stack to
restore the last window position saved therein. It will also
pop the stack.
call RestoreWinPosn(winposn)
This function call will use the winposn variable and restore
the window position accordingly. It will also search the
stack and remove any similar entry from the stack.
*cecutil-map* *cecutil-cmd* *cecutil-swp* *cecutil-rwp*
\swp : save current window position (uses the b:winposn{} stack)
:SWP like \swp, but provided as a command
\rwp : restore window position (uses the b:winposn{} stack)
:RWP like \rwp, but provided as a command
==============================================================================
3. Marks *cecutil-marks*
call SaveMark(markname) *cecutil-savemark*
let savemark= SaveMark(markname)
SM markname >
ex. call SaveMark("a")
let savemarkb= SaveMark("b")
:SM a
<
This function saves a string in the global variable g:savemark_{markname}
which contains sufficient information to completely restore the position
of a mark. It also returns that string.
call RestoreMark(markname) *cecutil-restoremark*
call RestoreMark(savemark)
This function either takes a single-character string (ex. "a") and uses
g:savemark_{markname} to restore the mark position or assumes that
the string passed to it is a SaveMark() string (and uses it to restore
the mark). >
ex. call RestoreMark("a")
call RestoreMark(savemarkb)
:RM a
<
call DestroyMark(markname) *cecutil-destroymark*
The DestroyMark() function completely removes a mark. It does this
by saving the window position, copying line one, putting the
to-be-destroyed mark on that new line, deleting the new line, and
then restoring the window position. The windows' modified status
is preserved. >
ex. call DestroyMark("a")
:DM a
<
==============================================================================
4.Maps *cecutil-maps*
*cecutil-saveusermaps*
call SaveUserMaps(mapmode,maplead,mapchx,suffix)
This function sets up a script-variable (ie. a variable that can
generally be accessed only from within cecutil's own functions;
see |s:|) called s:restoremap. The selected user's maps are appended
to this variable; the RestoreUserMaps() (|cecutil-restoreusermaps|)
function uses the contents of this variable to restore user maps.
mapmode - see :help maparg for its list (see |maparg()|) >
ex. "n" = Normal
< Will now accept an optional leading "u"; if present,
SaveUserMaps() will save and unmap (otherwise, it
will save only)
mapchx - "<something>" handled as a single map item. >
ex. "<left>"
< - "string" a string of single letters which are actually
multiple two-letter maps
maplead - the maps are assumed to have the form >
maplead . each_character_in_string
< ex. maplead="\" and mapchx="abc" saves mappings for >
\a, \b, and \c
< Of course, if maplead is "", then for mapchx="abc",
mappings for just a, b, and c are saved.
- :something handled as a single map item, w/o the ":" >
ex. mapchx= ":abc"
< will save the user mapping for "abc"
suffix - a string unique to your plugin >
ex. suffix= "DrawIt"
<
Some examples follow: >
call SaveUserMaps("n","","webWEBjklh$0%;,nN","HiMtchBrkt")
< normal mode maps for w, e, b, W, E, B, j, k, l, etc
(if any) are all saved in the variable
s:restoremaps_HiMtchBrkt >
call SaveUserMaps("n","","<up>","DrawIt")
< the normal mode map (if any) for the <up> key is saved in
the variable s:restoremaps_DrawIt >
call SaveUserMaps("n","",":F(","HiMtchBrkt")
< the normal mode map for F( (if any) is saved in the
variable s:restoremaps_HiMtchBrkt
call RestoreUserMaps(suffix)
The usermaps saved by SaveUserMaps() with the given suffix will be
restored (ie. s:restoremaps_{suffix}). Example: >
call RestoreUserMaps("HiMtchBrkt")
< will restore all user maps redefined for the HiMtchBrkt plugin
==============================================================================
5. History *cecutil-history* {{{1
v17 Sep 04, 2007 : * new function, QArgSplitter(), included
v16 Oct 30, 2006 : * com -> com! so AsNeeded is happier
Feb 12, 2007 * fixed a bug where :somemap (a map of "somemap")
did not use the optional mapleader (so it'd be
a map of "\somemap", if "\" is the mapleader).
(problem pointed out by Michael Zhang)
v15 Jan 25, 2006 : * bypass for report option for DestroyMark() included
* SaveWinPosn() and RestoreWinPosn() now handle an
empty buffer
* b:(varname) now use b:cecutil_(varname)
* map restoration improved
v14 Jan 23, 2006 : * bypasses for si, so, and siso options included
Jan 25, 2006 * SaveUserMaps' mapmode argument, heretofore just
a single letter (see |maparg()|), now accepts a
leading "u". If present, SaveUserMaps() will
do an unmap.
v13 Jan 12, 2006 : * SaveUserMaps() was saving user maps but then also
unmap'ing them. HiMtchBrkt needed to append a
function call to maps, not overwrite them. So
the new SaveUserMaps() just saves user maps,
leaving their definitions in place.
Jan 18, 2006 * keepjumps used to avoid jumplist changes when
using SaveWinPosn() and RestoreWinPosn()
v12 Dec 29, 2005 : * bugfix (affected Mines.vim)
v11 Dec 29, 2005 : * two new functions (SaveUserMaps() and
RestoreUserMaps() )
v10 Nov 22, 2005 : * SaveWinPosn bugfix
v9 Jun 02, 2005 : * <q-args> produces a "" argument when there are
no arguments, which caused difficulties. Fixed.
v8 Apr 22, 2005 : * <q-args> used to handle marknames with commands
Thus, :DM a will delete mark a
v7 Mar 10, 2005 : * removed zO from saved window position; caused
problems with ftplugin/currfunc.vim
* doing a SWP and RWP on an empty buffer produced
"empty buffer" messages; now these are ignored
Apr 13, 2005 * command (SWP RWP MP SP etc) now have -bar so
that the "|" can be used to chain such commands
v6 Feb 17, 2005 : * improved SaveMark() and RestoreMark()
v5 Jan 18, 2005 : * s:loaded_winposn changed to g:loaded_cecutil
v4 Oct 25, 2004 : * changed com! to com so that error messages will
be given when there's a command-name conflict
v3 May 19, 2004 : * bugfix: the sequence \swp\rwp wasn't working right
* bugfix: \swp...\rwp was echoing the current
line when the \rwp should've been silent
* improved Dfunc/Decho/Dret debugging
==============================================================================
vim:tw=78:ts=8:ft=help:fdm=marker

View File

@ -1,4 +1,4 @@
*pi_netrw.txt* For Vim version 7.1. Last change: 2008 Feb 26
*pi_netrw.txt* For Vim version 7.1. Last change: 2008 Mar 28
-----------------------------------------------------
NETRW REFERENCE MANUAL by Charles E. Campbell, Jr.
@ -141,6 +141,11 @@ You may do so by placing the following two lines in your <.vimrc>: >
==============================================================================
3. Netrw Reference *netrw-ref* {{{1
Netrw supports several protocols in addition to scp and ftp mentioned
in |netrw-start|. These include dav, fetch, http,... well, just look
at the list in |netrw-externapp|. Each protocol is associated with a
variable which holds the default command supporting that protocol.
EXTERNAL APPLICATIONS AND PROTOCOLS *netrw-externapp* {{{2
Protocol Variable Default Value
@ -180,7 +185,7 @@ READING *netrw-read* *netrw-nread* {{{2
WRITING *netrw-write* *netrw-nwrite* {{{2
Generally, one may just use the url notation with a normal file writing
One may just use the url notation with a normal file writing
command, such as >
:w ftp://[user@]machine/path
@ -201,8 +206,8 @@ WRITING *netrw-write* *netrw-nwrite* {{{2
SOURCING *netrw-source* {{{2
Generally, one may just use the url notation with the normal file
sourcing command, such as >
One may just use the url notation with the normal file sourcing
command, such as >
:so ftp://[user@]machine/path
<
@ -220,12 +225,16 @@ SOURCING *netrw-source* {{{2
DIRECTORY LISTING *netrw-dirlist* {{{2
Generally, one may browse a directory to get a listing by simply
attempting to edit the directory: >
One may browse a directory to get a listing by simply attempting to
edit the directory: >
:e scp://[user]@hostname/path/
:e ftp://[user]@hostname/path/
<
For remote directories (ie. those using scp or ftp), that trailing
"/" is necessary (it tells netrw that its to treat it as a directory
to browse instead of a file to download).
However, the Nread command can also be used to accomplish this:
:Nread [protocol]://[user]@hostname/path/
@ -249,9 +258,14 @@ CHANGING USERID AND PASSWORD *netrw-chgup* *netrw-userpass* {{{2
:call NetUserPass("uid","password") -- sets global uid and password
NETRW VARIABLES AND SETTINGS *netrw-variables* {{{2
(also see: |netrw-browser-var| |netrw-protocol| |netrw-settings| |netrw-var|)
Netrw provides a lot of variables which allow you to customize netrw to your
preferences. One way to look at them is via the command :NetrwSettings (see
|netrw-settings|) which will display your current netrw settings. Most such
settings are described below, in |netrw-browser-options|, and in
|netrw-externapp|:
*b:netrw_lastfile* last file Network-read/written retained on a per-buffer
basis (supports plain :Nw )
@ -1144,7 +1158,7 @@ Associated setting variable: |g:netrw_browsex_viewer|
*netrw-curdir*
DELETING FILES OR DIRECTORIES *netrw-delete* *netrw-D* *netrw-del* {{{2
If files have not been marked with |netrw-mf|:
If files have not been marked with |netrw-mf|: (local marked file list)
Deleting/removing files and directories involves moving the cursor to the
file/directory to be deleted and pressing "D". Directories must be empty
@ -1154,14 +1168,14 @@ If files have not been marked with |netrw-mf|:
the removal(s). You may select a range of lines with the "V" command
(visual selection), and then pressing "D".
If files have been marked with |netrw-mf|:
If files have been marked with |netrw-mf|: (local marked file list)
Marked files (and empty directories) will be deleted; again, you'll be
asked to confirm the deletion before it actually takes place.
The g:netrw_rm_cmd, g:netrw_rmf_cmd, and g:netrw_rmdir_cmd variables are used
to control the attempts to remove files and directories. The g:netrw_rm_cmd
is used with files, and its default value is:
The |g:netrw_rm_cmd|, |g:netrw_rmf_cmd|, and |g:netrw_rmdir_cmd| variables are
used to control the attempts to remove files and directories. The
g:netrw_rm_cmd is used with files, and its default value is:
g:netrw_rm_cmd: ssh HOSTNAME rm
@ -1456,6 +1470,7 @@ Associated setting variable: |g:netrw_keepdir|
MARKED FILES: ARBITRARY COMMAND *netrw-mx* {{{2
(See |netrw-mf| and |netrw-mr| for how to mark files)
(uses the local marked-file list)
Upon activation of the "mx" map, netrw will query the user for some command to
be applied to all marked files. All %s in the command will be substituted
@ -1465,6 +1480,7 @@ will be followed by a space and a marked filename.
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)
If any marked files are compressed, then "mz" will decompress them.
If any marked files are decompressed, then "mz" will compress them
@ -1478,6 +1494,7 @@ Associated setting variables: |g:netrw_compress| |g:netrw_decompress|
MARKED FILES: COPYING *netrw-mc* {{{2
(See |netrw-mf| and |netrw-mr| for how to mark files)
(Uses the global marked file list)
Select a target directory with mt (|netrw-mt|). Then change directory,
select file(s) (see |netrw-mf|), and press "mc".
@ -1486,18 +1503,21 @@ Associated setting variable: |g:netrw_localcopycmd| |g:netrw_ssh_cmd|
MARKED FILES: DIFF *netrw-md* {{{2
(See |netrw-mf| and |netrw-mr| for how to mark files)
(uses the global marked file list)
Use |vimdiff| to visualize difference between selected files (two or
three may be selected for this).
three may be selected for this). Uses the global marked file list.
MARKED FILES: EDITING *netrw-me* {{{2
(See |netrw-mf| and |netrw-mr| for how to mark files)
(uses the global marked file list)
This command will place the marked files on the |arglist| and commence
editing them. One may return the to explorer window with |:Rexplore|.
MARKED FILES: HIDING AND UNHIDING BY SUFFIX *netrw-mh* {{{2
(See |netrw-mf| and |netrw-mr| for how to mark files)
(uses the local marked file list)
This command extracts the suffices of the marked files and toggles their
presence on the hiding list. Please note that marking the same suffix
@ -1509,6 +1529,7 @@ Related topics: |netrw-a| |g:netrw_list_hide|
MARKED FILES: MOVING *netrw-mm* {{{2
(See |netrw-mf| and |netrw-mr| for how to mark files)
(uses the global marked file list)
Select a target directory with mT (|netrw-mt|). Then change directory,
select file(s) (see |netrw-mf|), and press "mm".
@ -1517,6 +1538,7 @@ Associated setting variable: |g:netrw_localmovecmd| |g:netrw_ssh_cmd|
MARKED FILES: PRINTING *netrw-mp* {{{2
(See |netrw-mf| and |netrw-mr| for how to mark files)
(uses the local marked file list)
Netrw will apply the |:hardcopy| command to marked files. What it does
is open each file in a one-line window, execute hardcopy, then close the
@ -1525,12 +1547,14 @@ one-line window.
MARKED FILES: SOURCING *netrw-ms* {{{2
(See |netrw-mf| and |netrw-mr| for how to mark files)
(uses the local marked file list)
Netrw will source the marked files (using vim's |:source| command)
MARKED FILES: TAGGING *netrw-mT* {{{2
(See |netrw-mf| and |netrw-mr| for how to mark files)
(uses the global marked file list)
The "mt" mapping will apply the command in |g:netrw_ctags| (by default, its
"ctags") to marked files. For remote browsing, in order to create a tags file
@ -1585,16 +1609,32 @@ One may mark files with the cursor atop a filename and then pressing "mf".
With gvim, one may also mark files with <s-leftmouse>. The following netrw
maps make use of marked files:
|netrw-a| |netrw-O| |netrw-mc| |netrw-me| |netrw-mp| |netrw-mx|
|netrw-D| |netrw-R| |netrw-md| |netrw-mm| |netrw-mT| |netrw-mz|
|netrw-a| Hide marked files/directories
|netrw-D| Delete marked files/directories
|netrw-mc| Copy marked files to target
|netrw-md| Apply vimdiff to marked files
|netrw-me| Edit marked files
|netrw-mm| Move marked files
|netrw-mp| Print marked files
|netrw-mt| Set target for |netrw-mm| and |netrw-mc|
|netrw-mT| Generate tags using marked files
|netrw-mx| Apply shell command to marked files
|netrw-mz| Compress/Decompress marked files
|netrw-O| Obtain marked files
|netrw-R| Rename marked files
One may unmark files one at a time the same way one marks them; ie. place
the cursor atop a marked file and press "mf". This process also works
with <s-leftmouse> using gvim. One may unmark all files by pressing
"mu" (see |netrw-mu|).
Two commands, |netrw-mc| and |netrw-mm|, copy/move marked files to a
target directory (which can be set with |netrw-mt|).
*markfilelist* *global_markfilelist* *local_markfilelist*
All marked files are entered onto the global marked file list; there is only
one such list. In addition, every netrw buffer also has its own local marked
file list; since netrw buffers are associated with specific directories, this
means that each directory has its own local marked file list. The various
commands which operate on marked files use one or the other of the marked file
lists.
MARKING FILES BY REGULAR EXPRESSION *netrw-mr* {{{2
@ -1642,15 +1682,21 @@ your browsing preferences. (see also: |netrw-settings|)
a script/function to handle the given
extension. (see |netrw_filehandler|).
*g:netrw_cd_escape* ="[]#*$%'\" ?`!&();<>\\"
This option is used to escape directory names
before changing directory to them.
*g:netrw_compress* ="gzip"
Will compress marked files with this
command
*g:netrw_decompress* = { ".gz" : "gunzip" ,
".bz2" : "bunzip2" ,
".zip" : "unzip" ,
".tar" : "tar -xf"}
A dictionary mapping suffices to
decompression programs.
*g:netrw_fastbrowse* =0: slow speed browsing, never re-use
directory listings; always obtain
directory listings.
@ -1671,6 +1717,9 @@ your browsing preferences. (see also: |netrw-settings|)
This option gives the choice of the trade-off
between accuracy and speed to the user.
*g:netrw_fname_escape* =' ?&;%'
Used on filenames before remote reading/writing
*g:netrw_ftp_browse_reject* ftp can produce a number of errors and warnings
that can show up as "directories" and "files"
in the listing. This pattern is used to
@ -1702,6 +1751,10 @@ your browsing preferences. (see also: |netrw-settings|)
unix or g:netrw_cygwin set: : "ls -tlF"
otherwise "dir"
*g:netrw_glob_escape* ='[]*?`{~$'
These characters in directory names are
escaped before applying glob()
*g:netrw_hide* if true, the hiding list is used
default: =0
@ -1814,13 +1867,10 @@ your browsing preferences. (see also: |netrw-settings|)
messages. By default its value is:
'^total\s\+\d\+$'
*g:netrw_use_noswf* netrw normally avoids writing swapfiles
for browser buffers. However, under some
systems this apparently is causing nasty
ml_get errors to appear; if you're getting
ml_get errors, try putting
let g:netrw_use_noswf= 0
in your .vimrc.
*g:netrw_tmpfile_escape* =' &;'
escape() is applied to all temporary files
to escape these characters.
*g:netrw_timefmt* specify format string to vim's strftime().
The default, "%c", is "the preferred date
@ -1832,6 +1882,14 @@ your browsing preferences. (see also: |netrw-settings|)
" %a %Y-%m-%d %I-%M-%S %p"
default: "%c"
*g:netrw_use_noswf* netrw normally avoids writing swapfiles
for browser buffers. However, under some
systems this apparently is causing nasty
ml_get errors to appear; if you're getting
ml_get errors, try putting
let g:netrw_use_noswf= 0
in your .vimrc.
*g:netrw_winsize* specify initial size of new windows made with
"o" (see |netrw-o|), "v" (see |netrw-v|),
|:Hexplore| or |:Vexplore|.
@ -2237,6 +2295,23 @@ which is loaded automatically at startup (assuming :set nocp).
==============================================================================
12. History *netrw-history* {{{1
v123: Feb 27, 2008 * Marked files now keeps a "global" marked file
list. The global marked file list is used to
support tag processing and vimdiff'ing
(|netrw-md| |netrw-mt|)
* Been insuring that mm and mc works with various
combinations of local and remote directories
* (Stefan Bittner) http://.../ should always have
filetype "html" -- fixed.
* (Stefan Bittner) a "?" in a http://.../ request
wasn't being handled correctly. Fixed by
removing ? from default |g:netrw_tmpfile_escape|.
* (Nico Weber) % codes in http://.../ requests
weren't being handled correctly. Fixed by
including % in default |g:netrw_fname_escape|.
* (Stefan Bittner) attempts to update Buffers.Refresh
were failing because locale use changed the menu
names. I implemented a workaround.
v122: Feb 12, 2008 * bugfix - first sorting sequence match now has
priority
Feb 14, 2008 * bugfix - sorting sequence was effectively ignoring

View File

@ -155,6 +155,25 @@ b:match_wholeBR matchit.txt /*b:match_wholeBR*
b:match_word matchit.txt /*b:match_word*
b:match_words matchit.txt /*b:match_words*
b:netrw_lastfile pi_netrw.txt /*b:netrw_lastfile*
cecutil cecutil.txt /*cecutil*
cecutil-cmd cecutil.txt /*cecutil-cmd*
cecutil-contents cecutil.txt /*cecutil-contents*
cecutil-copyright cecutil.txt /*cecutil-copyright*
cecutil-destroymark cecutil.txt /*cecutil-destroymark*
cecutil-history cecutil.txt /*cecutil-history*
cecutil-map cecutil.txt /*cecutil-map*
cecutil-maps cecutil.txt /*cecutil-maps*
cecutil-marks cecutil.txt /*cecutil-marks*
cecutil-position cecutil.txt /*cecutil-position*
cecutil-posn cecutil.txt /*cecutil-posn*
cecutil-restoremark cecutil.txt /*cecutil-restoremark*
cecutil-restorewinposn cecutil.txt /*cecutil-restorewinposn*
cecutil-rwp cecutil.txt /*cecutil-rwp*
cecutil-savemark cecutil.txt /*cecutil-savemark*
cecutil-saveusermaps cecutil.txt /*cecutil-saveusermaps*
cecutil-savewinposn cecutil.txt /*cecutil-savewinposn*
cecutil-swp cecutil.txt /*cecutil-swp*
cecutil.txt cecutil.txt /*cecutil.txt*
crefvim crefvim.txt /*crefvim*
crefvim.txt crefvim.txt /*crefvim.txt*
crefvimdoc crefvimdoc.txt /*crefvimdoc*
@ -1394,6 +1413,7 @@ g:netrw_alto pi_netrw.txt /*g:netrw_alto*
g:netrw_altv pi_netrw.txt /*g:netrw_altv*
g:netrw_browse_split pi_netrw.txt /*g:netrw_browse_split*
g:netrw_browsex_viewer pi_netrw.txt /*g:netrw_browsex_viewer*
g:netrw_cd_escape pi_netrw.txt /*g:netrw_cd_escape*
g:netrw_compress pi_netrw.txt /*g:netrw_compress*
g:netrw_cygwin pi_netrw.txt /*g:netrw_cygwin*
g:netrw_dav_cmd pi_netrw.txt /*g:netrw_dav_cmd*
@ -1401,6 +1421,7 @@ g:netrw_decompress pi_netrw.txt /*g:netrw_decompress*
g:netrw_extracmd pi_netrw.txt /*g:netrw_extracmd*
g:netrw_fastbrowse pi_netrw.txt /*g:netrw_fastbrowse*
g:netrw_fetch_cmd pi_netrw.txt /*g:netrw_fetch_cmd*
g:netrw_fname_escape pi_netrw.txt /*g:netrw_fname_escape*
g:netrw_ftp pi_netrw.txt /*g:netrw_ftp*
g:netrw_ftp_browse_reject pi_netrw.txt /*g:netrw_ftp_browse_reject*
g:netrw_ftp_cmd pi_netrw.txt /*g:netrw_ftp_cmd*
@ -1408,6 +1429,7 @@ g:netrw_ftp_list_cmd pi_netrw.txt /*g:netrw_ftp_list_cmd*
g:netrw_ftp_sizelist_cmd pi_netrw.txt /*g:netrw_ftp_sizelist_cmd*
g:netrw_ftp_timelist_cmd pi_netrw.txt /*g:netrw_ftp_timelist_cmd*
g:netrw_ftpmode pi_netrw.txt /*g:netrw_ftpmode*
g:netrw_glob_escape pi_netrw.txt /*g:netrw_glob_escape*
g:netrw_hide pi_netrw.txt /*g:netrw_hide*
g:netrw_http_cmd pi_netrw.txt /*g:netrw_http_cmd*
g:netrw_ignorenetrc pi_netrw.txt /*g:netrw_ignorenetrc*
@ -1443,6 +1465,7 @@ g:netrw_ssh_browse_reject pi_netrw.txt /*g:netrw_ssh_browse_reject*
g:netrw_ssh_cmd pi_netrw.txt /*g:netrw_ssh_cmd*
g:netrw_sshport pi_netrw.txt /*g:netrw_sshport*
g:netrw_timefmt pi_netrw.txt /*g:netrw_timefmt*
g:netrw_tmpfile_escape pi_netrw.txt /*g:netrw_tmpfile_escape*
g:netrw_uid pi_netrw.txt /*g:netrw_uid*
g:netrw_use_errorwindow pi_netrw.txt /*g:netrw_use_errorwindow*
g:netrw_use_noswf pi_netrw.txt /*g:netrw_use_noswf*
@ -1463,6 +1486,7 @@ getscript-data pi_getscript.txt /*getscript-data*
getscript-history pi_getscript.txt /*getscript-history*
getscript-plugins pi_getscript.txt /*getscript-plugins*
getscript-start pi_getscript.txt /*getscript-start*
global_markfilelist pi_netrw.txt /*global_markfilelist*
glvs pi_getscript.txt /*glvs*
glvs-alg pi_getscript.txt /*glvs-alg*
glvs-algorithm pi_getscript.txt /*glvs-algorithm*
@ -1477,6 +1501,7 @@ glvs-options pi_getscript.txt /*glvs-options*
glvs-plugins pi_getscript.txt /*glvs-plugins*
glvs-usage pi_getscript.txt /*glvs-usage*
http pi_netrw.txt /*http*
local_markfilelist pi_netrw.txt /*local_markfilelist*
logipat LogiPat.txt /*logipat*
logipat-arg LogiPat.txt /*logipat-arg*
logipat-caveat LogiPat.txt /*logipat-caveat*
@ -1489,6 +1514,7 @@ logipat-manual LogiPat.txt /*logipat-manual*
logipat-operators LogiPat.txt /*logipat-operators*
logipat-pattern LogiPat.txt /*logipat-pattern*
logipat.txt LogiPat.txt /*logipat.txt*
markfilelist pi_netrw.txt /*markfilelist*
matchit matchit.txt /*matchit*
matchit-% matchit.txt /*matchit-%*
matchit-\1 matchit.txt /*matchit-\\1*

View File

@ -22,7 +22,7 @@
if &cp || exists("g:loaded_netrwPlugin")
finish
endif
let g:loaded_netrwPlugin = "v116"
let g:loaded_netrwPlugin = "v123"
let s:keepcpo = &cpo
if v:version < 700
echohl WarningMsg | echo "***netrw*** you need vim version 7.0 for this version of netrw" | echohl None
@ -47,10 +47,10 @@ augroup END
augroup Network
au!
if has("win32") || has("win95") || has("win64") || has("win16")
au BufReadCmd file://* exe "silent doau BufReadPre ".netrw#RFC2396(expand("<amatch>"))|exe 'e '.substitute(netrw#RFC2396(expand("<amatch>")),'file://\(.*\)','\1',"")|exe "silent doau BufReadPost ".netrw#RFC2396(expand("<amatch>"))
au BufReadCmd file://* exe "silent doau BufReadPre ".netrw#RFC2396(expand("<amatch>"))|exe 'e '.substitute(netrw#RFC2396(expand("<amatch>")),'file://\(.*\)','\1',"")|exe "bwipe ".expand("<amatch>")|exe "silent doau BufReadPost ".netrw#RFC2396(expand("<amatch>"))
else
au BufReadCmd file://* exe "silent doau BufReadPre ".netrw#RFC2396(expand("<amatch>"))|exe 'e '.substitute(netrw#RFC2396(expand("<amatch>")),'file://\(.*\)','\1',"")|exe "silent doau BufReadPost ".netrw#RFC2396(expand("<amatch>"))
au BufReadCmd file://localhost/* exe "silent doau BufReadPre ".netrw#RFC2396(expand("<amatch>"))|exe 'e '.substitute(netrw#RFC2396(expand("<amatch>")),'file://localhost/\(.*\)','\1',"")|exe "silent doau BufReadPost ".netrw#RFC2396(expand("<amatch>"))
au BufReadCmd file://* exe "silent doau BufReadPre ".netrw#RFC2396(expand("<amatch>"))|exe 'e '.substitute(netrw#RFC2396(expand("<amatch>")),'file://\(.*\)','\1',"")|exe "bwipe ".expand("<amatch>")|exe "silent doau BufReadPost ".netrw#RFC2396(expand("<amatch>"))
au BufReadCmd file://localhost/* exe "silent doau BufReadPre ".netrw#RFC2396(expand("<amatch>"))|exe 'e '.substitute(netrw#RFC2396(expand("<amatch>")),'file://localhost/\(.*\)','\1',"")|exe "bwipe ".substitute(expand("<amatch>"),'file://\(\k\+@\)\=','','')|exe "silent doau BufReadPost ".netrw#RFC2396(expand("<amatch>"))
endif
au BufReadCmd ftp://*,rcp://*,scp://*,http://*,dav://*,rsync://*,sftp://* exe "silent doau BufReadPre ".expand("<amatch>")|exe '2Nread "'.expand("<amatch>").'"'|exe "silent doau BufReadPost ".expand("<amatch>")
au FileReadCmd ftp://*,rcp://*,scp://*,http://*,dav://*,rsync://*,sftp://* exe "silent doau FileReadPre ".expand("<amatch>")|exe 'Nread "' .expand("<amatch>").'"'|exe "silent doau FileReadPost ".expand("<amatch>")

View File

@ -50,17 +50,17 @@ syn match netrwVersion "(netrw.*)" contained
" Special filetype highlighting {{{1
" -----------------------------
if exists("g:netrw_special_syntax") && netrw_special_syntax
syn match netrwBak "\(\S\+ \)*\S\+\.bak\>"
syn match netrwCompress "\(\S\+ \)*\S\+\.\%(gz\|bz2\|Z\|zip\)\>"
syn match netrwData "\(\S\+ \)*\S\+\.dat\>"
syn match netrwHdr "\(\S\+ \)*\S\+\.h\>"
syn match netrwLib "\(\S\+ \)*\S*\.\%(a\|so\|lib\|dll\)\>"
syn match netrwMakeFile "\<[mM]akefile\>\|\(\S\+ \)*\S\+\.mak\>"
syn match netrwObj "\(\S\+ \)*\S*\.\%(o\|obj\)\>"
syn match netrwTags "\<tags\>"
syn match netrwTags "\<\(ANmenu\|ANtags\)\>"
syn match netrwTilde "\(\S\+ \)*\S\+\~\>"
syn match netrwTmp "\<tmp\(\S\+ \)*\S\+\>\|\(\S\+ \)*\S*tmp\>"
syn match netrwBak "\(\S\+ \)*\S\+\.bak\>" contains=netrwTreeBar
syn match netrwCompress "\(\S\+ \)*\S\+\.\%(gz\|bz2\|Z\|zip\)\>" contains=netrwTreeBar
syn match netrwData "\(\S\+ \)*\S\+\.dat\>" contains=netrwTreeBar
syn match netrwHdr "\(\S\+ \)*\S\+\.h\>" contains=netrwTreeBar
syn match netrwLib "\(\S\+ \)*\S*\.\%(a\|so\|lib\|dll\)\>" contains=netrwTreeBar
syn match netrwMakeFile "\<[mM]akefile\>\|\(\S\+ \)*\S\+\.mak\>" contains=netrwTreeBar
syn match netrwObj "\(\S\+ \)*\S*\.\%(o\|obj\)\>" contains=netrwTreeBar
syn match netrwTags "\<tags\>" contains=netrwTreeBar
syn match netrwTags "\<\(ANmenu\|ANtags\)\>" contains=netrwTreeBar
syn match netrwTilde "\(\S\+ \)*\S\+\~\>" contains=netrwTreeBar
syn match netrwTmp "\<tmp\(\S\+ \)*\S\+\>\|\(\S\+ \)*\S*tmp\>" contains=netrwTreeBar
endif
" ---------------------------------------------------------------------