GetLatestVimScripts

git-svn-id: https://vimsuite.svn.sourceforge.net/svnroot/vimsuite/trunk@180 eb2d0018-73a3-4aeb-bfe9-1def61c9ec69
This commit is contained in:
Stefan.Liebl 2010-01-12 16:18:53 +00:00
parent af28abb1bd
commit 587fd7e78a
28 changed files with 3971 additions and 3431 deletions

View File

@ -1,38 +1,34 @@
ScriptID SourceID Filename
--------------------------
1075 9389 netrw.vim
1502 8743 vimball.vim
1008 3118 srec.vim (ftplugin)
1009 3119 srec.vim (syntax file)
475 2535 latex-suite (install in vimfiles.latex)
614 3666 C-Referenz
670 8073 visincr.vim (Visual Increment)
862 2635 cscope_quickfix.vim
51 171 cscope_macros.vim
102 9375 DirDiff.vim
1189 8687 matrix.vim
1173 8689 tcomment
948 2878 Scons Compiler plugin
1709 6421 Scons Syntax file
1772 7248 DAMOS.zip DAMOS tools (von Stefan)
987 6978 DoxygenToolkit.vim
1397 6887 xml.vim
1290 5190 LogiPat.vim
1881 9564 svndiff
1462 5612 dtd2xml
1046 4249 Lusty Explorer
2043 7805 VimPdb (debugging python)
1776 7902 Vimgrep Replace
2048 7817 BlockDiff
39 8196 matchit.vim
2092 8095 reloaded.vim (matrix colorscheme)
848 8203 SrchRplcHiGrp.vim (Search/Replace on Syntax Group)
294 9414 Align.vim
479 9276 MultipleSearch
1066 7618 cecutil.vim
642 8136 getscript.vim
90 9279 vcscommand
642 8136 :AutoInstall: GetLatestVimScripts.vim
479 9276 :AutoInstall: MultipleSearch.vba
1173 8689 tComment.vim
2701 1 editsrec
1008 3118 srec.vim (ftplugin)
1009 3119 srec.vim (syntax file)
475 2535 latex-suite (install in vimfiles.latex)
614 3666 C-Referenz
670 8073 visincr.vim (Visual Increment)
862 2635 cscope_quickfix.vim
51 171 cscope_macros.vim
102 9375 DirDiff.vim
1189 8687 matrix.vim
1173 11513 tcomment
948 2878 Scons Compiler plugin
1709 6421 Scons Syntax file
1772 7248 DAMOS.zip DAMOS tools (von Stefan)
987 11878 DoxygenToolkit.vim
1397 11713 xml.vim
1290 5190 LogiPat.vim
1462 5612 dtd2xml
1046 4249 Lusty Explorer
2043 7805 VimPdb (debugging python)
1776 7902 Vimgrep Replace
2048 7817 BlockDiff
39 8196 matchit.vim
2092 8095 reloaded.vim (matrix colorscheme)
848 8203 SrchRplcHiGrp.vim (Search/Replace on Syntax Group)
294 10110 Align.vim
479 9276 MultipleSearch.vba
1066 7618 cecutil.vim
1173 11513 tComment.vim
2701 10950 editsrec
642 8136 :AutoInstall: getscript.vim
1075 11979 :AutoInstall: netrw.vim
1502 11981 :AutoInstall: vimball.vim

View File

@ -1,7 +1,7 @@
" Align: tool to align multiple fields based on one or more separators
" Author: Charles E. Campbell, Jr.
" Date: Oct 08, 2008
" Version: 34
" Date: Mar 03, 2009
" Version: 35
" GetLatestVimScripts: 294 1 :AutoInstall: Align.vim
" GetLatestVimScripts: 1066 1 :AutoInstall: cecutil.vim
" Copyright: Copyright (C) 1999-2007 Charles E. Campbell, Jr. {{{1
@ -21,10 +21,10 @@
" ---------------------------------------------------------------------
" Load Once: {{{1
if exists("g:loaded_align") || &cp
if exists("g:loaded_Align") || &cp
finish
endif
let g:loaded_align = "v34"
let g:loaded_Align = "v35"
if v:version < 700
echohl WarningMsg
echo "***warning*** this version of Align needs vim 7.0"
@ -36,9 +36,19 @@ set cpo&vim
"DechoTabOn
" ---------------------------------------------------------------------
" Debugging Support:
" Debugging Support: {{{1
"if !exists("g:loaded_Decho") | runtime plugin/Decho.vim | endif
" ---------------------------------------------------------------------
" Options: {{{1
if !exists("g:Align_xstrlen")
if &enc == "latin1" || $LANG == "en_US.UTF-8" || !has("multi_byte")
let g:Align_xstrlen= 0
else
let g:Align_xstrlen= 1
endif
endif
" ---------------------------------------------------------------------
" Align#AlignCtrl: enter alignment patterns here {{{1
"
@ -333,12 +343,17 @@ endfun
fun! Align#Align(hasctrl,...) range
" call Dfunc("Align#Align(hasctrl=".a:hasctrl.",...) a:0=".a:0)
" sanity check
" sanity checks
if string(a:hasctrl) != "0" && string(a:hasctrl) != "1"
echohl Error|echo 'usage: Align#Align(hasctrl<'.a:hasctrl.'> (should be 0 or 1),"separator(s)" (you have '.a:0.') )'|echohl None
" call Dret("Align#Align")
return
endif
if exists("s:AlignStyle") && s:AlignStyle == ":"
echohl Error |echo '(Align#Align) your AlignStyle is ":", which implies "do-no-alignment"!'|echohl None
" call Dret("Align#Align")
return
endif
" set up a list akin to an argument list
if a:0 > 0
@ -986,12 +1001,12 @@ fun! s:Strlen(x)
" 'tabstop', wide CJK as 2 rather than 1, Arabic alif as zero when immediately
" preceded by lam, one otherwise, etc.)
" (comment from TM, solution from me)
let modkeep= &mod
let modkeep= &l:mod
exe "norm! o\<esc>"
call setline(line("."),a:x)
let ret= virtcol("$") - 1
d
let &mod= modkeep
let &l:mod= modkeep
else
" at least give a decent default

View File

@ -1,13 +1,13 @@
" AlignMaps.vim : support functions for AlignMaps
" Author: Charles E. Campbell, Jr.
" Date: Oct 24, 2008
" Version: 40
" Date: Mar 03, 2009
" Version: 41
" ---------------------------------------------------------------------
" Load Once: {{{1
if &cp || exists("g:loaded_AlignMaps")
finish
endif
let g:loaded_AlignMaps= "v40"
let g:loaded_AlignMaps= "v41"
let s:keepcpo = &cpo
set cpo&vim
@ -16,7 +16,7 @@ set cpo&vim
" ---------------------------------------------------------------------
" AlignMaps#WrapperStart: {{{2
fun! AlignMaps#WrapperStart(vis)
fun! AlignMaps#WrapperStart(vis) range
" call Dfunc("AlignMaps#WrapperStart(vis=".a:vis.")")
if a:vis
@ -55,7 +55,7 @@ endfun
" ---------------------------------------------------------------------
" AlignMaps#WrapperEnd: {{{2
fun! AlignMaps#WrapperEnd()
fun! AlignMaps#WrapperEnd() range
" call Dfunc("AlignMaps#WrapperEnd() alignmaps_wrapcnt=".s:alignmaps_wrapcnt." my=".line("'y")." mz=".line("'z"))
" remove trailing white space introduced by whatever in the modification zone
@ -103,7 +103,7 @@ endfun
" ---------------------------------------------------------------------
" AlignMaps#StdAlign: some semi-standard align calls {{{2
fun! AlignMaps#StdAlign(mode)
fun! AlignMaps#StdAlign(mode) range
" call Dfunc("AlignMaps#StdAlign(mode=".a:mode.")")
if a:mode == 1
" align on @
@ -157,12 +157,12 @@ endfun
" ---------------------------------------------------------------------
" AlignMaps#Equals: supports \t= and \T= {{{2
fun! AlignMaps#Equals()
fun! AlignMaps#Equals() range
" call Dfunc("AlignMaps#Equals()")
'a,'zs/\s\+\([*/+\-%|&\~^]\==\)/ \1/e
'a,'zs@ \+\([*/+\-%|&\~^]\)=@\1=@ge
'a,'zs/==/\="\<Char-0xff>\<Char-0xff>"/ge
'a,'zs/!=/\="!\<Char-0xff>"/ge
'a,'zs/==/\="\<Char-0x0f>\<Char-0x0f>"/ge
'a,'zs/\([!<>:]\)=/\=submatch(1)."\<Char-0x0f>"/ge
norm g'zk
AlignCtrl mIp1P1=l =
AlignCtrl g =
@ -174,15 +174,15 @@ fun! AlignMaps#Equals()
'a,'z-1v/^\s*\/[*/]/s/\/[*/]/@&@/e
'a,'z-1v/^\s*\/[*/]/s/\*\//@&/e
if exists("g:mapleader")
exe "norm 'zk"
call AlignMaps#StdAlign(1)
exe "norm 'zk"
call AlignMaps#StdAlign(1)
else
exe "norm 'zk"
call AlignMaps#StdAlign(1)
exe "norm 'zk"
call AlignMaps#StdAlign(1)
endif
'y,'zs/^\(\s*\) @/\1/e
endif
'a,'z-1s/\%xff/=/ge
'a,'z-1s/\%x0f/=/ge
'y,'zs/ @//eg
" call Dret("AlignMaps#Equals")
endfun

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,152 @@
" Vim Library for Editing .srec Files
" Maintainer: Alexander Fleck
" <alexander.fleck@gmx.net>
" License: This File is placed in the Public Domain.
" Revision | Date [DD.MM.YY] | Changes
" 00.01.00 | 05.07.09 | 01. Revision
" create ByteCount
fun libsrec#CrBC(line)
let s:byco = ""
" Dictionary with Assumptions
let s:dict = { 0: '0F',
\ 1: '0F',
\ 2: '0F',
\ 3: '0F',
\ 4: '' ,
\ 5: '03',
\ 6: '' ,
\ 7: '05',
\ 8: '04',
\ 9: '03' }
let s:byco = s:dict[a:line[1]]
unlet s:dict
"unlet s:byco
return s:byco
endfun
" create ADdress
fun libsrec#CrAD(line)
let s:adrs = ""
" Number of Bytes for Address
let s:adby = ""
" Dictionary
let s:dict = { 0: 2,
\ 1: 2,
\ 2: 3,
\ 3: 4,
\ 4: 0,
\ 5: 2,
\ 6: 0,
\ 7: 4,
\ 8: 3,
\ 9: 2 }
let s:adby = s:dict[a:line[1]]
let s:n = 0
while 1
let s:n = s:n + 1
if s:n > s:adby
break
endif
let s:adrs = s:adrs . "00"
continue
endwhile
unlet s:n
unlet s:dict
unlet s:adby
"unlet s:adrs
return s:adrs
endfun
" create DAta
fun libsrec#CrDA(line)
let s:data = ""
" Number of Bytes for Data
let s:daby = ""
" get ByteCount from Line
let s:bchx = "0x" . a:line[2] . a:line[3]
" Dictionary
let s:dict = { 0: s:bchx - 3,
\ 1: s:bchx - 3,
\ 2: s:bchx - 4,
\ 3: s:bchx - 5,
\ 4: 0 ,
\ 5: 0 ,
\ 6: 0 ,
\ 7: 0 ,
\ 8: 0 ,
\ 9: 0 }
let s:daby = s:dict[a:line[1]]
let s:n = 0
while 1
let s:n = s:n + 1
if s:n > s:daby
break
endif
let s:data = s:data . "FF"
continue
endwhile
unlet s:n
unlet s:dict
unlet s:bchx
unlet s:daby
"unlet s:data
return s:data
endfun
" create CheckSum
fun libsrec#CrCS(line)
" CheckSum as a String
let s:chsu = ""
" get ByteCount from Line
let s:bchx = "0x" . a:line[2] . a:line[3]
if ((a:line[1] == "4") || (a:line[1] == "6"))
" there' s no S4 or S6
else
" CheckSum as a Value
let s:csby = 0
" add the Byte Values
let s:n = 0
while 1
let s:n = s:n + 1
if s:n > s:bchx
break
endif
let s:csby = s:csby + ("0x" . a:line[2*s:n] . a:line[2*s:n+1])
continue
endwhile
unlet s:n
" CheckSum is:
let s:csby = 255 - (s:csby % 256)
" convert to Hex Value,
" Hex String without "0x"
let s:hxva = "0123456789ABCDEF"
while s:csby
let s:chsu = s:hxva[s:csby % 16] . s:chsu
let s:csby = s:csby / 16
endwhile
unlet s:hxva
unlet s:csby
endif
unlet s:bchx
"unlet s:chsu
return s:chsu
endfun

File diff suppressed because it is too large Load Diff

View File

@ -145,6 +145,7 @@ fun! netrwSettings#NetrwSettings()
put = 'let g:netrw_special_syntax = '.g:netrw_special_syntax
put = 'let g:netrw_ssh_browse_reject = '.g:netrw_ssh_browse_reject
put = 'let g:netrw_scpport = '.g:netrw_scpport
put = 'let g:netrw_sepchr = '.g:netrw_sepchr
put = 'let g:netrw_sshport = '.g:netrw_sshport
put = 'let g:netrw_timefmt = '.g:netrw_timefmt
let tmpfileescline= line("$")

View File

@ -1,10 +1,10 @@
" tcomment.vim
" @Author: Thomas Link (mailto:micathom AT gmail com?subject=[vim])
" @Author: Tom Link (mailto:micathom AT gmail com?subject=[vim])
" @Website: http://www.vim.org/account/profile.php?user_id=4037
" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
" @Created: 2007-09-17.
" @Last Change: 2008-05-07.
" @Revision: 0.0.46
" @Last Change: 2009-02-15.
" @Revision: 0.0.66
if &cp || exists("loaded_tcomment_autoload")
finish
@ -90,6 +90,7 @@ function! tcomment#Comment(beg, end, ...)
" We want a comment block
call s:CommentBlock(a:beg, a:end, uncomment, cmtCheck, cms, indentStr)
else
" call s:CommentLines(a:beg, a:end, cstart, cend, uncomment, cmtCheck, cms0, indentStr)
" We want commented lines
" final search pattern for uncommenting
let cmtCheck = escape('\V\^\(\s\{-}\)'. cmtCheck .'\$', '"/\')
@ -109,10 +110,12 @@ function! tcomment#Comment(beg, end, ...)
endif
endf
function! tcomment#Operator(type, ...) "{{{3
let commentMode = a:0 >= 1 ? a:1 : ''
let bang = a:0 >= 2 ? a:2 : ''
if !exists('w:tcommentPos')
let w:tcommentPos = getpos(".")
endif
let sel_save = &selection
let &selection = "inclusive"
let reg_save = @@
@ -384,6 +387,17 @@ function! s:ProcessedLine(uncomment, match, checkRx, replace)
return rv
endf
function! s:CommentLines(beg, end, cstart, cend, uncomment, cmtCheck, cms0, indentStr) "{{{3
" We want commented lines
" final search pattern for uncommenting
let cmtCheck = escape('\V\^\(\s\{-}\)'. a:cmtCheck .'\$', '"/\')
" final pattern for commenting
let cmtReplace = escape(a:cms0, '"/')
silent exec a:beg .','. a:end .'s/\V'.
\ s:StartRx(a:cstart) . a:indentStr .'\zs\(\.\{-}\)'. s:EndRx(a:cend) .'/'.
\ '\=s:ProcessedLine('. a:uncomment .', submatch(0), "'. a:cmtCheck .'", "'. cmtReplace .'")/ge'
endf
function! s:CommentBlock(beg, end, uncomment, checkRx, replace, indentStr)
let t = @t
try
@ -428,28 +442,33 @@ function! s:GuessFileType(beg, end, commentMode, filetype, ...)
let cms = s:GuessCurrentCommentString(0)
endif
let n = a:beg
" TLogVAR n, a:beg, a:end
while n <= a:end
let m = indent(n) + 1
let le = col('$')
let le = len(getline(n))
" TLogVAR m, le
while m < le
let syntaxName = synIDattr(synID(n, m, 1), 'name')
" TLogVAR syntaxName, n, m
let ftypeMap = get(g:tcommentSyntaxMap, syntaxName)
if !empty(ftypeMap)
" TLogVAR ftypeMap
return s:GetCustomCommentString(ftypeMap, a:commentMode, cms)
elseif syntaxName =~ g:tcommentFileTypesRx
let ft = substitute(syntaxName, g:tcommentFileTypesRx, '\1', '')
" TLogVAR ft
if exists('g:tcommentIgnoreTypes_'. a:filetype) && g:tcommentIgnoreTypes_{a:filetype} =~ '\<'.ft.'\>'
let m = m + 1
let m += 1
else
return s:GetCustomCommentString(ft, a:commentMode, cms)
endif
elseif syntaxName == '' || syntaxName == 'None' || syntaxName =~ '^\u\+$' || syntaxName =~ '^\u\U*$'
let m = m + 1
let m += 1
else
break
endif
endwh
let n = n + 1
let n += 1
endwh
return [cms, commentMode]
endf

View File

@ -1,9 +1,9 @@
" vimball.vim : construct a file containing both paths and files
" Author: Charles E. Campbell, Jr.
" Date: May 30, 2008
" Version: 26
" Date: Dec 28, 2009
" Version: 30
" GetLatestVimScripts: 1502 1 :AutoInstall: vimball.vim
" Copyright: (c) 2004-2007 by Charles E. Campbell, Jr.
" Copyright: (c) 2004-2009 by Charles E. Campbell, Jr.
" The VIM LICENSE applies to Vimball.vim, and Vimball.txt
" (see |copyright|) except use "Vimball" instead of "Vim".
" No warranty, express or implied.
@ -11,11 +11,17 @@
" ---------------------------------------------------------------------
" Load Once: {{{1
if &cp || exists("g:loaded_vimball") || v:version < 700
if &cp || exists("g:loaded_vimball")
finish
endif
let s:keepcpo = &cpo
let g:loaded_vimball = "v26"
let g:loaded_vimball = "v30"
if v:version < 702
echohl WarningMsg
echo "***warning*** this version of vimball needs vim 7.2"
echohl Normal
finish
endif
let s:keepcpo= &cpo
set cpo&vim
"DechoTabOn
@ -52,30 +58,6 @@ if !exists("s:USAGE")
call vimball#ShowMesg(s:WARNING,"(vimball) g:vimball_mkdir undefined")
endif
endif
" set up shell quoting character
if exists("g:vimball_shq") && !exists("g:netrw_shq")
let g:netrw_shq= g:vimball_shq
endif
if !exists("g:netrw_shq")
if exists("&shq") && &shq != ""
let g:netrw_shq= &shq
elseif has("win32") || has("win95") || has("win64") || has("win16")
if g:netrw_cygwin
let g:netrw_shq= "'"
else
let g:netrw_shq= '"'
endif
else
let g:netrw_shq= "'"
endif
" call Decho("g:netrw_shq<".g:netrw_shq.">")
endif
" set up escape string (used to protect paths)
if !exists("g:vimball_path_escape")
let g:vimball_path_escape= ' ;#%'
endif
endif
" =====================================================================
@ -106,8 +88,8 @@ fun! vimball#MkVimball(line1,line2,writelevel,...) range
let vbname= vbname.'.vba'
endif
" call Decho("vbname<".vbname.">")
if a:1 =~ '[\/]'
call vimball#ShowMesg(s:ERROR,"(MkVimball) vimball name<".a:1."> should not include slashes")
if !a:writelevel && a:1 =~ '[\/]'
call vimball#ShowMesg(s:ERROR,"(MkVimball) vimball name<".a:1."> should not include slashes; use ! to insist")
" call Dret("MkVimball : vimball name<".a:1."> should not include slashes")
return
endif
@ -125,7 +107,7 @@ fun! vimball#MkVimball(line1,line2,writelevel,...) range
let home= expand(a:2)
else
" use first existing directory from rtp
let home= s:VimballHome()
let home= vimball#VimballHome()
endif
" save current directory
@ -169,9 +151,8 @@ fun! vimball#MkVimball(line1,line2,writelevel,...) range
call setline(lastline+1,0)
" write the file from the tab
let svfilepath= s:Path(svfile,'')
" call Decho("exe $r ".fnameescape(svfilepath))
exe "$r ".fnameescape(svfilepath)
" call Decho("exe $r ".fnameescape(svfile))
exe "$r ".fnameescape(svfile)
call setline(lastline+1,line("$") - lastline - 1)
" call Decho("lastline=".lastline." line$=".line("$"))
@ -186,13 +167,11 @@ fun! vimball#MkVimball(line1,line2,writelevel,...) range
call s:ChgDir(curdir)
setlocal ff=unix
if a:writelevel
let vbnamepath= s:Path(vbname,'')
" call Decho("exe w! ".fnameescape(vbnamepath))
exe "w! ".fnameescape(vbnamepath)
" call Decho("exe w! ".fnameescape(vbname))
exe "w! ".fnameescape(vbname)
else
let vbnamepath= s:Path(vbname,'')
" call Decho("exe w ".fnameescape(vbnamepath))
exe "w ".fnameescape(vbnamepath)
" call Decho("exe w ".fnameescape(vbname))
exe "w ".fnameescape(vbname)
endif
" call Decho("Vimball<".vbname."> created")
echo "Vimball<".vbname."> created"
@ -215,7 +194,13 @@ endfun
fun! vimball#Vimball(really,...)
" call Dfunc("vimball#Vimball(really=".a:really.") a:0=".a:0)
if getline(1) !~ '^" Vimball Archiver by Charles E. Campbell, Jr., Ph.D.$'
if v:version < 701 || (v:version == 701 && !exists('*fnameescape'))
echoerr "your vim is missing the fnameescape() function"
" call Dret("vimball#Vimball : needs 7.1 with patch 299")
return
endif
if getline(1) !~ '^" Vimball Archiver'
echoerr "(Vimball) The current file does not appear to be a Vimball!"
" call Dret("vimball#Vimball")
return
@ -237,7 +222,7 @@ fun! vimball#Vimball(really,...)
if a:0 > 0
let home= expand(a:1)
else
let home= s:VimballHome()
let home= vimball#VimballHome()
endif
" call Decho("home<".home.">")
@ -269,7 +254,9 @@ fun! vimball#Vimball(really,...)
while 1 < linenr && linenr < line("$")
let fname = substitute(getline(linenr),'\t\[\[\[1$','','')
let fname = substitute(fname,'\\','/','g')
let fsize = getline(linenr+1)+0
" let fsize = getline(linenr+1)+0
let fsize = substitute(getline(linenr+1),'^\(\d\+\).\{-}$','\1','')+0
let fenc = substitute(getline(linenr+1),'^\d\+\s*\(\S\+\)$','\1','')
let filecnt = filecnt + 1
" call Decho("fname<".fname."> fsize=".fsize." filecnt=".filecnt)
@ -304,7 +291,7 @@ fun! vimball#Vimball(really,...)
if !isdirectory(dirname)
" call Decho("making <".dirname.">")
if exists("g:vimball_mkdir")
call system(g:vimball_mkdir." ".s:Escape(dirname))
call system(g:vimball_mkdir." ".shellescape(dirname))
else
call mkdir(dirname)
endif
@ -332,11 +319,15 @@ fun! vimball#Vimball(really,...)
" write tab to file
if a:really
let fnamepath= s:Path(home."/".fname,'')
let fnamepath= home."/".fname
" call Decho("exe w! ".fnameescape(fnamepath))
exe "silent w! ".fnameescape(fnamepath)
echo "wrote ".fnamepath
call s:RecordInVar(home,"call delete('".fnameescape(fnamepath)."')")
if fenc != ""
exe "silent w! ++enc=".fnameescape(fenc)." ".fnameescape(fnamepath)
else
exe "silent w! ".fnameescape(fnamepath)
endif
echo "wrote ".fnameescape(fnamepath)
call s:RecordInVar(home,"call delete('".fnamepath."')")
endif
" return to tab with vimball
@ -358,9 +349,9 @@ fun! vimball#Vimball(really,...)
" set up help
" call Decho("about to set up help: didhelp<".didhelp.">")
if didhelp != ""
let htpath= s:Path(home."/".didhelp,"")
let htpath= home."/".didhelp
" call Decho("exe helptags ".htpath)
exe "helptags ".htpath
exe "helptags ".fnameescape(htpath)
echo "did helptags"
endif
@ -415,7 +406,7 @@ fun! vimball#RmVimball(...)
if a:0 >= 2
let home= expand(a:2)
else
let home= s:VimballHome()
let home= vimball#VimballHome()
endif
let curdir = getcwd()
" call Decho("home <".home.">")
@ -429,19 +420,20 @@ fun! vimball#RmVimball(...)
keepalt keepjumps 1split
silent! keepalt keepjumps e .VimballRecord
let keepsrch= @/
" call Decho("search for ^".curfile.".vba:")
" call Decho("search for ^".curfile."[-0-9.]*.vba:")
if search('^'.curfile.": ".'cw')
" call Decho('search for ^\M'.curfile.'.\m: ')
" call Decho('search for ^\M'.curfile.'.\mvba: ')
" call Decho('search for ^\M'.curfile.'\m[-0-9.]*\.vba: ')
if search('^\M'.curfile."\m: ".'cw')
let foundit= 1
elseif search('^'.curfile.".vba: ",'cw')
elseif search('^\M'.curfile.".\mvba: ",'cw')
let foundit= 1
elseif search('^'.curfile.'[-0-9.]*.vba: ','cw')
elseif search('^\M'.curfile.'\m[-0-9.]*\.vba: ','cw')
let foundit= 1
else
let foundit = 0
endif
if foundit
let exestring = substitute(getline("."),'^'.curfile.'\S\{-}\.vba: ','','')
let exestring = substitute(getline("."),'^\M'.curfile.'\m\S\{-}\.vba: ','','')
let s:VBRstring= substitute(exestring,'call delete(','','g')
let s:VBRstring= substitute(s:VBRstring,"[')]",'','g')
" call Decho("exe ".exestring)
@ -469,62 +461,62 @@ endfun
" ---------------------------------------------------------------------
" vimball#Decompress: attempts to automatically decompress vimballs {{{2
fun! vimball#Decompress(fname)
" call Dfunc("Decompress(fname<".a:fname.">)")
fun! vimball#Decompress(fname,...)
" call Dfunc("Decompress(fname<".a:fname.">) a:0=".a:0)
" decompression:
if expand("%") =~ '.*\.gz' && executable("gunzip")
" handle *.gz with gunzip
silent exe "!gunzip ".s:Escape(a:fname)
silent exe "!gunzip ".shellescape(a:fname)
if v:shell_error != 0
call vimball#ShowMesg(s:WARNING,"(vimball#Decompress) gunzip may have failed with <".a:fname.">")
endif
let fname= substitute(a:fname,'\.gz$','','')
exe "e ".escape(fname,' \')
call vimball#ShowMesg(s:USAGE,"Source this file to extract it! (:so %)")
if a:0 == 0| call vimball#ShowMesg(s:USAGE,"Source this file to extract it! (:so %)") | endif
elseif expand("%") =~ '.*\.gz' && executable("gzip")
" handle *.gz with gzip -d
silent exe "!gzip -d ".s:Escape(a:fname)
silent exe "!gzip -d ".shellescape(a:fname)
if v:shell_error != 0
call vimball#ShowMesg(s:WARNING,'(vimball#Decompress) "gzip -d" may have failed with <'.a:fname.">")
endif
let fname= substitute(a:fname,'\.gz$','','')
exe "e ".escape(fname,' \')
call vimball#ShowMesg(s:USAGE,"Source this file to extract it! (:so %)")
if a:0 == 0| call vimball#ShowMesg(s:USAGE,"Source this file to extract it! (:so %)") | endif
elseif expand("%") =~ '.*\.bz2' && executable("bunzip2")
" handle *.bz2 with bunzip2
silent exe "!bunzip2 ".s:Escape(a:fname)
silent exe "!bunzip2 ".shellescape(a:fname)
if v:shell_error != 0
call vimball#ShowMesg(s:WARNING,"(vimball#Decompress) bunzip2 may have failed with <".a:fname.">")
endif
let fname= substitute(a:fname,'\.bz2$','','')
exe "e ".escape(fname,' \')
call vimball#ShowMesg(s:USAGE,"Source this file to extract it! (:so %)")
if a:0 == 0| call vimball#ShowMesg(s:USAGE,"Source this file to extract it! (:so %)") | endif
elseif expand("%") =~ '.*\.bz2' && executable("bzip2")
" handle *.bz2 with bzip2 -d
silent exe "!bzip2 -d ".s:Escape(a:fname)
silent exe "!bzip2 -d ".shellescape(a:fname)
if v:shell_error != 0
call vimball#ShowMesg(s:WARNING,'(vimball#Decompress) "bzip2 -d" may have failed with <'.a:fname.">")
endif
let fname= substitute(a:fname,'\.bz2$','','')
exe "e ".escape(fname,' \')
call vimball#ShowMesg(s:USAGE,"Source this file to extract it! (:so %)")
if a:0 == 0| call vimball#ShowMesg(s:USAGE,"Source this file to extract it! (:so %)") | endif
elseif expand("%") =~ '.*\.zip' && executable("unzip")
" handle *.zip with unzip
silent exe "!unzip ".s:Escape(a:fname)
silent exe "!unzip ".shellescape(a:fname)
if v:shell_error != 0
call vimball#ShowMesg(s:WARNING,"(vimball#Decompress) unzip may have failed with <".a:fname.">")
endif
let fname= substitute(a:fname,'\.zip$','','')
exe "e ".escape(fname,' \')
call vimball#ShowMesg(s:USAGE,"Source this file to extract it! (:so %)")
if a:0 == 0| call vimball#ShowMesg(s:USAGE,"Source this file to extract it! (:so %)") | endif
endif
set noma bt=nofile fmr=[[[,]]] fdm=marker
if a:0 == 0| setlocal noma bt=nofile fmr=[[[,]]] fdm=marker | endif
" call Dret("Decompress")
endfun
@ -533,20 +525,21 @@ endfun
" vimball#ShowMesg: {{{2
fun! vimball#ShowMesg(level,msg)
" call Dfunc("vimball#ShowMesg(level=".a:level." msg<".a:msg.">)")
let rulerkeep = &ruler
let showcmdkeep = &showcmd
set noruler noshowcmd
redraw!
if &fo =~ '[ta]'
echomsg "***vimball*** " a:msg
echomsg "***vimball*** ".a:msg
else
if a:level == s:WARNING || a:level == s:USAGE
echohl WarningMsg
elseif a:level == s:ERROR
echohl Error
endif
echomsg "***vimball*** " a:msg
echomsg "***vimball*** ".a:msg
echohl None
endif
@ -571,27 +564,6 @@ fun! s:ChgDir(newdir)
" call Dret("ChgDir : curdir<".getcwd().">")
endfun
" ---------------------------------------------------------------------
" s:Path: prepend and append quotes and do escaping {{{2
fun! s:Path(cmd,quote)
" call Dfunc("Path(cmd<".a:cmd."> quote<".a:quote.">) vimball_path_escape<".g:vimball_path_escape.">")
if (has("win32") || has("win95") || has("win64") || has("win16"))
" let cmdpath= a:quote.substitute(a:cmd,'/','\\','g').a:quote
let cmdpath= a:quote.substitute(a:cmd,'\\','/','g').a:quote
" call Decho("cmdpath<".cmdpath."> (win32 mod)")
else
let cmdpath= a:quote.a:cmd.a:quote
" call Decho("cmdpath<".cmdpath."> (not-win32 mod)")
endif
if a:quote == "" && g:vimball_path_escape !~ ' '
let cmdpath= escape(cmdpath,' ')
" call Decho("cmdpath<".cmdpath."> (empty quote case)")
endif
let cmdpath= escape(cmdpath,g:vimball_path_escape)
" call Dret("Path <".cmdpath.">")
return cmdpath
endfun
" ---------------------------------------------------------------------
" s:RecordInVar: record a un-vimball command in the .VimballRecord file {{{2
fun! s:RecordInVar(home,cmd)
@ -664,9 +636,9 @@ fun! s:RecordInFile(home)
endfun
" ---------------------------------------------------------------------
" s:VimballHome: determine/get home directory path (usually from rtp) {{{2
fun! s:VimballHome()
" call Dfunc("VimballHome()")
" vimball#VimballHome: determine/get home directory path (usually from rtp) {{{2
fun! vimball#VimballHome()
" call Dfunc("vimball#VimballHome()")
if exists("g:vimball_home")
let home= g:vimball_home
else
@ -692,14 +664,14 @@ fun! s:VimballHome()
if !isdirectory(home)
if exists("g:vimball_mkdir")
" call Decho("home<".home."> isn't a directory -- making it now with g:vimball_mkdir<".g:vimball_mkdir.">")
" call Decho("system(".g:vimball_mkdir." ".s:Escape(home).")")
call system(g:vimball_mkdir." ".s:Escape(home))
" call Decho("system(".g:vimball_mkdir." ".shellescape(home).")")
call system(g:vimball_mkdir." ".shellescape(home))
else
" call Decho("home<".home."> isn't a directory -- making it now with mkdir()")
call mkdir(home)
endif
endif
" call Dret("VimballHome <".home.">")
" call Dret("vimball#VimballHome <".home.">")
return home
endfun
@ -713,14 +685,14 @@ fun! vimball#SaveSettings()
let s:acdkeep = &acd
endif
let s:eikeep = &ei
let s:fenkeep = &fen
let s:fenkeep = &l:fen
let s:hidkeep = &hidden
let s:ickeep = &ic
let s:lzkeep = &lz
let s:pmkeep = &pm
let s:repkeep = &report
let s:vekeep = &ve
let s:ffkeep = &ff
let s:ffkeep = &l:ff
if exists("&acd")
setlocal ei=all ve=all noacd nofen noic report=999 nohid bt= ma lz pm= ff=unix
else
@ -739,7 +711,7 @@ fun! vimball#RestoreSettings()
if exists("&acd")
let &acd = s:acdkeep
endif
let &fen = s:fenkeep
let &l:fen = s:fenkeep
let &hidden = s:hidkeep
let &ic = s:ickeep
let &lz = s:lzkeep
@ -747,7 +719,7 @@ fun! vimball#RestoreSettings()
let &report = s:repkeep
let &ve = s:vekeep
let &ei = s:eikeep
let &ff = s:ffkeep
let &l:ff = s:ffkeep
if s:makeep[0] != 0
" restore mark a
" call Decho("restore mark-a: makeep=".string(makeep))
@ -760,21 +732,6 @@ fun! vimball#RestoreSettings()
" call Dret("RestoreSettings")
endfun
" ---------------------------------------------------------------------
" s:Escape: {{{2
fun s:Escape(name)
" shellescape() was added by patch 7.0.111
if exists("*shellescape")
return shellescape(a:name)
endif
return g:netrw_shq . a:name . g:netrw_shq
endfun
" ---------------------------------------------------------------------
" Restore:
let &cpo= s:keepcpo
unlet s:keepcpo
" ---------------------------------------------------------------------
" Modelines: {{{1
" vim: fdm=marker

View File

@ -1,4 +1,4 @@
*align.txt* The Alignment Tool Oct 29, 2008
*align.txt* The Alignment Tool Mar 04, 2009
Author: Charles E. Campbell, Jr. <NdrOchip@ScampbellPfamily.AbizM>
(remove NOSPAM from Campbell's email first)
@ -51,8 +51,17 @@ Copyright: (c) 2004-2008 by Charles E. Campbell, Jr. *Align-copyright*
==============================================================================
2. Align Manual *alignman* *alignmanual* *align-manual* {{{1
To Enable: put <Align.vim> and <AlignMaps.vim> into your .vim/plugin
To see a user's guide, see |align-usage|
Align comes as a vimball; simply typing >
vim Align.vba.gz
:so %
< should put its components where they belong. The components are: >
.vim/plugin/AlignPlugin.vim
.vim/plugin/AlignMapsPlugin.vim
.vim/plugin/cecutil.vim
.vim/autoload/Align.vim
.vim/autoload/AlignMaps.vim
.vim/doc/Align.txt
< To see a user's guide, see |align-userguide|
To see examples, see |alignctrl| and |alignmaps|
>
/=============+=========+=====================================================\
@ -130,7 +139,7 @@ Copyright: (c) 2004-2008 by Charles E. Campbell, Jr. *Align-copyright*
\=============================================================================/
==============================================================================
3. Alignment Usage *alignusage* *align-usage* {{{1
3. Alignment Usage *alignusage* *align-usage* *align-userguide* {{{1
ALIGNMENT CONCEPTS *align-concept* *align-concepts* {{{2
@ -179,8 +188,8 @@ ALIGNMENT CONCEPTS *align-concept* *align-concepts* {{{2
xx = yy = zz = 4;
zzz = yyy = zzz = 5;
a = b = c = 3;
< There are more options available for field justification: see
|alignctrl-c|.
< There are many more options available for field justification: see
|alignctrl-c| and |alignctrl--|.
Separators, although commonly only one character long, are actually
specified by regular expressions (see |regexp|), and one may left
@ -221,7 +230,7 @@ ALIGNMENT COMMANDS *align-command* *align-commands* {{{2
ex. :%Align ,
Interpretation: align all commas over the entire
file.
< The :Align! format permits alignment control commands
< The :Align! format permits alignment control commands
to precede the alignment patterns. >
ex. :%Align! p2P2 =
< This will align all "=" in the file with two padding
@ -229,7 +238,7 @@ ALIGNMENT COMMANDS *align-command* *align-commands* {{{2
NOTE ON USING PATTERNS WITH ALIGN:~
Align and AlignCtrl use |<q-args>| to obtain their
input patterns and they use an internal function to
input patterns and they use an internal function to
split arguments at whitespace unless inside "..."s.
One may escape characters inside a double-quote string
by preceding such characters with a backslash.
@ -249,7 +258,8 @@ ALIGNMENT COMMANDS *align-command* *align-commands* {{{2
used (at least once) previously; this command
restores the AlignCtrl settings when AlignPush
was last used.
<
< Also see |alignctrl-m| for a way to automatically do
an AlignPop after an Align (primarily this is for maps).
ALIGNMENT OPTIONS *align-option* *align-options* {{{2
*align-utf8* *align-utf* *align-codepoint* *align-strlen* *align-multibyte*
@ -258,9 +268,20 @@ ALIGNMENT OPTIONS *align-option* *align-options* {{{2
available with utf-8, Align now provides a special option which you
may choose based upon your needs:
Use Built-in strlen() ~
>
let g:Align_xstrlen= 0
< This is the fastest method, but it doesn't handle multibyte characters
well. It is the default for:
enc=latin1
vim compiled without multi-byte support
$LANG is en_US.UTF-8 (assuming USA english)
Number of codepoints (Latin a + combining circumflex is two codepoints)~
>
let g:Align_xstrlen= 1:
let g:Align_xstrlen= 1 (default)
<
Number of spacing codepoints (Latin a + combining circumflex is one~
spacing codepoint; a hard tab is one; wide and narrow CJK are one~
@ -276,7 +297,7 @@ ALIGNMENT OPTIONS *align-option* *align-options* {{{2
<
By putting one of these settings into your <.vimrc>, Align will use an
internal (interpreted) function to determine a string's length instead
of the Vim's built-in |strlen()| function. As the function is
of the Vim's built-in |strlen()| function. Since the function is
interpreted, Align will run a bit slower but will handle such strings
correctly. The last setting (g:Align_xstrlen= 3) probably will run
the slowest but be the most accurate. (thanks to Tony Mechelynck for
@ -286,17 +307,17 @@ ALIGNMENT OPTIONS *align-option* *align-options* {{{2
ALIGNMENT CONTROL *alignctrl* *align-control* {{{2
This command doesn't do the alignment operation itself; instead, it
controls the subsequent alignment operation(s).
controls subsequent alignment operation(s).
The first argument to AlignCtrl is a string which may contain one or
more alignment control commands. Most of the commands are single
letter commands; the exceptions are the p# and P# commands which
interpret digits following the p or P as specifying padding about the
more alignment control settings. Most of the settings are specified
by single letters; the exceptions are the p# and P# commands which
interpret a digit following the p or P as specifying padding about the
separator.
The typical text line is considered to be composed of two or more
fields separated by one or more separator pattern(s):
>
fields separated by one or more separator pattern(s): >
ws field ws separator ws field ws separator ...
<
where "ws" stands for "white space" such as blanks and/or tabs.
@ -306,9 +327,11 @@ ALIGNMENT CONTROL *alignctrl* *align-control* {{{2
As a result, separators may not have white space (tabs or blanks) on
their outsides (ie. ": :" is fine as a separator, but " :: " is
not). Usually such separators are not needed.
not). Usually such separators are not needed, although a map has been
provided which works around this limitation and aligns on whitespace
(see |alignmap-tsp|).
However, if you really need to have such separators with leading or
However, if you really need to have separators with leading or
trailing whitespace, consider handling them by performing a substitute
first (ie. s/ :: /@/g), do the alignment on the temporary pattern
(ie. @), and then perform a substitute to revert the separators back
@ -401,11 +424,11 @@ ALIGNMENT CONTROL *alignctrl* *align-control* {{{2
The first "=" separator is skipped by the "-" specification,
and so "a=bb", "ccc=a", and "dd=eee" are considered as single fields.
The next "=" separator has its (left side) field left-justified.
Due to the cyclic nature of separator patterns, the "-l"
specification is equivalent to "-l-l-l ...".
Hence the next specification is a "skip", so "ccc=1", etc are fields.
In the second example in "More justification options":
@ -533,7 +556,7 @@ ALIGNMENT CONTROL *alignctrl* *align-control* {{{2
Separators may be of differing lengths as shown in the example below.
Hence they too may be justified left, right, or centered.
Furthermore, separator justification specification is cyclic:
Furthermore, separator justification specifications are cyclic:
< means <<<<<... justify separator(s) to the left
> means >>>>>... justify separator(s) to the right
@ -595,7 +618,7 @@ ALIGNMENT CONTROL *alignctrl* *align-control* {{{2
AlignCtrl v
<
To see what g/v patterns are currently active, just use the reporting
capability of a plain AlignCtrl call: >
capability of an unadorned call to AlignCtrl: >
AlignCtrl
<
@ -656,6 +679,13 @@ ALIGNMENT CONTROL *alignctrl* *align-control* {{{2
padded on the right with spaces (left justification), and separators
will be padded on each side with a single space.
To change one of these items, see:
AlignCtrl......|alignctrl|
qty............|align-concept|
AlignStyle.....|alignctrl--| |alignctrl-+| |alignctrl-:||alignctrl-c|
Padding........|alignctrl-p| |alignctrl-P|
One may get a string which can be fed back into AlignCtrl: >
:let alignctrl= Align#AlignCtrl()
@ -680,7 +710,7 @@ ALIGNMENT *align-align* {{{2
:[range]Align [list-of-separators]
<
where the |range| is the usual Vim-powered set of possibilities; the
where the |:range| is the usual Vim-powered set of possibilities; the
list of separators is the same as the AlignCtrl capability. There is
only one list of separators, but either AlignCtrl or Align can be used
to specify that list.
@ -728,19 +758,19 @@ ALIGNMENT *align-align* {{{2
==============================================================================
4. Alignment Maps *alignmaps* *align-maps* {{{1
There are a number of maps using Align#AlignCtrl() and Align#Align() in the
<AlignMaps.vim> file. This file may also be put into the plugins
subdirectory. Since AlignCtrl and Align supercede textab and its
<ttalign.vim> file, the maps either have a leading "t" (for "textab")
or the more complicated ones an "a" (for "alignment") for backwards
compatibility.
There are a number of maps using Align#AlignCtrl() and Align#Align()
in the <AlignMapsPlugin.vim> file. This file may also be put into the
plugins subdirectory. Since AlignCtrl and Align supercede textab and
its <ttalign.vim> file, the maps either have a leading "t" (for
"textab") or the more complicated ones an "a" (for "alignment") for
backwards compatibility.
Thee maps are shown below with a leading backslash (\). Actually,
the <Leader> construct is used (see :help mapleader), so the leading
map kick-off character is easily customized.
The maps are shown below with a leading backslash (\). Actually, the
<Leader> construct is used (see |mapleader|), so the maps' leading
kick-off character is easily customized.
Furthermore, all AlignMaps.vim maps use the <Plug> construct (see
|<Plug>|and |<usr_41.txt|). Hence, if one wishes to override the
Furthermore, all AlignMapsPlugin.vim maps use the <Plug> construct (see
|<Plug>|and |usr_41.txt|). Hence, if one wishes to override the
mapping entirely, one may do that, too. As an example: >
map <Leader>ACOM <Plug>AM_acom
< would have \ACOM do what \acom previously did (assuming that the
@ -748,6 +778,7 @@ ALIGNMENT *align-align* {{{2
\a, : useful for breaking up comma-separated
declarations prior to \adec |alignmap-a,|
\a( : aligns ( and , (useful for prototypes) *alignmap-a(*
\a? : aligns (...)? ...:... expressions on ? and : |alignmap-a?|
\a< : aligns << and >> for c++ |alignmap-a<|
\a= : aligns := assignments |alignmap-a=|
@ -777,6 +808,12 @@ ALIGNMENT *align-align* {{{2
(left justified)
\ts, : like \t, but swaps whitespace on the right of *alignmap-ts,*
the commas to their left
\ts: : like \t: but swaps whitespace on the right of *alignmap-ts:*
the colons to their left
\ts< : like \t< but swaps whitespace on the right of *alignmap-ts<*
the less-than signs to their left
\ts= : like \t= but swaps whitespace on the right of *alignmap-ts=*
the equals signs to their left
\Tsp : use Align to make a table separated by blanks |alignmap-Tsp|
(right justified)
\tsq : use Align to make a table separated by blanks |alignmap-tsq|
@ -808,7 +845,7 @@ ALIGNMENT *align-align* {{{2
ALIGNMENT MAP USE WITH VISUAL MODE~
Alternatively, one may select the text with the "V" visual mode
selector.
command.
ALIGNMENT MAP USE WITH MENUS~
One may use the mark-and-move style (ma, move, use the menu) or
@ -816,7 +853,7 @@ ALIGNMENT *align-align* {{{2
the alignment map with menu selection). The alignment map menu
items are under DrChip.AlignMaps .
One may change the top level menu name to whatever is wished; by
One may even change the top level menu name to whatever is wished; by
default, its >
let g:DrChipTopLvlMenu= "DrChip."
< If you set the variable to the empty string (""), then no menu items
@ -825,14 +862,19 @@ ALIGNMENT *align-align* {{{2
must be included).
COMPLEX ALIGNMENT MAP METHOD~
For those complex alignment maps which do alignment on constructs
(e.g. \acom, \adec, etc), a series of substitutes is used to insert
"@" symbols in appropriate locations. Align#Align() is then used to do
alignment directly on "@"s; then it is followed by further substitutes
to do clean-up. However, the maps \WS and \WE protect any original
embedded "@" symbols by first converting them to <DEL> characters,
doing the requested job, and then converting them back.
"@" symbols in appropriate locations. Align#Align() is then used to
do alignment directly on "@"s; then it is followed by further
substitutes to do clean-up. However, the maps \WS and \WE, used by
every map supported by AlignMaps, protect any original embedded "@"
symbols by first converting them to <DEL> characters, doing the
requested job, and then converting them back. >
\WS calls AlignMaps#WrapperStart()
\WE calls AlignMaps#WrapperEnd()
<
---------------------------
Alignment Map Examples: \a, *alignmap-a,* {{{3
@ -1136,7 +1178,7 @@ ALIGNMENT *align-align* {{{2
Also see |alignmap-acom|
---------------------------
--------------------------- *alignmap-Tsp*
Alignment Map Examples: \tsp *alignmap-tsp* {{{3
---------------------------
@ -1266,9 +1308,14 @@ ALIGNMENT *align-align* {{{2
<TR><TD> ...field three... </TD><TD> ...field four... </TD></TR>
<
==============================================================================
4. Alignment Tool History *align-history* {{{1
4. Alignment Tools' History *align-history* {{{1
ALIGN HISTORY {{{2
35 : Nov 02, 2008 * g:loaded_AlignPlugin testing to prevent re-loading
installed
Nov 19, 2008 * new sanity check for an AlignStyle of just ":"
Jan 08, 2009 * save&restore of |'mod'| now done with local
variant
34 : Jul 08, 2008 * using :AlignCtrl before entering any alignment
control commands was causing an error.
33 : Sep 20, 2007 * s:Strlen() introduced to support various ways
@ -1330,11 +1377,19 @@ ALIGN HISTORY {{{2
11 : Jul 08, 2002 : prevent separator patterns which match zero length
-+: included as additional alignment/justification
styles
10 : Jun 26, 2002 : =~# used instead of =~ (for matching case)
10 : Jun 26, 2002 : =~# used instead of =~ (for matching case)
ignorecase option handled
9 : Jun 25, 2002 : implemented cyclic padding
ALIGNMENT MAP HISTORY *alignmap-history* {{{2
v41 Nov 02, 2008 * g:loaded_AlignMapsPlugin testing to prevent
re-loading installed
* AlignMaps now use 0x0f (ctrl-p) for special
character substitutions (instead of 0xff).
Seems to avoid some problems with having to
use Strlen().
* bug fixed with \ts,
* new maps: \ts; \ts, \ts: \ts< \ts= \a(
v40 Oct 21, 2008 * Modified AlignMaps so that its maps use <Plug>s
and <script>s. \t@ and related maps have been
changed to call StdAlign() instead. The

21
vimfiles/doc/editsrec.txt Normal file
View File

@ -0,0 +1,21 @@
" Vim Global Plugin for Editing .srec Files, doc-File
" Maintainer: Alexander Fleck
" <alexander.fleck@gmx.net>
" License: This File is placed in the Public Domain.
" Revision | Date [DD.MM.YY] | Changes
" 00.01.00 | 05.07.09 | 01. Revision
*editsrec.txt* Global Plugin for Editing .srec Files
This Plugin consists of the following Files:
/plugin/editsrec.vim
/plugin/editsrec_test.txt
/autoload/libsrec.vim
and
/doc/editsrec.txt
, this File.
The Purpose of this Plugin is to edit .srec-Files.
Currently it only allows Editing Line by Line,
but Handling of Files will be added later.

View File

@ -1,414 +1,414 @@
*pi_getscript.txt* For Vim version 7.0. Last change: 2008 Jan 07
>
GETSCRIPT REFERENCE MANUAL by Charles E. Campbell, Jr.
<
Authors: Charles E. Campbell, Jr. <NdrOchip@ScampbellPfamilyA.Mbiz>
(remove NOSPAM from the email address)
*GetLatestVimScripts-copyright*
Copyright: (c) 2004-2006 by Charles E. Campbell, Jr. *glvs-copyright*
The VIM LICENSE applies to getscript.vim and
pi_getscript.txt (see |copyright|) except use
"getscript" instead of "Vim". No warranty, express or implied.
Use At-Your-Own-Risk.
Getscript is a plugin that simplifies retrieval of the latest versions of the
scripts that you yourself use! Typing |:GLVS| will invoke getscript; it will
then use the <GetLatestVimScripts.dat> (see |GetLatestVimScripts_dat|) file to
get the latest versions of scripts listed therein from http://vim.sf.net/.
==============================================================================
1. Contents *glvs-contents* *glvs* *getscript*
*GetLatestVimScripts*
1. Contents........................................: |glvs-contents|
2. GetLatestVimScripts -- Getting Started..........: |glvs-install|
3. GetLatestVimScripts Usage.......................: |glvs-usage|
4. GetLatestVimScripts Data File...................: |glvs-data|
5. GetLatestVimScripts Friendly Plugins............: |glvs-plugins|
6. GetLatestVimScripts AutoInstall.................: |glvs-autoinstall|
7. GetLatestViMScripts Options.....................: |glvs-options|
8. GetLatestVimScripts Algorithm...................: |glvs-alg|
9. GetLatestVimScripts History.....................: |glvs-hist|
==============================================================================
2. GetLatestVimScripts -- Getting Started *getscript-start*
*getlatestvimscripts-install*
VERSION FROM VIM DISTRIBUTION *glvs-dist-install*
Vim 7.0 does not include the GetLatestVimScripts.dist file which
serves as an example and a template. So, you'll need to create
your own! See |GetLatestVimScripts_dat|.
VERSION FROM VIM SF NET *glvs-install*
NOTE: The last step, that of renaming/moving the GetLatestVimScripts.dist
file, is for those who have just downloaded GetLatestVimScripts.tar.bz2 for
the first time.
The GetLatestVimScripts.dist file serves as an example and a template for your
own personal list. Feel free to remove all the scripts mentioned within it;
the "important" part of it is the first two lines.
Your computer needs to have wget for GetLatestVimScripts to do its work.
1. if compressed: gunzip getscript.vba.gz
2. Unix:
vim getscript.vba
:so %
:q
cd ~/.vim/GetLatest
mv GetLatestVimScripts.dist GetLatestVimScripts.dat
(edit GetLatestVimScripts.dat to install your own personal
list of desired plugins -- see |GetLatestVimScripts_dat|)
3. Windows:
vim getscript.vba
:so %
:q
cd **path-to-vimfiles**/GetLatest
mv GetLatestVimScripts.dist GetLatestVimScripts.dat
(edit GetLatestVimScripts.dat to install your own personal
list of desired plugins -- see |GetLatestVimScripts_dat|)
==============================================================================
3. GetLatestVimScripts Usage *glvs-usage* *:GLVS*
Unless its been defined elsewhere, >
:GLVS
will invoke GetLatestVimScripts(). If some other plugin has defined that
command, then you may type
>
:GetLatestVimScripts
<
The script will attempt to update and, if permitted, will automatically
install scripts from http://vim.sourceforge.net/. To do so it will peruse a
file,
>
.vim/GetLatest/GetLatestVimScripts.dat (unix)
<
or >
..wherever..\vimfiles\GetLatest\GetLatestVimScripts.dat (windows)
(see |glvs-data|), and examine plugins in your [.vim|vimfiles]/plugin
directory (see |glvs-plugins|).
Scripts which have been downloaded will appear in the
~/.vim/GetLatest (unix) or ..wherever..\vimfiles\GetLatest (windows)
subdirectory. GetLatestVimScripts will attempt to automatically
install them if you have the following line in your <.vimrc>: >
let g:GetLatestVimScripts_allowautoinstall=1
The <GetLatestVimScripts.dat> file will be automatically be updated to
reflect the latest version of script(s) so downloaded.
(also see |glvs-options|)
==============================================================================
4. GetLatestVimScripts Data File *getscript-data* *glvs-data*
*:GetLatestVimScripts_dat*
The data file <GetLatestVimScripts.dat> must have for its first two lines
the following text:
>
ScriptID SourceID Filename
--------------------------
<
Following those two lines are three columns; the first two are numeric
followed by a text column. The GetLatest/GetLatestVimScripts.dist file
contains an example of such a data file. Anything following a #... is
ignored, so you may embed comments in the file.
The first number on each line gives the script's ScriptID. When you're about
to use a web browser to look at scripts on http://vim.sf.net/, just before you
click on the script's link, you'll see a line resembling
http://vim.sourceforge.net/scripts/script.php?script_id=40
The "40" happens to be a ScriptID that GetLatestVimScripts needs to
download the associated page.
The second number on each line gives the script's SourceID. The SourceID
records the count of uploaded scripts as determined by vim.sf.net; hence it
serves to indicate "when" a script was uploaded. Setting the SourceID to 1
insures that GetLatestVimScripts will assume that the script it has is
out-of-date.
The SourceID is extracted by GetLatestVimScripts from the script's page on
vim.sf.net; whenever its greater than the one stored in the
GetLatestVimScripts.dat file, the script will be downloaded
(see |GetLatestVimScripts_dat|).
If your script's author has included a special comment line in his/her plugin,
the plugin itself will be used by GetLatestVimScripts to build your
<GetLatestVimScripts.dat> file, including any dependencies on other scripts it
may have. As an example, consider: >
" GetLatestVimScripts: 884 1 :AutoInstall: AutoAlign.vim
This comment line tells getscript.vim to check vimscript #884 and that the
script is automatically installable. Getscript will also use this line to
help build the GetLatestVimScripts.dat file, by including a line such as: >
884 1 AutoAlign.vim
<
in it an AutoAlign.vim line isn't already in GetLatestVimScripts.dat file.
See |glvs-plugins| for more. Thus, GetLatestVimScripts thus provides a
comprehensive ability to keep your plugins up-to-date!
*GetLatestVimScripts_dat*
As an example of a <GetLatestVimScripts.dat> file:
>
ScriptID SourceID Filename
--------------------------
294 1 Align.vim
120 2 decho.vim
40 3 DrawIt.tar.gz
451 4 EasyAccents.vim
195 5 engspchk.vim
642 6 GetLatestVimScripts.vim
489 7 Manpageview.vim
<
Note: the first two lines are required, but essentially act as comments.
==============================================================================
5. GetLatestVimScripts Friendly Plugins *getscript-plugins* *glvs-plugins*
If a plugin author includes the following comment anywhere in their plugin,
GetLatestVimScripts will find it and use it to automatically build the user's
GetLatestVimScripts.dat files:
>
src_id
v
" GetLatestVimScripts: ### ### yourscriptname
^
scriptid
<
As an author, you should include such a line in to refer to your own script
plus any additional lines describing any plugin dependencies it may have.
Same format, of course!
If your command is auto-installable (see |glvs-autoinstall|), and most scripts
are, then you may include :AutoInstall: at the start of "yourscriptname".
GetLatestVimScripts commands for those scripts are then appended, if not
already present, to the user's GetLatest/GetLatestVimScripts.dat file. Its a
relatively painless way to automate the acquisition of any scripts your
plugins depend upon.
Now, as an author, you probably don't want GetLatestVimScripts to download
your own scripts for you yourself, thereby overwriting your not-yet-released
hard work. GetLatestVimScripts provides a solution for this: put
>
0 0 yourscriptname
<
into your <GetLatestVimScripts.dat> file and GetLatestVimScripts will skip
examining the "yourscriptname" scripts for those GetLatestVimScripts comment
lines. As a result, those lines won't be inadvertently installed into your
<GetLatestVimScripts.dat> file and subsequently used to download your own
scripts. This is especially important to do if you've included the
:AutoInstall: option.
Be certain to use the same "yourscriptname" in the "0 0 yourscriptname" line
as you've used in your GetLatestVimScripts comment!
==============================================================================
6. GetLatestVimScripts AutoInstall *getscript-autoinstall*
*glvs-autoinstall*
GetLatestVimScripts now supports "AutoInstall". Not all scripts are
supportive of auto-install, as they may have special things you need to do to
install them (please refer to the script's "install" directions). On the
other hand, most scripts will be auto-installable.
To let GetLatestVimScripts do an autoinstall, the data file's comment field
should begin with (surrounding blanks are ignored): >
:AutoInstall:
<
Both colons are needed, and it should begin the comment (yourscriptname)
field.
One may prevent any autoinstalling by putting the following line in your
<.vimrc>: >
let g:GetLatestVimScripts_allowautoinstall= 0
<
With :AutoInstall: enabled, as it is by default, files which end with
---.tar.bz2 : decompressed & untarred in .vim/ directory
---.vba.bz2 : decompressed in .vim/ directory, then vimball handles it
---.vim.bz2 : decompressed & moved into .vim/plugin directory
---.tar.gz : decompressed & untarred in .vim/ directory
---.vba.gz : decompressed in .vim/ directory, then vimball handles it
---.vim.gz : decompressed & moved into .vim/plugin directory
---.vba : unzipped in .vim/ directory
---.vim : moved to .vim/plugin directory
---.zip : unzipped in .vim/ directory
and which merely need to have their components placed by the untar/gunzip or
move-to-plugin-directory process should be auto-installable. Vimballs, of
course, should always be auto-installable.
When is a script not auto-installable? Let me give an example:
.vim/after/syntax/blockhl.vim
The <blockhl.vim> script provides block highlighting for C/C++ programs; it is
available at:
http://vim.sourceforge.net/scripts/script.php?script_id=104
Currently, vim's after/syntax only supports by-filetype scripts (in
blockhl.vim's case, that's after/syntax/c.vim). Hence, auto-install would
possibly overwrite the current user's after/syntax/c.vim file.
In my own case, I use <aftersyntax.vim> (renamed to after/syntax/c.vim) to
allow a after/syntax/c/ directory:
http://vim.sourceforge.net/scripts/script.php?script_id=1023
The script allows multiple syntax files to exist separately in the
after/syntax/c subdirectory. I can't bundle aftersyntax.vim in and build an
appropriate tarball for auto-install because of the potential for the
after/syntax/c.vim contained in it to overwrite a user's c.vim.
==============================================================================
7. GetLatestVimScripts Options *glvs-options*
>
g:GetLatestVimScripts_wget
< default= "wget"
This variable holds the name of the command for obtaining
scripts.
>
g:GetLatestVimScripts_options
< default= "-q -O"
This variable holds the options to be used with the
g:GetLatestVimScripts_wget command.
>
g:getLatestVimScripts_allowautoinstall
< default= 1
This variable indicates whether GetLatestVimScripts is allowed
to attempt to automatically install scripts. Note that it
doesn't understand vimballs (yet). Furthermore, the plugin
author has to have explicitly indicated that his/her plugin
is automatically installable.
==============================================================================
8. GetLatestVimScripts Algorithm *glvs-algorithm* *glvs-alg*
The Vim sourceforge page dynamically creates a page by keying off of the
so-called script-id. Within the webpage of
http://vim.sourceforge.net/scripts/script.php?script_id=40
is a line specifying the latest source-id (src_id). The source identifier
numbers are always increasing, hence if the src_id is greater than the one
recorded for the script in GetLatestVimScripts then it's time to download a
newer copy of that script.
GetLatestVimScripts will then download the script and update its internal
database of script ids, source ids, and scriptnames.
The AutoInstall process will:
Move the file from GetLatest/ to the following directory
Unix : $HOME/.vim
Windows: $HOME\vimfiles
if the downloaded file ends with ".bz2"
bunzip2 it
else if the downloaded file ends with ".gz"
gunzip it
if the resulting file ends with ".zip"
unzip it
else if the resulting file ends with ".tar"
tar -oxvf it
else if the resulting file ends with ".vim"
move it to the plugin subdirectory
==============================================================================
9. GetLatestVimScripts History *getscript-history* *glvs-hist* {{{1
v29 Jan 07, 2008 : * Bram M pointed out that cpo is a global option and that
getscriptPlugin.vim was setting it but not restoring it.
v28 Jan 02, 2008 : * improved shell quoting character handling, cygwin
interface, register-a bypass
Oct 29, 2007 * Bill McCarthy suggested a change to getscript that avoids
creating pop-up windows
v24 Apr 16, 2007 : * removed save&restore of the fo option during script
loading
v23 Nov 03, 2006 : * ignores comments (#...)
* handles vimballs
v22 Oct 13, 2006 : * supports automatic use of curl if wget is not
available
v21 May 01, 2006 : * now takes advantage of autoloading.
v20 Dec 23, 2005 : * Eric Haarbauer found&fixed a bug with unzip use;
unzip needs the -o flag to overwrite.
v19 Nov 28, 2005 : * v18's GetLatestVimScript line accessed the wrong
script! Fixed.
v18 Mar 21, 2005 : * bugfix to automatic database construction
* bugfix - nowrapscan caused an error
(tnx to David Green for the fix)
Apr 01, 2005 * if shell is bash, "mv" instead of "ren" used in
:AutoInstall:s, even though its o/s is windows
Apr 01, 2005 * when downloading errors occurred, GLVS was
terminating early. It now just goes on to trying
the next script (after trying three times to
download a script description page)
Apr 20, 2005 * bugfix - when a failure to download occurred,
GetLatestVimScripts would stop early and claim that
everything was current. Fixed.
v17 Aug 25, 2004 : * g:GetLatestVimScripts_allowautoinstall, which
defaults to 1, can be used to prevent all
:AutoInstall:
v16 Aug 25, 2004 : * made execution of bunzip2/gunzip/tar/zip silent
* fixed bug with :AutoInstall: use of helptags
v15 Aug 24, 2004 : * bugfix: the "0 0 comment" download prevention wasn't
always preventing downloads (just usually). Fixed.
v14 Aug 24, 2004 : * bugfix -- helptags was using dotvim, rather than
s:dotvim. Fixed.
v13 Aug 23, 2004 : * will skip downloading a file if its scriptid or srcid
is zero. Useful for script authors; that way their
own GetLatestVimScripts activity won't overwrite
their scripts.
v12 Aug 23, 2004 : * bugfix - a "return" got left in the distribution that
was intended only for testing. Removed, now works.
* :AutoInstall: implemented
v11 Aug 20, 2004 : * GetLatestVimScripts is now a plugin:
* :GetLatestVimScripts command
* (runtimepath)/GetLatest/GetLatestVimScripts.dat
now holds scripts that need updating
v10 Apr 19, 2004 : * moved history from script to doc
v9 Jan 23, 2004 : windows (win32/win16/win95) will use
double quotes ("") whereas other systems will use
single quotes ('') around the urls in calls via wget
v8 Dec 01, 2003 : makes three tries at downloading
v7 Sep 02, 2003 : added error messages if "Click on..." or "src_id="
not found in downloaded webpage
Uses t_ti, t_te, and rs to make progress visible
v6 Aug 06, 2003 : final status messages now display summary of work
( "Downloaded someqty scripts" or
"Everything was current")
Now GetLatestVimScripts is careful about downloading
GetLatestVimScripts.vim itself!
(goes to <NEW_GetLatestVimScripts.vim>)
v5 Aug 04, 2003 : missing an endif near bottom
v4 Jun 17, 2003 : redraw! just before each "considering" message
v3 May 27, 2003 : Protects downloaded files from errant shell
expansions with single quotes: '...'
v2 May 14, 2003 : extracts name of item to be obtained from the
script file. Uses it instead of comment field
for output filename; comment is used in the
"considering..." line and is now just a comment!
* Fixed a bug: a string-of-numbers is not the
same as a number, so I added zero to them
and they became numbers. Fixes comparison.
==============================================================================
vim:tw=78:ts=8:ft=help:fdm=marker
*pi_getscript.txt* For Vim version 7.0. Last change: 2008 Jan 07
>
GETSCRIPT REFERENCE MANUAL by Charles E. Campbell, Jr.
<
Authors: Charles E. Campbell, Jr. <NdrOchip@ScampbellPfamilyA.Mbiz>
(remove NOSPAM from the email address)
*GetLatestVimScripts-copyright*
Copyright: (c) 2004-2006 by Charles E. Campbell, Jr. *glvs-copyright*
The VIM LICENSE applies to getscript.vim and
pi_getscript.txt (see |copyright|) except use
"getscript" instead of "Vim". No warranty, express or implied.
Use At-Your-Own-Risk.
Getscript is a plugin that simplifies retrieval of the latest versions of the
scripts that you yourself use! Typing |:GLVS| will invoke getscript; it will
then use the <GetLatestVimScripts.dat> (see |GetLatestVimScripts_dat|) file to
get the latest versions of scripts listed therein from http://vim.sf.net/.
==============================================================================
1. Contents *glvs-contents* *glvs* *getscript*
*GetLatestVimScripts*
1. Contents........................................: |glvs-contents|
2. GetLatestVimScripts -- Getting Started..........: |glvs-install|
3. GetLatestVimScripts Usage.......................: |glvs-usage|
4. GetLatestVimScripts Data File...................: |glvs-data|
5. GetLatestVimScripts Friendly Plugins............: |glvs-plugins|
6. GetLatestVimScripts AutoInstall.................: |glvs-autoinstall|
7. GetLatestViMScripts Options.....................: |glvs-options|
8. GetLatestVimScripts Algorithm...................: |glvs-alg|
9. GetLatestVimScripts History.....................: |glvs-hist|
==============================================================================
2. GetLatestVimScripts -- Getting Started *getscript-start*
*getlatestvimscripts-install*
VERSION FROM VIM DISTRIBUTION *glvs-dist-install*
Vim 7.0 does not include the GetLatestVimScripts.dist file which
serves as an example and a template. So, you'll need to create
your own! See |GetLatestVimScripts_dat|.
VERSION FROM VIM SF NET *glvs-install*
NOTE: The last step, that of renaming/moving the GetLatestVimScripts.dist
file, is for those who have just downloaded GetLatestVimScripts.tar.bz2 for
the first time.
The GetLatestVimScripts.dist file serves as an example and a template for your
own personal list. Feel free to remove all the scripts mentioned within it;
the "important" part of it is the first two lines.
Your computer needs to have wget for GetLatestVimScripts to do its work.
1. if compressed: gunzip getscript.vba.gz
2. Unix:
vim getscript.vba
:so %
:q
cd ~/.vim/GetLatest
mv GetLatestVimScripts.dist GetLatestVimScripts.dat
(edit GetLatestVimScripts.dat to install your own personal
list of desired plugins -- see |GetLatestVimScripts_dat|)
3. Windows:
vim getscript.vba
:so %
:q
cd **path-to-vimfiles**/GetLatest
mv GetLatestVimScripts.dist GetLatestVimScripts.dat
(edit GetLatestVimScripts.dat to install your own personal
list of desired plugins -- see |GetLatestVimScripts_dat|)
==============================================================================
3. GetLatestVimScripts Usage *glvs-usage* *:GLVS*
Unless its been defined elsewhere, >
:GLVS
will invoke GetLatestVimScripts(). If some other plugin has defined that
command, then you may type
>
:GetLatestVimScripts
<
The script will attempt to update and, if permitted, will automatically
install scripts from http://vim.sourceforge.net/. To do so it will peruse a
file,
>
.vim/GetLatest/GetLatestVimScripts.dat (unix)
<
or >
..wherever..\vimfiles\GetLatest\GetLatestVimScripts.dat (windows)
(see |glvs-data|), and examine plugins in your [.vim|vimfiles]/plugin
directory (see |glvs-plugins|).
Scripts which have been downloaded will appear in the
~/.vim/GetLatest (unix) or ..wherever..\vimfiles\GetLatest (windows)
subdirectory. GetLatestVimScripts will attempt to automatically
install them if you have the following line in your <.vimrc>: >
let g:GetLatestVimScripts_allowautoinstall=1
The <GetLatestVimScripts.dat> file will be automatically be updated to
reflect the latest version of script(s) so downloaded.
(also see |glvs-options|)
==============================================================================
4. GetLatestVimScripts Data File *getscript-data* *glvs-data*
*:GetLatestVimScripts_dat*
The data file <GetLatestVimScripts.dat> must have for its first two lines
the following text:
>
ScriptID SourceID Filename
--------------------------
<
Following those two lines are three columns; the first two are numeric
followed by a text column. The GetLatest/GetLatestVimScripts.dist file
contains an example of such a data file. Anything following a #... is
ignored, so you may embed comments in the file.
The first number on each line gives the script's ScriptID. When you're about
to use a web browser to look at scripts on http://vim.sf.net/, just before you
click on the script's link, you'll see a line resembling
http://vim.sourceforge.net/scripts/script.php?script_id=40
The "40" happens to be a ScriptID that GetLatestVimScripts needs to
download the associated page.
The second number on each line gives the script's SourceID. The SourceID
records the count of uploaded scripts as determined by vim.sf.net; hence it
serves to indicate "when" a script was uploaded. Setting the SourceID to 1
insures that GetLatestVimScripts will assume that the script it has is
out-of-date.
The SourceID is extracted by GetLatestVimScripts from the script's page on
vim.sf.net; whenever its greater than the one stored in the
GetLatestVimScripts.dat file, the script will be downloaded
(see |GetLatestVimScripts_dat|).
If your script's author has included a special comment line in his/her plugin,
the plugin itself will be used by GetLatestVimScripts to build your
<GetLatestVimScripts.dat> file, including any dependencies on other scripts it
may have. As an example, consider: >
" GetLatestVimScripts: 884 1 :AutoInstall: AutoAlign.vim
This comment line tells getscript.vim to check vimscript #884 and that the
script is automatically installable. Getscript will also use this line to
help build the GetLatestVimScripts.dat file, by including a line such as: >
884 1 AutoAlign.vim
<
in it an AutoAlign.vim line isn't already in GetLatestVimScripts.dat file.
See |glvs-plugins| for more. Thus, GetLatestVimScripts thus provides a
comprehensive ability to keep your plugins up-to-date!
*GetLatestVimScripts_dat*
As an example of a <GetLatestVimScripts.dat> file:
>
ScriptID SourceID Filename
--------------------------
294 1 Align.vim
120 2 decho.vim
40 3 DrawIt.tar.gz
451 4 EasyAccents.vim
195 5 engspchk.vim
642 6 GetLatestVimScripts.vim
489 7 Manpageview.vim
<
Note: the first two lines are required, but essentially act as comments.
==============================================================================
5. GetLatestVimScripts Friendly Plugins *getscript-plugins* *glvs-plugins*
If a plugin author includes the following comment anywhere in their plugin,
GetLatestVimScripts will find it and use it to automatically build the user's
GetLatestVimScripts.dat files:
>
src_id
v
" GetLatestVimScripts: ### ### yourscriptname
^
scriptid
<
As an author, you should include such a line in to refer to your own script
plus any additional lines describing any plugin dependencies it may have.
Same format, of course!
If your command is auto-installable (see |glvs-autoinstall|), and most scripts
are, then you may include :AutoInstall: at the start of "yourscriptname".
GetLatestVimScripts commands for those scripts are then appended, if not
already present, to the user's GetLatest/GetLatestVimScripts.dat file. Its a
relatively painless way to automate the acquisition of any scripts your
plugins depend upon.
Now, as an author, you probably don't want GetLatestVimScripts to download
your own scripts for you yourself, thereby overwriting your not-yet-released
hard work. GetLatestVimScripts provides a solution for this: put
>
0 0 yourscriptname
<
into your <GetLatestVimScripts.dat> file and GetLatestVimScripts will skip
examining the "yourscriptname" scripts for those GetLatestVimScripts comment
lines. As a result, those lines won't be inadvertently installed into your
<GetLatestVimScripts.dat> file and subsequently used to download your own
scripts. This is especially important to do if you've included the
:AutoInstall: option.
Be certain to use the same "yourscriptname" in the "0 0 yourscriptname" line
as you've used in your GetLatestVimScripts comment!
==============================================================================
6. GetLatestVimScripts AutoInstall *getscript-autoinstall*
*glvs-autoinstall*
GetLatestVimScripts now supports "AutoInstall". Not all scripts are
supportive of auto-install, as they may have special things you need to do to
install them (please refer to the script's "install" directions). On the
other hand, most scripts will be auto-installable.
To let GetLatestVimScripts do an autoinstall, the data file's comment field
should begin with (surrounding blanks are ignored): >
:AutoInstall:
<
Both colons are needed, and it should begin the comment (yourscriptname)
field.
One may prevent any autoinstalling by putting the following line in your
<.vimrc>: >
let g:GetLatestVimScripts_allowautoinstall= 0
<
With :AutoInstall: enabled, as it is by default, files which end with
---.tar.bz2 : decompressed & untarred in .vim/ directory
---.vba.bz2 : decompressed in .vim/ directory, then vimball handles it
---.vim.bz2 : decompressed & moved into .vim/plugin directory
---.tar.gz : decompressed & untarred in .vim/ directory
---.vba.gz : decompressed in .vim/ directory, then vimball handles it
---.vim.gz : decompressed & moved into .vim/plugin directory
---.vba : unzipped in .vim/ directory
---.vim : moved to .vim/plugin directory
---.zip : unzipped in .vim/ directory
and which merely need to have their components placed by the untar/gunzip or
move-to-plugin-directory process should be auto-installable. Vimballs, of
course, should always be auto-installable.
When is a script not auto-installable? Let me give an example:
.vim/after/syntax/blockhl.vim
The <blockhl.vim> script provides block highlighting for C/C++ programs; it is
available at:
http://vim.sourceforge.net/scripts/script.php?script_id=104
Currently, vim's after/syntax only supports by-filetype scripts (in
blockhl.vim's case, that's after/syntax/c.vim). Hence, auto-install would
possibly overwrite the current user's after/syntax/c.vim file.
In my own case, I use <aftersyntax.vim> (renamed to after/syntax/c.vim) to
allow a after/syntax/c/ directory:
http://vim.sourceforge.net/scripts/script.php?script_id=1023
The script allows multiple syntax files to exist separately in the
after/syntax/c subdirectory. I can't bundle aftersyntax.vim in and build an
appropriate tarball for auto-install because of the potential for the
after/syntax/c.vim contained in it to overwrite a user's c.vim.
==============================================================================
7. GetLatestVimScripts Options *glvs-options*
>
g:GetLatestVimScripts_wget
< default= "wget"
This variable holds the name of the command for obtaining
scripts.
>
g:GetLatestVimScripts_options
< default= "-q -O"
This variable holds the options to be used with the
g:GetLatestVimScripts_wget command.
>
g:getLatestVimScripts_allowautoinstall
< default= 1
This variable indicates whether GetLatestVimScripts is allowed
to attempt to automatically install scripts. Note that it
doesn't understand vimballs (yet). Furthermore, the plugin
author has to have explicitly indicated that his/her plugin
is automatically installable.
==============================================================================
8. GetLatestVimScripts Algorithm *glvs-algorithm* *glvs-alg*
The Vim sourceforge page dynamically creates a page by keying off of the
so-called script-id. Within the webpage of
http://vim.sourceforge.net/scripts/script.php?script_id=40
is a line specifying the latest source-id (src_id). The source identifier
numbers are always increasing, hence if the src_id is greater than the one
recorded for the script in GetLatestVimScripts then it's time to download a
newer copy of that script.
GetLatestVimScripts will then download the script and update its internal
database of script ids, source ids, and scriptnames.
The AutoInstall process will:
Move the file from GetLatest/ to the following directory
Unix : $HOME/.vim
Windows: $HOME\vimfiles
if the downloaded file ends with ".bz2"
bunzip2 it
else if the downloaded file ends with ".gz"
gunzip it
if the resulting file ends with ".zip"
unzip it
else if the resulting file ends with ".tar"
tar -oxvf it
else if the resulting file ends with ".vim"
move it to the plugin subdirectory
==============================================================================
9. GetLatestVimScripts History *getscript-history* *glvs-hist* {{{1
v29 Jan 07, 2008 : * Bram M pointed out that cpo is a global option and that
getscriptPlugin.vim was setting it but not restoring it.
v28 Jan 02, 2008 : * improved shell quoting character handling, cygwin
interface, register-a bypass
Oct 29, 2007 * Bill McCarthy suggested a change to getscript that avoids
creating pop-up windows
v24 Apr 16, 2007 : * removed save&restore of the fo option during script
loading
v23 Nov 03, 2006 : * ignores comments (#...)
* handles vimballs
v22 Oct 13, 2006 : * supports automatic use of curl if wget is not
available
v21 May 01, 2006 : * now takes advantage of autoloading.
v20 Dec 23, 2005 : * Eric Haarbauer found&fixed a bug with unzip use;
unzip needs the -o flag to overwrite.
v19 Nov 28, 2005 : * v18's GetLatestVimScript line accessed the wrong
script! Fixed.
v18 Mar 21, 2005 : * bugfix to automatic database construction
* bugfix - nowrapscan caused an error
(tnx to David Green for the fix)
Apr 01, 2005 * if shell is bash, "mv" instead of "ren" used in
:AutoInstall:s, even though its o/s is windows
Apr 01, 2005 * when downloading errors occurred, GLVS was
terminating early. It now just goes on to trying
the next script (after trying three times to
download a script description page)
Apr 20, 2005 * bugfix - when a failure to download occurred,
GetLatestVimScripts would stop early and claim that
everything was current. Fixed.
v17 Aug 25, 2004 : * g:GetLatestVimScripts_allowautoinstall, which
defaults to 1, can be used to prevent all
:AutoInstall:
v16 Aug 25, 2004 : * made execution of bunzip2/gunzip/tar/zip silent
* fixed bug with :AutoInstall: use of helptags
v15 Aug 24, 2004 : * bugfix: the "0 0 comment" download prevention wasn't
always preventing downloads (just usually). Fixed.
v14 Aug 24, 2004 : * bugfix -- helptags was using dotvim, rather than
s:dotvim. Fixed.
v13 Aug 23, 2004 : * will skip downloading a file if its scriptid or srcid
is zero. Useful for script authors; that way their
own GetLatestVimScripts activity won't overwrite
their scripts.
v12 Aug 23, 2004 : * bugfix - a "return" got left in the distribution that
was intended only for testing. Removed, now works.
* :AutoInstall: implemented
v11 Aug 20, 2004 : * GetLatestVimScripts is now a plugin:
* :GetLatestVimScripts command
* (runtimepath)/GetLatest/GetLatestVimScripts.dat
now holds scripts that need updating
v10 Apr 19, 2004 : * moved history from script to doc
v9 Jan 23, 2004 : windows (win32/win16/win95) will use
double quotes ("") whereas other systems will use
single quotes ('') around the urls in calls via wget
v8 Dec 01, 2003 : makes three tries at downloading
v7 Sep 02, 2003 : added error messages if "Click on..." or "src_id="
not found in downloaded webpage
Uses t_ti, t_te, and rs to make progress visible
v6 Aug 06, 2003 : final status messages now display summary of work
( "Downloaded someqty scripts" or
"Everything was current")
Now GetLatestVimScripts is careful about downloading
GetLatestVimScripts.vim itself!
(goes to <NEW_GetLatestVimScripts.vim>)
v5 Aug 04, 2003 : missing an endif near bottom
v4 Jun 17, 2003 : redraw! just before each "considering" message
v3 May 27, 2003 : Protects downloaded files from errant shell
expansions with single quotes: '...'
v2 May 14, 2003 : extracts name of item to be obtained from the
script file. Uses it instead of comment field
for output filename; comment is used in the
"considering..." line and is now just a comment!
* Fixed a bug: a string-of-numbers is not the
same as a number, so I added zero to them
and they became numbers. Fixes comparison.
==============================================================================
vim:tw=78:ts=8:ft=help:fdm=marker

View File

@ -1,8 +1,22 @@
*pi_netrw.txt* For Vim version 7.2. Last change: 2008 Oct 23
*pi_netrw.txt* For Vim version 7.2. Last change: 2009 Dec 28
-----------------------------------------------------
NETRW REFERENCE MANUAL by Charles E. Campbell, Jr.
-----------------------------------------------------
Author: Charles E. Campbell, Jr. <NdrOchip@ScampbellPfamily.AbizM>
(remove NOSPAM from Campbell's email first)
Copyright: Copyright (C) 2009 Charles E Campbell, Jr *netrw-copyright*
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, netrw.vim,
netrwPlugin.vim, netrwFileHandlers.vim, netrwSettings.vim,
syntax/netrw.vim, and pi_netrw.txt are provided *as is* and comes
with no warranty of any kind, either expressed or implied. No
guarantees of merchantability. No guarantees of suitability for
any purpose. By using this plugin, you agree that in no event will
the copyright holder be liable for any damages resulting from the
use of this software.
*dav* *ftp* *netrw-file* *Nread* *rcp* *scp*
@ -18,6 +32,7 @@
EXTERNAL APPLICATIONS AND PROTOCOLS................|netrw-externapp|
READING............................................|netrw-read|
WRITING............................................|netrw-write|
SOURCING...........................................|netrw-source|
DIRECTORY LISTING..................................|netrw-dirlist|
CHANGING THE USERID AND PASSWORD...................|netrw-chgup|
VARIABLES AND SETTINGS.............................|netrw-variables|
@ -38,7 +53,7 @@
Browsing With A Horizontally Split Window..........|netrw-o|
Browsing With A New Tab............................|netrw-t|
Browsing With A Vertically Split Window............|netrw-v|
Change Listing Style...............................|netrw-i|
Change Listing Style.(thin wide long tree).........|netrw-i|
Changing To A Bookmarked Directory.................|netrw-gb|
Changing To A Predecessor Directory................|netrw-u|
Changing To A Successor Directory..................|netrw-U|
@ -81,10 +96,12 @@
Renaming Files Or Directories......................|netrw-move|
Reversing Sorting Order............................|netrw-r|
Selecting Sorting Style............................|netrw-s|
Setting Editing Window.............................|netrw-C|
10. Problems and Fixes...................................|netrw-problems|
11. Debugging Netrw Itself...............................|netrw-debug|
12. History..............................................|netrw-history|
13. Credits..............................................|netrw-credits|
13. Todo.................................................|netrw-todo|
14. Credits..............................................|netrw-credits|
{Vi does not have any of this}
@ -92,7 +109,7 @@
2. Starting With Netrw *netrw-start* {{{1
Netrw makes reading files, writing files, browsing over a network, and
browsing locally easy! First, make sure that you have plugins enabled, so
local browsing easy! First, make sure that you have plugins enabled, so
you'll need to have at least the following in your <.vimrc>:
(or see |netrw-activate|) >
@ -137,8 +154,11 @@ the directory name is followed by a "/"): >
<
See |netrw-browse| for more!
There are more protocols supported by netrw just than scp and ftp, too: see the
next section, |netrw-externapp|, for how to use these external applications.
There are more protocols supported by netrw than just scp and ftp, too: see the
next section, |netrw-externapp|, on how to use these external applications with
netrw and vim.
PREVENTING LOADING
If you want to use plugins, but for some reason don't wish to use netrw, then
you need to avoid loading both the plugin and the autoload portions of netrw.
@ -151,7 +171,7 @@ 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
Netrw supports several protocols in addition to scp and ftp as 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.
@ -175,17 +195,19 @@ EXTERNAL APPLICATIONS AND PROTOCOLS *netrw-externapp* {{{2
sftp: *g:netrw_sftp_cmd* = "sftp"
*g:netrw_http_xcmd* : the option string for http://... protocols are
specified via this variable and may be independently oveerridden.
elinks : "-dump >"
links : "-dump >"
specified via this variable and may be independently overridden. By
default, the option arguments for the http-handling commands are: >
elinks : "-source >"
links : "-source >"
curl : "-o"
wget : "-q -O"
fetch : "-o"
For example, if your system has elinks but you want to see the html
source in detail rather than a text rendering thereof, you may wish
to have let g:netrw_http_xcmd= "-source >" in your .vimrc.
<
For example, if your system has elinks, and you'd rather see the
page using an attempt at rendering the text, you may wish to have >
let g:netrw_http_xcmd= "-dump >"
< in your .vimrc.
READING *netrw-read* *netrw-nread* {{{2
@ -259,8 +281,8 @@ DIRECTORY LISTING *netrw-dirlist* {{{2
: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).
"/" is necessary (the slash tells netrw to treat the argument as a
directory to browse instead of a file to download).
However, the Nread command can also be used to accomplish this:
@ -293,8 +315,17 @@ preferences. One way to look at them is via the command :NetrwSettings (see
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 )
*b:netrw_lastfile* last file Network-read/written retained on a
per-buffer basis (supports plain :Nw )
*g:netrw_chgwin* specifies a window number where file edits will take
place. (also see |netrw-C|)
(default) not defined
*g:Netrw_funcref* specifies a function to be called when netrw edits
a file. The file is first edited, and then the
function reference (|Funcref|) is called.
(default) not defined
*g:netrw_ftp* if it doesn't exist, use default ftp
=0 use default ftp (uid password)
@ -303,7 +334,7 @@ settings are described below, in |netrw-browser-options|, and in
value of this variable to see if the alternate ftp
method works for your setup.
*g:netrw_extracmd* default: doesn't exist
*g:netrw_ftpextracmd* default: doesn't exist
If this variable exists, then any string it contains
will be placed into the commands set to your ftp
client. As an example:
@ -323,8 +354,8 @@ settings are described below, in |netrw-browser-options|, and in
*g:netrw_nogx* if this variable exists, then the "gx" map will not
be available (see |netrw-gx|)
*g:netrw_uid* (ftp) user-id, retained on a per-session basis
*s:netrw_passwd* (ftp) password, retained on a per-session basis
*g:netrw_uid* (ftp) user-id, retained on a per-vim-session basis
*s:netrw_passwd* (ftp) password, retained on a per-vim-session basis
*g:netrw_preview* =0 (default) preview window shown in a horizontally
split window
@ -335,6 +366,13 @@ settings are described below, in |netrw-browser-options|, and in
*g:netrw_scpport* = "-P" : option to use to set port for scp
*g:netrw_sshport* = "-p" : option to use to set port for ssh
*g:netrw_sepchr* =\0xff
=\0x01 for enc == euc-jp (and perhaps it should be for
others, too, please let me
know)
Separates priority codes from filenames internally.
See |netrw-p12|.
*g:netrw_silent* =0 : transfers done normally
=1 : transfers done silently
@ -398,6 +436,30 @@ series of commands (typically ftp) which it issues to an external program
from/written to a temporary file (under Unix/Linux, /tmp/...) which the
<netrw.vim> script will clean up.
Now, a word about Jan Minář's "FTP User Name and Password Disclosure"; first,
ftp is not a secure protocol. User names and passwords are transmitted "in
the clear" over the internet; any snooper tool can pick these up; this is not
a netrw thing, this is a ftp thing. If you're concerned about this, please
try to use scp or sftp instead.
Netrw re-uses the user id and password during the same vim session and so long
as the remote hostname remains the same.
Jan seems to be a bit confused about how netrw handles ftp; normally multiple
commands are performed in a "ftp session", and he seems to feel that the
uid/password should only be retained over one ftp session. However, netrw
does every ftp operation in a separate "ftp session"; so remembering the
uid/password for just one "ftp session" would be the same as not remembering
the uid/password at all. IMHO this would rapidly grow tiresome as one
browsed remote directories, for example.
On the other hand, thanks go to Jan M. for pointing out the many
vulnerabilities that netrw (and vim itself) had had in handling "crafted"
filenames. The |shellescape()| and |fnameescape()| functions were written in
response by Bram Moolenaar to handle these sort of problems, and netrw has
been modified to use them. Still, my advice is, if the "filename" looks like
a vim command that you aren't comfortable with having executed, don't open it.
*netrw-putty* *netrw-pscp* *netrw-psftp*
One may modify any protocol's implementing external application by setting a
variable (ex. scp uses the variable g:netrw_scp_cmd, which is defaulted to
@ -414,8 +476,8 @@ file). Thus, concerned users may decide to write a NetReadFixup() function
that will clean up after reading with their ftp. Some Unix systems (ie.,
FreeBSD) provide a utility called "fetch" which uses the ftp protocol but is
not noisy and more convenient, actually, for <netrw.vim> to use.
Consequently, if "fetch" is executable, it will be used to do reads for
ftp://... (and http://...) . See |netrw-var| for more about this.
Consequently, if "fetch" is available (ie. executable), it may be preferable
to use it for ftp://... based transfers.
For rcp, scp, sftp, and http, one may use network-oriented file transfers
transparently; ie.
@ -423,7 +485,7 @@ transparently; ie.
vim rcp://[user@]machine/path
vim scp://[user@]machine/path
<
If your ftp supports <.netrc>, then it too can be just as transparently used
If your ftp supports <.netrc>, then it too can be transparently used
if the needed triad of machine name, user id, and password are present in
that file. Your ftp must be able to use the <.netrc> file on its own, however.
>
@ -586,9 +648,8 @@ below, a {netfile} is an url to a remote file.
:[range]Nw[rite] {netfile} [{netfile}]...
Write the specified lines to the {netfile}.
:Nr[ead] Read the specified lines into the current
buffer from the file specified in
b:netrw_lastfile.
:Nr[ead] Read the lines from the file specified in b:netrw_lastfile
into the current buffer.
:Nr[ead] {netfile} {netfile}...
Read the {netfile} after the current line.
@ -651,12 +712,9 @@ set in the user's <.vimrc> file: (see also |netrw-settings| |netrw-protocol|)
to be ignored.
b:netrw_lastfile Holds latest method/machine/path.
b:netrw_line Holds current line number (during NetWrite)
g:netrw_passwd Holds current password for ftp.
g:netrw_silent =0 transfers done normally
=1 transfers done silently
g:netrw_uid Holds current user-id for ftp.
=1 use alternate ftp (user uid password)
(see |netrw-options|)
g:netrw_use_nt_rcp =0 don't use WinNT/2K/XP's rcp (default)
=1 use WinNT/2K/XP's rcp, binary mode
g:netrw_win95ftp =0 use unix-style ftp even if win95/98/ME/etc
@ -672,9 +730,10 @@ temporarily.
Variable Meaning
-------- ------------------------------------
<
g:netrw_method Index indicating rcp/ftp+.netrc/ftp
b:netrw_method Index indicating rcp/ftp+.netrc/ftp
w:netrw_method (same as b:netrw_method)
g:netrw_machine Holds machine name parsed from input
g:netrw_fname Holds filename being accessed >
b:netrw_fname Holds filename being accessed >
------------------------------------------------------------
<
*netrw-protocol*
@ -764,7 +823,7 @@ renders the server treatment as "trusted".
*netrw-fixup* *netreadfixup*
If your ftp for whatever reason generates unwanted lines (such as AUTH
messages) you may write a NetReadFixup(tmpfile) function:
messages) you may write a NetReadFixup() function:
>
function! NetReadFixup(method,line1,line2)
" a:line1: first new line in current file
@ -801,7 +860,7 @@ itself:
==============================================================================
9. Browsing *netrw-browsing* *netrw-browse* *netrw-help* {{{1
*netrw-browser* *netrw-dir* *netrw-list*
*netrw-browser* *netrw-dir* *netrw-list*
INTRODUCTION TO BROWSING *netrw-intro-browse* {{{2
(Quick References: |netrw-quickmaps| |netrw-quickcoms|)
@ -837,7 +896,7 @@ where [protocol] is typically scp or ftp. As an example, try: >
vim ftp://ftp.home.vim.org/pub/vim/
<
For local directories, the trailing slash is not required. Again, because its
For local directories, the trailing slash is not required. Again, because it's
easy to miss: to browse remote directories, the url must terminate with a
slash!
@ -849,6 +908,7 @@ There are several things you can do to affect the browser's display of files:
* To change the listing style, press the "i" key (|netrw-i|).
Currently there are four styles: thin, long, wide, and tree.
To make that change "permanent", see |g:netrw_liststyle|.
* To hide files (don't want to see those xyz~ files anymore?) see
|netrw-ctrl-h|.
@ -857,6 +917,18 @@ There are several things you can do to affect the browser's display of files:
See |netrw-browse-cmds| for all the things you can do with netrw!
*netrw-getftype* *netrw-filigree* *netrw-ftype*
The |getftype()| function is used to append a bit of filigree to indicate
filetype to locally listed files:
directory : /
executable : *
fifo : |
links : @
sockets : =
The filigree also affects the |g:netrw_sort_sequence|.
QUICK HELP *netrw-quickhelp* {{{2
(Use ctrl-] to select a topic)~
@ -895,11 +967,11 @@ QUICK REFERENCE: MAPS *netrw-browse-maps* {{{2
hiding (suppress display of files matching g:netrw_list_hide)
showing (display only files which match g:netrw_list_hide)
c Make browsing directory the current directory |netrw-c|
C Setting the editing window |netrw-C|
d Make a directory |netrw-d|
D Attempt to remove the file(s)/directory(ies) |netrw-D|
gb Go to previous bookmarked directory |netrw-gb|
gh Quick hide/unhide of dot-files |netrw-gh|
gi Display information on file |netrw-qf|
<c-h> Edit file hiding list |netrw-ctrl-h|
i Cycle between thin, long, wide, and tree listings |netrw-i|
<c-l> Causes Netrw to refresh the directory listing |netrw-ctrl-l|
@ -911,18 +983,19 @@ QUICK REFERENCE: MAPS *netrw-browse-maps* {{{2
mh Toggle marked file suffices' presence on hiding list |netrw-mh|
mm Move marked files to marked-file target directory |netrw-mm|
mp Print marked files |netrw-mp|
mr Mark files satisfying a |regexp| |netrw-mr|
mr Mark files satisfying a shell-style |regexp| |netrw-mr|
mt Current browsing directory becomes markfile target |netrw-mt|
mT Apply ctags to marked files |netrw-mT|
mu Unmark all marked files |netrw-mu|
mx Apply arbitrary shell command to marked files |netrw-mx|
mz Compress/decompress marked files |netrw-mz|
o Enter the file/directory under the cursor in a new |netrw-o|
browser window. A horizontal split is used.
browser window. A horizontal split is used.
O Obtain a file specified by cursor |netrw-O|
p Preview the file |netrw-p|
P Browse in the previously used window |netrw-P|
q List bookmarked directories and history |netrw-qb|
qb List bookmarked directories and history |netrw-qb|
qf Display information on file |netrw-qf|
r Reverse sorting order |netrw-r|
R Rename the designed file(s)/directory(ies) |netrw-R|
s Select sorting style: by name, time, or file size |netrw-s|
@ -931,11 +1004,12 @@ QUICK REFERENCE: MAPS *netrw-browse-maps* {{{2
u Change to recently-visited directory |netrw-u|
U Change to subsequently-visited directory |netrw-U|
v Enter the file/directory under the cursor in a new |netrw-v|
browser window. A vertical split is used.
browser window. A vertical split is used.
x View file with an associated program |netrw-x|
% Open a new file in netrw's current directory |netrw-%|
*netrw-mouse* *netrw-leftmouse* *netrw-middlemouse* *netrw-rightmouse*
<leftmouse> (gvim only) selects word under mouse as if a <cr>
had been pressed (ie. edit file, change directory)
<middlemouse> (gvim only) same as P selecting word under mouse;
@ -970,7 +1044,7 @@ One may easily "bookmark" a directory by using >
mb
<
Bookmarks are retained in between sesions in a $HOME/.netrwbook file, and are
Bookmarks are retained in between sessions in a $HOME/.netrwbook file, and are
kept in sorted order.
Related Topics:
@ -984,7 +1058,7 @@ BROWSING *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.
Directories will themselves be listed, and files will be opened using the
protocol given in the original read request.
protocol given in the original read request.
CAVEAT: There are four forms of listing (see |netrw-i|). Netrw assumes that
two or more spaces delimit filenames and directory names for the long and
@ -999,8 +1073,8 @@ horizontally or vertically, respectively. When the option is set to three, a
<cr> will cause the file to appear in a new tab.
When using the gui (gvim) one may select a file by pressing the <leftmouse>
button. In addtion, if
When using the gui (gvim), one may select a file by pressing the <leftmouse>
button. In addition, if
*|g:netrw_retmap| == 1 AND (its default value is 0)
* in a netrw-selected file, AND
@ -1041,19 +1115,19 @@ new window and cursor at the bottom, have
let g:netrw_alto = 1
in your <.vimrc>. (also see |netrw-t| |netrw-v|)
There is only one tree listing buffer; using "o" on a displayed subdirectory
will split the screen, but the same buffer will be shown twice.
in your <.vimrc>. (also see |netrw-t| |netrw-T| |netrw-v|)
Associated setting variables: |g:netrw_alto| |g:netrw_winsize|
BROWSING WITH A NEW TAB *netrw-t* {{{2
BROWSING WITH A NEW TAB *netrw-t* *netrw-T* {{{2
Normally one enters a file or directory using the <cr>. The "t" map
allows one to open a new window hold the new directory listing or file in a
new tab. (also see: |netrw-o| |netrw-v|)
allows one to open a new window holding the new directory listing or file in
a new tab. The "T" version puts the file or directory into a background tab
(see |gT|)
Related actions: |netrw-o| |netrw-v|
BROWSING WITH A VERTICALLY SPLIT WINDOW *netrw-v* {{{2
@ -1068,18 +1142,19 @@ window and cursor at the right, have
let g:netrw_altv = 1
in your <.vimrc>. (also see: |netrw-o| |netrw-t|)
in your <.vimrc>. (also see: |netrw-o| |netrw-t| |netrw-T|)
There is only one tree listing buffer; using "v" on a displayed subdirectory
There is only one tree listing buffer; using "v" on a displayed subdirectory
will split the screen, but the same buffer will be shown twice.
Associated setting variable: |g:netrw_altv| |g:netrw_winsize|
CHANGE LISTING STYLE *netrw-i* {{{2
CHANGE LISTING STYLE (THIN LONG WIDE TREE) *netrw-i* {{{2
The "i" map cycles between the thin, long, wide, and tree listing formats.
The short listing format gives just the files' and directories' names.
The thin listing format gives just the files' and directories' names.
The long listing is either based on the "ls" command via ssh for remote
directories or displays the filename, file size (in bytes), and the time and
@ -1095,13 +1170,23 @@ This listing format is the most compact.
The tree listing format has a top directory followed by files and directories
preceded by a "|". One may open and close directories by pressing the <cr>
key while atop the directory name. There is only one tree listing buffer;
hence, using "v" or "o" on a subdirectory will only show the same buffer,
twice.
key while atop the directory name.
One may make a preferred listing style your default; see |g:netrw_liststyle|.
As an example, by putting the following line in your .vimrc, >
let g:netrw_liststyle= 4
the tree style will become your default listing style.
Associated setting variables: |g:netrw_liststyle| |g:netrw_maxfilenamelen|
|g:netrw_timefmt| |g:netrw_list_cmd|
CHANGE FILE PERMISSION *netrw-gp* {{{2
"gp" will ask you for a new permission for the file named under the cursor.
Currently, this only works for local files.
Associated setting variables: |g:netrw_chgperm|
CHANGING TO A BOOKMARKED DIRECTORY *netrw-gb* {{{2
@ -1113,7 +1198,7 @@ Any count may be used to reference any of the bookmarks.
Related Topics:
|netrw-mB| how to delete bookmarks
|netrw-mb| how to return to a bookmark
|netrw-mb| how to make a bookmark
|netrw-qb| how to list bookmarks
@ -1169,7 +1254,7 @@ Netrw determines which special handler by the following method:
If g:netrw_browsex_viewer == '-', then netrwFileHandler() will be
invoked first (see |netrw_filehandler|).
* for Windows 32 or 64, the url and FileProtocolHandler dlls are used.
* for Windows 32 or 64, the url and FileProtocolHandler dlls are used.
* for Gnome (with gnome-open): gnome-open is used.
* for KDE (with kfmclient) : kfmclient is used.
* for Mac OS X : open is used.
@ -1189,7 +1274,7 @@ the handler function must exist for it to be called!
NFH_html("scp://user@host/some/path/mypgm.html")
<
Users may write their own netrw File Handler functions to support more
suffixes with special handling. See <plugin/netrwFileHandlers.vim> for
suffixes with special handling. See <autoload/netrwFileHandlers.vim> for
examples on how to make file handler functions. As an example: >
" NFH_suffix(filename)
@ -1203,11 +1288,11 @@ characters (except for the underscore) in them. To support suffices that
contain such characters, netrw will first convert the suffix using the
following table: >
@ -> AT ! -> EXCLAMATION % -> PERCENT
: -> COLON = -> EQUAL ? -> QUESTION
@ -> AT ! -> EXCLAMATION % -> PERCENT
: -> COLON = -> EQUAL ? -> QUESTION
, -> COMMA - -> MINUS ; -> SEMICOLON
$ -> DOLLAR + -> PLUS ~ -> TILDE
<
$ -> DOLLAR + -> PLUS ~ -> TILDE
<
So, for example: >
file.rcs,v -> NFH_rcsCOMMAv()
@ -1272,12 +1357,12 @@ Associated setting variable: |g:netrw_local_rmdir| |g:netrw_rm_cmd|
*netrw-rexplore* *netrw-sexplore* *netrw-texplore* *netrw-vexplore*
DIRECTORY EXPLORATION COMMANDS {{{2
:[N]Explore[!] [dir]... Explore directory of current file *:Explore*
:[N]Hexplore[!] [dir]... Horizontal Split & Explore *:Hexplore*
:Rexplore ... Return to Explorer *:Rexplore*
:[N]Sexplore[!] [dir]... Split&Explore current file's directory*:Sexplore*
:Texplore [dir]... Tab & Explore *:Texplore*
:[N]Vexplore[!] [dir]... Vertical Split & Explore *:Vexplore*
:[N]Explore[!] [dir]... Explore directory of current file *:Explore*
:[N]Hexplore[!] [dir]... Horizontal Split & Explore *:Hexplore*
:Rexplore ... Return to Explorer *:Rexplore*
:[N]Sexplore[!] [dir]... Split&Explore current file's directory *:Sexplore*
:Texplore [dir]... Tab & Explore *:Texplore*
:[N]Vexplore[!] [dir]... Vertical Split & Explore *:Vexplore*
Used with :Explore **/pattern : (also see |netrw-starstar|)
:Nexplore............. go to next matching file *:Nexplore*
@ -1312,8 +1397,8 @@ windows should have.
:Rexplore This command is a little different from the others. When one
edits a file, for example by pressing <cr> when atop a file in
a netrw browser window, :Rexplore will return the display to
that of the last netrw browser window. Its a command version
of <2-leftmouse> (which is only available under gvim and
that of the last netrw browser window. It is a command version
of the <2-leftmouse> map (which is only available under gvim and
cooperative terms).
@ -1326,11 +1411,11 @@ the request. >
*/filepat files in current directory which satisfy filepat
**/filepat files in current directory or below which satisfy the
file pattern
file pattern
*//pattern files in the current directory which contain the
pattern (vimgrep is used)
pattern (vimgrep is used)
**//pattern files in the current directory or below which contain
the pattern (vimgrep is used)
the pattern (vimgrep is used)
<
The cursor will be placed on the first file in the list. One may then
continue to go to subsequent files on that list via |:Nexplore| or to
@ -1383,6 +1468,18 @@ be the only ones displayed (see |netrw-a|).
The "gh" mapping (see |netrw-gh|) quickly alternates between the usual
hiding list and the hiding of files or directories that begin with ".".
As an example, >
let g:netrw_list_hide= '\(^\|\s\s\)\zs\.\S\+'
Effectively, this makes the effect of a |netrw-gh| command the initial setting.
What it means:
\(^\|\s\s\) : if the line begins with the following, -or-
two consecutive spaces are encountered
\zs : start the hiding match now
\. : if it now begins with a dot
\S\+ : and is followed by one or more non-whitespace
characters
Associated setting variables: |g:netrw_hide| |g:netrw_list_hide|
Associated topics: |netrw-a| |netrw-gh| |netrw-mh|
@ -1393,7 +1490,12 @@ When "Sorted by" is name, one may specify priority via the sorting sequence
(g:netrw_sort_sequence). The sorting sequence typically prioritizes the
name-listing by suffix, although any pattern will do. Patterns are delimited
by commas. The default sorting sequence is (all one line):
>
For Unix: >
'[\/]$,\<core\%(\.\d\+\)\=,\.[a-np-z]$,\.h$,\.c$,\.cpp$,*,\.o$,\.obj$,
\.info$,\.swp$,\.bak$,\~$'
<
Otherwise: >
'[\/]$,\.[a-np-z]$,\.h$,\.c$,\.cpp$,*,\.o$,\.obj$,\.info$,
\.swp$,\.bak$,\~$'
<
@ -1632,10 +1734,11 @@ MARKING FILES BY REGULAR EXPRESSION *netrw-mr* {{{2
(also see |netrw-mf|)
One may also mark files by pressing "mr"; netrw will then issue a prompt,
"Enter regexp: ". You may then enter a regular expression such as \.c$ .
All files in the current directory will then be marked. Note that the
regular expressions are vim-style |regexp| ones, not shell ones. So
entering *.c probably isn't what you want!
"Enter regexp: ". You may then enter a shell-style regular expression such
as *.c$ (see |glob()|). For remote systems, glob() doesn't work -- so netrw
converts "*" into ".*" (see |regexp|) and marks files based on that. In the
future I may make it possible to use |regexp|s instead of glob()-style
expressions (yet-another-option).
MARKED FILES: ARBITRARY COMMAND *netrw-mx* {{{2
@ -1718,7 +1821,7 @@ MARKED FILES: MOVING *netrw-mm* {{{2
first or do the copy and then delete yourself using mc and D.
Use at your own risk!
Select a target directory with mT (|netrw-mt|). Then change directory,
Select a target directory with mt (|netrw-mt|). Then change directory,
select file(s) (see |netrw-mf|), and press "mm".
Associated setting variable: |g:netrw_localmovecmd| |g:netrw_ssh_cmd|
@ -1743,7 +1846,7 @@ 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
The "mT" mapping will apply the command in |g:netrw_ctags| (by default, it is
"ctags") to marked files. For remote browsing, in order to create a tags file
netrw will use ssh (see |g:netrw_ssh_cmd|), and so ssh must be available for
this to work on remote systems. For your local system, see |ctags| on how to
@ -1791,7 +1894,7 @@ The "mu" mapping will unmark all currently marked files.
NETRW BROWSER VARIABLES *netrw-browser-options* *netrw-browser-var* {{{2
(if you're interestd in the netrw file transfer settings, see |netrw-options|)
(if you're interested in the netrw file transfer settings, see |netrw-options|)
The <netrw.vim> browser provides settings in the form of variables which
you may modify; by placing these settings in your <.vimrc>, you may customize
@ -1808,12 +1911,21 @@ your browsing preferences. (see also: |netrw-settings|)
by setting this variable (see |netrw-v|)
default: =&spr (see |'spr'|)
*g:netrw_banner* enable/suppress the banner
=0: suppress the banner
=1: banner is enabled (default)
NOTE: suppressing the banner is a new feature
which may cause problems.
*g:netrw_browse_split* when browsing, <cr> will open the file by:
=0: re-using the same window
=1: horizontally splitting the window first
=2: vertically splitting the window first
=1: horizontally splitting the window first
=2: vertically splitting the window first
=3: open file in new tab
=4: act like "P" (ie. open previous window)
Note that |g:netrw_preview| may be used
to get vertical splitting instead of
horizontal splitting.
*g:netrw_browsex_viewer* specify user's preference for a viewer: >
"kfmclient exec"
@ -1824,6 +1936,10 @@ your browsing preferences. (see also: |netrw-settings|)
a script/function to handle the given
extension. (see |netrw_filehandler|).
*g:netrw_chgperm* Unix/Linux: "chmod PERM FILENAME"
Windows: "cacls FILENAME /e /p PERM"
Used to change access permission for a file.
*g:netrw_compress* ="gzip"
Will compress marked files with this
command
@ -1836,10 +1952,10 @@ your browsing preferences. (see also: |netrw-settings|)
|g:netrw_liststyle| ==0 (thin listing) or
|g:netrw_liststyle| ==1 (long listing) or
|g:netrw_liststyle| ==3 (tree listing)
(ie. doesn't affect the wide listing)
=0: off
=2: like ==1, but the wide listing gets both
cursorline and |'cursorcolumn'|locally set
(ie. doesn't affect the wide listing)
*g:netrw_decompress* = { ".gz" : "gunzip" ,
".bz2" : "bunzip2" ,
@ -1873,7 +1989,7 @@ your browsing preferences. (see also: |netrw-settings|)
versus speed.
*g:netrw_fname_escape* =' ?&;%'
Used on filenames before remote reading/writing
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"
@ -1907,7 +2023,7 @@ your browsing preferences. (see also: |netrw-settings|)
otherwise "dir"
*g:netrw_glob_escape* ='[]*?`{~$'
These characters in directory names are
These characters in directory names are
escaped before applying glob()
*g:netrw_hide* if true, the hiding list is used
@ -1942,12 +2058,12 @@ your browsing preferences. (see also: |netrw-settings|)
default: ""
*g:netrw_localcopycmd* ="cp" Linux/Unix/MacOS/Cygwin
="copy" Windows
="copy" Windows
Copies marked files (|netrw-mf|) to target
directory (|netrw-mt|, |netrw-mc|)
*g:netrw_localmovecmd* ="mv" Linux/Unix/MacOS/Cygwin
="move" Windows
="move" Windows
Moves marked files (|netrw-mf|) to target
directory (|netrw-mt|, |netrw-mm|)
@ -1967,6 +2083,14 @@ your browsing preferences. (see also: |netrw-settings|)
*g:netrw_mkdir_cmd* command for making a remote directory
default: "ssh USEPORT HOSTNAME mkdir"
*g:netrw_mousemaps* =1 (default) enables the mouse buttons
while browsing:
leftmouse : open file/directory
shift-leftmouse : mark file
middlemouse : same as P
rightmouse : remove file/directory
=0: disables mouse maps
*g:netrw_retmap* if it exists and is set to one, then:
* if in a netrw-selected file, AND
* no normal-mode <2-leftmouse> mapping exists,
@ -2010,12 +2134,14 @@ your browsing preferences. (see also: |netrw-settings|)
< default: ""
*g:netrw_sort_sequence* when sorting by name, first sort by the
comma-separated pattern sequence
comma-separated pattern sequence. Note that
the filigree added to indicate filetypes
should be accounted for in your pattern.
default: '[\/]$,*,\.bak$,\.o$,\.h$,
\.info$,\.swp$,\.obj$'
*g:netrw_special_syntax* If true, then certain files will be shown
in special syntax in the browser:
in special syntax in the browser:
netrwBak : *.bak
netrwCompress: *.gz *.bz2 *.Z *.zip
@ -2050,7 +2176,7 @@ your browsing preferences. (see also: |netrw-settings|)
*g:netrw_tmpfile_escape* =' &;'
escape() is applied to all temporary files
escape() is applied to all temporary files
to escape these characters.
*g:netrw_timefmt* specify format string to vim's strftime().
@ -2064,7 +2190,7 @@ your browsing preferences. (see also: |netrw-settings|)
default: "%c"
*g:netrw_use_noswf* netrw normally avoids writing swapfiles
for browser buffers. However, under some
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
@ -2076,18 +2202,18 @@ your browsing preferences. (see also: |netrw-settings|)
|:Hexplore| or |:Vexplore|.
default: ""
*g:netrw_xstrlen* Controls how netrw computes a string
including multi-byte characters' string
*g:netrw_xstrlen* Controls how netrw computes string lengths,
including multi-byte characters' string
length. (thanks to N Weibull, T Mechelynck)
=0: uses Vim's built-in strlen()
=1: number of codepoints (Latin + a combining
=1: number of codepoints (Latin a + combining
circumflex is two codepoints) (DEFAULT)
=2: number of spacing codepoints (Latin a +
combining circumflex is one spacing
combining circumflex is one spacing
codepoint; a hard tab is one; wide and
narrow CJK are one each; etc.)
=3: virtual length (counting tabs as anything
between 1 and |'tabstop'|, wide CJJK as 2
between 1 and |'tabstop'|, wide CJK as 2
rather than 1, Arabic alif as zero when
immediately preceded by lam, one
otherwise, etc)
@ -2238,6 +2364,16 @@ Related topics: |netrw-r| |netrw-S|
Associated setting variables: |g:netrw_sort_by| |g:netrw_sort_sequence|
SETTING EDITING WINDOW *netrw-C* {{{2
One may select a netrw window for editing with the "C" mapping, or by setting
g:netrw_chgwin to the selected window number. Subsequent selection of a file
to edit (|netrw-cr|) will use that window.
Related topics: |netrw-cr|
Associated setting variables: |g:netrw_chgwin|
10. Problems and Fixes *netrw-problems* {{{1
(This section is likely to grow as I get feedback)
@ -2259,7 +2395,7 @@ Associated setting variables: |g:netrw_sort_by| |g:netrw_sort_sequence|
Windows' ftp has a minimal support for ls (ie. it doesn't
accept sorting options). It doesn't support the -F which
gives an explanatory character (ABC/ for "ABC is a directory").
Netrw then uses "dir" to get both its short and long listings.
Netrw then uses "dir" to get both its thin and long listings.
If you think your ftp does support a full-up ls, put the
following into your <.vimrc>: >
@ -2314,7 +2450,7 @@ Associated setting variables: |g:netrw_sort_by| |g:netrw_sort_sequence|
Put the following line in your |.vimrc|:
>
let g:netrw_keepdir= 0
<
<
*netrw-p7*
P7. I use Chinese (or other non-ascii) characters in my filenames, and
netrw (Explore, Sexplore, Hexplore, etc) doesn't display them!
@ -2342,7 +2478,7 @@ Associated setting variables: |g:netrw_sort_by| |g:netrw_sort_sequence|
(Marlin Unruh) This program also works for me. It's a single
executable, so he/she can copy it into the Windows\System32
folder and create a shortcut to it.
folder and create a shortcut to it.
(Dudley Fox) You might also wish to consider plink, as it
sounds most similar to what you are looking for. plink is an
@ -2350,12 +2486,12 @@ Associated setting variables: |g:netrw_sort_by| |g:netrw_sort_sequence|
http://the.earth.li/~sgtatham/putty/0.58/htmldoc/Chapter7.html#plink
(Vissale Neang) Maybe you can try OpenSSH for windows, which
(Vissale Neang) Maybe you can try OpenSSH for windows, which
can be obtained from:
http://sshwindows.sourceforge.net/
It doesn't need the full Cygwin package.
It doesn't need the full Cygwin package.
(Antoine Mechelynck) For individual Unix-like programs needed
for work in a native-Windows environment, I recommend getting
@ -2366,7 +2502,7 @@ Associated setting variables: |g:netrw_sort_by| |g:netrw_sort_sequence|
Unlike Cygwin, which sets up a Unix-like virtual machine on
top of Windows, GnuWin32 is a rewrite of Unix utilities with
Windows system calls, and its programs works quite well in the
cmd.exe "Dos box".
cmd.exe "Dos box".
(dave) Download WinSCP and use that to connect to the server.
In Preferences > Editors, set gvim as your editor:
@ -2393,7 +2529,7 @@ Associated setting variables: |g:netrw_sort_by| |g:netrw_sort_sequence|
How to use a private key with 'pscp': >
http://www.tartarus.org/~simon/puttydoc/Chapter5.html
5.2.4 Using public key authentication with PSCP
5.2.4 Using public key authentication with PSCP
<
(Ben Schmidt) I find the ssh included with cwRsync is
brilliant, and install cwRsync or cwRsyncServer on most
@ -2451,6 +2587,16 @@ Associated setting variables: |g:netrw_sort_by| |g:netrw_sort_sequence|
<leftmouse> in the browser window and then press the
<middlemouse> to select the file.
*netrw-p12*
P12. My directory isn't sorting correctly, or unwanted letters are
appearing in the listed filenames, or things aren't lining
up properly in the wide listing, ...
This may be due to an encoding problem. I myself usually use
utf-8, but really only use ascii (ie. bytes from 32-126).
Multibyte encodings use two (or more) bytes per character.
You may need to change |g:netrw_sepchr| and/or |g:netrw_xstrlen|.
==============================================================================
11. Debugging Netrw Itself *netrw-debug* {{{1
@ -2496,7 +2642,7 @@ which is loaded automatically at startup (assuming :set nocp).
read/write your file over the network in a separate tab.
To save the file, use >
:wincmd j
:tabnext
:set bt=
:w! DBG
< Please send that information to <netrw.vim>'s maintainer, >
@ -2505,6 +2651,57 @@ which is loaded automatically at startup (assuming :set nocp).
==============================================================================
12. History *netrw-history* {{{1
v136: Jan 14, 2009 * extended |g:Netrw_funcref| to also handle lists
of function references
Jan 14, 2009 * (reported by Marvin Renich) with spell check
enabled, some filenamess will still being
displayed as spelling errors.
Apr 13, 2009 * (Björn Winckler) writing a file using
remote scp caused syntax highlighting problem.
Solution: avoid syntax/syntax.vim's
au Filetype * syntax setting autocommand by
checking that the current buffer has the
netrw filetype before attempting a doau
in s:NetrwSafeOptions().
Apr 14, 2009 * (asgeo1) suggested the "T" map (|netrw-T|)
Apr 14, 2009 * marking wasn't working on executable and
other special filenames
Apr 20, 2009 * (Dennis Benzinger) files opened via http have
their syntax filetype auto-detected
Jun 19, 2009 * (Yukihiro Nakadaira) help document improvements
Jul 22, 2009 * g:netrw_browse_split will honor the
|'equalalways'| setting.
Jul 29, 2009 * implemented "I" mapping to toggle banner
(this is experimental and still being debugged)
Sep 19, 2009 * (Mike McEwan) writes via ftp now send both
g:netrw_ftpmode and g:netrw_ftpextracmd (if the
latter exists)
Dec 02, 2009 * netrw uses vimgrep several places; it now uses
"noautocmd vimgrep" (should be speedier).
Dec 03, 2009 * changed back to using -source instead of -dump
for elinks-using commands. (requested by James
Vega and Karsten Hopp)
v135: Oct 29, 2008 * using |simplify()| on directory names
(supporting handling ".."s in directory names)
Oct 31, 2008 * added special file highlighting for core dumps
under Unix/Linux. The default sorting sequence
now also gives core dumps priority.
Nov 10, 2008 * uses a call to netrw#Nread() instead of Nread
to avoid having to use fnameescape()
* fixed a tree redrawing problem (open directory,
open subdir, close subdir, close dir)
Nov 19, 2008 * sprinkled some histdel("/",-1)s through the code
in an attempt to prevent netrw from changing
the search history.
Jan 02, 2009 * |g:Netrw_funcref| included
Jan 05, 2009 * Explore */ **/ *// **// all clear explorer
variables
Jan 05, 2009 * (Panagiotis Louridas) extended s:WinPath()
to remove cygdrive from non-cygwin Windows
paths. Improved the determination as to
whether or not to do so.
Jan 13, 2009 * included contains=@NoSpell in every syntax
group for syntax/netrw.vim .
v134: Sep 30, 2008 * (Sander Marechal) provided a bugfix involving
the use of the |netrw-t| command with a remote
directory.
@ -2656,8 +2853,8 @@ which is loaded automatically at startup (assuming :set nocp).
* executable files now displayed with trailing (*)
* symbolically linked files now displayed with
trailing (@)
* Somewhen, s:NetrwMarkFileMove() got damaged. Its
now restored (missing an endif, for example).
* Somewhen, s:NetrwMarkFileMove() got damaged. It
* is now restored (missing an endif, for example).
* |netrw-mu| implemented (unmarking marked files)
* many bugs have been removed from the marked file
system (tnx to Mark S. for feedback)
@ -2728,7 +2925,7 @@ which is loaded automatically at startup (assuming :set nocp).
the end of the s:NetrwBrowseChgDir() function;
they're now at the end of every if..elseif..else
block. The edit-a-file one is not quite at the end
of its block; instead, its just before the edit.
of its block; instead, it's just before the edit.
Restores user options, then this new placement
allows ftplugins, autocmds, etc to change settings
(ex. ftplugin/cpp.vim sets cindent).
@ -2765,7 +2962,7 @@ which is loaded automatically at startup (assuming :set nocp).
marked files.
v110: May 10, 2007 * added [ and ] maps to NetrwTreeListing
May 25, 2007 * |g:netrw_preview| included
May 29, 2007 * modifed netrw#NetBrowseX to consistently use
May 29, 2007 * modified netrw#NetBrowseX to consistently use
g:netrw_shq instead of hardcoded quotes,
and modified the snippet that sets up redir
so Windows machines use "nul" instead of
@ -2781,7 +2978,7 @@ which is loaded automatically at startup (assuming :set nocp).
decipher the name.
May 07, 2007 * g:netrw_use_errorwindow now allows one to
have error messages go to a reliable window
or to use a less reliable but recallable
or to use a less reliable but recallable
echoerr method
May 07, 2007 * g:netrw_scpport and g:netrw_sshport support
use of -P and -p, respectively, to set port
@ -3226,7 +3423,16 @@ which is loaded automatically at startup (assuming :set nocp).
==============================================================================
12. Credits *netrw-credits* {{{1
13. Todo *netrw-todo* {{{1
07/29/09 : banner :|g:netrw_banner| can be used to suppress the
suppression banner. This feature is new and experimental,
so its in the process of being debugged.
09/04/09 : "gp" : See if it can be made to work for remote systems.
: See if it can be made to work with marked files.
==============================================================================
14. Credits *netrw-credits* {{{1
Vim editor by Bram Moolenaar (Thanks, Bram!)
dav support by C Campbell

View File

@ -1,4 +1,4 @@
*pi_vimball.txt* For Vim version 7.1. Last change: 2008 May 30
*pi_vimball.txt* For Vim version 7.2. Last change: 2009 Dec 28
----------------
Vimball Archiver
@ -6,7 +6,7 @@
Author: Charles E. Campbell, Jr. <NdrOchip@ScampbellPfamily.AbizM>
(remove NOSPAM from Campbell's email first)
Copyright: (c) 2004-2008 by Charles E. Campbell, Jr. *Vimball-copyright*
Copyright: (c) 2004-2009 by Charles E. Campbell, Jr. *Vimball-copyright*
The VIM LICENSE applies to Vimball.vim, and Vimball.txt
(see |copyright|) except use "Vimball" instead of "Vim".
No warranty, express or implied.
@ -55,7 +55,7 @@ Copyright: (c) 2004-2008 by Charles E. Campbell, Jr. *Vimball-copyright*
==============================================================================
3. Vimball Manual *vimball-manual*
*:MkVimball*
MAKING A VIMBALL *:MkVimball*
:[range]MkVimball[!] filename [path]
The range is composed of lines holding paths to files to be included
@ -79,29 +79,34 @@ Copyright: (c) 2004-2008 by Charles E. Campbell, Jr. *Vimball-copyright*
"filename.vba" file, overwriting it if it already exists. This
behavior resembles that for |:w|.
*g:vimball_mkdir*
If you wish to force slashes into the filename, that can also be done
by using the exclamation mark (ie. :MkVimball! path/filename).
The tip at http://vim.wikia.com/wiki/Using_VimBall_with_%27Make%27
has a good idea on how to automate the production of vimballs using
make.
MAKING DIRECTORIES VIA VIMBALLS *g:vimball_mkdir*
First, the |mkdir()| command is tried (not all systems support it).
If it doesn't exist, then g:vimball_mkdir doesn't exist, it is set to:
If it doesn't exist, then if g:vimball_mkdir doesn't exist, it is set
as follows: >
|g:netrw_local_mkdir|, if it exists
"mkdir", if it is executable
"makedir", if it is executable
Otherwise, it is undefined.
One may explicitly specify the directory making command using
"mkdir" , if it is executable
"makedir" , if it is executable
Otherwise , it is undefined.
< One may explicitly specify the directory making command using
g:vimball_mkdir. This command is used to make directories that
are needed as indicated by the vimball.
*g:vimball_home*
CONTROLLING THE VIMBALL EXTRACTION DIRECTORY *g:vimball_home*
You may override the use of the |'runtimepath'| by specifying a
variable, g:vimball_home.
Path Preprocessing *g:vimball_path_escape*
Paths used in vimball are preprocessed by s:Path(); in addition,
certain characters are escaped (by prepending a backslash). The
characters are in g:vimball_path_escape, and may be overridden by
the user in his/her .vimrc initialization script.
*vimball-extract*
vim filename.vba
@ -112,12 +117,16 @@ Copyright: (c) 2004-2008 by Charles E. Campbell, Jr. *Vimball-copyright*
file holds the "Vimball Archiver by Charles E. Campbell, Jr., Ph.D."
line.
:VimballList *:VimballList*
LISTING FILES IN A VIMBALL *:VimballList*
:VimballList
This command will tell Vimball to list the files in the archive, along
with their lengths in lines.
:UseVimball [path] *:UseVimball*
MANUALLY INVOKING VIMBALL EXTRACTION *:UseVimball*
:UseVimball [path]
This command is contained within the vimball itself; it invokes the
vimball#Vimball() routine which is responsible for unpacking the
@ -126,7 +135,9 @@ Copyright: (c) 2004-2008 by Charles E. Campbell, Jr. *Vimball-copyright*
installation, thereby overriding the automatic choice of the first
existing directory on the |'runtimepath'|.
:RmVimball vimballfile [path] *:RmVimball*
REMOVING A VIMBALL *:RmVimball*
:RmVimball vimballfile [path]
This command removes all files generated by the specified vimball
(but not any directories it may have made). One may choose a path
@ -136,10 +147,29 @@ Copyright: (c) 2004-2008 by Charles E. Campbell, Jr. *Vimball-copyright*
containing a record of what files need to be removed for all vimballs
used thus far.
PREVENTING LOADING
If for some reason you don't want to be able to extract plugins
using vimballs: you may prevent the loading of vimball.vim by
putting the following two variables in your <.vimrc>: >
let g:loaded_vimballPlugin= 1
let g:loaded_vimball = 1
<
==============================================================================
4. Vimball History *vimball-history* {{{1
30 : Dec 08, 2008 * fnameescape() inserted to protect error
messaging using corrupted filenames from
causing problems
* RmVimball supports filenames that would
otherwise be considered to have "magic"
characters (ie. Abc[1].vba)
Feb 18, 2009 * s:Escape(), g:vimball_shq, and g:netrw_shq
removed (shellescape() used directly)
Oct 05, 2009 * (Nikolai Weibull) suggested that MkVimball
be allowed to use slashes in the filename.
26 : May 27, 2008 * g:vimball_mkdir usage installed. Makes the
$HOME/.vim (or $HOME\vimfiles) directory if
necessary.
@ -164,7 +194,7 @@ Copyright: (c) 2004-2008 by Charles E. Campbell, Jr. *Vimball-copyright*
will extract plugin/somefile to the AsNeeded/
directory
17 : Jun 28, 2006 * changes all \s to /s internally for Windows
16 : Jun 15, 2006 * A. Mechylynck's idea to allow users to specify
16 : Jun 15, 2006 * A. Mechelynck's idea to allow users to specify
installation root paths implemented for
UseVimball, MkVimball, and RmVimball.
* RmVimball implemented

View File

@ -1,12 +1,3 @@
:CVSEdit vcscommand.txt /*:CVSEdit*
:CVSEditors vcscommand.txt /*:CVSEditors*
:CVSUnedit vcscommand.txt /*:CVSUnedit*
:CVSWatch vcscommand.txt /*:CVSWatch*
:CVSWatchAdd vcscommand.txt /*:CVSWatchAdd*
:CVSWatchOff vcscommand.txt /*:CVSWatchOff*
:CVSWatchOn vcscommand.txt /*:CVSWatchOn*
:CVSWatchRemove vcscommand.txt /*:CVSWatchRemove*
:CVSWatchers vcscommand.txt /*:CVSWatchers*
:Explore pi_netrw.txt /*:Explore*
:GLVS pi_getscript.txt /*:GLVS*
:GetLatestVimScripts_dat pi_getscript.txt /*:GetLatestVimScripts_dat*
@ -40,6 +31,7 @@
:RmVimball pi_vimball.txt /*:RmVimball*
:Search MultipleSearch.txt /*:Search*
:SearchBuffers MultipleSearch.txt /*:SearchBuffers*
:Sexplore pi_netrw.txt /*:Sexplore*
:TComment tComment.txt /*:TComment*
:TCommentAs tComment.txt /*:TCommentAs*
:TCommentBlock tComment.txt /*:TCommentBlock*
@ -47,23 +39,6 @@
:TCommentRight tComment.txt /*:TCommentRight*
:Texplore pi_netrw.txt /*:Texplore*
:UseVimball pi_vimball.txt /*:UseVimball*
:VCSAdd vcscommand.txt /*:VCSAdd*
:VCSAnnotate vcscommand.txt /*:VCSAnnotate*
:VCSBlame vcscommand.txt /*:VCSBlame*
:VCSCommit vcscommand.txt /*:VCSCommit*
:VCSDelete vcscommand.txt /*:VCSDelete*
:VCSDiff vcscommand.txt /*:VCSDiff*
:VCSGotoOriginal vcscommand.txt /*:VCSGotoOriginal*
:VCSInfo vcscommand.txt /*:VCSInfo*
:VCSLock vcscommand.txt /*:VCSLock*
:VCSLog vcscommand.txt /*:VCSLog*
:VCSRemove vcscommand.txt /*:VCSRemove*
:VCSRevert vcscommand.txt /*:VCSRevert*
:VCSReview vcscommand.txt /*:VCSReview*
:VCSStatus vcscommand.txt /*:VCSStatus*
:VCSUnlock vcscommand.txt /*:VCSUnlock*
:VCSUpdate vcscommand.txt /*:VCSUpdate*
:VCSVimDiff vcscommand.txt /*:VCSVimDiff*
:Vexplore pi_netrw.txt /*:Vexplore*
:VimballList pi_vimball.txt /*:VimballList*
Align-copyright Align.txt /*Align-copyright*
@ -92,25 +67,6 @@ SRHiGrp SrchRplcHiGrp.txt /*SRHiGrp*
SRSearch SrchRplcHiGrp.txt /*SRSearch*
SrchRplcHiGrp.txt SrchRplcHiGrp.txt /*SrchRplcHiGrp.txt*
TCommentDefineType() tComment.txt /*TCommentDefineType()*
VCSCommandCVSDiffOpt vcscommand.txt /*VCSCommandCVSDiffOpt*
VCSCommandCVSExec vcscommand.txt /*VCSCommandCVSExec*
VCSCommandCommitOnWrite vcscommand.txt /*VCSCommandCommitOnWrite*
VCSCommandDeleteOnHide vcscommand.txt /*VCSCommandDeleteOnHide*
VCSCommandDiffSplit vcscommand.txt /*VCSCommandDiffSplit*
VCSCommandDisableAll vcscommand.txt /*VCSCommandDisableAll*
VCSCommandDisableExtensionMappings vcscommand.txt /*VCSCommandDisableExtensionMappings*
VCSCommandDisableMappings vcscommand.txt /*VCSCommandDisableMappings*
VCSCommandEdit vcscommand.txt /*VCSCommandEdit*
VCSCommandEnableBufferSetup vcscommand.txt /*VCSCommandEnableBufferSetup*
VCSCommandMapPrefix vcscommand.txt /*VCSCommandMapPrefix*
VCSCommandMappings vcscommand.txt /*VCSCommandMappings*
VCSCommandResultBufferNameExtension vcscommand.txt /*VCSCommandResultBufferNameExtension*
VCSCommandResultBufferNameFunction vcscommand.txt /*VCSCommandResultBufferNameFunction*
VCSCommandSVKExec vcscommand.txt /*VCSCommandSVKExec*
VCSCommandSVNDiffExt vcscommand.txt /*VCSCommandSVNDiffExt*
VCSCommandSVNDiffOpt vcscommand.txt /*VCSCommandSVNDiffOpt*
VCSCommandSVNExec vcscommand.txt /*VCSCommandSVNExec*
VCSCommandSplit vcscommand.txt /*VCSCommandSplit*
VimPdb.txt VimPdb.txt /*VimPdb.txt*
Vimball-copyright pi_vimball.txt /*Vimball-copyright*
[% matchit.txt /*[%*
@ -132,6 +88,7 @@ align-option Align.txt /*align-option*
align-options Align.txt /*align-options*
align-strlen Align.txt /*align-strlen*
align-usage Align.txt /*align-usage*
align-userguide Align.txt /*align-userguide*
align-utf Align.txt /*align-utf*
align-utf8 Align.txt /*align-utf8*
align.txt Align.txt /*align.txt*
@ -162,6 +119,8 @@ alignman Align.txt /*alignman*
alignmanual Align.txt /*alignmanual*
alignmap-Htd Align.txt /*alignmap-Htd*
alignmap-T= Align.txt /*alignmap-T=*
alignmap-Tsp Align.txt /*alignmap-Tsp*
alignmap-a( Align.txt /*alignmap-a(*
alignmap-a, Align.txt /*alignmap-a,*
alignmap-a< Align.txt /*alignmap-a<*
alignmap-a= Align.txt /*alignmap-a=*
@ -187,16 +146,15 @@ alignmap-t? Align.txt /*alignmap-t?*
alignmap-tab Align.txt /*alignmap-tab*
alignmap-tml Align.txt /*alignmap-tml*
alignmap-ts, Align.txt /*alignmap-ts,*
alignmap-ts: Align.txt /*alignmap-ts:*
alignmap-ts< Align.txt /*alignmap-ts<*
alignmap-ts= Align.txt /*alignmap-ts=*
alignmap-tsp Align.txt /*alignmap-tsp*
alignmap-tsq Align.txt /*alignmap-tsq*
alignmap-tt Align.txt /*alignmap-tt*
alignmap-t~ Align.txt /*alignmap-t~*
alignmaps Align.txt /*alignmaps*
alignusage Align.txt /*alignusage*
b:VCSCommandCommand vcscommand.txt /*b:VCSCommandCommand*
b:VCSCommandOriginalBuffer vcscommand.txt /*b:VCSCommandOriginalBuffer*
b:VCSCommandSourceFile vcscommand.txt /*b:VCSCommandSourceFile*
b:VCSCommandVCSType vcscommand.txt /*b:VCSCommandVCSType*
b:match_col matchit.txt /*b:match_col*
b:match_debug matchit.txt /*b:match_debug*
b:match_ignorecase matchit.txt /*b:match_ignorecase*
@ -1450,11 +1408,11 @@ crvdoc-licGPL crefvimdoc.txt /*crvdoc-licGPL*
crvdoc-licLGPL crefvimdoc.txt /*crvdoc-licLGPL*
crvdoc-limbugs crefvimdoc.txt /*crvdoc-limbugs*
crvdoc-usage crefvimdoc.txt /*crvdoc-usage*
cvscommand-changes vcscommand.txt /*cvscommand-changes*
dav pi_netrw.txt /*dav*
davs pi_netrw.txt /*davs*
drv-dtArrayInit crefvim.txt /*drv-dtArrayInit*
drv-dtIncompleteArrayDecl crefvim.txt /*drv-dtIncompleteArrayDecl*
editsrec.txt editsrec.txt /*editsrec.txt*
ex-visincr-I visincr.txt /*ex-visincr-I*
ex-visincr-IA visincr.txt /*ex-visincr-IA*
ex-visincr-ID visincr.txt /*ex-visincr-ID*
@ -1470,17 +1428,20 @@ g:MultipleSearchColorSequence MultipleSearch.txt /*g:MultipleSearchColorSequence
g:MultipleSearchMaxColors MultipleSearch.txt /*g:MultipleSearchMaxColors*
g:MultipleSearchTextColorSequence MultipleSearch.txt /*g:MultipleSearchTextColorSequence*
g:NetrwTopLvlMenu pi_netrw.txt /*g:NetrwTopLvlMenu*
g:Netrw_funcref pi_netrw.txt /*g:Netrw_funcref*
g:netrw_alto pi_netrw.txt /*g:netrw_alto*
g:netrw_altv pi_netrw.txt /*g:netrw_altv*
g:netrw_banner pi_netrw.txt /*g:netrw_banner*
g:netrw_browse_split pi_netrw.txt /*g:netrw_browse_split*
g:netrw_browsex_viewer pi_netrw.txt /*g:netrw_browsex_viewer*
g:netrw_chgperm pi_netrw.txt /*g:netrw_chgperm*
g:netrw_chgwin pi_netrw.txt /*g:netrw_chgwin*
g:netrw_compress pi_netrw.txt /*g:netrw_compress*
g:netrw_ctags pi_netrw.txt /*g:netrw_ctags*
g:netrw_cursorline pi_netrw.txt /*g:netrw_cursorline*
g:netrw_cygwin pi_netrw.txt /*g:netrw_cygwin*
g:netrw_dav_cmd pi_netrw.txt /*g:netrw_dav_cmd*
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*
@ -1490,6 +1451,7 @@ g:netrw_ftp_cmd pi_netrw.txt /*g:netrw_ftp_cmd*
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_ftpextracmd pi_netrw.txt /*g:netrw_ftpextracmd*
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*
@ -1508,6 +1470,7 @@ g:netrw_localmovecmd pi_netrw.txt /*g:netrw_localmovecmd*
g:netrw_maxfilenamelen pi_netrw.txt /*g:netrw_maxfilenamelen*
g:netrw_menu pi_netrw.txt /*g:netrw_menu*
g:netrw_mkdir_cmd pi_netrw.txt /*g:netrw_mkdir_cmd*
g:netrw_mousemaps pi_netrw.txt /*g:netrw_mousemaps*
g:netrw_nogx pi_netrw.txt /*g:netrw_nogx*
g:netrw_preview pi_netrw.txt /*g:netrw_preview*
g:netrw_rcp_cmd pi_netrw.txt /*g:netrw_rcp_cmd*
@ -1518,6 +1481,7 @@ g:netrw_rmf_cmd pi_netrw.txt /*g:netrw_rmf_cmd*
g:netrw_rsync_cmd pi_netrw.txt /*g:netrw_rsync_cmd*
g:netrw_scp_cmd pi_netrw.txt /*g:netrw_scp_cmd*
g:netrw_scpport pi_netrw.txt /*g:netrw_scpport*
g:netrw_sepchr pi_netrw.txt /*g:netrw_sepchr*
g:netrw_sftp_cmd pi_netrw.txt /*g:netrw_sftp_cmd*
g:netrw_silent pi_netrw.txt /*g:netrw_silent*
g:netrw_sort_by pi_netrw.txt /*g:netrw_sort_by*
@ -1544,7 +1508,6 @@ g:tcommentMapLeaderOp2 tComment.txt /*g:tcommentMapLeaderOp2*
g:tcommentOpModeExtra tComment.txt /*g:tcommentOpModeExtra*
g:vimball_home pi_vimball.txt /*g:vimball_home*
g:vimball_mkdir pi_vimball.txt /*g:vimball_mkdir*
g:vimball_path_escape pi_vimball.txt /*g:vimball_path_escape*
g:visincr_datedivset visincr.txt /*g:visincr_datedivset*
getlatestvimscripts-install pi_getscript.txt /*getlatestvimscripts-install*
getscript pi_getscript.txt /*getscript*
@ -1611,11 +1574,13 @@ netreadfixup pi_netrw.txt /*netreadfixup*
netrw pi_netrw.txt /*netrw*
netrw-% pi_netrw.txt /*netrw-%*
netrw-- pi_netrw.txt /*netrw--*
netrw-C pi_netrw.txt /*netrw-C*
netrw-D pi_netrw.txt /*netrw-D*
netrw-O pi_netrw.txt /*netrw-O*
netrw-P pi_netrw.txt /*netrw-P*
netrw-R pi_netrw.txt /*netrw-R*
netrw-S pi_netrw.txt /*netrw-S*
netrw-T pi_netrw.txt /*netrw-T*
netrw-U pi_netrw.txt /*netrw-U*
netrw-a pi_netrw.txt /*netrw-a*
netrw-activate pi_netrw.txt /*netrw-activate*
@ -1633,6 +1598,7 @@ netrw-cadaver pi_netrw.txt /*netrw-cadaver*
netrw-chgup pi_netrw.txt /*netrw-chgup*
netrw-clean pi_netrw.txt /*netrw-clean*
netrw-contents pi_netrw.txt /*netrw-contents*
netrw-copyright pi_netrw.txt /*netrw-copyright*
netrw-cr pi_netrw.txt /*netrw-cr*
netrw-credits pi_netrw.txt /*netrw-credits*
netrw-ctrl-h pi_netrw.txt /*netrw-ctrl-h*
@ -1652,10 +1618,14 @@ netrw-explore pi_netrw.txt /*netrw-explore*
netrw-explore-cmds pi_netrw.txt /*netrw-explore-cmds*
netrw-externapp pi_netrw.txt /*netrw-externapp*
netrw-file pi_netrw.txt /*netrw-file*
netrw-filigree pi_netrw.txt /*netrw-filigree*
netrw-fixup pi_netrw.txt /*netrw-fixup*
netrw-ftp pi_netrw.txt /*netrw-ftp*
netrw-ftype pi_netrw.txt /*netrw-ftype*
netrw-gb pi_netrw.txt /*netrw-gb*
netrw-getftype pi_netrw.txt /*netrw-getftype*
netrw-gh pi_netrw.txt /*netrw-gh*
netrw-gp pi_netrw.txt /*netrw-gp*
netrw-gx pi_netrw.txt /*netrw-gx*
netrw-handler pi_netrw.txt /*netrw-handler*
netrw-help pi_netrw.txt /*netrw-help*
@ -1667,6 +1637,7 @@ netrw-horiz pi_netrw.txt /*netrw-horiz*
netrw-i pi_netrw.txt /*netrw-i*
netrw-incompatible pi_netrw.txt /*netrw-incompatible*
netrw-intro-browse pi_netrw.txt /*netrw-intro-browse*
netrw-leftmouse pi_netrw.txt /*netrw-leftmouse*
netrw-list pi_netrw.txt /*netrw-list*
netrw-listbookmark pi_netrw.txt /*netrw-listbookmark*
netrw-listhack pi_netrw.txt /*netrw-listhack*
@ -1680,8 +1651,10 @@ netrw-me pi_netrw.txt /*netrw-me*
netrw-mf pi_netrw.txt /*netrw-mf*
netrw-mg pi_netrw.txt /*netrw-mg*
netrw-mh pi_netrw.txt /*netrw-mh*
netrw-middlemouse pi_netrw.txt /*netrw-middlemouse*
netrw-ml_get pi_netrw.txt /*netrw-ml_get*
netrw-mm pi_netrw.txt /*netrw-mm*
netrw-mouse pi_netrw.txt /*netrw-mouse*
netrw-move pi_netrw.txt /*netrw-move*
netrw-mp pi_netrw.txt /*netrw-mp*
netrw-mr pi_netrw.txt /*netrw-mr*
@ -1700,6 +1673,7 @@ netrw-p pi_netrw.txt /*netrw-p*
netrw-p1 pi_netrw.txt /*netrw-p1*
netrw-p10 pi_netrw.txt /*netrw-p10*
netrw-p11 pi_netrw.txt /*netrw-p11*
netrw-p12 pi_netrw.txt /*netrw-p12*
netrw-p2 pi_netrw.txt /*netrw-p2*
netrw-p3 pi_netrw.txt /*netrw-p3*
netrw-p4 pi_netrw.txt /*netrw-p4*
@ -1732,6 +1706,7 @@ netrw-ref pi_netrw.txt /*netrw-ref*
netrw-rename pi_netrw.txt /*netrw-rename*
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-settings pi_netrw.txt /*netrw-settings*
netrw-sexplore pi_netrw.txt /*netrw-sexplore*
@ -1746,6 +1721,7 @@ netrw-starstarpat pi_netrw.txt /*netrw-starstarpat*
netrw-start pi_netrw.txt /*netrw-start*
netrw-t pi_netrw.txt /*netrw-t*
netrw-texplore pi_netrw.txt /*netrw-texplore*
netrw-todo pi_netrw.txt /*netrw-todo*
netrw-transparent pi_netrw.txt /*netrw-transparent*
netrw-u pi_netrw.txt /*netrw-u*
netrw-uidpass pi_netrw.txt /*netrw-uidpass*
@ -1791,29 +1767,6 @@ v_]% matchit.txt /*v_]%*
v_a% matchit.txt /*v_a%*
v_g% matchit.txt /*v_g%*
vba pi_vimball.txt /*vba*
vcscommand vcscommand.txt /*vcscommand*
vcscommand-buffer-management vcscommand.txt /*vcscommand-buffer-management*
vcscommand-buffer-variables vcscommand.txt /*vcscommand-buffer-variables*
vcscommand-bugs vcscommand.txt /*vcscommand-bugs*
vcscommand-commands vcscommand.txt /*vcscommand-commands*
vcscommand-config vcscommand.txt /*vcscommand-config*
vcscommand-contents vcscommand.txt /*vcscommand-contents*
vcscommand-customize vcscommand.txt /*vcscommand-customize*
vcscommand-events vcscommand.txt /*vcscommand-events*
vcscommand-install vcscommand.txt /*vcscommand-install*
vcscommand-intro vcscommand.txt /*vcscommand-intro*
vcscommand-manual vcscommand.txt /*vcscommand-manual*
vcscommand-mappings vcscommand.txt /*vcscommand-mappings*
vcscommand-mappings-override vcscommand.txt /*vcscommand-mappings-override*
vcscommand-naming vcscommand.txt /*vcscommand-naming*
vcscommand-options vcscommand.txt /*vcscommand-options*
vcscommand-ssh vcscommand.txt /*vcscommand-ssh*
vcscommand-ssh-config vcscommand.txt /*vcscommand-ssh-config*
vcscommand-ssh-env vcscommand.txt /*vcscommand-ssh-env*
vcscommand-ssh-other vcscommand.txt /*vcscommand-ssh-other*
vcscommand-ssh-wrapper vcscommand.txt /*vcscommand-ssh-wrapper*
vcscommand-statusline vcscommand.txt /*vcscommand-statusline*
vcscommand.txt vcscommand.txt /*vcscommand.txt*
vimball pi_vimball.txt /*vimball*
vimball-contents pi_vimball.txt /*vimball-contents*
vimball-extract pi_vimball.txt /*vimball-extract*

View File

@ -2,8 +2,8 @@
" FileType: XML
" Author: Rene de Zwart <renez (at) lightcon.xs4all.nl>
" Maintainer: Rene de Zwart <renez (at) lightcon.xs4all.nl>
" Last Change: $Date: 2007/03/17 12:39:40 $
" Version: $Revision: 1.35 $
" Last Change: Date: 2009-11-12
" Version: Revision: 1.37
"
" Licence: This program is free software; you can redistribute it
" and/or modify it under the terms of the GNU General Public
@ -12,12 +12,17 @@
" for the original code. Guo-Peng Wen for the self
" install documentation code.
" Bart vam Deenen for makeElement function
" Rene de Zwart
" Observation - If you want to do something to a match pair most of the time
" you must do first the close tag. Because doing first the open
" tag could change the close tag position.
" NOTE with filetype index on de standard indent/html.vim interferes
" with xml.vim. You can
" 1) set filetype indent off in .vimrc
" 2) echo "let b:did_indent = 1" > .vim/indent/html.vim
" Only do this when not done yet for this buffer
@ -54,7 +59,7 @@ let s:OptAttrib = s:Attrib . '*'. s:NoSlashBeforeGt
let s:ReqAttrib = s:Attrib . '\+'. s:NoSlashBeforeGt
let s:OpenTag = '<[^!/?][^>]*' . s:OptAttrib
let s:OpenOrCloseTag = '<[^!?][^>]*'. s:OptAttrib
let s:CloseTag = '<\/[^>]*'. s:OptAttrib
let s:CloseTag = '<\/[^>]*'. s:NoSlashBeforeGt
let s:SpaceInfront = '^\s*<'
let s:EndofName = '\($\|\s\|>\)'
@ -109,25 +114,19 @@ endfunction
endif
" SavePos() saves position in bufferwide variable {{{1
if !exists('*s:SavePos')
fun! s:SavePos()
retu 'call cursor('.line('.').','. col('.'). ')'
endf
en
" findOpenTag() {{{1
if !exists('*s:findOpenTag')
fun! s:findOpenTag(flag)
call search(s:OpenTag,a:flag)
endf
en
" findCloseTag() {{{1
if !exists('*s:findCloseTag')
fun! s:findCloseTag(flag)
call search(s:CloseTag,a:flag)
endf
en
" GetTagName() Gets the tagname from start position {{{1
"Now lets go for the name part. The namepart are xmlnamechars which
@ -141,7 +140,6 @@ endf
en
" hasAtt() Looks for attribute in open tag {{{1
" expect cursor to be on <
if !exists('*s:hasAtt')
fun! s:hasAtt()
"Check if this open tag has attributes
let l:line = line('.') | let l:col = col('.')
@ -151,7 +149,6 @@ fun! s:hasAtt()
en
en
endf
en
" TagUnderCursor() Is there a tag under the cursor? {{{1
@ -266,7 +263,7 @@ fun! s:Match(name)
let l:flags='bW'
let l:level = -1
el
exe 'normal '.b:endline.'G0'.(b:endcol-1).'l'
exe 'normal! '.b:endline.'G0'.(b:endcol-1).'l'
let l:flags='W'
let l:level = 1
en
@ -351,16 +348,16 @@ fun! s:DelComment()
if s:InComment()
if b:begcom
if search('-->','W' ) >=0
normal hh3x
normal! hh3x
call cursor(b:begcomline,b:begcomcol)
normal 4x
normal! 4x
retu 1
en
el
if search('<!--','bW' ) >=0
normal 4x
normal! 4x
call cursor(b:endcomline,b:endcomcol)
normal hh3x
normal! hh3x
retu 1
en
en
@ -382,20 +379,20 @@ fun! s:DelCommentSection()
let l:len = strlen(l:sentinel)
if b:begcom
if search('-->','W' ) >=0
exe "normal f>a".l:sentinel."\<Esc>"
exe "normal! f>a".l:sentinel."\<Esc>"
call cursor(b:begcomline,b:begcomcol)
exe "normal \"xd/".l:sentinel."/e-".l:len."\<Cr>"
exe "normal ".l:len."x"
exe "normal! \"xd/".l:sentinel."/e-".l:len."\<Cr>"
exe "normal! ".l:len."x"
retu 1
en
el
if search('<!--','bW' ) >=0
let l:restore = s:SavePos()
call cursor(b:endcomline,b:endcomcol)
exe "normal a".l:sentinel."\<Esc>"
exe "normal! a".l:sentinel."\<Esc>"
exe l:restore
exe "normal \"xd/".l:sentinel."/e-".l:len."\<Cr>"
exe "normal ".l:len."x"
exe "normal! \"xd/".l:sentinel."/e-".l:len."\<Cr>"
exe "normal! ".l:len."x"
retu 1
en
en
@ -415,16 +412,16 @@ fun! s:DelCData()
if s:InCData()
if b:begdat
if search(']]>','W' ) >=0
normal hh3x
normal! hh3x
call cursor(b:begdatline,b:begdatcol)
normal 9x
normal! 9x
retu 1
en
el
if search('<![CDATA[','bW' ) >=0
normal 9x
normal! 9x
call cursor(b:enddatline,b:enddatcol)
normal hh3x
normal! hh3x
retu 1
en
en
@ -503,20 +500,20 @@ fun! s:DelCDataSection()
let l:len = strlen(l:sentinel)
if b:begdat
if search(']]>','W' ) >=0
exe "normal f>a".l:sentinel."\<Esc>"
exe "normal! f>a".l:sentinel."\<Esc>"
call cursor(b:begdatline,b:begdatcol)
exe "normal \"xd/".l:sentinel."/e-".l:len."\<Cr>"
exe "normal ".l:len."x"
exe "normal! \"xd/".l:sentinel."/e-".l:len."\<Cr>"
exe "normal! ".l:len."x"
retu 1
en
el
if search('<![CDATA[','bW' ) >=0
let l:restore = s:SavePos()
call cursor(b:enddatline,b:enddatcol)
exe "normal a".l:sentinel."\<Esc>"
exe "normal! a".l:sentinel."\<Esc>"
exe l:restore
exe "normal \"xd/".l:sentinel."/e-".l:len."\<Cr>"
exe "normal ".l:len."x"
exe "normal! \"xd/".l:sentinel."/e-".l:len."\<Cr>"
exe "normal! ".l:len."x"
retu 1
en
en
@ -546,16 +543,16 @@ fun! s:MatchesVisual()
let l:restore = s:SavePos()
if s:TagUnderCursor()
if b:firstWasEndTag
normal f>
normal! f>
en
normal gv
normal! gv
if s:Match(b:tagName)
if b:firstWasEndTag == 0
normal f>
normal! f>
en
retu
en
normal v
normal! v
en
exe l:restore
endf
@ -568,18 +565,18 @@ function! s:makeElement()
let b:haveAtt = 0
let l:alone = (match(getline('.'),'^\s*>\s*$') >= 0)
let l:endOfLine = ((col('.')+1) == col('$'))
normal i<pf>
normal! i<pf>
if b:html_mode && b:tagName =~? b:emptyTags
if b:haveAtt == 0
call s:Callback (b:tagName, b:html_mode)
endif
if b:xml_use_xhtml
exe "normal i/\<Esc>l"
exe "normal! i/\<Esc>l"
en
if l:endOfLine
start!
el
normal l
normal! l
start
en
el
@ -607,29 +604,29 @@ fun! s:CloseTagFun()
"<t>
" cursor comes here
"</t>
normal h
normal! h
if s:TagUnderCursor()
if b:firstWasEndTag == 0
exe "normal 2f>s\<Cr>\<Esc>Ox\<Esc>>>$x"
exe "normal! 2f>s\<Cr>\<Esc>Ox\<Esc>>>$x"
start!
retu
en
en
elseif s:TagUnderCursor()
if b:firstWasEndTag == 0
exe "normal />\<Cr>"
exe "normal! />\<Cr>"
if b:html_mode && b:tagName =~? b:emptyTags
if b:haveAtt == 0
call s:Callback (b:tagName, b:html_mode)
en
if b:xml_use_xhtml
exe "normal i/\<Esc>l"
exe "normal! i/\<Esc>l"
en
if l:endOfLine
start!
retu
el
normal l
normal! l
start
retu
en
@ -647,7 +644,7 @@ fun! s:CloseTagFun()
if (col('.')+1) == col("$")
startinsert!
else
normal l
normal! l
startinsert
en
endf
@ -671,14 +668,14 @@ fun! s:BlockTag(multi)
"Get at the end of the block
if col('.') == col("'<") && line('.') == line("'<")
normal gvov
normal! gvov
en
if a:multi
exe "normal! a\<Cr></".l:newname.">\<Cr>\<Esc>"
let l:eline = line('.')
normal gvov
normal! gvov
if col('.') == col("'>") && line('.') == line("'>")
normal gvov
normal! gvov
en
let l:sline = line(".") + 2
exe "normal! i\<Cr><".l:newname.
@ -688,11 +685,11 @@ fun! s:BlockTag(multi)
let &report=999999
exe l:sline.','.l:eline.'>'
let &report= l:rep
exe 'normal '.l:sline.'G0mh'.l:eline."G$v'hgq"
exe 'normal! '.l:sline.'G0mh'.l:eline."G$v'hgq"
el
exe "normal! a</".l:newname.">\<Esc>gvov"
if col('.') == col("'>") && line('.') == line("'>")
normal gvov
normal! gvov
en
exe "normal! i<".l:newname.
\ (strlen(l:newatt) ? ' '.l:newatt : '' )
@ -707,10 +704,10 @@ en
if !exists('*s:BlockWith')
fun! s:BlockWith(open,close)
if col('.') == col("'<") && line('.') == line("'<")
normal gvov
normal! gvov
en
exe "normal! a\<Cr>;x\<Esc>0cfx".a:close."\<Cr>\<Esc>"
normal gvov
normal! gvov
exe "normal! i\<Cr>;x\<Esc>0cfx".a:open."\<Cr>\<Esc>"
endf
en
@ -722,10 +719,10 @@ if !exists('*s:vlistitem')
fun! s:vlistitem()
"Get at the end of the block
if col('.') == col("'<") && line('.') == line("'<")
normal gvov
normal! gvov
en
exe "normal! a</para>\<Cr></listitem>\<Esc>mh"
normal gvov
normal! gvov
exe "normal! i\<Cr><listitem>\<Cr>\<Tab><para>\<Esc>'h/listitem>/e+1\<Cr>"
endf
en
@ -741,9 +738,9 @@ fun! s:Change()
let b:lastTag = l:newname
if s:Match(b:tagName)
exe b:gotoCloseTag
exe 'normal 2lcw' . l:newname . "\<Esc>"
exe 'normal! 2lcw' . l:newname . "\<Esc>"
exe b:gotoOpenTag
exe 'normal lcw' . l:newname . "\<Esc>"
exe 'normal! lcw' . l:newname . "\<Esc>"
en
en
endf
@ -777,7 +774,7 @@ fun! s:Join()
el
let b:gotoCloseTag = s:SavePos()
en
let l:DeleteTag = "normal d/>/e\<Cr>"
let l:DeleteTag = "normal! d/>/e\<Cr>"
exe b:gotoCloseTag
exe l:DeleteTag
exe b:gotoOpenTag
@ -804,9 +801,9 @@ fun! s:ChangeWholeTag()
en
if s:Match(b:tagName)
exe b:gotoCloseTag
exe "normal 2lc/>\<Cr>".l:newname."\<Esc>"
exe "normal! 2lc/>\<Cr>".l:newname."\<Esc>"
exe b:gotoOpenTag
exe "normal lc/>/\<Cr>".l:newname.
exe "normal! lc/>/\<Cr>".l:newname.
\ (strlen(l:newatt) ? ' '.l:newatt : '' )
\."\<Esc>"
en
@ -820,7 +817,7 @@ fun! s:Delete()
let l:restore = s:SavePos()
if s:TagUnderCursor()
if s:Match(b:tagName)
let l:DeleteTag = "normal d/>/e\<Cr>"
let l:DeleteTag = "normal! d/>/e\<Cr>"
exe b:gotoCloseTag
exe l:DeleteTag
exe b:gotoOpenTag
@ -845,10 +842,10 @@ fun! s:DeleteSection()
let l:rep=&report
let &report=999999
exe b:gotoCloseTag
exe "normal />\<Cr>a".l:sentinel."\<Esc>"
exe "normal! />\<Cr>a".l:sentinel."\<Esc>"
exe b:gotoOpenTag
exe "normal \"xd/".l:sentinel."/e-".l:len."\<Cr>"
exe "normal ".l:len."x"
exe "normal! \"xd/".l:sentinel."/e-".l:len."\<Cr>"
exe "normal! ".l:len."x"
let &report= l:rep
en
en
@ -889,7 +886,7 @@ fun! s:FoldTagAll()
en
let b:lastTag = l:tname
en
normal G$
normal! G$
let l:flag='w'
while search('<'.l:tname.s:OptAttrib,l:flag) > 0
let l:flag='W'
@ -952,7 +949,7 @@ fun! s:EndTag()
if l:level == 0
let l:Name = s:GetTagName(col('.'))
exe l:restore
exe 'normal a</'. l:Name.">\e"
exe 'normal! a</'. l:Name.">\e"
el
exe l:restore
en
@ -1087,9 +1084,9 @@ fun! s:FormatTag()
if s:TagUnderCursor()
if s:Match(b:tagName)
exe b:gotoCloseTag
normal hhmh
normal! hhmh
exe b:gotoOpenTag
exe "normal />/e+1\<Cr>v'hgq"
exe "normal! />/e+1\<Cr>v'hgq"
en
en
endf
@ -1112,18 +1109,18 @@ fun! s:FormatTagAll()
retu
en
en
normal G$
normal! G$
let l:flag = 'w'
while search('<'.l:tname . s:OptAttrib, l:flag) > 0
let l:flag = 'W'
let l:sline = line('.')
let l:level = 1
exe "normal />/e+1\<cr>mh"
exe "normal! />/e+1\<cr>mh"
while l:level && search('</\='.l:tname . s:EndofName,'W') > 0
let l:level = l:level + (getline('.')[col('.')] == '/' ? -1 : 1)
endwhile
if l:level == 0
normal hv'hogq
normal! hv'hogq
el
let l:tmp =
\ inputdialog("The tag ".l:tname."(".l:sline.") doesn't have a closetag")
@ -1143,39 +1140,39 @@ fun! s:IndentAll()
let l:rep=&report
let &report=999999
"shift everything left
normal 1G<G<G<G<G<G<GG$
normal! 1G<G<G<G<G<G<GG$
if search(s:OpenTag,'w') > 0
let l:level = 1
normal f>
normal! f>
"if there is something after the tag move that to the next line
if col('.')+1 != col('$')
echo "after tag".line('.')
exe "normal a\<Cr>\<Esc>"
exe "normal! a\<Cr>\<Esc>"
el
normal j
normal! j
en
normal >Gk$
normal! >Gk$
while search(s:OpenOrCloseTag,'W') > 0
"if there is text before the tag then move the tag to the next line
if match(getline('.'),s:SpaceInfront) == -1
exe "normal i\<Cr>\<Esc>l"
exe "normal! i\<Cr>\<Esc>l"
en
if getline('.')[col('.')] == '/'
normal <G0f>
normal! <G0f>
"if there is something after the tag move that to the next line
if col('.')+1 != col('$')
exe "normal a\<Cr>\<Esc>"
exe "normal! a\<Cr>\<Esc>"
en
let l:level = l:level - 1
el
normal f>
normal! f>
"if there is something after the tag move that to the next line
if col('.')+1 != col('$')
exe "normal a\<Cr>\<Esc>"
exe "normal! a\<Cr>\<Esc>"
el
normal j0
normal! j0
en
normal >Gk$
normal! >Gk$
let l:level = l:level + 1
en
endwhile
@ -1298,7 +1295,7 @@ function! s:XmlInstallDocumentation(full_name, revision)
" Try a default configuration in user home:
"let l:vim_doc_path = expand("~") . l:doc_home
let l:vim_doc_path = matchstr(&rtp,
\ escape($HOME, '\') .'[/\\]\%(\.vim\|vimfiles\)')
\ escape($HOME, ' \') .'[/\\]\%(\.vim\|vimfiles\)')
if (!(filewritable(l:vim_doc_path) == 2))
execute l:mkdir_cmd . l:vim_doc_path
if (!(filewritable(l:vim_doc_path) == 2))
@ -1367,7 +1364,7 @@ function! s:XmlInstallDocumentation(full_name, revision)
call append(line('$'), ' v' . 'im:tw=78:ts=8:fen:fdm=marker:ft=help:norl:')
" Replace revision:
exe "normal :1,5s/#version#/ v" . a:revision . "/\<CR>"
exe "normal! :1,5s/#version#/ v" . a:revision . "/\<CR>"
" Save the help document:
exe 'w! ' . l:doc_file
@ -1382,7 +1379,7 @@ endfunction
" }}}2
let s:revision=
\ substitute("$Revision: 1.35 $",'\$\S*: \([.0-9]\+\) \$','\1','')
\ substitute("$Revision: 1.36 $",'\$\S*: \([.0-9]\+\) \$','\1','')
silent! let s:install_status =
\ s:XmlInstallDocumentation(expand('<sfile>:p'), s:revision)
if (s:install_status == 1)
@ -1744,9 +1741,6 @@ for details.
------------------------------------------------------------------------------
*xml-plugin-callbacks*
------------------------------------------------------------------------------
*xml-plugin-callbacks*
Callback Functions {{{2 ~
A callback function is a function used to customize features on a per tag

View File

@ -1,6 +1,6 @@
" AlignMapsPlugin: Alignment maps based upon <Align.vim> and <AlignMaps.vim>
" Maintainer: Dr. Charles E. Campbell, Jr. <NdrOchipS@PcampbellAfamily.Mbiz>
" Date: Oct 24, 2008
" Date: Mar 03, 2009
"
" NOTE: the code herein needs vim 6.0 or later
" needs <Align.vim> v6 or later
@ -36,10 +36,11 @@
" ---------------------------------------------------------------------
" Load Once: {{{1
if &cp
if &cp || exists("g:loaded_AlignMapsPlugin")
finish
endif
let s:keepcpo= &cpo
let s:keepcpo = &cpo
let g:loaded_AlignMapsPlugin = "v41"
set cpo&vim
" =====================================================================
@ -63,11 +64,12 @@ endif
nmap <silent> <script> <Plug>AlignMapsWrapperEnd :call AlignMaps#WrapperEnd()<CR>:set nolz<CR>
" ---------------------------------------------------------------------
" Complex C-code alignment maps: {{{2!= ""
" Complex C-code alignment maps: {{{2
if !hasmapto('<Plug>AM_a?') |map <unique> <Leader>a? <Plug>AM_a?|endif
if !hasmapto('<Plug>AM_a,') |map <unique> <Leader>a, <Plug>AM_a,|endif
if !hasmapto('<Plug>AM_a<') |map <unique> <Leader>a< <Plug>AM_a<|endif
if !hasmapto('<Plug>AM_a=') |map <unique> <Leader>a= <Plug>AM_a=|endif
if !hasmapto('<Plug>AM_a(') |map <unique> <Leader>a( <Plug>AM_a(|endif
if !hasmapto('<Plug>AM_abox') |map <unique> <Leader>abox <Plug>AM_abox|endif
if !hasmapto('<Plug>AM_acom') |map <unique> <Leader>acom <Plug>AM_acom|endif
if !hasmapto('<Plug>AM_adcom')|map <unique> <Leader>adcom <Plug>AM_adcom|endif
@ -88,6 +90,7 @@ endif
map <silent> <script> <Plug>AM_a? <SID>WS:AlignCtrl mIp1P1lC ? : : : : <CR>:'a,.Align<CR>:'a,'z-1s/\(\s\+\)? /?\1/e<CR><SID>WE
map <silent> <script> <Plug>AM_a, <SID>WS:'y,'zs/\(\S\)\s\+/\1 /ge<CR>'yjma'zk:call AlignMaps#CharJoiner(",")<cr>:silent 'y,'zg/,/call AlignMaps#FixMultiDec()<CR>'z:exe "norm \<Plug>AM_adec"<cr><SID>WE
map <silent> <script> <Plug>AM_a< <SID>WS:AlignCtrl mIp1P1=l << >><CR>:'a,.Align<CR><SID>WE
map <silent> <script> <Plug>AM_a( <SID>WS:AlignCtrl mIp0P1=l<CR>:'a,.Align [(,]<CR>:sil 'y+1,'z-1s/\(\s\+\),/,\1/ge<CR><SID>WE
map <silent> <script> <Plug>AM_a= <SID>WS:AlignCtrl mIp1P1=l<CR>:AlignCtrl g :=<CR>:'a,'zAlign :\==<CR><SID>WE
map <silent> <script> <Plug>AM_abox <SID>WS:let g:alignmaps_iws=substitute(getline("'a"),'^\(\s*\).*$','\1','e')<CR>:'a,'z-1s/^\s\+//e<CR>:'a,'z-1s/^.*$/@&@/<CR>:AlignCtrl m=p01P0w @<CR>:'a,.Align<CR>:'a,'z-1s/@/ * /<CR>:'a,'z-1s/@$/*/<CR>'aYP:s/./*/g<CR>0r/'zkYp:s/./*/g<CR>0r A/<Esc>:exe "'a-1,'z-1s/^/".g:alignmaps_iws."/e"<CR><SID>WE
map <silent> <script> <Plug>AM_acom <SID>WS:'a,.s/\/[*/]\/\=/@&@/e<CR>:'a,.s/\*\//@&/e<CR>:'y,'zs/^\( *\) @/\1@/e<CR>'zk:call AlignMaps#StdAlign(2)<CR>:'y,'zs/^\(\s*\) @/\1/e<CR>:'y,'zs/ @//eg<CR><SID>WE
@ -97,8 +100,8 @@ map <silent> <script> <Plug>AM_ascom <SID>WS:'a,.s/\/[*/]/@&@/e<CR>:'a,.s/\*\//@
map <silent> <script> <Plug>AM_adec <SID>WS:'a,'zs/\([^ \t/(]\)\([*&]\)/\1 \2/e<CR>:'y,'zv/^\//s/\([^ \t]\)\s\+/\1 /ge<CR>:'y,'zv/^\s*[*/]/s/\([^/][*&]\)\s\+/\1/ge<CR>:'y,'zv/^\s*[*/]/s/^\(\s*\%(\K\k*\s\+\%([a-zA-Z_*(&]\)\@=\)\+\)\([*(&]*\)\s*\([a-zA-Z0-9_()]\+\)\s*\(\(\[.\{-}]\)*\)\s*\(=\)\=\s*\(.\{-}\)\=\s*;/\1@\2#@\3\4@\6@\7;@/e<CR>:'y,'zv/^\s*[*/]/s/\*\/\s*$/@*\//e<CR>:'y,'zv/^\s*[*/]/s/^\s\+\*/@@@@@* /e<CR>:'y,'zv/^\s*[*/]/s/^@@@@@\*\(.*[^*/]\)$/&@*/e<CR>'yjma'zk:AlignCtrl v ^\s*[*/#]<CR>:call AlignMaps#StdAlign(1)<cr>:'y,'zv/^\s*[*/]/s/@ //ge<CR>:'y,'zv/^\s*[*/]/s/\(\s*\);/;\1/e<CR>:'y,'zv/^#/s/# //e<CR>:'y,'zv/^\s\+[*/#]/s/\([^/*]\)\(\*\+\)\( \+\)/\1\3\2/e<CR>:'y,'zv/^\s\+[*/#]/s/\((\+\)\( \+\)\*/\2\1*/e<CR>:'y,'zv/^\s\+[*/#]/s/^\(\s\+\) \*/\1*/e<CR>:'y,'zv/^\s\+[*/#]/s/[ \t@]*$//e<CR>:'y,'zs/^[*]/ */e<CR><SID>WE
map <silent> <script> <Plug>AM_adef <SID>WS:AlignPush<CR>:AlignCtrl v ^\s*\(\/\*\<bar>\/\/\)<CR>:'a,.v/^\s*\(\/\*\<bar>\/\/\)/s/^\(\s*\)#\(\s\)*define\s*\(\I[a-zA-Z_0-9(),]*\)\s*\(.\{-}\)\($\<Bar>\/\*\)/#\1\2define @\3@\4@\5/e<CR>:'a,.v/^\s*\(\/\*\<bar>\/\/\)/s/\($\<Bar>\*\/\)/@&/e<CR>'zk:call AlignMaps#StdAlign(1)<cr>'yjma'zk:'a,.v/^\s*\(\/\*\<bar>\/\/\)/s/ @//g<CR><SID>WE
map <silent> <script> <Plug>AM_afnc :<c-u>set lz<CR>:silent call AlignMaps#Afnc()<CR>:set nolz<CR>
map <silent> <script> <Plug>AM_aunum <SID>WS:'a,'zs/\%([0-9.]\)\s\+\zs\([-+.]\=\d\)/@\1/ge<CR>:'a,'zs/\(\(^\|\s\)\d\+\)\(\s\+\)@/\1@\3@/ge<CR>:'a,'zs/\.@/\.0@/ge<CR>:AlignCtrl mp0P0r<CR>:'a,'zAlign [.@]<CR>:'a,'zs/@/ /ge<CR>:'a,'zs/\(\.\)\(\s\+\)\([0-9.,eE+]\+\)/\1\3\2/ge<CR>:'a,'zs/\([eE]\)\(\s\+\)\([0-9+\-+]\+\)/\1\3\2/ge<CR><SID>WE
map <silent> <script> <Plug>AM_aenum <SID>WS:'a,'zs/\%([0-9.]\)\s\+\([-+]\=\d\)/\1@\2/ge<CR>:'a,'zs/\.@/\.0@/ge<CR>:AlignCtrl mp0P0r<CR>:'a,'zAlign [,@]<CR>:'a,'zs/@/ /ge<CR>:'a,'zs/\(,\)\(\s\+\)\([-0-9.,eE+]\+\)/\1\3\2/ge<CR>:'a,'zs/\([eE]\)\(\s\+\)\([0-9+\-+]\+\)/\1\3\2/ge<CR><SID>WE
map <silent> <script> <Plug>AM_aunum <SID>WS:'a,'zs/\%([0-9.]\)\s\+\zs\([-+.]\=\d\)/@\1/ge<CR>:'a,'zs/\(\(^\|\s\)\d\+\)\(\s\+\)@/\1@\3@/ge<CR>:'a,'zs/\.@/\.0@/ge<CR>:AlignCtrl wmp0P0r<CR>:'a,'zAlign [.@]<CR>:'a,'zs/@/ /ge<CR>:'a,'zs/\(\.\)\(\s\+\)\([0-9.,eE+]\+\)/\1\3\2/ge<CR>:'a,'zs/\([eE]\)\(\s\+\)\([0-9+\-+]\+\)/\1\3\2/ge<CR><SID>WE
map <silent> <script> <Plug>AM_aenum <SID>WS:'a,'zs/\%([0-9.]\)\s\+\([-+]\=\d\)/\1@\2/ge<CR>:'a,'zs/\.@/\.0@/ge<CR>:AlignCtrl wmp0P0r<CR>:'a,'zAlign [,@]<CR>:'a,'zs/@/ /ge<CR>:'a,'zs/\(,\)\(\s\+\)\([-0-9.,eE+]\+\)/\1\3\2/ge<CR>:'a,'zs/\([eE]\)\(\s\+\)\([0-9+\-+]\+\)/\1\3\2/ge<CR><SID>WE
" ---------------------------------------------------------------------
" html table alignment {{{2
@ -128,7 +131,7 @@ map <silent> <script> <Plug>AM_Ts, <SID>WS:AlignCtrl mIp0P1=r ,<CR>:'a,.Align<C
map <silent> <script> <Plug>AM_T: <SID>WS:AlignCtrl mIp1P1=r :<CR>:'a,.Align<CR><SID>WE
map <silent> <script> <Plug>AM_T; <SID>WS:AlignCtrl mIp0P0=r ;<CR>:'a,.Align<CR><SID>WE
map <silent> <script> <Plug>AM_T< <SID>WS:AlignCtrl mIp0P0=r <<CR>:'a,.Align<CR><SID>WE
map <silent> <script> <Plug>AM_T= <SID>WS:'a,'z-1s/\s\+\([*/+\-%<Bar>&\~^]\==\)/ \1/e<CR>:'a,'z-1s@ \+\([*/+\-%<Bar>&\~^]\)=@\1=@ge<CR>:'a,'z-1s/; */;@/e<CR>:'a,'z-1s/==/\="\<Char-0xff>\<Char-0xff>"/ge<CR>:'a,'z-1s/!=/\x="!\<Char-0xff>"/ge<CR>:AlignCtrl mIp1P1=r = @<CR>:AlignCtrl g =<CR>:'a,'z-1Align<CR>:'a,'z-1s/; *@/;/e<CR>:'a,'z-1s/; *$/;/e<CR>:'a,'z-1s@\([*/+\-%<Bar>&\~^]\)\( \+\)=@\2\1=@ge<CR>:'a,'z-1s/\( \+\);/;\1/ge<CR>:'a,'z-1s/\xff/=/ge<CR><SID>WE:exe "norm <Plug>acom"
map <silent> <script> <Plug>AM_T= <SID>WS:'a,'z-1s/\s\+\([*/+\-%<Bar>&\~^]\==\)/ \1/e<CR>:'a,'z-1s@ \+\([*/+\-%<Bar>&\~^]\)=@\1=@ge<CR>:'a,'z-1s/; */;@/e<CR>:'a,'z-1s/==/\="\<Char-0x0f>\<Char-0x0f>"/ge<CR>:'a,'z-1s/!=/\x="!\<Char-0x0f>"/ge<CR>:AlignCtrl mIp1P1=r = @<CR>:AlignCtrl g =<CR>:'a,'z-1Align<CR>:'a,'z-1s/; *@/;/e<CR>:'a,'z-1s/; *$/;/e<CR>:'a,'z-1s@\([*/+\-%<Bar>&\~^]\)\( \+\)=@\2\1=@ge<CR>:'a,'z-1s/\( \+\);/;\1/ge<CR>:'a,'z-1s/\xff/=/ge<CR><SID>WE:exe "norm <Plug>acom"
map <silent> <script> <Plug>AM_T? <SID>WS:AlignCtrl mIp0P0=r ?<CR>:'a,.Align<CR>:'y,'zs/ \( *\);/;\1/ge<CR><SID>WE
map <silent> <script> <Plug>AM_T@ <SID>WS:AlignCtrl mIp0P0=r @<CR>:'a,.Align<CR><SID>WE
map <silent> <script> <Plug>AM_Tab <SID>WS:'a,.s/^\(\t*\)\(.*\)/\=submatch(1).escape(substitute(submatch(2),'\t','@','g'),'\')/<CR>:AlignCtrl mI=r @<CR>:'a,.Align<CR>:'y+1,'z-1s/@/ /g<CR><SID>WE
@ -140,11 +143,15 @@ map <silent> <script> <Plug>AM_T~ <SID>WS:AlignCtrl mIp0P0=r ~<CR>:'a,.Align<C
if !hasmapto('<Plug>AM_t|') |map <unique> <Leader>t| <Plug>AM_t||endif
if !hasmapto('<Plug>AM_t#') |map <unique> <Leader>t# <Plug>AM_t#|endif
if !hasmapto('<Plug>AM_t,') |map <unique> <Leader>t, <Plug>AM_t,|endif
if !hasmapto('<Plug>AM_ts,') |map <unique> <Leader>ts, <Plug>AM_ts,|endif
if !hasmapto('<Plug>AM_t:') |map <unique> <Leader>t: <Plug>AM_t:|endif
if !hasmapto('<Plug>AM_t;') |map <unique> <Leader>t; <Plug>AM_t;|endif
if !hasmapto('<Plug>AM_t<') |map <unique> <Leader>t< <Plug>AM_t<|endif
if !hasmapto('<Plug>AM_t=') |map <unique> <Leader>t= <Plug>AM_t=|endif
if !hasmapto('<Plug>AM_ts,') |map <unique> <Leader>ts, <Plug>AM_ts,|endif
if !hasmapto('<Plug>AM_ts:') |map <unique> <Leader>ts: <Plug>AM_ts:|endif
if !hasmapto('<Plug>AM_ts;') |map <unique> <Leader>ts; <Plug>AM_ts;|endif
if !hasmapto('<Plug>AM_ts<') |map <unique> <Leader>ts< <Plug>AM_ts<|endif
if !hasmapto('<Plug>AM_ts=') |map <unique> <Leader>ts= <Plug>AM_ts=|endif
if !hasmapto('<Plug>AM_w=') |map <unique> <Leader>w= <Plug>AM_w=|endif
if !hasmapto('<Plug>AM_t?') |map <unique> <Leader>t? <Plug>AM_t?|endif
if !hasmapto('<Plug>AM_t~') |map <unique> <Leader>t~ <Plug>AM_t~|endif
@ -159,17 +166,22 @@ if !hasmapto('<Plug>AM_tt') |map <unique> <Leader>tt <Plug>AM_tt|endif
map <silent> <script> <Plug>AM_t| <SID>WS:AlignCtrl mIp0P0=l <Bar><CR>:'a,.Align<CR><SID>WE
map <silent> <script> <Plug>AM_t# <SID>WS:AlignCtrl mIp0P0=l #<CR>:'a,.Align<CR><SID>WE
map <silent> <script> <Plug>AM_t, <SID>WS:AlignCtrl mIp0P1=l ,<CR>:'a,.Align<CR><SID>WE
map <silent> <script> <Plug>AM_ts, <SID>WS:AlignCtrl mIp0P1=l ,<CR>:'a,.Align<CR>:'a,.s/\(\s*\),/,\1/ge<CR><SID>WE
map <silent> <script> <Plug>AM_t: <SID>WS:AlignCtrl mIp1P1=l :<CR>:'a,.Align<CR><SID>WE
map <silent> <script> <Plug>AM_t; <SID>WS:AlignCtrl mIp0P1=l ;<CR>:'a,.Align<CR>:'y,'zs/\( *\);/;\1/ge<CR><SID>WE
map <silent> <script> <Plug>AM_t; <SID>WS:AlignCtrl mIp0P1=l ;<CR>:'a,.Align<CR>:sil 'y,'zs/\( *\);/;\1/ge<CR><SID>WE
map <silent> <script> <Plug>AM_t< <SID>WS:AlignCtrl mIp0P0=l <<CR>:'a,.Align<CR><SID>WE
map <silent> <script> <Plug>AM_t= <SID>WS:call AlignMaps#Equals()<CR><SID>WE
map <silent> <script> <Plug>AM_w= <SID>WS:'a,'zg/=/s/\s\+\([*/+\-%<Bar>&\~^]\==\)/ \1/e<CR>:'a,'zg/=/s@ \+\([*/+\-%<Bar>&\~^]\)=@\1=@ge<CR>:'a,'zg/=/s/==/\="\<Char-0xff>\<Char-0xff>"/ge<CR>:'a,'zg/=/s/!=/\="!\<Char-0xff>"/ge<CR>'zk:AlignCtrl mWp1P1=l =<CR>:AlignCtrl g =<CR>:'a,'z-1g/=/Align<CR>:'a,'z-1g/=/s@\([*/+\-%<Bar>&\~^!=]\)\( \+\)=@\2\1=@ge<CR>:'a,'z-1g/=/s/\( \+\);/;\1/ge<CR>:'a,'z-1v/^\s*\/[*/]/s/\/[*/]/@&@/e<CR>:'a,'z-1v/^\s*\/[*/]/s/\*\//@&/e<CR>'zk:call AlignMaps#StdAlign(1)<cr>:'y,'zs/^\(\s*\) @/\1/e<CR>:'a,'z-1g/=/s/\xff/=/ge<CR>:'y,'zg/=/s/ @//eg<CR><SID>WE
map <silent> <script> <Plug>AM_ts, <SID>WS:AlignCtrl mIp0P1=l #<CR>:'a,.Align<CR>:sil 'y+1,'z-1s/\(\s*\)#/,\1/ge<CR><SID>WE
map <silent> <script> <Plug>AM_ts, <SID>WS:AlignCtrl mIp0P1=l ,<CR>:'a,.Align<CR>:sil 'y+1,'z-1s/\(\s*\),/,\1/ge<CR><SID>WE
map <silent> <script> <Plug>AM_ts: <SID>WS:AlignCtrl mIp1P1=l :<CR>:'a,.Align<CR>:sil 'y+1,'z-1s/\(\s*\):/:\1/ge<CR><SID>WE
map <silent> <script> <Plug>AM_ts; <SID>WS:AlignCtrl mIp1P1=l ;<CR>:'a,.Align<CR>:sil 'y+1,'z-1s/\(\s*\);/;\1/ge<CR><SID>WE
map <silent> <script> <Plug>AM_ts< <SID>WS:AlignCtrl mIp1P1=l <<CR>:'a,.Align<CR>:sil 'y+1,'z-1s/\(\s*\)</<\1/ge<CR><SID>WE
map <silent> <script> <Plug>AM_ts= <SID>WS:AlignCtrl mIp1P1=l =<CR>:'a,.Align<CR>:sil 'y+1,'z-1s/\(\s*\)=/=\1/ge<CR><SID>WE
map <silent> <script> <Plug>AM_w= <SID>WS:'a,'zg/=/s/\s\+\([*/+\-%<Bar>&\~^]\==\)/ \1/e<CR>:'a,'zg/=/s@ \+\([*/+\-%<Bar>&\~^]\)=@\1=@ge<CR>:'a,'zg/=/s/==/\="\<Char-0x0f>\<Char-0x0f>"/ge<CR>:'a,'zg/=/s/!=/\="!\<Char-0x0f>"/ge<CR>'zk:AlignCtrl mWp1P1=l =<CR>:AlignCtrl g =<CR>:'a,'z-1g/=/Align<CR>:'a,'z-1g/=/s@\([*/+\-%<Bar>&\~^!=]\)\( \+\)=@\2\1=@ge<CR>:'a,'z-1g/=/s/\( \+\);/;\1/ge<CR>:'a,'z-1v/^\s*\/[*/]/s/\/[*/]/@&@/e<CR>:'a,'z-1v/^\s*\/[*/]/s/\*\//@&/e<CR>'zk:call AlignMaps#StdAlign(1)<cr>:'y,'zs/^\(\s*\) @/\1/e<CR>:'a,'z-1g/=/s/\xff/=/ge<CR>:'y,'zg/=/s/ @//eg<CR><SID>WE
map <silent> <script> <Plug>AM_t? <SID>WS:AlignCtrl mIp0P0=l ?<CR>:'a,.Align<CR>:.,'zs/ \( *\);/;\1/ge<CR><SID>WE
map <silent> <script> <Plug>AM_t~ <SID>WS:AlignCtrl mIp0P0=l ~<CR>:'a,.Align<CR>:'y,'zs/ \( *\);/;\1/ge<CR><SID>WE
map <silent> <script> <Plug>AM_t@ <SID>WS::call AlignMaps#StdAlign(1)<cr>:<SID>WE
map <silent> <script> <Plug>AM_m= <SID>WS:'a,'zs/\s\+\([*/+\-%<Bar>&\~^]\==\)/ \1/e<CR>:'a,'zs@ \+\([*/+\-%<Bar>&\~^]\)=@\1=@ge<CR>:'a,'zs/==/\="\<Char-0xff>\<Char-0xff>"/ge<CR>:'a,'zs/!=/\="!\<Char-0xff>"/ge<CR>'zk:AlignCtrl mIp1P1=l =<CR>:AlignCtrl g =<CR>:'a,'z-1Align<CR>:'a,'z-1s@\([*/+\-%<Bar>&\~^!=]\)\( \+\)=@\2\1=@ge<CR>:'a,'z-1s/\( \+\);/;\1/ge<CR>:'a,'z-s/%\ze[^=]/ @%@ /e<CR>'zk:call AlignMaps#StdAlign(1)<cr>:'y,'zs/^\(\s*\) @/\1/e<CR>:'a,'z-1s/\xff/=/ge<CR>:'y,'zs/ @//eg<CR><SID>WE
map <silent> <script> <Plug>AM_tab <SID>WS:'a,.s/^\(\t*\)\(.*\)$/\=submatch(1).escape(substitute(submatch(2),'\t',"\<Char-0xff>",'g'),'\')/<CR>:if &ts == 1<bar>exe "AlignCtrl mI=lp0P0 \<Char-0xff>"<bar>else<bar>exe "AlignCtrl mI=l \<Char-0xff>"<bar>endif<CR>:'a,.Align<CR>:exe "'y+1,'z-1s/\<Char-0xff>/".((&ts == 1)? '\t' : ' ')."/g"<CR><SID>WE
map <silent> <script> <Plug>AM_m= <SID>WS:'a,'zs/\s\+\([*/+\-%<Bar>&\~^]\==\)/ \1/e<CR>:'a,'zs@ \+\([*/+\-%<Bar>&\~^]\)=@\1=@ge<CR>:'a,'zs/==/\="\<Char-0x0f>\<Char-0x0f>"/ge<CR>:'a,'zs/!=/\="!\<Char-0x0f>"/ge<CR>'zk:AlignCtrl mIp1P1=l =<CR>:AlignCtrl g =<CR>:'a,'z-1Align<CR>:'a,'z-1s@\([*/+\-%<Bar>&\~^!=]\)\( \+\)=@\2\1=@ge<CR>:'a,'z-1s/\( \+\);/;\1/ge<CR>:'a,'z-s/%\ze[^=]/ @%@ /e<CR>'zk:call AlignMaps#StdAlign(1)<cr>:'y,'zs/^\(\s*\) @/\1/e<CR>:'a,'z-1s/\xff/=/ge<CR>:'y,'zs/ @//eg<CR><SID>WE
map <silent> <script> <Plug>AM_tab <SID>WS:'a,.s/^\(\t*\)\(.*\)$/\=submatch(1).escape(substitute(submatch(2),'\t',"\<Char-0x0f>",'g'),'\')/<CR>:if &ts == 1<bar>exe "AlignCtrl mI=lp0P0 \<Char-0x0f>"<bar>else<bar>exe "AlignCtrl mI=l \<Char-0x0f>"<bar>endif<CR>:'a,.Align<CR>:exe "'y+1,'z-1s/\<Char-0x0f>/".((&ts == 1)? '\t' : ' ')."/g"<CR><SID>WE
map <silent> <script> <Plug>AM_tml <SID>WS:AlignCtrl mWp1P0=l \\\@<!\\\s*$<CR>:'a,.Align<CR><SID>WE
map <silent> <script> <Plug>AM_tsp <SID>WS:'a,.s/^\(\s*\)\(.*\)/\=submatch(1).escape(substitute(submatch(2),'\s\+','@','g'),'\')/<CR>:AlignCtrl mI=lp0P0 @<CR>:'a,.Align<CR>:'y+1,'z-1s/@/ /g<CR><SID>WE
map <silent> <script> <Plug>AM_tsq <SID>WS:'a,.AlignReplaceQuotedSpaces<CR>:'a,.s/^\(\s*\)\(.*\)/\=submatch(1).substitute(submatch(2),'\s\+','@','g')/<CR>:AlignCtrl mIp0P0=l @<CR>:'a,.Align<CR>:'y+1,'z-1s/[%@]/ /g<CR><SID>WE

View File

@ -1,6 +1,6 @@
" AlignPlugin: tool to align multiple fields based on one or more separators
" Author: Charles E. Campbell, Jr.
" Date: Nov 15, 2007
" Date: Nov 02, 2008
" GetLatestVimScripts: 294 1 :AutoInstall: Align.vim
" GetLatestVimScripts: 1066 1 :AutoInstall: cecutil.vim
" Copyright: Copyright (C) 1999-2007 Charles E. Campbell, Jr. {{{1
@ -19,10 +19,10 @@
" faith to faith.
" ---------------------------------------------------------------------
" Load Once: {{{1
if &cp || exists("g:loaded_alignPlugin")
if &cp || exists("g:loaded_AlignPlugin")
finish
endif
let g:loaded_alignPlugin = 1
let g:loaded_AlignPlugin = "v35"
let s:keepcpo = &cpo
set cpo&vim

File diff suppressed because it is too large Load Diff

View File

@ -1,468 +0,0 @@
" ---------------------------------------------------------------------
" GetLatestVimScripts.vim
" Author: Charles E. Campbell, Jr.
" Date: Feb 15, 2006
" Version: 20
" Installing: :help glvs-install
" Usage: :help glvs
"
" GetLatestVimScripts: 642 1 :AutoInstall: GetLatestVimScripts.vim
" ---------------------------------------------------------------------
" Initialization: {{{1
" if you're sourcing this file, surely you can't be
" expecting vim to be in its vi-compatible mode
if &cp
echoerr "GetLatestVimScripts is not vi-compatible; not loaded (you need to set nocp)"
finish
endif
let s:keepfo = &fo
let s:keepcpo = &cpo
set cpo&vim
if exists("loaded_GetLatestVimScripts")
finish
endif
let g:loaded_GetLatestVimScripts= "v20"
" ---------------------------------------------------------------------
" Global Variables: {{{1
" allow user to change the command for obtaining scripts (does fetch work?)
if !exists("g:GetLatestVimScripts_wget")
let g:GetLatestVimScripts_wget= "wget"
endif
if !exists("g:GetLatestVimScripts_options")
let g:GetLatestVimScripts_options= "-q -O"
endif
if !exists("g:GetLatestVimScripts_allowautoinstall")
let g:GetLatestVimScripts_allowautoinstall= 1
endif
"" For debugging:
"let g:GetLatestVimScripts_wget = "echo"
"let g:GetLatestVimScripts_options = "options"
" check if s:autoinstall is possible
let s:autoinstall= ""
if g:GetLatestVimScripts_allowautoinstall
if (has("win32") || has("gui_win32") || has("gui_win32s") || has("win16") || has("win64") || has("win32unix") || has("win95")) && &shell != "bash"
" windows (but not cygwin/bash)
let s:dotvim= "vimfiles"
if !exists("g:GetLatestVimScripts_mv")
let g:GetLatestVimScripts_mv= "ren"
endif
else
" unix
let s:dotvim= ".vim"
if !exists("g:GetLatestVimScripts_mv")
let g:GetLatestVimScripts_mv= "mv"
endif
endif
if exists('$HOME') && isdirectory(expand("$HOME")."/".s:dotvim)
let s:autoinstall= $HOME."/".s:dotvim
endif
" call Decho("s:autoinstall<".s:autoinstall.">")
else
" call Decho("g:GetLatestVimScripts_allowautoinstall=".g:GetLatestVimScripts_allowautoinstall.": :AutoInstall: disabled")
endif
" ---------------------------------------------------------------------
" Public Interface: {{{1
com! -nargs=0 GetLatestVimScripts call <SID>GetLatestVimScripts()
silent! com -nargs=0 GLVS call <SID>GetLatestVimScripts()
" ---------------------------------------------------------------------
" GetOneScript: (Get Latest Vim Script) this function operates {{{1
" on the current line, interpreting two numbers and text as
" ScriptID, SourceID, and Filename.
" It downloads any scripts that have newer versions from vim.sf.net.
fun! <SID>GetOneScript(...)
" call Dfunc("GetOneScript()")
" set options to allow progress to be shown on screen
let t_ti= &t_ti
let t_te= &t_te
let rs = &rs
set t_ti= t_te= nors
" put current line on top-of-screen and interpret it into
" a script identifer : used to obtain webpage
" source identifier : used to identify current version
" and an associated comment: used to report on what's being considered
if a:0 >= 3
let scriptid = a:1
let srcid = a:2
let cmmnt = a:3
" call Decho("scriptid<".scriptid.">")
" call Decho("srcid <".srcid.">")
" call Decho("cmmnt <".cmmnt.">")
else
let curline = getline(".")
let parsepat = '^\s*\(\d\+\)\s\+\(\d\+\)\s\+\(.\{-}\)$'
try
let scriptid = substitute(curline,parsepat,'\1','e')
catch /^Vim\%((\a\+)\)\=:E486/
let scriptid= 0
endtry
try
let srcid = substitute(curline,parsepat,'\2','e')
catch /^Vim\%((\a\+)\)\=:E486/
let srcid= 0
endtry
try
let cmmnt = substitute(curline,parsepat,'\3','e')
catch /^Vim\%((\a\+)\)\=:E486/
let cmmnt= ""
endtry
" call Decho("curline <".curline.">")
" call Decho("parsepat<".parsepat.">")
" call Decho("scriptid<".scriptid.">")
" call Decho("srcid <".srcid.">")
" call Decho("cmmnt <".cmmnt.">")
endif
if scriptid == 0 || srcid == 0
" When looking for :AutoInstall: lines, skip scripts that
" have 0 0 scriptname
" call Dret("GetOneScript : skipping a scriptid==srcid==0 line")
return
endif
let doautoinstall= 0
if cmmnt =~ ":AutoInstall:"
" call Decho("cmmnt<".cmmnt."> has :AutoInstall:...")
let aicmmnt= substitute(cmmnt,'\s\+:AutoInstall:\s\+',' ','')
" call Decho("aicmmnt<".aicmmnt."> s:autoinstall=".s:autoinstall)
if s:autoinstall != ""
let doautoinstall = g:GetLatestVimScripts_allowautoinstall
endif
else
let aicmmnt= cmmnt
endif
" call Decho("aicmmnt<".aicmmnt.">: doautoinstall=".doautoinstall)
exe "norm z\<CR>"
redraw!
" call Decho('considering <'.aicmmnt.'> scriptid='.scriptid.' srcid='.srcid)
echomsg 'considering <'.aicmmnt.'> scriptid='.scriptid.' srcid='.srcid
" grab a copy of the plugin's vim.sf.net webpage
let scriptaddr = 'http://vim.sf.net/script.php?script_id='.scriptid
let tmpfile = tempname()
let v:errmsg = ""
" make three tries at downloading the description
let itry= 1
while itry <= 3
" call Decho("try#".itry." to download description of <".aicmmnt."> with addr=".scriptaddr)
if has("win32") || has("win16") || has("win95")
" call Decho("silent !".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".tmpfile.' "'.scriptaddr.'"')
exe "silent !".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".tmpfile.' "'.scriptaddr.'"'
else
" call Decho("silent !".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".tmpfile." '".scriptaddr."'")
exe "silent !".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".tmpfile." '".scriptaddr."'"
endif
if itry == 1
exe "silent vsplit ".tmpfile
else
silent! e %
endif
" find the latest source-id in the plugin's webpage
silent! 1
let findpkg= search('Click on the package to download','W')
if findpkg > 0
break
endif
let itry= itry + 1
endwhile
" call Decho(" --- end downloading tries while loop --- itry=".itry)
" testing: did finding /Click on the package.../ fail?
if findpkg == 0 || itry >= 4
silent q!
call delete(tmpfile)
" restore options
let &t_ti = t_ti
let &t_te = t_te
let &rs = rs
let s:downerrors = s:downerrors + 1
" call Decho("***warning*** couldn'".'t find "Click on the package..." in description page for <'.aicmmnt.">")
echomsg "***warning*** couldn'".'t find "Click on the package..." in description page for <'.aicmmnt.">"
" call Dret("GetOneScript : srch for /Click on the package/ failed")
return
endif
" call Decho('found "Click on the package to download"')
let findsrcid= search('src_id=','W')
if findsrcid == 0
silent q!
call delete(tmpfile)
" restore options
let &t_ti = t_ti
let &t_te = t_te
let &rs = rs
let s:downerrors = s:downerrors + 1
" call Decho("***warning*** couldn'".'t find "src_id=" in description page for <'.aicmmnt.">")
echomsg "***warning*** couldn'".'t find "src_id=" in description page for <'.aicmmnt.">"
" call Dret("GetOneScript : srch for /src_id/ failed")
return
endif
" call Decho('found "src_id=" in description page')
let srcidpat = '^\s*<td class.*src_id=\(\d\+\)">\([^<]\+\)<.*$'
let latestsrcid= substitute(getline("."),srcidpat,'\1','')
let fname = substitute(getline("."),srcidpat,'\2','')
" call Decho("srcidpat<".srcidpat."> latestsrcid<".latestsrcid."> fname<".fname.">")
silent q!
call delete(tmpfile)
" convert the strings-of-numbers into numbers
let srcid = srcid + 0
let latestsrcid = latestsrcid + 0
" call Decho("srcid=".srcid." latestsrcid=".latestsrcid." fname<".fname.">")
" has the plugin's most-recent srcid increased, which indicates
" that it has been updated
if latestsrcid > srcid
let s:downloads= s:downloads + 1
if fname == bufname("%")
" GetLatestVimScript has to be careful about downloading itself
let fname= "NEW_".fname
endif
" the plugin has been updated since we last obtained it, so download a new copy
" call Decho("...downloading new <".fname.">")
echomsg "...downloading new <".fname.">"
if has("win32") || has("gui_win32") || has("gui_win32s") || has("win16") || has("win64") || has("win32unix") || has("win95")
" call Decho("windows: silent !".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".fname.' "'.'http://vim.sf.net/scripts/download_script.php?src_id='.latestsrcid.'"')
exe "silent !".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".fname.' "'.'http://vim.sf.net/scripts/download_script.php?src_id='.latestsrcid.'"'
else
" call Decho("unix: silent !".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".fname." '".'http://vim.sf.net/scripts/download_script.php?src_id='.latestsrcid."'")
exe "silent !".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".fname." '".'http://vim.sf.net/scripts/download_script.php?src_id='.latestsrcid."'"
endif
" AutoInstall: only if doautoinstall is so indicating
if doautoinstall
" call Decho("attempting to do autoinstall: getcwd<".getcwd()."> filereadable(".fname.")=".filereadable(fname))
if filereadable(fname)
" call Decho("move <".fname."> to ".s:autoinstall)
" call Decho("DISABLED for testing")
exe "silent !"g:GetLatestVimScripts_mv." ".fname." ".s:autoinstall
let curdir= escape(substitute(getcwd(),'\','/','ge'),"|[]*'\" #")
exe "cd ".s:autoinstall
if fname =~ '\.bz2$'
" call Decho("attempt to bunzip2 ".fname)
exe "silent !bunzip2 ".fname
let fname= substitute(fname,'\.bz2$','','')
elseif fname =~ '\.gz$'
" call Decho("attempt to gunzip ".fname)
exe "silent !gunzip ".fname
let fname= substitute(fname,'\.gz$','','')
endif
if fname =~ '\.zip$'
" call Decho("attempt to unzip ".fname)
exe "silent !unzip -o".fname
elseif fname =~ '\.tar$'
" call Decho("attempt to untar ".fname)
exe "silent !tar -oxvf ".fname
endif
if fname =~ '.vim$'
" call Decho("attempt to simply move ".fname." to plugin")
exe "silent !".g:GetLatestVimScripts_mv." ".fname." plugin"
endif
exe "helptags ../".s:dotvim."/doc"
exe "cd ".curdir
endif
endif
" update the data in the <GetLatestVimScripts.dat> file
let modline=scriptid." ".latestsrcid." ".cmmnt
call setline(line("."),modline)
" call Decho("modline<".modline."> (updated GetLatestVimScripts.dat file)")
endif
" restore options
let &t_ti= t_ti
let &t_te= t_te
let &rs = rs
" call Dret("GetOneScript")
endfun
" ---------------------------------------------------------------------
" GetLatestVimScripts: this function gets the latest versions of {{{1
" scripts based on the list in
"
" (first dir in runtimepath)/GetLatest/GetLatestVimScripts.dat
fun! <SID>GetLatestVimScripts()
" call Dfunc("GetLatestVimScripts() autoinstall<".s:autoinstall.">")
" insure that wget is executable
if executable(g:GetLatestVimScripts_wget) != 1
echoerr "GetLatestVimScripts needs ".g:GetLatestVimScripts_wget." which apparently is not available on your system"
" call Dret("GetLatestVimScripts : wget not executable/availble")
return
endif
" Find the .../GetLatest sudirectory under the runtimepath
let rtplist= &rtp
while rtplist != ""
let datadir= substitute(rtplist,',.*$','','e')."/GetLatest"
if isdirectory(datadir)
" call Decho("found directory<".datadir.">")
break
endif
unlet datadir
if rtplist =~ ','
let rtplist= substitute(rtplist,'^.\{-},','','e')
else
let rtplist= ""
endif
endwhile
" Sanity checks: readability and writability
if !exists("datadir")
echoerr "Unable to find a GetLatest subdirectory on your runtimepath"
" call Dret("GetLatestVimScripts : unable to find a GetLatest subdirectory")
return
endif
if filewritable(datadir) != 2
echoerr "Your ".datadir." isn't writable"
" call Dret("GetLatestVimScripts : non-writable directory<".datadir.">")
return
endif
let datafile= datadir."/GetLatestVimScripts.dat"
if !filereadable(datafile)
echoerr "Your data file<".datafile."> isn't readable"
" call Dret("GetLatestVimScripts : non-readable datafile<".datafile.">")
return
endif
if !filewritable(datafile)
echoerr "Your data file<".datafile."> isn't writable"
" call Dret("GetLatestVimScripts : non-writable datafile<".datafile.">")
return
endif
" call Decho("datadir <".datadir.">")
" call Decho("datafile <".datafile.">")
" don't let any events interfere (like winmanager's, taglist's, etc)
let eikeep= &ei
set ei=all
" record current directory, change to datadir, open split window with
" datafile
let origdir= getcwd()
exe "cd ".escape(substitute(datadir,'\','/','ge'),"|[]*'\" #")
split
exe "e ".escape(substitute(datafile,'\','/','ge'),"|[]*'\" #")
res 1000
let s:downloads = 0
let s:downerrors= 0
" Check on dependencies mentioned in plugins
" call Decho(" ")
" call Decho("searching plugins for GetLatestVimScripts dependencies")
let lastline = line("$")
let plugins = globpath(&rtp,"plugin/*.vim")
let foundscript = 0
" call Decho("plugins<".plugins."> lastline#".lastline)
while plugins != ""
let plugin = substitute(plugins,'\n.*$','','e')
let plugins= (plugins =~ '\n')? substitute(plugins,'^.\{-}\n\(.*\)$','\1','e') : ""
$
" call Decho(".dependency checking<".plugin."> line$=".line("$"))
exe "silent r ".plugin
while search('^"\s\+GetLatestVimScripts:\s\+\d\+\s\+\d\+','W') != 0
let newscript= substitute(getline("."),'^"\s\+GetLatestVimScripts:\s\+\d\+\s\+\d\+\s\+\(.*\)$','\1','e')
let llp1 = lastline+1
if newscript !~ '^"'
" found a "GetLatestVimScripts: # #" line in the script; check if its already in the datafile
let curline = line(".")
let noai_script = substitute(newscript,'\s*:AutoInstall:\s*','','e')
exe llp1
let srchline = search('\<'.noai_script.'\>','bW')
" call Decho("..newscript<".newscript."> noai_script<".noai_script."> srch=".srchline." lastline=".lastline)
if srchline == 0
" found a new script to permanently include in the datafile
let keep_rega = @a
let @a = substitute(getline(curline),'^"\s\+GetLatestVimScripts:\s\+','','')
exe lastline."put a"
echomsg "Appending <".@a."> to ".datafile." for ".newscript
" call Decho("..APPEND (".noai_script.")<".@a."> to GetLatestVimScripts.dat")
let @a = keep_rega
let lastline = llp1
let curline = curline + 1
let foundscript = foundscript + 1
" else " Decho
" call Decho("..found <".noai_script."> (already in datafile at line#".srchline.")")
endif
let curline = curline + 1
exe curline
endif
endwhile
let llp1= lastline + 1
" call Decho(".deleting lines: ".llp1.",$d")
exe "silent! ".llp1.",$d"
endwhile
if foundscript == 0
set nomod
endif
" Check on out-of-date scripts using GetLatest/GetLatestVimScripts.dat
set lz
" call Decho(" --- end of dependency checking loop --- ")
" call Decho("call GetOneScript on lines at end of datafile<".datafile.">")
1
/^-----/,$g/^\s*\d/call <SID>GetOneScript()
" Final report (an echomsg)
try
silent! ?^-------?
catch /^Vim\%((\a\+)\)\=:E114/
" call Dret("GetLatestVimScripts : nothing done!")
return
endtry
exe "norm! kz\<CR>"
let s:msg = ""
if s:downloads == 1
let s:msg = "Downloaded one updated script to <".datadir.">"
elseif s:downloads == 2
let s:msg= "Downloaded two updated scripts to <".datadir.">"
elseif s:downloads > 1
let s:msg= "Downloaded ".s:downloads." updated scripts to <".datadir.">"
else
let s:msg= "Everything was already current"
endif
if s:downerrors > 0
let s:msg= s:msg." (".s:downerrors." downloading errors)"
endif
echomsg s:msg
" save the file
if &mod
wq
else
q
endif
" restore events and current directory
exe "cd ".escape(substitute(origdir,'\','/','ge'),"|[]*'\" #")
let &ei= eikeep
set nolz
" call Dret("GetLatestVimScripts : did ".s:downloads." downloads")
endfun
" ---------------------------------------------------------------------
" Restore Options: {{{1
let &fo = s:keepfo
let &cpo= s:keepcpo
" vim: ts=4 fdm=marker nowrap

View File

@ -83,7 +83,7 @@ fun! SaveWinPosn(...)
return ""
endif
let so_keep = &l:so
let siso_keep = &l:siso
let siso_keep = &siso
let ss_keep = &l:ss
setlocal so=0 siso=0 ss=0
@ -114,9 +114,9 @@ fun! SaveWinPosn(...)
let b:cecutil_winposn{b:cecutil_iwinposn}= savedposn
endif
let &l:so = so_keep
let &l:siso = siso_keep
let &l:ss = ss_keep
let &l:so = so_keep
let &siso = siso_keep
let &l:ss = ss_keep
" if exists("b:cecutil_iwinposn") " Decho
" call Decho("b:cecutil_winpos{".b:cecutil_iwinposn."}[".b:cecutil_winposn{b:cecutil_iwinposn}."]")
@ -129,6 +129,8 @@ endfun
" ---------------------------------------------------------------------
" RestoreWinPosn: {{{2
" call RestoreWinPosn()
" call RestoreWinPosn(winposn)
fun! RestoreWinPosn(...)
" call Dfunc("RestoreWinPosn() a:0=".a:0)
" call Decho("getline(1)<".getline(1).">")

View File

@ -0,0 +1,169 @@
" Vim Global Plugin for Editing .srec Files
" Maintainer: Alexander Fleck
" <alexander.fleck@gmx.net>
" License: This File is placed in the Public Domain.
" Revision | Date [DD.MM.YY] | Changes
" 00.01.00 | 05.07.09 | 01. Revision
if exists("loaded_editsrec")
finish
endif
let loaded_editsrec = 1
let s:save_cpo = &cpo
set cpo&vim
" BC = ByteCount
if !hasmapto('<Plug>EditSrecLineBC')
map <unique> <Leader>lb <Plug>EditSrecLineBC
endif
noremap <unique> <script> <Plug>EditSrecLineBC <SID>AutoLineBC
noremap <SID>AutoLineBC <Esc>:call <SID>AutoLineBC()<CR>
if !hasmapto('<Plug>EditSrecPartBC')
map <unique> <Leader>pb <Plug>EditSrecPartBC
endif
noremap <unique> <script> <Plug>EditSrecPartBC <SID>AutoPartBC
noremap <SID>AutoPartBC <Esc>:call <SID>AutoPartBC()<CR>
" AD = ADdress
if !hasmapto('<Plug>EditSrecLineAD')
map <unique> <Leader>la <Plug>EditSrecLineAD
endif
noremap <unique> <script> <Plug>EditSrecLineAD <SID>AutoLineAD
noremap <SID>AutoLineAD <Esc>:call <SID>AutoLineAD()<CR>
if !hasmapto('<Plug>EditSrecPartAD')
map <unique> <Leader>pa <Plug>EditSrecPartAD
endif
noremap <unique> <script> <Plug>EditSrecPartAD <SID>AutoPartAD
noremap <SID>AutoPartAD <Esc>:call <SID>AutoPartAD()<CR>
" DA = DAta
if !hasmapto('<Plug>EditSrecLineDA')
map <unique> <Leader>ld <Plug>EditSrecLineDA
endif
noremap <unique> <script> <Plug>EditSrecLineDA <SID>AutoLineDA
noremap <SID>AutoLineDA <Esc>:call <SID>AutoLineDA()<CR>
if !hasmapto('<Plug>EditSrecPartDA')
map <unique> <Leader>pd <Plug>EditSrecPartDA
endif
noremap <unique> <script> <Plug>EditSrecPartDA <SID>AutoPartDA
noremap <SID>AutoPartDA <Esc>:call <SID>AutoPartDA()<CR>
" CS = CheckSum
if !hasmapto('<Plug>EditSrecLineCS')
map <unique> <Leader>lc <Plug>EditSrecLineCS
endif
noremap <unique> <script> <Plug>EditSrecLineCS <SID>AutoLineCS
noremap <SID>AutoLineCS <Esc>:call <SID>AutoLineCS()<CR>
if !hasmapto('<Plug>EditSrecPartCS')
map <unique> <Leader>pc <Plug>EditSrecPartCS
endif
noremap <unique> <script> <Plug>EditSrecPartCS <SID>AutoPartCS
noremap <SID>AutoPartCS <Esc>:call <SID>AutoPartCS()<CR>
" obsolete Mappings
"imap <F5> <Esc>:call <SID>AutoLineBC()<CR>a
"imap <F6> <Esc>:call <SID>AutoLineAD()<CR>a
"imap <F7> <Esc>:call <SID>AutoLineDA()<CR>a
"imap <F8> <Esc>:call <SID>AutoLineCS()<CR>a
"imap <C-F5> <Esc>:call <SID>AutoPartBC()<CR>a
"imap <C-F6> <Esc>:call <SID>AutoPartAD()<CR>a
"imap <C-F7> <Esc>:call <SID>AutoPartDA()<CR>a
"imap <C-F8> <Esc>:call <SID>AutoPartCS()<CR>a
" create Line from ByteCount
fun s:AutoLineBC()
let s:ln = getline(".")
let s:ln = s:ln . libsrec#CrBC(s:ln)
let s:ln = s:ln . libsrec#CrAD(s:ln)
let s:ln = s:ln . libsrec#CrDA(s:ln)
let s:ln = s:ln . libsrec#CrCS(s:ln)
call setline(".", s:ln)
unlet s:ln
endfun
" create only ByteCount
fun s:AutoPartBC()
let s:ln = getline(".")
let s:ln = s:ln . libsrec#CrBC(s:ln)
call setline(".", s:ln)
unlet s:ln
endfun
" create Line from ADdress
fun s:AutoLineAD()
let s:ln = getline(".")
let s:ln = s:ln . libsrec#CrAD(s:ln)
let s:ln = s:ln . libsrec#CrDA(s:ln)
let s:ln = s:ln . libsrec#CrCS(s:ln)
call setline(".", s:ln)
unlet s:ln
endfun
" create only ADdress
fun s:AutoPartAD()
let s:ln = getline(".")
let s:ln = s:ln . libsrec#CrAD(s:ln)
call setline(".", s:ln)
unlet s:ln
endfun
" create Line from DAta
fun s:AutoLineDA()
let s:ln = getline(".")
let s:ln = s:ln . libsrec#CrDA(s:ln)
let s:ln = s:ln . libsrec#CrCS(s:ln)
call setline(".", s:ln)
unlet s:ln
endfun
" create only DAta
fun s:AutoPartDA()
let s:ln = getline(".")
let s:ln = s:ln . libsrec#CrDA(s:ln)
call setline(".", s:ln)
unlet s:ln
endfun
" create Line from CheckSum
fun s:AutoLineCS()
let s:ln = getline(".")
let s:ln = s:ln . libsrec#CrCS(s:ln)
call setline(".", s:ln)
unlet s:ln
endfun
" create only CheckSum
fun s:AutoPartCS()
let s:ln = getline(".")
let s:ln = s:ln . libsrec#CrCS(s:ln)
call setline(".", s:ln)
unlet s:ln
endfun
let &cpo = s:save_cpo

View File

@ -0,0 +1,337 @@
" Vim Test Cases for Editing .srec Files
" Maintainer: Alexander Fleck
" <alexander.fleck@gmx.net>
" License: This File is placed in the Public Domain.
" Revision | Date [DD.MM.YY] | Changes
" 00.01.00 | 05.07.09 | 01. Revision
" This File contains Test Cases for the Plugin 'editsrec.vim'
" and its Library 'libsrec.vim'.
TestCases for ByteCount
Line -----------------------------
insert a new Line and type "S0"
type "<Esc><Leader>lb"
the following Line will be created
S00F0000FFFFFFFFFFFFFFFFFFFFFFFFFC
insert a new Line and type "S1"
type "<Esc><Leader>lb"
the following Line will be created
S10F0000FFFFFFFFFFFFFFFFFFFFFFFFFC
insert a new Line and type "S2"
type "<Esc><Leader>lb"
the following Line will be created
S20F000000FFFFFFFFFFFFFFFFFFFFFFFB
insert a new Line and type "S3"
type "<Esc><Leader>lb"
the following Line will be created
S30F00000000FFFFFFFFFFFFFFFFFFFFFA
insert a new Line and type "S4"
type "<Esc><Leader>lb"
Nothing will be created
insert a new Line and type "S5"
type "<Esc><Leader>lb"
the following Line will be created
S5030000FC
insert a new Line and type "S6"
type "<Esc><Leader>lb"
Nothing will be created
insert a new Line and type "S7"
type "<Esc><Leader>lb"
the following Line will be created
S70500000000FA
insert a new Line and type "S8"
type "<Esc><Leader>lb"
the following Line will be created
S804000000FB
insert a new Line and type "S9"
type "<Esc><Leader>lb"
the following Line will be created
S9030000FC
Part -----------------------------
insert a new Line and type "S0"
type "<Esc><Leader>pb"
the following Line will be created
S00F
insert a new Line and type "S1"
type "<Esc><Leader>pb"
the following Line will be created
S10F
insert a new Line and type "S2"
type "<Esc><Leader>pb"
the following Line will be created
S20F
insert a new Line and type "S3"
type "<Esc><Leader>pb"
the following Line will be created
S30F
insert a new Line and type "S4"
type "<Esc><Leader>pb"
Nothing will be created
insert a new Line and type "S5"
type "<Esc><Leader>pb"
the following Line will be created
S503
insert a new Line and type "S6"
type "<Esc><Leader>pb"
Nothing will be created
insert a new Line and type "S7"
type "<Esc><Leader>pb"
the following Line will be created
S705
insert a new Line and type "S8"
type "<Esc><Leader>pb"
the following Line will be created
S804
insert a new Line and type "S9"
type "<Esc><Leader>pb"
the following Line will be created
S903
TestCases for ADdress
Line -----------------------------
insert a new Line and type "S00F"
type "<Esc><Leader>la"
the following Line will be created
S00F0000FFFFFFFFFFFFFFFFFFFFFFFFFC
insert a new Line and type "S10F"
type "<Esc><Leader>la"
the following Line will be created
S10F0000FFFFFFFFFFFFFFFFFFFFFFFFFC
insert a new Line and type "S20F"
type "<Esc><Leader>la"
the following Line will be created
S20F000000FFFFFFFFFFFFFFFFFFFFFFFB
insert a new Line and type "S30F"
type "<Esc><Leader>la"
the following Line will be created
S30F00000000FFFFFFFFFFFFFFFFFFFFFA
insert a new Line and type "S40F"
type "<Esc><Leader>la"
Nothing will be created
insert a new Line and type "S503"
type "<Esc><Leader>la"
the following Line will be created
S5030000FC
insert a new Line and type "S60F"
type "<Esc><Leader>la"
Nothing will be created
insert a new Line and type "S705"
type "<Esc><Leader>la"
the following Line will be created
S70500000000FA
insert a new Line and type "S804"
type "<Esc><Leader>la"
the following Line will be created
S804000000FB
insert a new Line and type "S903"
type "<Esc><Leader>la"
the following Line will be created
S9030000FC
Part -----------------------------
insert a new Line and type "S00F"
type "<Esc><Leader>pa"
the following Line will be created
S00F0000
insert a new Line and type "S10F"
type "<Esc><Leader>pa"
the following Line will be created
S10F0000
insert a new Line and type "S20F"
type "<Esc><Leader>pa"
the following Line will be created
S20F000000
insert a new Line and type "S30F"
type "<Esc><Leader>pa"
the following Line will be created
S30F00000000
insert a new Line and type "S40F"
type "<Esc><Leader>pa"
Nothing will be created
insert a new Line and type "S503"
type "<Esc><Leader>pa"
the following Line will be created
S5030000
insert a new Line and type "S60F"
type "<Esc><Leader>pa"
Nothing will be created
insert a new Line and type "S705"
type "<Esc><Leader>pa"
the following Line will be created
S70500000000
insert a new Line and type "S804"
type "<Esc><Leader>pa"
the following Line will be created
S804000000
insert a new Line and type "S903"
type "<Esc><Leader>pa"
the following Line will be created
S9030000
TestCases for DAta
Line -----------------------------
insert a new Line and type "S00F0000"
type "<Esc><Leader>ld"
the following Line will be created
S00F0000FFFFFFFFFFFFFFFFFFFFFFFFFC
insert a new Line and type "S10F0000"
type "<Esc><Leader>ld"
the following Line will be created
S10F0000FFFFFFFFFFFFFFFFFFFFFFFFFC
insert a new Line and type "S20F000000"
type "<Esc><Leader>ld"
the following Line will be created
S20F000000FFFFFFFFFFFFFFFFFFFFFFFB
insert a new Line and type "S30F00000000"
type "<Esc><Leader>ld"
the following Line will be created
S30F00000000FFFFFFFFFFFFFFFFFFFFFA
insert a new Line and type "S40F0000"
type "<Esc><Leader>ld"
Nothing will be created
insert a new Line and type "S5030000"
type "<Esc><Leader>ld"
the following Line will be created
S5030000FC
insert a new Line and type "S60F0000"
type "<Esc><Leader>ld"
Nothing will be created
insert a new Line and type "S70500000000"
type "<Esc><Leader>ld"
the following Line will be created
S70500000000FA
insert a new Line and type "S804000000"
type "<Esc><Leader>ld"
the following Line will be created
S804000000FB
insert a new Line and type "S9030000"
type "<Esc><Leader>ld"
the following Line will be created
S9030000FC
Part -----------------------------
insert a new Line and type "S00F0000"
type "<Esc><Leader>pd"
the following Line will be created
S00F0000FFFFFFFFFFFFFFFFFFFFFFFF
insert a new Line and type "S10F0000"
type "<Esc><Leader>pd"
the following Line will be created
S00F0000FFFFFFFFFFFFFFFFFFFFFFFF
insert a new Line and type "S20F000000"
type "<Esc><Leader>pd"
the following Line will be created
S00F000000FFFFFFFFFFFFFFFFFFFFFF
insert a new Line and type "S30F00000000"
type "<Esc><Leader>pd"
the following Line will be created
S00F00000000FFFFFFFFFFFFFFFFFFFF
insert a new Line and type "S40F0000"
type "<Esc><Leader>pd"
Nothing will be created
insert a new Line and type "S5030000"
type "<Esc><Leader>pd"
the following Line will be created
S5030000
insert a new Line and type "S60F0000"
type "<Esc><Leader>pd"
Nothing will be created
insert a new Line and type "S70500000000"
type "<Esc><Leader>pd"
the following Line will be created
S70500000000
insert a new Line and type "S804000000"
type "<Esc><Leader>pd"
the following Line will be created
S804000000
insert a new Line and type "S9030000"
type "<Esc><Leader>pd"
the following Line will be created
S9030000
TestCases for CheckSum
Line -----------------------------
insert a new Line and type "S00F0000FFFFFFFFFFFFFFFFFFFFFFFF"
type "<Esc><Leader>lc"
the following Line will be created
S00F0000FFFFFFFFFFFFFFFFFFFFFFFFFC
insert a new Line and type "S10F0000FFFFFFFFFFFFFFFFFFFFFFFF"
type "<Esc><Leader>lc"
the following Line will be created
S10F0000FFFFFFFFFFFFFFFFFFFFFFFFFC
insert a new Line and type "S20F000000FFFFFFFFFFFFFFFFFFFFFF"
type "<Esc><Leader>lc"
the following Line will be created
S20F000000FFFFFFFFFFFFFFFFFFFFFFFB
insert a new Line and type "S30F00000000FFFFFFFFFFFFFFFFFFFF"
type "<Esc><Leader>lc"
the following Line will be created
S30F00000000FFFFFFFFFFFFFFFFFFFFFA
insert a new Line and type "S40F0000"
type "<Esc><Leader>lc"
Nothing will be created
insert a new Line and type "S5030000"
type "<Esc><Leader>lc"
the following Line will be created
S5030000FC
insert a new Line and type "S60F0000"
type "<Esc><Leader>lc"
Nothing will be created
insert a new Line and type
type "<Esc><Leader>lc"
the following Line will be created
S70500000000FA
insert a new Line and type "S804000000"
type "<Esc><Leader>lc"
the following Line will be created
S804000000FB
insert a new Line and type "S9030000"
type "<Esc><Leader>lc"
the following Line will be created
S9030000FC
Part -----------------------------
insert a new Line and type "S00F0000FFFFFFFFFFFFFFFFFFFFFFFF"
type "<Esc><Leader>pc"
the following Line will be created
S00F0000FFFFFFFFFFFFFFFFFFFFFFFFFC
insert a new Line and type "S10F0000FFFFFFFFFFFFFFFFFFFFFFFF"
type "<Esc><Leader>pc"
the following Line will be created
S10F0000FFFFFFFFFFFFFFFFFFFFFFFFFC
insert a new Line and type "S20F000000FFFFFFFFFFFFFFFFFFFFFF"
type "<Esc><Leader>pc"
the following Line will be created
S20F000000FFFFFFFFFFFFFFFFFFFFFFFB
insert a new Line and type "S30F00000000FFFFFFFFFFFFFFFFFFFF"
type "<Esc><Leader>pc"
the following Line will be created
S30F00000000FFFFFFFFFFFFFFFFFFFFFA
insert a new Line and type "S40F0000"
type "<Esc><Leader>pc"
Nothing will be created
insert a new Line and type "S5030000"
type "<Esc><Leader>pc"
the following Line will be created
S5030000FC
insert a new Line and type "S60F0000"
type "<Esc><Leader>pc"
Nothing will be created
insert a new Line and type "S70500000000"
type "<Esc><Leader>pc"
the following Line will be created
S70500000000FA
insert a new Line and type "S804000000"
type "<Esc><Leader>pc"
the following Line will be created
S804000000FB
insert a new Line and type "S9030000"
type "<Esc><Leader>pc"
the following Line will be created
S9030000FC

View File

@ -20,7 +20,7 @@
if &cp || exists("g:loaded_netrwPlugin")
finish
endif
let g:loaded_netrwPlugin = "v134"
let g:loaded_netrwPlugin = "v136"
if v:version < 702
echohl WarningMsg | echo "***netrw*** you need vim version 7.2 for this version of netrw" | echohl None
finish
@ -49,8 +49,8 @@ augroup Network
au BufReadCmd file://* exe "silent doau BufReadPre ".fnameescape(netrw#RFC2396(expand("<amatch>")))|exe 'e '.fnameescape(substitute(netrw#RFC2396(expand("<amatch>")),'file://\(.*\)','\1',""))|exe "bwipe ".fnameescape(expand("<amatch>"))|exe "silent doau BufReadPost ".fnameescape(netrw#RFC2396(expand("<amatch>")))
au BufReadCmd file://localhost/* exe "silent doau BufReadPre ".fnameescape(netrw#RFC2396(expand("<amatch>")))|exe 'e '.fnameescape(substitute(netrw#RFC2396(expand("<amatch>")),'file://localhost/\(.*\)','\1',""))|exe "bwipe ".fnameescape(substitute(expand("<amatch>"),'file://\(\k\+@\)\=','',''))|exe "silent doau BufReadPost ".fnameescape(netrw#RFC2396(expand("<amatch>")))
endif
au BufReadCmd ftp://*,rcp://*,scp://*,http://*,dav://*,davs://*,rsync://*,sftp://* exe "silent doau BufReadPre ".fnameescape(expand("<amatch>"))|exe '2Nread '.fnameescape(expand("<amatch>"))|exe "silent doau BufReadPost ".fnameescape(expand("<amatch>"))
au FileReadCmd ftp://*,rcp://*,scp://*,http://*,dav://*,davs://*,rsync://*,sftp://* exe "silent doau FileReadPre ".fnameescape(expand("<amatch>"))|exe 'Nread '.fnameescape(expand("<amatch>"))|exe "silent doau FileReadPost ".fnameescape(expand("<amatch>"))
au BufReadCmd ftp://*,rcp://*,scp://*,http://*,dav://*,davs://*,rsync://*,sftp://* exe "silent doau BufReadPre ".fnameescape(expand("<amatch>"))|call netrw#Nread(2,expand("<amatch>"))|exe "silent doau BufReadPost ".fnameescape(expand("<amatch>"))
au FileReadCmd ftp://*,rcp://*,scp://*,http://*,dav://*,davs://*,rsync://*,sftp://* exe "silent doau FileReadPre ".fnameescape(expand("<amatch>"))|call netrw#Nread(1,expand("<amatch>"))|exe "silent doau FileReadPost ".fnameescape(expand("<amatch>"))
au BufWriteCmd ftp://*,rcp://*,scp://*,dav://*,davs://*,rsync://*,sftp://* exe "silent doau BufWritePre ".fnameescape(expand("<amatch>"))|exe 'Nwrite '.fnameescape(expand("<amatch>"))|exe "silent doau BufWritePost ".fnameescape(expand("<amatch>"))
au FileWriteCmd ftp://*,rcp://*,scp://*,dav://*,davs://*,rsync://*,sftp://* exe "silent doau FileWritePre ".fnameescape(expand("<amatch>"))|exe "'[,']".'Nwrite '.fnameescape(expand("<amatch>"))|exe "silent doau FileWritePost ".fnameescape(expand("<amatch>"))
try

View File

@ -1,374 +0,0 @@
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" svndiff (C) 2007 Ico Doornekamp
"
" This program is free software; you can redistribute it and/or modify it
" under the terms of the GNU General Public License as published by the Free
" Software Foundation; either version 2 of the License, or (at your option)
" any later version.
"
" This program is distributed in the hope that it will be useful, but WITHOUT
" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
" more details.
"
" Introduction
" ------------
"
" NOTE: This plugin is unix-only!
"
" An small vim 7.0 plugin for showing RCS diff information in a file while
" editing. This plugin runs a diff between the current buffer and the original
" file from svn or git, and shows coloured signs indicating where the buffer
" differs from the original file from the repository. The original
" text is not shown, only signs are used to indicate where changes were made.
"
" The plugin can be used for files managed with subversion or GIT. The type of
" RCS will be detected when first issuing a svndiff command on the file.
"
" The following symbols and syntax highlight groups are used for the signs:
"
" > DiffAdd: Newly added lines. (default=blue)
"
" ! DiffChange: Lines which are changed from the original. (default=cyan)
"
" < DiffDel: Applied to the lines directly above and below a deleted block
" (default=magenta)
" Usage
" -----
"
" The plugin defines one function: Svndiff(). This function figures out the
" difference between the current buffer and it's svn/git original, and adds
" the signs at the places where the buffer differs from the original file from
" svn or git. You'll need to call this function after making changes to update
" the highlighting.
"
" The function takes one argument specifying an additional action to perform:
"
" "prev" : jump to the previous different block
" "next" : jump to the next different block
" "clear" : clean up all signs
"
" You might want to map some keys to run the Svndiff function. For
" example, add to your .vimrc:
"
" noremap <F3> :call Svndiff("prev")<CR>
" noremap <F4> :call Svndiff("next")<CR>
" noremap <F5> :call Svndiff("clear")<CR>
"
"
" Configuration
" -------------
"
" The following configuration variables are availabe:
"
" * g:svndiff_autoupdate
"
" If this variable is defined, svndiff will automatically update the signs
" when the user stops typing for a short while, and when leaving insert
" mode. This might slow things down on large files, so use with caution.
" The vim variable 'updatetime' can be used to set the auto-update intervar,
" but not that changing this variable other effects as well. (refer to the
" vim docs for more info)
" To use, add to your .vimrc:
"
" let g:svndiff_autoupdate = 1
"
" * g:svndiff_one_sign_delete
"
" Normally, two 'delete' signs are placed around the location where
" text was deleted. When this variable is defined, only one sign is
" placed, above the location of the deleted text.
" To use, add to your .vimrc:
"
" let g:svndiff_one_sign_delete = 1
"
" Colors
" ------
"
" Personally, I find the following colours more intuitive for diff colours:
" red=deleted, green=added, yellow=changed. If you want to use these colours,
" try adding the following lines to your .vimrc
"
" hi DiffAdd ctermfg=0 ctermbg=2 guibg='green'
" hi DiffDelete ctermfg=0 ctermbg=1 guibg='red'
" hi DiffChange ctermfg=0 ctermbg=3 guibg='yellow'
"
" Changelog
" ---------
"
" 1.0 2007-04-02 Initial version
"
" 1.1 2007-04-02 Added goto prev/next diffblock commands
"
" 1.2 2007-06-14 Updated diff arguments from -u0 (obsolete) to -U0
"
" 2.0 2007-08-16 Changed from syntax highlighting to using signs, thanks
" to Noah Spurrier for the idea. NOTE: the name of the
" function changed from Svndiff_show() to Svndiff(), so
" you might need to update your .vimrc mappings!
"
" 3.0 2008-02-02 Redesign with some ideas from Jan Bezdekovsky. The
" diff is only updated when the buffer actually changes,
" cleanup of signs is now done properly and some info
" about each diff block is printed in the status line.
"
" 3.1 2008-02-04 Fixed bug that broke plugin in non-english locales, thanks
" to Bernhard Walle for the patch
"
" 3.2 2008-02-27 The latest rewrite broke vim 6 compatiblity. The plugin
" is now simply disabled for older vim versions to avoid
" a lot of warnings when loading.
"
" 4.0 2008-11-24 Added GIT support. The RCS type is now detected (svn/git)
"
" 4.1 2008-11-25 Added CVS support.
"
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
if v:version < 700
finish
endif
" Globals for this plugin
let s:sign_base = 200000 " Base for our sign id's, hoping to avoid colisions
let s:is_active = {} " dictionary with buffer names that have svndiff active
let s:rcs_type = {} " RCS type, will be autodetected to 'svn' or 'git'
let s:rcs_cmd = {} " Shell command to execute to get contents of clean file from RCS
let s:diff_signs = {} " dict with list of ids of all signs, per file
let s:diff_blocks = {} " dict with list of ids of first line of each diff block, per file
let s:changedtick = {} " dict with changedticks of each buffer since last invocation
" Commands to execute to get current file contents in various rcs systems
let s:rcs_cmd_svn = "svn cat "
let s:rcs_cmd_git = "git cat-file -p HEAD:"
let s:rcs_cmd_cvs = "cvs -q update -p "
"
" Do the diff and update signs.
"
function s:Svndiff_update(...)
let fname = bufname("%")
if ! exists("s:is_active[fname]")
return 0
end
" Guess RCS type for this file
if ! has_key(s:rcs_type, fname)
let info = system("LANG=C svn info " . fname)
if match(info, "Path") != -1
let s:rcs_type[fname] = "svn"
let s:rcs_cmd[fname] = s:rcs_cmd_svn
end
let info = system("git st " . fname)
if v:shell_error == 0
let s:rcs_type[fname] = "git"
let s:rcs_cmd[fname] = s:rcs_cmd_git
end
let info = system("cvs st " . fname)
if v:shell_error == 0
let s:rcs_type[fname] = "cvs"
let s:rcs_cmd[fname] = s:rcs_cmd_cvs
end
end
" Could not detect RCS type, print message and exit
if ! has_key(s:rcs_type, fname)
echom "Svndiff: Warning, file " . fname . " is not managed by subversion or git"
unlet s:is_active[fname]
return
end
" Check if the changedticks changed since the last invocation of this
" function. If nothing changed, there's no need to update the signs.
if exists("s:changedtick[fname]") && s:changedtick[fname] == b:changedtick
return 1
end
let s:changedtick[fname] = b:changedtick
" The diff has changed since the last time, so we need to update the signs.
" This is where the magic happens: pipe the current buffer contents to a
" shell command calculating the diff in a friendly parsable format.
let contents = join(getbufline("%", 1, "$"), "\n")
let diff = system("diff -U0 <(" . s:rcs_cmd[fname] . fname . ") <(cat;echo)", contents)
" clear the old signs
call s:Svndiff_clear()
" Parse the output of the diff command and put signs at changed, added and
" removed lines
for line in split(diff, '\n')
let part = matchlist(line, '@@ -\([0-9]*\),*\([0-9]*\) +\([0-9]*\),*\([0-9]*\) @@')
if ! empty(part)
let old_from = part[1]
let old_count = part[2] == '' ? 1 : part[2]
let new_from = part[3]
let new_count = part[4] == '' ? 1 : part[4]
" Figure out if text was added, removed or changed.
if old_count == 0
let from = new_from
let to = new_from + new_count - 1
let name = 'svndiff_add'
let info = new_count . " lines added"
elseif new_count == 0
let from = new_from
let to = new_from
let name = 'svndiff_delete'
let info = old_count . " lines deleted"
if ! exists("g:svndiff_one_sign_delete")
let to += 1
endif
else
let from = new_from
let to = new_from + new_count - 1
let name = 'svndiff_change'
let info = new_count . " lines changed"
endif
let id = from + s:sign_base
let s:diff_blocks[fname] += [{ 'id': id, 'info': info }]
" Add signs to mark the changed lines
let line = from
while line <= to
let id = line + s:sign_base
exec 'sign place ' . id . ' line=' . line . ' name=' . name . ' file=' . fname
let s:diff_signs[fname] += [id]
let line = line + 1
endwhile
endif
endfor
endfunction
"
" Remove all signs we placed earlier
"
function s:Svndiff_clear(...)
let fname = bufname("%")
if exists("s:diff_signs[fname]")
for id in s:diff_signs[fname]
exec 'sign unplace ' . id . ' file=' . fname
endfor
end
let s:diff_blocks[fname] = []
let s:diff_signs[fname] = []
endfunction
"
" Jump to previous diff block sign above the current line
"
function s:Svndiff_prev(...)
let fname = bufname("%")
let diff_blocks_reversed = reverse(copy(s:diff_blocks[fname]))
for block in diff_blocks_reversed
let line = block.id - s:sign_base
if line < line(".")
call setpos(".", [ 0, line, 1, 0 ])
echom 'svndiff: ' . block.info
return
endif
endfor
echom 'svndiff: no more diff blocks above cursor'
endfunction
"
" Jump to next diff block sign below the current line
"
function s:Svndiff_next(...)
let fname = bufname("%")
for block in s:diff_blocks[fname]
let line = block.id - s:sign_base
if line > line(".")
call setpos(".", [ 0, line, 1, 0 ])
echom 'svndiff: ' . block.info
return
endif
endfor
echom 'svndiff: no more diff blocks below cursor'
endfunction
"
" Wrapper function: Takes one argument, which is the action to perform:
" {next|prev|clear}
"
function Svndiff(...)
let cmd = exists("a:1") ? a:1 : ''
let fname = bufname("%")
if fname == ""
echom "Buffer has no file name, can not do a svn diff"
return
endif
if cmd == 'clear'
let s:changedtick[fname] = 0
if exists("s:is_active[fname]")
unlet s:is_active[fname]
endif
call s:Svndiff_clear()
end
if cmd == 'prev'
let s:is_active[fname] = 1
let ok = s:Svndiff_update()
if ok
call s:Svndiff_prev()
endif
endif
if cmd == 'next'
let s:is_active[fname] = 1
let ok = s:Svndiff_update()
if ok
call s:Svndiff_next()
endif
endif
endfunction
" Define sign characters and colors
sign define svndiff_add text=> texthl=diffAdd
sign define svndiff_delete text=< texthl=diffDelete
sign define svndiff_change text=! texthl=diffChange
" Define autocmds if autoupdate is enabled
if exists("g:svndiff_autoupdate")
autocmd CursorHold,CursorHoldI * call s:Svndiff_update()
autocmd InsertLeave * call s:Svndiff_update()
endif
" vi: ts=2 sw=2

View File

@ -1,9 +1,9 @@
" tComment.vim -- An easily extensible & universal comment plugin
" @Author: Thomas Link (micathom AT gmail com)
" @Author: Tom Link (micathom AT gmail com)
" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
" @Created: 27-Dez-2004.
" @Last Change: 2008-05-15.
" @Revision: 1.9.664
" @Last Change: 2009-08-07.
" @Revision: 1.9.671
"
" GetLatestVimScripts: 1173 1 tComment.vim
@ -129,6 +129,7 @@ call TCommentDefineType('c_inline', g:tcommentInlineC )
call TCommentDefineType('c_block', g:tcommentBlockC )
call TCommentDefineType('cfg', '# %s' )
call TCommentDefineType('conf', '# %s' )
call TCommentDefineType('crontab', '# %s' )
call TCommentDefineType('desktop', '# %s' )
call TCommentDefineType('docbk', '<!-- %s -->' )
call TCommentDefineType('docbk_inline', g:tcommentInlineXML)
@ -158,7 +159,9 @@ call TCommentDefineType('java', '/* %s */' )
call TCommentDefineType('java_inline', g:tcommentInlineC )
call TCommentDefineType('java_block', g:tcommentBlockC )
call TCommentDefineType('java_doc_block', g:tcommentBlockC2 )
call TCommentDefineType('jproperties', '# %s' )
call TCommentDefineType('lisp', '; %s' )
call TCommentDefineType('lynx', '# %s' )
call TCommentDefineType('m4', 'dnl %s' )
call TCommentDefineType('mail', '> %s' )
call TCommentDefineType('msidl', '// %s' )
@ -376,3 +379,7 @@ new: >)
1.9
- Fix left offset for inline comments (via operator binding)
1.10
- tcomment#Operator defines w:tcommentPos if invoked repeatedly
- s:GuessFileType: use len(getline()) instead of col()

View File

@ -1,6 +1,6 @@
" vimballPlugin : construct a file containing both paths and files
" Author: Charles E. Campbell, Jr.
" Copyright: (c) 2004-2007 by Charles E. Campbell, Jr.
" Copyright: (c) 2004-2009 by Charles E. Campbell, Jr.
" The VIM LICENSE applies to Vimball.vim, and Vimball.txt
" (see |copyright|) except use "Vimball" instead of "Vim".
" No warranty, express or implied.
@ -16,18 +16,18 @@
if &cp || exists("g:loaded_vimballPlugin")
finish
endif
let g:loaded_vimballPlugin = "v26"
let g:loaded_vimballPlugin = "v30"
let s:keepcpo = &cpo
set cpo&vim
" ------------------------------------------------------------------------------
" Public Interface: {{{1
com! -ra -complete=file -na=+ -bang MkVimball call vimball#MkVimball(<line1>,<line2>,<bang>0,<f-args>)
com! -na=? -complete=dir UseVimball call vimball#Vimball(1,<f-args>)
com! -na=0 VimballList call vimball#Vimball(0)
com! -na=* -complete=dir RmVimball call vimball#SaveSettings()|call vimball#RmVimball(<f-args>)|call vimball#RestoreSettings()
au BufEnter *.vba.gz,*.vba.bz2,*.vba.zip call vimball#Decompress(expand("<amatch>"))
au BufEnter *.vba setlocal ff=unix noma bt=nofile fmr=[[[,]]] fdm=marker|call vimball#ShowMesg(0,"Source this file to extract it! (:so %)")
com! -na=? -complete=dir UseVimball call vimball#Vimball(1,<f-args>)
com! -na=0 VimballList call vimball#Vimball(0)
com! -na=* -complete=dir RmVimball call vimball#SaveSettings()|call vimball#RmVimball(<f-args>)|call vimball#RestoreSettings()
au SourceCmd *.vba.gz,*.vba.bz2,*.vba.zip call vimball#Decompress(expand("<amatch>"))|call vimball#Vimball(1)
au BufEnter *.vba,*.vba.gz,*.vba.bz2,*.vba.zip setlocal bt=nofile fmr=[[[,]]] fdm=marker|if &ff != 'unix'| setlocal ff=unix|endif|call vimball#ShowMesg(0,"Source this file to extract it! (:so %)")
" =====================================================================
" Restoration And Modelines: {{{1

View File

@ -1,7 +1,7 @@
" Language : Netrw Remote-Directory Listing Syntax
" Maintainer : Charles E. Campbell, Jr.
" Last change: Aug 12, 2008
" Version : 14
" Last change: Jan 14, 2009
" Version : 16
" ---------------------------------------------------------------------
" Syntax Clearing: {{{1
@ -16,51 +16,55 @@ endif
syn cluster NetrwGroup contains=netrwHide,netrwSortBy,netrwSortSeq,netrwQuickHelp,netrwVersion,netrwCopyTgt
syn cluster NetrwTreeGroup contains=netrwDir,netrwSymLink,netrwExe
syn match netrwSpecial "\%(\S\+ \)*\S\+[*|=]\ze\%(\s\{2,}\|$\)" contains=netrwClassify
syn match netrwDir "\.\{1,2}/" contains=netrwClassify
syn match netrwDir "\%(\S\+ \)*\S\+/" contains=netrwClassify
syn match netrwSizeDate "\<\d\+\s\d\{1,2}/\d\{1,2}/\d\{4}\s" contains=netrwDateSep skipwhite nextgroup=netrwTime
syn match netrwSymLink "\%(\S\+ \)*\S\+@\ze\%(\s\{2,}\|$\)" contains=netrwClassify
syn match netrwExe "\%(\S\+ \)*\S\+\*\ze\%(\s\{2,}\|$\)" contains=netrwClassify
syn match netrwTreeBar "^\%([-+|] \)*" contains=netrwTreeBarSpace nextgroup=@netrwTreeGroup
syn match netrwTreeBarSpace " " contained
syn match netrwPlain "\(\S\+ \)*\S\+" contains=@NoSpell
syn match netrwSpecial "\%(\S\+ \)*\S\+[*|=]\ze\%(\s\{2,}\|$\)" contains=netrwClassify,@NoSpell
syn match netrwDir "\.\{1,2}/" contains=netrwClassify,@NoSpell
syn match netrwDir "\%(\S\+ \)*\S\+/" contains=netrwClassify,@NoSpell
syn match netrwSizeDate "\<\d\+\s\d\{1,2}/\d\{1,2}/\d\{4}\s" skipwhite contains=netrwDateSep,@NoSpell nextgroup=netrwTime
syn match netrwSymLink "\%(\S\+ \)*\S\+@\ze\%(\s\{2,}\|$\)" contains=netrwClassify,@NoSpell
syn match netrwExe "\%(\S\+ \)*\S\+\*\ze\%(\s\{2,}\|$\)" contains=netrwClassify,@NoSpell
syn match netrwTreeBar "^\%([-+|] \)\+" contains=netrwTreeBarSpace nextgroup=@netrwTreeGroup
syn match netrwTreeBarSpace " " contained
syn match netrwClassify "[*=|@/]\ze\%(\s\{2,}\|$\)" contained
syn match netrwDateSep "/" contained
syn match netrwTime "\d\{1,2}:\d\{2}:\d\{2}" contained contains=netrwTimeSep
syn match netrwClassify "[*=|@/]\ze\%(\s\{2,}\|$\)" contained
syn match netrwDateSep "/" contained
syn match netrwTime "\d\{1,2}:\d\{2}:\d\{2}" contained contains=netrwTimeSep
syn match netrwTimeSep ":"
syn match netrwComment '".*\%(\t\|$\)' contains=@NetrwGroup
syn match netrwHide '^"\s*\(Hid\|Show\)ing:' skipwhite nextgroup=netrwHidePat
syn match netrwComment '".*\%(\t\|$\)' contains=@NetrwGroup,@NoSpell
syn match netrwHide '^"\s*\(Hid\|Show\)ing:' skipwhite contains=@NoSpell nextgroup=netrwHidePat
syn match netrwSlash "/" contained
syn match netrwHidePat "[^,]\+" contained skipwhite nextgroup=netrwHideSep
syn match netrwHideSep "," contained skipwhite nextgroup=netrwHidePat
syn match netrwSortBy "Sorted by" contained transparent skipwhite nextgroup=netrwList
syn match netrwSortSeq "Sort sequence:" contained transparent skipwhite nextgroup=netrwList
syn match netrwCopyTgt "Copy/Move Tgt:" contained transparent skipwhite nextgroup=netrwList
syn match netrwList ".*$" contained contains=netrwComma
syn match netrwHidePat "[^,]\+" contained skipwhite contains=@NoSpell nextgroup=netrwHideSep
syn match netrwHideSep "," contained skipwhite nextgroup=netrwHidePat
syn match netrwSortBy "Sorted by" contained transparent skipwhite nextgroup=netrwList
syn match netrwSortSeq "Sort sequence:" contained transparent skipwhite nextgroup=netrwList
syn match netrwCopyTgt "Copy/Move Tgt:" contained transparent skipwhite nextgroup=netrwList
syn match netrwList ".*$" contained contains=netrwComma,@NoSpell
syn match netrwComma "," contained
syn region netrwQuickHelp matchgroup=Comment start="Quick Help:\s\+" end="$" contains=netrwHelpCmd keepend contained
syn match netrwHelpCmd "\S\ze:" contained skipwhite nextgroup=netrwCmdSep
syn region netrwQuickHelp matchgroup=Comment start="Quick Help:\s\+" end="$" contains=netrwHelpCmd,@NoSpell keepend contained
syn match netrwHelpCmd "\S\ze:" contained skipwhite contains=@NoSpell nextgroup=netrwCmdSep
syn match netrwCmdSep ":" contained nextgroup=netrwCmdNote
syn match netrwCmdNote ".\{-}\ze " contained
syn match netrwVersion "(netrw.*)" contained
syn match netrwCmdNote ".\{-}\ze " contained contains=@NoSpell
syn match netrwVersion "(netrw.*)" contained contains=@NoSpell
" -----------------------------
" Special filetype highlighting {{{1
" -----------------------------
if exists("g:netrw_special_syntax") && netrw_special_syntax
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
syn match netrwBak "\(\S\+ \)*\S\+\.bak\>" contains=netrwTreeBar,@NoSpell
syn match netrwCompress "\(\S\+ \)*\S\+\.\%(gz\|bz2\|Z\|zip\)\>" contains=netrwTreeBar,@NoSpell
if has("unix")
syn match netrwCoreDump "\<core\%(\.\d\+\)\=\>" contains=netrwTreeBar,@NoSpell
endif
syn match netrwData "\(\S\+ \)*\S\+\.dat\>" contains=netrwTreeBar,@NoSpell
syn match netrwHdr "\(\S\+ \)*\S\+\.h\>" contains=netrwTreeBar,@NoSpell
syn match netrwLib "\(\S\+ \)*\S*\.\%(a\|so\|lib\|dll\)\>" contains=netrwTreeBar,@NoSpell
syn match netrwMakeFile "\<[mM]akefile\>\|\(\S\+ \)*\S\+\.mak\>" contains=netrwTreeBar,@NoSpell
syn match netrwObj "\(\S\+ \)*\S*\.\%(o\|obj\)\>" contains=netrwTreeBar,@NoSpell
syn match netrwTags "\<tags\>" contains=netrwTreeBar,@NoSpell
syn match netrwTags "\<\(ANmenu\|ANtags\)\>" contains=netrwTreeBar,@NoSpell
syn match netrwTilde "\(\S\+ \)*\S\+\~\>" contains=netrwTreeBar,@NoSpell
syn match netrwTmp "\<tmp\(\S\+ \)*\S\+\>\|\(\S\+ \)*\S*tmp\>" contains=netrwTreeBar,@NoSpell
endif
" ---------------------------------------------------------------------
@ -89,6 +93,7 @@ if !exists("did_drchip_netrwlist_syntax")
" special syntax highlighting (see :he g:netrw_special_syntax)
hi default link netrwBak NonText
hi default link netrwCompress Folded
hi default link netrwCoreDump WarningMsg
hi default link netrwData DiffChange
hi default link netrwLib DiffChange
hi default link netrwMakefile DiffChange