GetLatestVimScripts

git-svn-id: https://vimsuite.svn.sourceforge.net/svnroot/vimsuite/trunk@153 eb2d0018-73a3-4aeb-bfe9-1def61c9ec69
This commit is contained in:
stefan 2008-03-31 09:07:35 +00:00
parent a89ce114bc
commit 647bd57e00
24 changed files with 8577 additions and 3178 deletions

View File

@ -1,12 +1,12 @@
ScriptID SourceID Filename ScriptID SourceID Filename
-------------------------- --------------------------
1075 8042 netrw.vim 1075 8351 netrw.vim
1502 7078 vimball.vim 1502 7078 vimball.vim
1008 3118 srec.vim (ftplugin) 1008 3118 srec.vim (ftplugin)
1009 3119 srec.vim (syntax file) 1009 3119 srec.vim (syntax file)
475 2535 latex-suite (install in vimfiles.latex) 475 2535 latex-suite (install in vimfiles.latex)
614 3666 C-Referenz 614 3666 C-Referenz
670 6208 visincr.vim (Visual Increment) 670 8073 visincr.vim (Visual Increment)
862 2635 cscope_quickfix.vim 862 2635 cscope_quickfix.vim
51 171 cscope_macros.vim 51 171 cscope_macros.vim
102 5306 DirDiff.vim 102 5306 DirDiff.vim
@ -18,13 +18,15 @@ ScriptID SourceID Filename
987 6978 DoxygenToolkit.vim 987 6978 DoxygenToolkit.vim
1397 6887 xml.vim 1397 6887 xml.vim
1290 5190 LogiPat.vim 1290 5190 LogiPat.vim
1881 7505 svndiff 1881 8355 svndiff
1462 5612 dtd2xml 1462 5612 dtd2xml
1046 4249 Lusty Explorer 1046 4249 Lusty Explorer
2043 7805 VimPdb (debugging python) 2043 7805 VimPdb (debugging python)
1776 7902 Vimgrep Replace 1776 7902 Vimgrep Replace
2048 7817 BlockDiff 2048 7817 BlockDiff
39 7637 matchit.vim 39 8196 matchit.vim
2092 8041 reloaded.vim (matrix colorscheme) 2092 8095 reloaded.vim (matrix colorscheme)
642 7080 getscript.vim 848 8203 SrchRplcHiGrp.vim (Search/Replace on Syntax Group)
642 7080 :AutoInstall: GetLatestVimScripts.vim 294 8407 Align.vim
642 8136 getscript.vim
642 8136 :AutoInstall: GetLatestVimScripts.vim

1007
vimfiles/autoload/Align.vim Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,147 @@
" calutil.vim: some calendar utilities
" Author: Charles E. Campbell, Jr.
" Date: Oct 19, 2007
" Version: 3a ASTRO-ONLY
" ---------------------------------------------------------------------
if exists("loaded_calutil")
finish
endif
let g:loaded_calutil= "v3a"
" ---------------------------------------------------------------------
" DayOfWeek: {{{1
" Usage : call calutil#DayOfWeek(y,m,d,[0|1|2])
" g:CalUtilDayOfWeek: if 0-> integer (default)
" 1-> 3-letter English abbreviation for name of day
" 2-> English name of day
" Returns
" g:CalUtilDayOfWeek
" ---------
" 1 : 0 1 2 3 4 5 6
" 2 : Mon Tue Wed Thu Fri Sat Sun
" 3 : Monday Tuesday Wednesday Thursday Friday Saturday Sunday
fun! calutil#DayOfWeek(y,m,d,...)
if a:0 > 0
let g:CalUtilDayOfWeek= a:1
endif
let z= Cal2Jul(a:y,a:m,a:d)
if z >= 0
let z= z%7
else
let z= 7 - (-z%7)
endif
if exists("g:CalUtilDayOfWeek")
if g:CalUtilDayOfWeek == 2
let dow0="Mon"
let dow1="Tue"
let dow2="Wed"
let dow3="Thu"
let dow4="Fri"
let dow5="Sat"
let dow6="Sun"
return dow{z}
elseif g:CalUtilDayOfWeek == 3
let dow0="Monday"
let dow1="Tuesday"
let dow2="Wednesday"
let dow3="Thursday"
let dow4="Friday"
let dow5="Saturday"
let dow6="Sunday"
return dow{z}
endif
endif
return z
endfun
" ---------------------------------------------------------------------
" calutil#Cal2Jul: convert a (after 9/14/1752) Gregorian calendar date to Julian day {{{1
" (on,before " ) Julian calendar date to Julian day
" (proleptic)
fun! calutil#Cal2Jul(y,m,d)
let year = a:y
let month= a:m
let day = a:d
" there is no year zero
if year == 0
let year= -1
elseif year < 0
let year= year + 1
endif
let julday= day - 32075 +
\ 1461*(year + 4800 + (month - 14)/12)/4 +
\ 367*(month - 2 - ((month - 14)/12)*12)/12 -
\ 3*((year + 4900 + (month - 14)/12)/100)/4
" 2361221 == Sep 2, 1752, which was followed immediately by
" Sep 14, 1752 (in England). Various countries
" adopted the Gregorian calendar at different times.
if julday <= 2361221
let a = (14-month)/12
let y = year + 4800 - a
let m = month + 12*a - 3
let julday = day + (153*m + 2)/5 + y*365 + y/4 - 32083
endif
return julday
endfun
" ---------------------------------------------------------------------
" calutil#Jul2Cal: convert a Julian day to a date: {{{1
" Default year/month/day
" julday,1 julday,"ymd" year/month/day
" julday,2 julday,"mdy" month/day/year
" julday,3 julday,"dmy" day/month/year
fun! calutil#Jul2Cal(julday,...)
let julday= a:julday
if julday <= 2361221
" Proleptic Julian Calendar:
" 2361210 == Sep 2, 1752, which was followed immediately by Sep 14, 1752
" in England
let c = julday + 32082
let d = (4*c + 3)/1461
let e = c - (1461*d)/4
let m = (5*e + 2)/153
let day = e - (153*m + 2)/5 + 1
let month = m + 3 - 12*(m/10)
let year = d - 4800 + m/10
if year <= 0
" proleptic Julian Calendar: there *is* no year 0!
let year= year - 1
endif
else
" Gregorian calendar
let t1 = julday + 68569
let t2 = 4*t1/146097
let t1 = t1 - (146097*t2 + 3)/4
let yr = 4000*(t1 + 1)/1461001
let t1 = t1 - (1461*yr/4 - 31)
let mo = 80*t1/2447
let day = (t1 - 2447*mo/80)
let t1 = mo/11
let month = (mo + 2 - 12*t1)
let year = (100*(t2 - 49) + yr + t1)
endif
if a:0 > 0
if a:1 == 1 || a:1 =~ "ymd"
return year."/".month."/".day
elseif a:1 == 2 || a:1 =~ "mdy"
return month."/".day."/".year
elseif a:1 == 3 || a:1 =~ "dmy"
return day."/".month."/".year
else
return year."/".month."/".day
endif
else
return year."/".month."/".day
endif
endfun
" ---------------------------------------------------------------------
" vim: ts=4 fdm=marker

View File

@ -1,16 +1,17 @@
" --------------------------------------------------------------------- " ---------------------------------------------------------------------
" getscript.vim " getscript.vim
" Author: Charles E. Campbell, Jr. " Author: Charles E. Campbell, Jr.
" Date: May 05, 2007 " Date: Jan 08, 2008
" Version: 25 " Version: 29
" Installing: :help glvs-install " Installing: :help glvs-install
" Usage: :help glvs " Usage: :help glvs
" "
" GetLatestVimScripts: 642 1 :AutoInstall: getscript.vim " GetLatestVimScripts: 642 1 :AutoInstall: getscript.vim
"redraw!|call inputsave()|call input("Press <cr> to continue")|call inputrestore()
" --------------------------------------------------------------------- " ---------------------------------------------------------------------
" Initialization: {{{1 " Initialization: {{{1
" if you're sourcing this file, surely you can't be " if you're sourcing this file, surely you can't be
" expecting vim to be in its vi-compatible mode " expecting vim to be in its vi-compatible mode!
if &cp if &cp
echoerr "GetLatestVimScripts is not vi-compatible; not loaded (you need to set nocp)" echoerr "GetLatestVimScripts is not vi-compatible; not loaded (you need to set nocp)"
finish finish
@ -22,11 +23,44 @@ set cpo&vim
if exists("g:loaded_getscript") if exists("g:loaded_getscript")
finish finish
endif endif
let g:loaded_getscript= "v25" let g:loaded_getscript= "v29"
" --------------------------------------------------------------------- " ---------------------------
" Global Variables: {{{1 " Global Variables: {{{1
" allow user to change the command for obtaining scripts (does fetch work?) " ---------------------------
" Cygwin Detection ------- {{{2
if !exists("g:getscript_cygwin")
if has("win32") || has("win95") || has("win64") || has("win16")
if &shell =~ '\%(\<bash\>\|\<zsh\>\)\%(\.exe\)\=$'
let g:getscript_cygwin= 1
else
let g:getscript_cygwin= 0
endif
else
let g:getscript_cygwin= 0
endif
endif
" shell quoting character {{{2
if exists("g:netrw_shq") && !exists("g:getscript_shq")
let g:getscript_shq= g:netrw_shq
elseif !exists("g:getscript_shq")
if exists("&shq") && &shq != ""
let g:getscript_shq= &shq
elseif exists("&sxq") && &sxq != ""
let g:getscript_shq= &sxq
elseif has("win32") || has("win95") || has("win64") || has("win16")
if g:getscript_cygwin
let g:getscript_shq= "'"
else
let g:getscript_shq= '"'
endif
else
let g:getscript_shq= "'"
endif
" call Decho("g:getscript_shq<".g:getscript_shq.">")
endif
" wget vs curl {{{2
if !exists("g:GetLatestVimScripts_wget") if !exists("g:GetLatestVimScripts_wget")
if executable("wget") if executable("wget")
let g:GetLatestVimScripts_wget= "wget" let g:GetLatestVimScripts_wget= "wget"
@ -101,6 +135,7 @@ fun! s:GetOneScript(...)
" call Dfunc("GetOneScript()") " call Dfunc("GetOneScript()")
" set options to allow progress to be shown on screen " set options to allow progress to be shown on screen
let rega= @a
let t_ti= &t_ti let t_ti= &t_ti
let t_te= &t_te let t_te= &t_te
let rs = &rs let rs = &rs
@ -121,6 +156,7 @@ fun! s:GetOneScript(...)
else else
let curline = getline(".") let curline = getline(".")
if curline =~ '^\s*#' if curline =~ '^\s*#'
let @a= rega
" call Dret("GetOneScript : skipping a pure comment line") " call Dret("GetOneScript : skipping a pure comment line")
return return
endif endif
@ -153,15 +189,15 @@ fun! s:GetOneScript(...)
endif endif
if scriptid == 0 || srcid == 0 if scriptid == 0 || srcid == 0
" When looking for :AutoInstall: lines, skip scripts that " When looking for :AutoInstall: lines, skip scripts that have 0 0 scriptname
" have 0 0 scriptname let @a= rega
" call Dret("GetOneScript : skipping a scriptid==srcid==0 line") " call Dret("GetOneScript : skipping a scriptid==srcid==0 line")
return return
endif endif
let doautoinstall= 0 let doautoinstall= 0
if fname =~ ":AutoInstall:" if fname =~ ":AutoInstall:"
" call Decho("fname<".fname."> has :AutoInstall:...") " call Decho("case AutoInstall: fname<".fname.">")
let aicmmnt= substitute(fname,'\s\+:AutoInstall:\s\+',' ','') let aicmmnt= substitute(fname,'\s\+:AutoInstall:\s\+',' ','')
" call Decho("aicmmnt<".aicmmnt."> s:autoinstall=".s:autoinstall) " call Decho("aicmmnt<".aicmmnt."> s:autoinstall=".s:autoinstall)
if s:autoinstall != "" if s:autoinstall != ""
@ -182,19 +218,19 @@ fun! s:GetOneScript(...)
let tmpfile = tempname() let tmpfile = tempname()
let v:errmsg = "" let v:errmsg = ""
" make three tries at downloading the description " make up to three tries at downloading the description
let itry= 1 let itry= 1
while itry <= 3 while itry <= 3
" call Decho("try#".itry." to download description of <".aicmmnt."> with addr=".scriptaddr) " call Decho("try#".itry." to download description of <".aicmmnt."> with addr=".scriptaddr)
if has("win32") || has("win16") || has("win95") if has("win32") || has("win16") || has("win95")
" call Decho("silent !".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".tmpfile.' "'.scriptaddr.'"') " call Decho("new|exe silent r!".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".g:getscript_shq.tmpfile.g:getscript_shq.' '.g:getscript_shq.scriptaddr.g:getscript_shq."|q!")
exe "silent !".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".tmpfile.' "'.scriptaddr.'"' new|exe "silent r!".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".g:getscript_shq.tmpfile.g:getscript_shq.' '.g:getscript_shq.scriptaddr.g:getscript_shq|q!
else else
" call Decho("silent !".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".tmpfile." '".scriptaddr."'") " call Decho("exe silent !".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".g:getscript_shq.tmpfile.g:getscript_shq." ".g:getscript_shq.scriptaddr.g:getscript_shq)
exe "silent !".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".tmpfile." '".scriptaddr."'" exe "silent !".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".g:getscript_shq.tmpfile.g:getscript_shq." ".g:getscript_shq.scriptaddr.g:getscript_shq
endif endif
if itry == 1 if itry == 1
exe "silent vsplit ".tmpfile exe "silent vsplit ".tmpfile
else else
silent! e % silent! e %
endif endif
@ -209,19 +245,20 @@ fun! s:GetOneScript(...)
endwhile endwhile
" call Decho(" --- end downloading tries while loop --- itry=".itry) " call Decho(" --- end downloading tries while loop --- itry=".itry)
" testing: did finding /Click on the package.../ fail? " testing: did finding "Click on the package..." fail?
if findpkg == 0 || itry >= 4 if findpkg == 0 || itry >= 4
silent q! silent q!
call delete(tmpfile) call delete(tmpfile)
" restore options " restore options
let &t_ti = t_ti let &t_ti = t_ti
let &t_te = t_te let &t_te = t_te
let &rs = rs let &rs = rs
let s:downerrors = s:downerrors + 1 let s:downerrors = s:downerrors + 1
" call Decho("***warning*** couldn'".'t find "Click on the package..." in description page for <'.aicmmnt.">") " 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.">" echomsg "***warning*** couldn'".'t find "Click on the package..." in description page for <'.aicmmnt.">"
" call Dret("GetOneScript : srch for /Click on the package/ failed") " call Dret("GetOneScript : srch for /Click on the package/ failed")
return let @a= rega
return
endif endif
" call Decho('found "Click on the package to download"') " call Decho('found "Click on the package to download"')
@ -236,6 +273,7 @@ fun! s:GetOneScript(...)
let s:downerrors = s:downerrors + 1 let s:downerrors = s:downerrors + 1
" call Decho("***warning*** couldn'".'t find "src_id=" in description page for <'.aicmmnt.">") " 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.">" echomsg "***warning*** couldn'".'t find "src_id=" in description page for <'.aicmmnt.">"
let @a= rega
" call Dret("GetOneScript : srch for /src_id/ failed") " call Dret("GetOneScript : srch for /src_id/ failed")
return return
endif endif
@ -243,97 +281,115 @@ fun! s:GetOneScript(...)
let srcidpat = '^\s*<td class.*src_id=\(\d\+\)">\([^<]\+\)<.*$' let srcidpat = '^\s*<td class.*src_id=\(\d\+\)">\([^<]\+\)<.*$'
let latestsrcid= substitute(getline("."),srcidpat,'\1','') let latestsrcid= substitute(getline("."),srcidpat,'\1','')
let fname = substitute(getline("."),srcidpat,'\2','') let sname = substitute(getline("."),srcidpat,'\2','') " script name actually downloaded
" call Decho("srcidpat<".srcidpat."> latestsrcid<".latestsrcid."> fname<".fname.">") " call Decho("srcidpat<".srcidpat."> latestsrcid<".latestsrcid."> sname<".sname.">")
silent q! silent q!
call delete(tmpfile) call delete(tmpfile)
" convert the strings-of-numbers into numbers " convert the strings-of-numbers into numbers
let srcid = srcid + 0 let srcid = srcid + 0
let latestsrcid = latestsrcid + 0 let latestsrcid = latestsrcid + 0
" call Decho("srcid=".srcid." latestsrcid=".latestsrcid." fname<".fname.">") " call Decho("srcid=".srcid." latestsrcid=".latestsrcid." sname<".sname.">")
" has the plugin's most-recent srcid increased, which indicates " has the plugin's most-recent srcid increased, which indicates
" that it has been updated " that it has been updated
if latestsrcid > srcid if latestsrcid > srcid
" call Decho("[latestsrcid=".latestsrcid."] <= [srcid=".srcid."]: need to update <".sname.">")
let s:downloads= s:downloads + 1 let s:downloads= s:downloads + 1
if fname == bufname("%") if sname == bufname("%")
" GetLatestVimScript has to be careful about downloading itself " GetLatestVimScript has to be careful about downloading itself
let fname= "NEW_".fname let sname= "NEW_".sname
endif endif
" the plugin has been updated since we last obtained it, so download a new copy " the plugin has been updated since we last obtained it, so download a new copy
" call Decho("...downloading new <".fname.">") " call Decho("...downloading new <".sname.">")
echomsg "...downloading new <".fname.">" echomsg "...downloading new <".sname.">"
if has("win32") || has("gui_win32") || has("gui_win32s") || has("win16") || has("win64") || has("win32unix") || has("win95") if has("win32") || has("win16") || has("win95")
" call Decho("windows: silent !".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".fname.' "'.'http://vim.sf.net/scripts/download_script.php?src_id='.latestsrcid.'"') " call Decho("new|exe silent r!".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".g:getscript_shq.sname.g:getscript_shq." ".g:getscript_shq.'http://vim.sf.net/scripts/download_script.php?src_id='.latestsrcid.g:getscript_shq."|q")
exe "silent !".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".fname.' "'.'http://vim.sf.net/scripts/download_script.php?src_id='.latestsrcid.'"' new|exe "silent r!".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".g:getscript_shq.sname.g:getscript_shq." ".g:getscript_shq.'http://vim.sf.net/scripts/download_script.php?src_id='.latestsrcid.g:getscript_shq|q
else else
" call Decho("unix: silent !".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".fname." '".'http://vim.sf.net/scripts/download_script.php?src_id='.latestsrcid."'") " call Decho("silent !".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".g:getscript_shq.sname.g:getscript_shq." ".g:getscript_shq.'http://vim.sf.net/scripts/download_script.php?src_id='.latestsrcid.g:getscript_shq)
exe "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." ".g:getscript_shq.sname.g:getscript_shq." ".g:getscript_shq.'http://vim.sf.net/scripts/download_script.php?src_id='.latestsrcid.g:getscript_shq
endif endif
" AutoInstall: only if doautoinstall is so indicating " AutoInstall: only if doautoinstall has been requested by the plugin itself
if doautoinstall if doautoinstall
" call Decho("attempting to do autoinstall: getcwd<".getcwd()."> filereadable(".fname.")=".filereadable(fname)) " call Decho("attempting to do autoinstall: getcwd<".getcwd()."> filereadable(".sname.")=".filereadable(sname))
if filereadable(fname) if filereadable(sname)
" call Decho("move <".fname."> to ".s:autoinstall) " call Decho("silent !".g:GetLatestVimScripts_mv." ".g:getscript_shq.sname.g:getscript_shq." ".g:getscript_shq.s:autoinstall.g:getscript_shq)
exe "silent !".g:GetLatestVimScripts_mv." ".fname." ".s:autoinstall exe "silent !".g:GetLatestVimScripts_mv." ".g:getscript_shq.sname.g:getscript_shq." ".g:getscript_shq.s:autoinstall.g:getscript_shq
let curdir= escape(substitute(getcwd(),'\','/','ge'),"|[]*'\" #") let curdir = escape(substitute(getcwd(),'\','/','ge'),"|[]*'\" #")
" call Decho("exe cd ".s:autoinstall) let installdir= curdir."/Installed"
exe "cd ".s:autoinstall if !isdirectory(installdir)
call mkdir(installdir)
endif
" call Decho("exe cd ".s:autoinstall)
exe "cd ".escape(s:autoinstall,' ')
" decompress " decompress
if fname =~ '\.bz2$' if sname =~ '\.bz2$'
" call Decho("attempt to bunzip2 ".fname) " call Decho("decompress: attempt to bunzip2 ".sname)
exe "silent !bunzip2 ".fname exe "silent !bunzip2 ".g:getscript_shq.sname.g:getscript_shq
let fname= substitute(fname,'\.bz2$','','') let sname= substitute(sname,'\.bz2$','','')
" call Decho("new fname<".fname."> after bunzip2") " call Decho("decompress: new sname<".sname."> after bunzip2")
elseif fname =~ '\.gz$' elseif sname =~ '\.gz$'
" call Decho("attempt to gunzip ".fname) " call Decho("decompress: attempt to gunzip ".sname)
exe "silent !gunzip ".fname exe "silent !gunzip ".g:getscript_shq.sname.g:getscript_shq
let fname= substitute(fname,'\.gz$','','') let sname= substitute(sname,'\.gz$','','')
" call Decho("new fname<".fname."> after gunzip") " call Decho("decompress: new sname<".sname."> after gunzip")
endif endif
" distribute archive(.zip, .tar, .vba) contents " distribute archive(.zip, .tar, .vba) contents
if fname =~ '\.zip$' if sname =~ '\.zip$'
" call Decho("attempt to unzip ".fname) " call Decho("dearchive: attempt to unzip ".sname)
exe "silent !unzip -o ".fname exe "silent !unzip -o ".g:getscript_shq.sname.g:getscript_shq
elseif fname =~ '\.tar$' elseif sname =~ '\.tar$'
" call Decho("attempt to untar ".fname) " call Decho("dearchive: attempt to untar ".sname)
exe "silent !tar -xvf ".fname exe "silent !tar -xvf ".g:getscript_shq.sname.g:getscript_shq
elseif fname =~ '\.vba$' elseif sname =~ '\.vba$'
" call Decho("attempt to handle a vimball: ".fname) " call Decho("dearchive: attempt to handle a vimball: ".sname)
1split silent 1split
exe "e ".fname exe "silent e ".escape(sname,' ')
so % silent so %
q silent q
endif endif
if fname =~ '.vim$' if sname =~ '.vim$'
" call Decho("attempt to simply move ".fname." to plugin") " call Decho("dearchive: attempt to simply move ".sname." to plugin")
exe "silent !".g:GetLatestVimScripts_mv." ".fname." plugin" exe "silent !".g:GetLatestVimScripts_mv." ".g:getscript_shq.sname.g:getscript_shq." plugin"
endif else
" call Decho("dearchive: move <".sname."> to installdir<".installdir.">")
exe "silent !".g:GetLatestVimScripts_mv." ".g:getscript_shq.sname.g:getscript_shq." ".installdir
endif
" helptags step " helptags step
let docdir= substitute(&rtp,',.*','','e')."/doc" let docdir= substitute(&rtp,',.*','','e')."/doc"
" call Decho("helptags docdir<".docdir.">") " call Decho("helptags: docdir<".docdir.">")
exe "helptags ".docdir exe "helptags ".docdir
exe "cd ".curdir exe "cd ".curdir
endif endif
if fname !~ ':AutoInstall:'
let modline=scriptid." ".latestsrcid." :AutoInstall: ".fname.cmmnt
else
let modline=scriptid." ".latestsrcid." ".fname.cmmnt
endif
else
let modline=scriptid." ".latestsrcid." ".fname.cmmnt
endif endif
" update the data in the <GetLatestVimScripts.dat> file " update the data in the <GetLatestVimScripts.dat> file
let modline=scriptid." ".latestsrcid." ".fname.cmmnt
call setline(line("."),modline) call setline(line("."),modline)
" call Decho("update data in ".expand("%")."#".line(".").": modline<".modline.">") " call Decho("update data in ".expand("%")."#".line(".").": modline<".modline.">")
" else " Decho
" call Decho("[latestsrcid=".latestsrcid."] <= [srcid=".srcid."], no need to update")
endif endif
" restore options " restore options
let &t_ti= t_ti let &t_ti = t_ti
let &t_te= t_te let &t_te = t_te
let &rs = rs let &rs = rs
let @a = rega
" call Dret("GetOneScript") " call Dret("GetOneScript")
endfun endfun
@ -410,7 +466,7 @@ fun! getscript#GetLatestVimScripts()
" call Decho("searching plugins for GetLatestVimScripts dependencies") " call Decho("searching plugins for GetLatestVimScripts dependencies")
let lastline = line("$") let lastline = line("$")
" call Decho("lastline#".lastline) " call Decho("lastline#".lastline)
let plugins = split(globpath(&rtp,"plugin/*.vim")) let plugins = split(globpath(&rtp,"plugin/*.vim"),'\n')
let foundscript = 0 let foundscript = 0
let firstdir= "" let firstdir= ""
@ -419,11 +475,12 @@ fun! getscript#GetLatestVimScripts()
" don't process plugins in system directories " don't process plugins in system directories
if firstdir == "" if firstdir == ""
let firstdir= substitute(plugin,'[/\\][^/\\]\+$','','') let firstdir= substitute(plugin,'[/\\][^/\\]\+$','','')
" call Decho("firstdir<".firstdir.">") " call Decho("setting firstdir<".firstdir.">")
else else
let curdir= substitute(plugin,'[/\\][^/\\]\+$','','') let curdir= substitute(plugin,'[/\\][^/\\]\+$','','')
" call Decho("curdir<".curdir.">") " call Decho("curdir<".curdir.">")
if curdir != firstdir if curdir != firstdir
" call Decho("skipping subsequent plugins: curdir<".curdir."> != firstdir<".firstdir.">")
break break
endif endif
endif endif
@ -432,14 +489,14 @@ fun! getscript#GetLatestVimScripts()
$ $
" call Decho(" ") " call Decho(" ")
" call Decho(".dependency checking<".plugin."> line$=".line("$")) " call Decho(".dependency checking<".plugin."> line$=".line("$"))
exe "silent r ".plugin exe "silent r ".escape(plugin,"[]#*$%'\" ?`!&();<>\\")
while search('^"\s\+GetLatestVimScripts:\s\+\d\+\s\+\d\+','W') != 0 while search('^"\s\+GetLatestVimScripts:\s\+\d\+\s\+\d\+','W') != 0
let newscript= substitute(getline("."),'^"\s\+GetLatestVimScripts:\s\+\d\+\s\+\d\+\s\+\(.*\)$','\1','e') let newscript= substitute(getline("."),'^"\s\+GetLatestVimScripts:\s\+\d\+\s\+\d\+\s\+\(.*\)$','\1','e')
let llp1 = lastline+1 let llp1 = lastline+1
" call Decho("..newscript<".newscript.">") " call Decho("..newscript<".newscript.">")
" don't process ""GetLatestVimScripts lines " don't process ""GetLatestVimScripts lines -- those that have been doubly-commented out
if newscript !~ '^"' if newscript !~ '^"'
" found a "GetLatestVimScripts: # #" line in the script; check if its already in the datafile " found a "GetLatestVimScripts: # #" line in the script; check if its already in the datafile
let curline = line(".") let curline = line(".")
@ -476,12 +533,12 @@ fun! getscript#GetLatestVimScripts()
" call Decho(" ") " call Decho(" ")
if foundscript == 0 if foundscript == 0
set nomod setlocal nomod
endif endif
" Check on out-of-date scripts using GetLatest/GetLatestVimScripts.dat " Check on out-of-date scripts using GetLatest/GetLatestVimScripts.dat
" call Decho("begin: checking out-of-date scripts using datafile<".datafile.">") " call Decho("begin: checking out-of-date scripts using datafile<".datafile.">")
set lz setlocal lz
1 1
" /^-----/,$g/^\s*\d/call Decho(getline(".")) " /^-----/,$g/^\s*\d/call Decho(getline("."))
1 1
@ -520,12 +577,15 @@ fun! getscript#GetLatestVimScripts()
" restore events and current directory " restore events and current directory
exe "cd ".escape(substitute(origdir,'\','/','ge'),"|[]*'\" #") exe "cd ".escape(substitute(origdir,'\','/','ge'),"|[]*'\" #")
let &ei= eikeep let &ei= eikeep
set nolz setlocal nolz
" call Dret("GetLatestVimScripts : did ".s:downloads." downloads") " call Dret("GetLatestVimScripts : did ".s:downloads." downloads")
endfun endfun
" ---------------------------------------------------------------------
" ---------------------------------------------------------------------
" Restore Options: {{{1 " Restore Options: {{{1
let &cpo= s:keepcpo let &cpo= s:keepcpo
unlet s:keepcpo
" ---------------------------------------------------------------------
" Modelines: {{{1
" vim: ts=8 sts=2 fdm=marker nowrap " vim: ts=8 sts=2 fdm=marker nowrap

File diff suppressed because it is too large Load Diff

View File

@ -126,6 +126,7 @@ fun! netrwSettings#NetrwSettings()
put = 'let g:netrw_mkdir_cmd = '.g:netrw_mkdir_cmd put = 'let g:netrw_mkdir_cmd = '.g:netrw_mkdir_cmd
put = 'let g:netrw_preview = '.g:netrw_preview put = 'let g:netrw_preview = '.g:netrw_preview
put = 'let g:netrw_rename_cmd = '.g:netrw_rename_cmd put = 'let g:netrw_rename_cmd = '.g:netrw_rename_cmd
put = 'let g:netrw_retmap = '.g:netrw_retmap
put = 'let g:netrw_rm_cmd = '.g:netrw_rm_cmd put = 'let g:netrw_rm_cmd = '.g:netrw_rm_cmd
put = 'let g:netrw_rmdir_cmd = '.g:netrw_rmdir_cmd put = 'let g:netrw_rmdir_cmd = '.g:netrw_rmdir_cmd
put = 'let g:netrw_rmf_cmd = '.g:netrw_rmf_cmd put = 'let g:netrw_rmf_cmd = '.g:netrw_rmf_cmd
@ -133,6 +134,7 @@ fun! netrwSettings#NetrwSettings()
put = 'let g:netrw_sort_by = '.g:netrw_sort_by put = 'let g:netrw_sort_by = '.g:netrw_sort_by
put = 'let g:netrw_sort_direction = '.g:netrw_sort_direction put = 'let g:netrw_sort_direction = '.g:netrw_sort_direction
put = 'let g:netrw_sort_sequence = '.g:netrw_sort_sequence put = 'let g:netrw_sort_sequence = '.g:netrw_sort_sequence
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_ssh_browse_reject = '.g:netrw_ssh_browse_reject
put = 'let g:netrw_scpport = '.g:netrw_scpport put = 'let g:netrw_scpport = '.g:netrw_scpport
put = 'let g:netrw_sshport = '.g:netrw_sshport put = 'let g:netrw_sshport = '.g:netrw_sshport

View File

@ -1,7 +1,7 @@
" visincr.vim: Visual-block incremented lists " visincr.vim: Visual-block incremented lists
" Author: Charles E. Campbell, Jr. Ph.D. " Author: Charles E. Campbell, Jr. Ph.D.
" Date: Sep 19, 2006 " Date: Dec 19, 2007
" Version: 17 " Version: 19
" "
" Visincr assumes that a block of numbers selected by a " Visincr assumes that a block of numbers selected by a
" ctrl-v (visual block) has been selected for incrementing. " ctrl-v (visual block) has been selected for incrementing.
@ -26,32 +26,43 @@ if &cp || exists("g:loaded_visincr")
finish finish
endif endif
let s:keepcpo = &cpo let s:keepcpo = &cpo
let g:loaded_visincr = "v17" let g:loaded_visincr = "v19"
set cpo&vim set cpo&vim
" --------------------------------------------------------------------- " ---------------------------------------------------------------------
" Methods: {{{1 " Methods: {{{1
let s:I = 0 let s:I = 0
let s:II = 1 let s:II = 1
let s:IMDY = 2 let s:IMDY = 2
let s:IYMD = 3 let s:IYMD = 3
let s:IDMY = 4 let s:IDMY = 4
let s:ID = 5 let s:ID = 5
let s:IM = 6 let s:IM = 6
let s:IA = 7 let s:IA = 7
let s:IX = 8 let s:IX = 8
let s:IIX = 9 let s:IIX = 9
let s:IO = 10 let s:IO = 10
let s:IIO = 11 let s:IIO = 11
let s:IR = 12 let s:IR = 12
let s:IIR = 13 let s:IIR = 13
let s:RI = 14 let s:IPOW = 14
let s:RII = 15 let s:IIPOW = 15
let s:RIMDY = 16 let s:RI = 16
let s:RIYMD = 17 let s:RII = 17
let s:RIDMY = 18 let s:RIMDY = 18
let s:RID = 19 let s:RIYMD = 19
let s:RIM = 20 let s:RIDMY = 20
let s:RID = 21
let s:RIM = 22
let s:RIA = 23
let s:RIX = 24
let s:RIIX = 25
let s:RIO = 26
let s:RIIO = 27
let s:RIR = 28
let s:RIIR = 29
let s:RIPOW = 30
let s:RIIPOW = 31
" ------------------------------------------------------------------------------ " ------------------------------------------------------------------------------
" Options: {{{1 " Options: {{{1
@ -60,7 +71,7 @@ if !exists("g:visincr_leaddate")
let g:visincr_leaddate = '0' let g:visincr_leaddate = '0'
endif endif
if !exists("g:visincr_datedivset") if !exists("g:visincr_datedivset")
let g:visincr_datedivset= '[-./]' let g:visincr_datedivset= '[-./_:~,+*^]\='
endif endif
" ============================================================================== " ==============================================================================
@ -86,17 +97,20 @@ fun! visincr#VisBlockIncr(method,...)
" save boundary line numbers and set up method {{{3 " save boundary line numbers and set up method {{{3
let y1 = line("'<") let y1 = line("'<")
let y2 = line("'>") let y2 = line("'>")
let method = (a:method >= s:RI)? a:method - s:RI : a:method let method = (a:method >= s:RI)? (a:method - s:RI) : a:method
let leaddate= g:visincr_leaddate let leaddate= g:visincr_leaddate
" call Decho("a:method=".a:method." s:RI=".s:RI." method=".method." leaddeate<".leaddate.">")
" get increment (default=1) {{{3 " get increment (default=1; except for power increments, that's default=2) {{{3
if a:0 > 0 if a:0 > 0
let incr= a:1 let incr= a:1
if a:method == s:IX || a:method == s:IIX if method == s:IX || method == s:IIX
let incr= s:Hex2Dec(incr) let incr= s:Hex2Dec(incr)
elseif a:method == s:IO || a:method == s:IIO elseif method == s:IO || method == s:IIO
let incr= s:Oct2Dec(incr) let incr= s:Oct2Dec(incr)
endif endif
elseif method == s:IPOW || method == s:IIPOW
let incr= 2
else else
let incr= 1 let incr= 1
endif endif
@ -153,6 +167,14 @@ fun! visincr#VisBlockIncr(method,...)
let restrict= '\c\%'.col(".").'c\(jan\|feb\|mar\|apr\|may\|jun\|jul\|aug\|sep\|oct\|nov\|dec\)' let restrict= '\c\%'.col(".").'c\(jan\|feb\|mar\|apr\|may\|jun\|jul\|aug\|sep\|oct\|nov\|dec\)'
endif endif
" call Decho(":IM restricted<".restrict.">") " call Decho(":IM restricted<".restrict.">")
elseif a:method == s:RIPOW
let restrict= '\%'.col(".").'c\d'
" call Decho(":RIPOW restricted<".restrict.">")
elseif a:method == s:RIIPOW
let restrict= '\%'.col(".").'c\s\{,'.width.'}\d'
" call Decho(":RIIPOW restricted<".restrict.">")
endif endif
" determine zfill {{{3 " determine zfill {{{3
@ -368,10 +390,19 @@ fun! visincr#VisBlockIncr(method,...)
let pat = '^.*\%'.leftcol.'v\( \=[0-9]\{1,4}\)'.g:visincr_datedivset.'\( \=[0-9]\{1,2}\)'.g:visincr_datedivset.'\( \=[0-9]\{1,4}\)\%'.rghtcol.'v.*$' let pat = '^.*\%'.leftcol.'v\( \=[0-9]\{1,4}\)'.g:visincr_datedivset.'\( \=[0-9]\{1,2}\)'.g:visincr_datedivset.'\( \=[0-9]\{1,4}\)\%'.rghtcol.'v.*$'
let datediv= substitute(curline,'^.*\%'.leftcol.'v\%( \=[0-9]\{1,4}\)\('.g:visincr_datedivset.'\).*$','\1','') let datediv= substitute(curline,'^.*\%'.leftcol.'v\%( \=[0-9]\{1,4}\)\('.g:visincr_datedivset.'\).*$','\1','')
if strlen(datediv) > 1
redraw!
echohl WarningMsg
echomsg "***visincr*** Your date looks odd, is g:visincr_datedivset<".g:visincr_datedivset."> what you want?"
endif
" call Decho("pat <".pat.">")
" call Decho("datediv<".datediv.">") " call Decho("datediv<".datediv.">")
" IMDY: {{{3 " IMDY: {{{3
if method == s:IMDY if method == s:IMDY
if datediv == ""
let pat= '^.*\%'.leftcol.'v\( \=[0-9]\{1,2}\)\( \=[0-9]\{1,2}\)\( \=[0-9]\{1,4}\)\%'.rghtcol.'v.*$'
endif
let m = substitute(substitute(curline,pat,'\1',''),' ','','ge')+0 let m = substitute(substitute(curline,pat,'\1',''),' ','','ge')+0
let d = substitute(substitute(curline,pat,'\2',''),' ','','ge')+0 let d = substitute(substitute(curline,pat,'\2',''),' ','','ge')+0
let y = substitute(substitute(curline,pat,'\3',''),' ','','ge')+0 let y = substitute(substitute(curline,pat,'\3',''),' ','','ge')+0
@ -380,6 +411,9 @@ fun! visincr#VisBlockIncr(method,...)
" IYMD: {{{3 " IYMD: {{{3
elseif method == s:IYMD elseif method == s:IYMD
if datediv == ""
let pat= '^.*\%'.leftcol.'v\( \=[0-9]\{1,4}\)\( \=[0-9]\{1,2}\)\( \=[0-9]\{1,2}\)\%'.rghtcol.'v.*$'
endif
let y = substitute(substitute(curline,pat,'\1',''),' ','','ge')+0 let y = substitute(substitute(curline,pat,'\1',''),' ','','ge')+0
let m = substitute(substitute(curline,pat,'\2',''),' ','','ge')+0 let m = substitute(substitute(curline,pat,'\2',''),' ','','ge')+0
let d = substitute(substitute(curline,pat,'\3',''),' ','','ge')+0 let d = substitute(substitute(curline,pat,'\3',''),' ','','ge')+0
@ -388,6 +422,9 @@ fun! visincr#VisBlockIncr(method,...)
" IDMY: {{{3 " IDMY: {{{3
elseif method == s:IDMY elseif method == s:IDMY
if datediv == ""
let pat= '^.*\%'.leftcol.'v\( \=[0-9]\{1,2}\)\( \=[0-9]\{1,2}\)\( \=[0-9]\{1,4}\)\%'.rghtcol.'v.*$'
endif
let d = substitute(substitute(curline,pat,'\1',''),' ','','ge')+0 let d = substitute(substitute(curline,pat,'\1',''),' ','','ge')+0
let m = substitute(substitute(curline,pat,'\2',''),' ','','ge')+0 let m = substitute(substitute(curline,pat,'\2',''),' ','','ge')+0
let y = substitute(substitute(curline,pat,'\3',''),' ','','ge')+0 let y = substitute(substitute(curline,pat,'\3',''),' ','','ge')+0
@ -454,7 +491,7 @@ fun! visincr#VisBlockIncr(method,...)
return return
endif " IMDY IYMD IDMY ID IM endif " IMDY IYMD IDMY ID IM
" I II IX IIX IO IIO IR IIR: {{{3 " I II IX IIX IO IIO IR IIR IPOW IIPOW: {{{3
" construct a line from the first line that only has the number in it " construct a line from the first line that only has the number in it
let rml = rghtcol - leftcol let rml = rghtcol - leftcol
let rmlp1 = rml + 1 let rmlp1 = rml + 1
@ -508,6 +545,7 @@ fun! visincr#VisBlockIncr(method,...)
let ocnt = cnt let ocnt = cnt
" call Decho("cntlen=".cntlen." cnt=".cnt." ocnt=".ocnt." (before I*[XOR] subs)") " call Decho("cntlen=".cntlen." cnt=".cnt." ocnt=".ocnt." (before I*[XOR] subs)")
" elide leading zeros
if method == s:IX || method == s:IIX if method == s:IX || method == s:IIX
let cnt= substitute(cnt,'^0*\([1-9a-fA-F]\|0$\)','\1',"ge") let cnt= substitute(cnt,'^0*\([1-9a-fA-F]\|0$\)','\1',"ge")
elseif method == s:IO || method == s:IIO elseif method == s:IO || method == s:IIO
@ -539,6 +577,20 @@ fun! visincr#VisBlockIncr(method,...)
else else
let maxcnt= s:Dec2Rom(s:Rom2Dec(cnt) + incr*(y2 - y1)) let maxcnt= s:Dec2Rom(s:Rom2Dec(cnt) + incr*(y2 - y1))
endif endif
elseif method == s:IPOW || method == s:IIPOW
let maxcnt = cnt
let i = 1
if incr > 0
while i <= (y2-y1)
let maxcnt= maxcnt*incr
let i= i + 1
endwhile
else
while i <= (y2-y1)
let maxcnt= maxcnt/(-incr)
let i= i + 1
endwhile
endif
else else
let maxcnt= printf("%d",cnt + incr*(y2 - y1)) let maxcnt= printf("%d",cnt + incr*(y2 - y1))
endif endif
@ -596,9 +648,9 @@ fun! visincr#VisBlockIncr(method,...)
let ins= ins - 1 let ins= ins - 1
endwhile endwhile
" back up to left-of-block (plus optional left-hand-side modeling) {{{3 " back up to left-of-block (plus optional left-hand-side modeling) (left-justification support) {{{3
norm! 0 norm! 0
if method == s:I || method == s:IO || method == s:IX || method == s:IR if method == s:I || method == s:IO || method == s:IX || method == s:IR || method == s:IPOW
let bkup= leftcol let bkup= leftcol
" call Decho("bkup= [leftcol=".leftcol."] (due to method)") " call Decho("bkup= [leftcol=".leftcol."] (due to method)")
elseif maxcntlen > 0 elseif maxcntlen > 0
@ -627,7 +679,7 @@ fun! visincr#VisBlockIncr(method,...)
silent! exe 's/\%'.leftcol.'v\( \+\)/\=substitute(submatch(1)," ","'.zfill.'","ge")/e' silent! exe 's/\%'.leftcol.'v\( \+\)/\=substitute(submatch(1)," ","'.zfill.'","ge")/e'
endif endif
" set up for next line {{{3 " update cnt: set up for next line {{{3
if l != y2 if l != y2
norm! j norm! j
endif endif
@ -637,6 +689,12 @@ fun! visincr#VisBlockIncr(method,...)
let cnt= s:Dec2Oct(s:Oct2Dec(cnt) + incr) let cnt= s:Dec2Oct(s:Oct2Dec(cnt) + incr)
elseif method == s:IR || method == s:IIR elseif method == s:IR || method == s:IIR
let cnt= s:Dec2Rom(s:Rom2Dec(cnt) + incr) let cnt= s:Dec2Rom(s:Rom2Dec(cnt) + incr)
elseif method == s:IPOW || method == s:IIPOW
if incr > 0
let cnt= cnt*incr
elseif incr < 0
let cnt= cnt/(-incr)
endif
else else
let cnt= cnt + incr let cnt= cnt + incr
endif endif

View File

@ -10,18 +10,17 @@ if exists("syntax_on")
endif endif
let g:colors_name="reloaded" let g:colors_name="reloaded"
hi LineNr term=bold gui=bold guifg=White guibg=DarkGray
hi Normal ctermfg=Green ctermbg=Black hi Normal ctermfg=Green ctermbg=Black
hi Normal guifg=Green guibg=Black hi Normal guifg=Green guibg=Black
hi NonText ctermfg=DarkGray ctermbg=Black hi NonText ctermfg=DarkGreen ctermbg=Black
hi NonText guifg=DarkGray guibg=Black hi NonText guifg=DarkGreen guibg=Black
hi Statement ctermfg=Green ctermbg=Black hi Statement ctermfg=Green ctermbg=Black
hi Statement guifg=Green guibg=Black hi Statement guifg=Green guibg=Black
hi Comment ctermfg=DarkGreen ctermbg=Black cterm=bold term=bold hi Comment ctermfg=DarkGreen ctermbg=Black cterm=bold term=bold
hi Comment guifg=DarkGreen guibg=Black gui=bold term=bold hi Comment guifg=DarkGreen guibg=Black gui=bold term=bold
hi Constant ctermfg=Black ctermbg=Green hi Constant ctermfg=Green ctermbg=DarkGreen
hi Constant guifg=Black guibg=Green hi Constant guifg=Green guibg=DarkGreen
hi Identifier ctermfg=Green ctermbg=Black hi Identifier ctermfg=Green ctermbg=Black
hi Identifier guifg=Green guibg=Black hi Identifier guifg=Green guibg=Black
hi Type ctermfg=Green ctermbg=Black hi Type ctermfg=Green ctermbg=Black
@ -48,19 +47,24 @@ let g:colors_name="reloaded"
hi WarningMsg guifg=Yellow guibg=Black hi WarningMsg guifg=Yellow guibg=Black
hi VertSplit ctermfg=White ctermbg=Black hi VertSplit ctermfg=White ctermbg=Black
hi VertSplit guifg=White guibg=Black hi VertSplit guifg=White guibg=Black
hi Directory ctermfg=Green ctermbg=DarkBlue hi Directory ctermfg=DarkGreen ctermbg=Black
hi Directory guifg=Green guibg=DarkBlue hi Directory guifg=DarkGreen guibg=Black
hi Visual ctermfg=White ctermbg=DarkGray cterm=underline term=none hi Visual ctermfg=White ctermbg=DarkGray cterm=underline term=none
hi Visual guifg=White guibg=DarkGray gui=underline term=none hi Visual guifg=White guibg=DarkGray gui=underline term=none
hi Title ctermfg=White ctermbg=DarkBlue hi Title ctermfg=White ctermbg=DarkBlue
hi Title guifg=White guibg=DarkBlue hi Title guifg=White guibg=DarkBlue
hi StatusLine term=bold cterm=bold,underline ctermfg=White ctermbg=Black hi StatusLine term=bold cterm=bold,underline ctermfg=Green ctermbg=Black
hi StatusLine term=bold gui=bold,underline guifg=White guibg=Black hi StatusLine term=bold gui=bold,underline guifg=Green guibg=Black
hi StatusLineNC term=bold cterm=bold,underline ctermfg=Gray ctermbg=Black hi StatusLineNC term=bold cterm=bold,underline ctermfg=Gray ctermbg=Black
hi StatusLineNC term=bold gui=bold,underline guifg=Gray guibg=Black hi StatusLineNC term=bold gui=bold,underline guifg=Gray guibg=Black
hi LineNr term=bold cterm=bold ctermfg=White ctermbg=DarkGray hi LineNr term=bold cterm=bold ctermfg=Black ctermbg=DarkGreen
hi LineNr term=bold gui=bold guifg=White guibg=DarkGray hi LineNr term=bold gui=bold guifg=Black guibg=DarkGreen
hi SpecialKey guifg=DarkGreen guibg=Black
hi SpecialKey ctermfg=DarkGreen ctermbg=Black
hi cursorline guifg=Black guibg=DarkGreen
hi cursorline ctermfg=Black ctermbg=DarkGreen
hi cursorcolumn guifg=Black guibg=Green
hi cursorcolumn ctermfg=Black ctermbg=Green
hi cursorline ctermbg=White
hi cursorline guibg=DarkGray

1387
vimfiles/doc/Align.txt Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,199 @@
*SrchRplcHiGrp.txt* Search and Replace Restricted to a Highlighting Group
Author: David Fishburn January 22, 2008
==============================================================================
1. Contents *srchrplchigrp* *srchrplchigrp-contents*
1. Contents......................: |srchrplchigrp-contents|
2. Commands......................: |srchrplchigrp-commands|
SR............................: |SR|
SRDispHiGrp...................: |SRDispHiGrp|
SRChooseHiGrp.................: |SRChooseHiGrp|
SRHiGrp.......................: |SRHiGrp|
3. Examples......................: |srchrplchigrp-examples|
==============================================================================
2. Commands *srchrplchigrp-commands*
SR = Search and Replace *SR*
SRDispHiGrp *SRDispHiGrp*
Displays the syntax id and name the of the syntax group
which has been chosen.
SRChooseHiGrp[!] *SRChooseHiGrp*
Before you can run the search and replace command (:SRHiGrp),
you must choose which syntax group id you want to operate on.
The top level syntax id of the current cursor position is
chosen (ie. the top-level one versus the final one).
The optional bang lets SRChooseHiGrp use the translated
syntax ID. This is final one versus the top-level one.
Assuming we were using a SQL file and placed the cursor on the
FROM word, then using the SyntaxAttr plugin
(http://vim.sourceforge.net/script.php?script_id=383)
it displays both the top-level and translated
(or final) highlight group as follows: >
group: sqlKeyword->Statement guifg=#ffff00(#ffff00)
<
Examples: >
:SRChooseHiGrp
< Will operate on only sqlKeyword syntax groups
>
:SRChooseHiGrp!
< Will operate on all Statement syntax groups. Based on
|group-name|, the Statement group will highlight the
same color for the following highlight groups:
Conditional
Repeat
Label
Operator
Keyword
Exception
Therefore SRChooseHiGrp! will operate over all of the
above syntax groups.
SRSearch *SRSearch*
This command will perform a forward search starting at the current
cursor position for a specified highlight group name. The range defaults
to the entire file. It supports all visual modes, characterwise (v),
linewise (V) and blockwise (<C-V>).
It optionally takes takes one parameter. You can supply a hightlight
group name: >
:SRSearch Statement
<
The command supports highlight group name completion. >
:SRSearch C<Tab>
< Depending on which syntax groups are defined (given your filetype and
various plugins) this will cycle through all highlight group names
beginning with the letter 'C'.
Alternatively, you can use the SRChooseHiGrp or SRChooseHiGrp!
command to select the highlight group. Running SRSearch
without a parameter will check if a valid group name was
selected via SRChooseHiGrp and begin the search. If no valid
group name was specified, an error message will be reported.
SRHiGrp[!] *SRHiGrp*
This command will perform a search and replace over a visual
range. It works in all visual modes, characterwise (v),
linewise (V) and blockwise (<C-V>).
It optionally takes takes 2 parameters.
Parameter 1 controls what characters are matched. The default
for this value is \(\w\+\>\). This expression is appended to
the \%# which starts the match from the current cursor
position. This expression must specify a submatch \(...\).
Parameter 2 controls what to do with the matched string. The
default for this value is \U\1. This expression will cause
the matched string to be UPPER cased. The \1 refers to the
submatch from the first parameter.
If the parameters are not supplied, the user will be prompted
to enter the expression(s).
The optional bang (!) works the same as SRHiGrp, but will
operate on all syntax groups that are NOT the chosen one
(SRChooseHiGrp).
Syntax: >
[range]SRHiGrp[!] 'from-pattern','to-string'
<
==============================================================================
3. Examples *srchrplchigrp-examples*
SRHiGrp
-------
First place your cursor on an item that is syntax colored the way
you want:
>
:SRChooseHiGrp
<
Next, visually select a block of text
(all visual modes are supported)
>
:SRHiGrp
or
:SRHiGrp '\(\w\+\>\)'
or
:SRHiGrp '\(\w\+\>\)', '\U\1'
<
If you had the following in a SQL file:
>
if exists( select 1
from sys.sysprocedure sp
key join sys.sysuserperm sup
where sp.proc_name = 'sp_http_course_detail'
and sup.user_name = user_name() ) then
drop procedure sp_http_course_detail;
end if;
<
Where the keywords (if, exists, select, from ...) are all
highlighted yellow (based on my colorscheme). After I visually
select the area and run the command taking default prompts:
>
:'<,'>SRHiGrp
<
The result is:
>
IF EXISTS( SELECT 1
FROM sys.sysprocedure sp
KEY JOIN sys.sysuserperm sup
WHERE sp.proc_name = 'sp_http_course_detail'
AND sup.user_name = user_name() ) THEN
DROP PROCEDURE sp_http_course_detail;
END IF;
<
Where the keywords (if, exists, select, from ...) are all
highlighted yellow (based on my colorscheme). After I visually
select the area and run the command taking default prompts: >
:'<,'>SRHiGrp!
<
The result is:
>
if exists( select 1
from SYS.SYSPROCEDURE SP
key join SYS.SYSUSERPERM SUP
where SP.PROC_NAME = 'SP_HTTP_COURSE_DETAIL'
and SUP.USER_NAME = USER_NAME() ) then
drop procedure SP_HTTP_COURSE_DETAIL;
end if;
<
SRSearch
--------
SRSearch simply does a forward search for the specified highlight
group. A few examples: >
:SRSearch sqlKeyword
:1,5SRSearch sqlKeyword
:'<,'>SRSearch sqlKeyword
<
Optionally, you can first choose the hightlight group by placing your
cursor on the highlight you want and: >
:SRChooseHiGrp
:SRSearch
<
Using Vim's tab completion you can also: >
:SRSearch s<Tab>
<
Each time you press tab, it will cycle through the currently defined
syntax highlight groups beginning with the letter 's'.
The results of the search is displayed in the command line and is
highlighted in the color of the syntax group. This will remind you
which group was searched for. >
SRSearch - Match found - Group ID: 171 Name: sqlKeyword
SRSearch - Match NOT found - Group ID: 171 Name: sqlKeyword
<
vim:tw=78:ts=8:ft=help:norl:

View File

@ -1,4 +1,4 @@
*pi_getscript.txt* For Vim version 7.0. Last change: 2006 Nov 1 *pi_getscript.txt* For Vim version 7.0. Last change: 2008 Jan 07
> >
GETSCRIPT REFERENCE MANUAL by Charles E. Campbell, Jr. GETSCRIPT REFERENCE MANUAL by Charles E. Campbell, Jr.
< <
@ -309,7 +309,7 @@ so-called script-id. Within the webpage of
is a line specifying the latest source-id (src_id). The source identifier 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 numbers are always increasing, hence if the src_id is greater than the one
recorded for the script in GetLatestVimScripts then its time to download a recorded for the script in GetLatestVimScripts then it's time to download a
newer copy of that script. newer copy of that script.
GetLatestVimScripts will then download the script and update its internal GetLatestVimScripts will then download the script and update its internal
@ -335,6 +335,12 @@ The AutoInstall process will:
============================================================================== ==============================================================================
9. GetLatestVimScripts History *getscript-history* *glvs-hist* {{{1 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 v24 Apr 16, 2007 : * removed save&restore of the fo option during script
loading loading
v23 Nov 03, 2006 : * ignores comments (#...) v23 Nov 03, 2006 : * ignores comments (#...)

View File

@ -1,4 +1,4 @@
*pi_netrw.txt* For Vim version 7.1. Last change: 2007 Dec 12 *pi_netrw.txt* For Vim version 7.1. Last change: 2008 Feb 26
----------------------------------------------------- -----------------------------------------------------
NETRW REFERENCE MANUAL by Charles E. Campbell, Jr. NETRW REFERENCE MANUAL by Charles E. Campbell, Jr.
@ -45,12 +45,14 @@
Customizing Browsing With A User Function..........|netrw-x| Customizing Browsing With A User Function..........|netrw-x|
Deleting Files Or Directories......................|netrw-D| Deleting Files Or Directories......................|netrw-D|
Directory Exploring Commands.......................|netrw-explore| Directory Exploring Commands.......................|netrw-explore|
Exploring With Stars and Patterns..................|netrw-star|
Displaying Information About File..................|netrw-qf|
Edit File Or Directory Hiding List.................|netrw-ctrl-h| Edit File Or Directory Hiding List.................|netrw-ctrl-h|
Editing The Sorting Sequence.......................|netrw-S| Editing The Sorting Sequence.......................|netrw-S|
Going Up...........................................|netrw--| Going Up...........................................|netrw--|
Hiding Files Or Directories........................|netrw-a| Hiding Files Or Directories........................|netrw-a|
Improving Browsing.................................|netrw-ssh-hack| Improving Browsing.................................|netrw-ssh-hack|
Listing Bookmarks And History......................|netrw-q| Listing Bookmarks And History......................|netrw-qb|
Making A New Directory.............................|netrw-d| Making A New Directory.............................|netrw-d|
Making The Browsing Directory The Current Directory|netrw-c| Making The Browsing Directory The Current Directory|netrw-c|
Marked Files: Compression And Decompression........|netrw-mz| Marked Files: Compression And Decompression........|netrw-mz|
@ -807,11 +809,13 @@ 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|). * To change the listing style, press the "i" key (|netrw-i|).
Currently there are four styles: thin, long, wide, and tree. Currently there are four styles: thin, long, wide, and tree.
* To hide files (don't want to see those xyz~ files anymore?) see * To hide files (don't want to see those xyz~ files anymore?) see
|netrw-ctrl-h|. |netrw-ctrl-h|.
* Press s to sort files by name, time, or size. * Press s to sort files by name, time, or size.
See |netrw-browse-cmds| for all the things you can do! See |netrw-browse-cmds| for all the things you can do with netrw!
QUICK REFERENCE: MAPS *netrw-browse-maps* {{{2 QUICK REFERENCE: MAPS *netrw-browse-maps* {{{2
@ -830,6 +834,7 @@ QUICK REFERENCE: MAPS *netrw-browse-maps* {{{2
d Make a directory |netrw-d| d Make a directory |netrw-d|
D Attempt to remove the file(s)/directory(ies) |netrw-D| D Attempt to remove the file(s)/directory(ies) |netrw-D|
gb Go to previous bookmarked directory |netrw-gb| gb Go to previous bookmarked directory |netrw-gb|
gi Display information on file |netrw-qf|
<c-h> Edit file hiding list |netrw-ctrl-h| <c-h> Edit file hiding list |netrw-ctrl-h|
i Cycle between thin, long, wide, and tree listings |netrw-i| i Cycle between thin, long, wide, and tree listings |netrw-i|
<c-l> Causes Netrw to refresh the directory listing |netrw-ctrl-l| <c-l> Causes Netrw to refresh the directory listing |netrw-ctrl-l|
@ -838,6 +843,7 @@ QUICK REFERENCE: MAPS *netrw-browse-maps* {{{2
md Apply diff to marked files (up to 3) |netrw-md| md Apply diff to marked files (up to 3) |netrw-md|
me Place marked files on arg list and edit them |netrw-me| me Place marked files on arg list and edit them |netrw-me|
mf Mark a file |netrw-mf| mf Mark a file |netrw-mf|
mh Toggle marked file suffices' presence on hiding list |netrw-mh|
mm Move marked files to marked-file target directory |netrw-mm| mm Move marked files to marked-file target directory |netrw-mm|
mp Print marked files |netrw-mp| mp Print marked files |netrw-mp|
mr Mark files satisfying a |regexp| |netrw-mr| mr Mark files satisfying a |regexp| |netrw-mr|
@ -851,7 +857,7 @@ QUICK REFERENCE: MAPS *netrw-browse-maps* {{{2
O Obtain a file specified by cursor |netrw-O| O Obtain a file specified by cursor |netrw-O|
p Preview the file |netrw-p| p Preview the file |netrw-p|
P Browse in the previously used window |netrw-P| P Browse in the previously used window |netrw-P|
q List bookmarked directories and history |netrw-q| q List bookmarked directories and history |netrw-qb|
r Reverse sorting order |netrw-r| r Reverse sorting order |netrw-r|
R Rename the designed file(s)/directory(ies) |netrw-R| R Rename the designed file(s)/directory(ies) |netrw-R|
s Select sorting style: by name, time, or file size |netrw-s| s Select sorting style: by name, time, or file size |netrw-s|
@ -869,11 +875,13 @@ QUICK REFERENCE: MAPS *netrw-browse-maps* {{{2
see |netrw-P| see |netrw-P|
<rightmouse> (gvim only) delete file/directory using word under <rightmouse> (gvim only) delete file/directory using word under
mouse mouse
<2-leftmouse> (gvim only) when in a netrw-selected file, a double <2-leftmouse> (gvim only) when:
clicked leftmouse button will return to the netrw * in a netrw-selected file, AND
browser window. This mapping is available only if * |g:netrw_retmap| == 1 AND
the user doesn't already have a <2-leftmouse> mapping. * the user doesn't already have a <2-leftmouse> mapping
See |g:netrw_noretmap| if you don't want this mapping. defined before netrw is autoloaded,
then a double clicked leftmouse button will return
to the netrw browser window.
<s-leftmouse> (gvim only) like mf, will mark files <s-leftmouse> (gvim only) like mf, will mark files
QUICK REFERENCE: COMMANDS *netrw-explore-cmds* *netrw-browse-cmds* {{{2 QUICK REFERENCE: COMMANDS *netrw-explore-cmds* *netrw-browse-cmds* {{{2
@ -895,7 +903,7 @@ One may easily "bookmark" a directory by using >
< <
Any count may be used. One may use viminfo's "!" option to retain bookmarks Any count may be used. One may use viminfo's "!" option to retain bookmarks
between vim sessions. See |netrw-gb| for how to return to a bookmark and between vim sessions. See |netrw-gb| for how to return to a bookmark and
|netrw-q| for how to list them. |netrw-qb| for how to list them.
BROWSING *netrw-cr* {{{2 BROWSING *netrw-cr* {{{2
@ -917,10 +925,17 @@ default. When the option is one or two, the splitting will be taken
horizontally or vertically, respectively. When the option is set to three, a horizontally or vertically, respectively. When the option is set to three, a
<cr> will cause the file to appear in a new tab. <cr> will cause the file to appear in a new tab.
When using the gui (gvim), one may also click on a file using the leftmouse
button. A doubly-clicked leftmouse button will return to the netrw browser When using the gui (gvim) one may select a file by pressing the <leftmouse>
window (unless |g:netrw_noretmap| is used, or the double-click leftmouse map button. In addtion, if
is already defined before netrw is loaded).
*|g:netrw_retmap| == 1 AND (its default value is 0)
* in a netrw-selected file, AND
* the user doesn't already have a <2-leftmouse> mapping defined before
netrw is loaded
then a doubly-clicked leftmouse button will return to the netrw browser
window.
Netrw attempts to speed up browsing, especially for remote browsing where one Netrw attempts to speed up browsing, especially for remote browsing where one
may have to enter passwords, by keeping and re-using previously obtained may have to enter passwords, by keeping and re-using previously obtained
@ -1022,7 +1037,7 @@ To change directory back to a bookmarked directory, use
{cnt}gb {cnt}gb
Any count may be used to reference any of the bookmarks. See |netrw-mb| on Any count may be used to reference any of the bookmarks. See |netrw-mb| on
how to bookmark a directory and |netrw-q| on how to list bookmarks. how to bookmark a directory and |netrw-qb| on how to list bookmarks.
CHANGING TO A PREDECESSOR DIRECTORY *netrw-u* *netrw-updir* {{{2 CHANGING TO A PREDECESSOR DIRECTORY *netrw-u* *netrw-updir* {{{2
@ -1038,7 +1053,7 @@ CHANGING TO A SUCCESSOR DIRECTORY *netrw-U* *netrw-downdir* {{{2
With the "U" map, one can change to a later directory (successor). With the "U" map, one can change to a later directory (successor).
This map is the opposite of the "u" map. (see |netrw-u|) Use the This map is the opposite of the "u" map. (see |netrw-u|) Use the
q map to list both the bookmarks and history. (see |netrw-q|) q map to list both the bookmarks and history. (see |netrw-qb|)
NETRW CLEAN *netrw-clean* *:NetrwClean* NETRW CLEAN *netrw-clean* *:NetrwClean*
@ -1198,6 +1213,9 @@ DIRECTORY EXPLORATION COMMANDS {{{2
By default, these commands use the current file's directory. However, one By default, these commands use the current file's directory. However, one
may explicitly provide a directory (path) to use. may explicitly provide a directory (path) to use.
The |g:netrw_winsize| variable also is used, if specified by the user, to
size Hexplore and Vexplore windows.
:Rexplore This command is a little different from the others. When one :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 edits a file, for example by pressing <cr> when atop a file in
a netrw browser window, :Rexplore will return the display to a netrw browser window, :Rexplore will return the display to
@ -1205,32 +1223,41 @@ may explicitly provide a directory (path) to use.
of <2-leftmouse> (which is only available under gvim and of <2-leftmouse> (which is only available under gvim and
cooperative terms). cooperative terms).
*netrw-starstar*
When Explore, Sexplore, Hexplore, or Vexplore are used with a **/filepat, *netrw-star* *netrw-starpat* *netrw-starstar* *netrw-starstarpat*
such as: EXPLORING WITH STARS AND PATTERNS
>
:Explore **/filename_pattern When Explore, Sexplore, Hexplore, or Vexplore are used with one of the
following four styles, Explore generates a list of files which satisfy
the request. >
*/filepat files in current directory which satisfy filepat
**/filepat files in current directory or below which satisfy the
file pattern
*//pattern files in the current directory which contain the
pattern (vimgrep is used)
**//pattern files in the current directory or below which contain
the pattern (vimgrep is used)
< <
netrw will attempt to find a file in the current directory or any subdirectory The cursor will be placed on the first file in the list. One may then
which matches the filename pattern. Internally, it produces a list of files continue to go to subsequent files on that list via |:Nexplore| or to
which match the pattern and their paths; to that extent it resembles the Unix preceding files on that list with |:Pexplore|. Explore will update the
operation: directory and place the cursor appropriately.
>
find $(pwd) -name "$1" -exec "echo" "{}" ";" 2> /dev/null A plain >
< :Explore
The directory display is updated to show the subdirectory containing a will clear the explore list.
matching file. One may then proceed to the next (or previous) matching files'
directories by using Nexplore or Pexplore, respectively. If your console or If your console or gui produces recognizable shift-up or shift-down sequences,
gui produces recognizable shift-up or shift-down sequences, then you'll likely then you'll likely find using shift-downarrow and shift-uparrow convenient.
find using shift-downarrow and shift-uparrow convenient. They're mapped by They're mapped by netrw:
netrw:
<s-down> == Nexplore, and <s-down> == Nexplore, and
<s-up> == Pexplore. <s-up> == Pexplore.
As an example, consider As an example, consider
> >
:Explore **/*.c :Explore */*.c
:Nexplore :Nexplore
:Nexplore :Nexplore
:Pexplore :Pexplore
@ -1238,29 +1265,6 @@ As an example, consider
The status line will show, on the right hand side of the status line, a The status line will show, on the right hand side of the status line, a
message like "Match 3 of 20". message like "Match 3 of 20".
*netrw-starpat*
When Explore, Sexplore, Hexplore, or Vexplore are used with a */pattern,
such as:
>
:Explore */pattern
<
netrw will use |:vimgrep| to find files which contain the given pattern.
Like what happens with |netrw-starstar|, a list of files which contain
matches to the given pattern is generated. The cursor will then jump
to the first file with the given pattern; |:Nexplore|, |:Pexplore|, and
the shifted-down and -up arrows work with the list to move to the next
or previous files in that list.
*netrw-starstarpat*
When Explore, Sexplore, Hexplore, or Vexplore are used with a **//pattern,
such as:
>
:Explore **//pattern
<
then Explore will use |:vimgrep| to find files like |netrw-starpat|;
however, Explore will also search subdirectories as well as the current
directory.
Associated setting variables: |g:netrw_keepdir| |g:netrw_browse_split| Associated setting variables: |g:netrw_keepdir| |g:netrw_browse_split|
|g:netrw_fastbrowse| |g:netrw_ftp_browse_reject| |g:netrw_fastbrowse| |g:netrw_ftp_browse_reject|
|g:netrw_ftp_list_cmd| |g:netrw_ftp_sizelist_cmd| |g:netrw_ftp_list_cmd| |g:netrw_ftp_sizelist_cmd|
@ -1268,6 +1272,13 @@ Associated setting variables: |g:netrw_keepdir| |g:netrw_browse_split|
|g:netrw_liststyle| |g:netrw_liststyle|
DISPLAYING INFORMATION ABOUT FILE *netrw-qf* {{{2
With the cursor atop a filename, pressing "qf" will reveal the file's size
and last modification timestamp. Currently this capability is only available
for local files.
EDIT FILE OR DIRECTORY HIDING LIST *netrw-ctrl-h* *netrw-edithide* {{{2 EDIT FILE OR DIRECTORY HIDING LIST *netrw-ctrl-h* *netrw-edithide* {{{2
The "<ctrl-h>" map brings up a requestor allowing the user to change the The "<ctrl-h>" map brings up a requestor allowing the user to change the
@ -1279,14 +1290,15 @@ either be hidden (ie. not shown) or be the only ones displayed (see
Associated setting variable: |g:netrw_hide| Associated setting variable: |g:netrw_hide|
EDITING THE SORTING SEQUENCE *netrw-S* *netrw-sortsequence* {{{2 EDITING THE SORTING SEQUENCE *netrw-S* *netrw-sortsequence* {{{2
When "Sorted by" is name, one may specify priority via the sorting sequence When "Sorted by" is name, one may specify priority via the sorting sequence
(g:netrw_sort_sequence). The sorting sequence typically prioritizes the (g:netrw_sort_sequence). The sorting sequence typically prioritizes the
name-listing by suffix, although any pattern will do. Patterns are delimited name-listing by suffix, although any pattern will do. Patterns are delimited
by commas. The default sorting sequence is: by commas. The default sorting sequence is (all one line):
> >
[\/]$,*,\.bak$,\.o$,\.h$,\.info$,\.swp$,\.obj$ '[\/]$,\.[a-np-z]$,\.h$,\.c$,\.cpp$,*,\.o$,\.obj$,\.info$,
\.swp$,\.bak$,\~$'
< <
The lone * is where all filenames not covered by one of the other patterns The lone * is where all filenames not covered by one of the other patterns
will end up. One may change the sorting sequence by modifying the will end up. One may change the sorting sequence by modifying the
@ -1297,7 +1309,7 @@ Related topics: |g:netrw-s| |g:netrw-S|
Associated setting variable: |g:netrw_sort_sequence| Associated setting variable: |g:netrw_sort_sequence|
GOING UP *netrw--* {{{2 GOING UP *netrw--* {{{2
To go up a directory, press "-" or press the <cr> when atop the ../ directory To go up a directory, press "-" or press the <cr> when atop the ../ directory
entry in the listing. entry in the listing.
@ -1314,7 +1326,7 @@ preferred. The NetList function which implements remote browsing
expects that directories will be flagged by a trailing slash. expects that directories will be flagged by a trailing slash.
HIDING FILES OR DIRECTORIES *netrw-a* *netrw-hiding* {{{2 HIDING FILES OR DIRECTORIES *netrw-a* *netrw-hiding* {{{2
Netrw's browsing facility allows one to use the hiding list in one of three Netrw's browsing facility allows one to use the hiding list in one of three
ways: ignore it, hide files which match, and show only those files which ways: ignore it, hide files which match, and show only those files which
@ -1353,6 +1365,11 @@ If files have been marked using |netrw-mf|, then this command will:
and showing only non-hidden files. and showing only non-hidden files.
endif endif
*netrw-gh*
As a quick shortcut, one may press >
gh
to toggle between hiding files which begin with a period (dot) or not.
Associated setting variable: |g:netrw_list_hide| Associated setting variable: |g:netrw_list_hide|
*netrw-ctrl_h* *netrw-ctrl_h*
@ -1400,10 +1417,12 @@ passwords:
http://sial.org/howto/openssh/publickey-auth/ http://sial.org/howto/openssh/publickey-auth/
LISTING BOOKMARKS AND HISTORY *netrw-q* *netrw-listbookmark* {{{2 LISTING BOOKMARKS AND HISTORY *netrw-qb* *netrw-listbookmark* {{{2
Pressing "q" will list the bookmarked directories and directory traversal Pressing "qb" (query bookmarks) will list the bookmarked directories and
history (query). (see |netrw-mb|, |netrw-gb|, |netrw-u|, and |netrw-U|) directory traversal history (query).
(see |netrw-mb|, |netrw-gb|, |netrw-u|, and |netrw-U|)
MAKING A NEW DIRECTORY *netrw-d* {{{2 MAKING A NEW DIRECTORY *netrw-d* {{{2
@ -1457,7 +1476,7 @@ associated decompressing utilities; see |g:netrw_decompress|.
Associated setting variables: |g:netrw_compress| |g:netrw_decompress| Associated setting variables: |g:netrw_compress| |g:netrw_decompress|
MARKED FILES: COPYING *netrw-mc* {{{2 MARKED FILES: COPYING *netrw-mc* {{{2
(See |netrw-mf| and |netrw-mr| for how to mark files) (See |netrw-mf| and |netrw-mr| for how to mark files)
Select a target directory with mt (|netrw-mt|). Then change directory, Select a target directory with mt (|netrw-mt|). Then change directory,
@ -1465,18 +1484,29 @@ select file(s) (see |netrw-mf|), and press "mc".
Associated setting variable: |g:netrw_localcopycmd| |g:netrw_ssh_cmd| Associated setting variable: |g:netrw_localcopycmd| |g:netrw_ssh_cmd|
MARKED FILES: DIFF *netrw-md* {{{2 MARKED FILES: DIFF *netrw-md* {{{2
(See |netrw-mf| and |netrw-mr| for how to mark files) (See |netrw-mf| and |netrw-mr| for how to mark files)
Use |vimdiff| to visualize difference between selected files (two or Use |vimdiff| to visualize difference between selected files (two or
three may be selected for this). three may be selected for this).
MARKED FILES: EDITING *netrw-me* {{{2 MARKED FILES: EDITING *netrw-me* {{{2
(See |netrw-mf| and |netrw-mr| for how to mark files) (See |netrw-mf| and |netrw-mr| for how to mark files)
This command will place the marked files on the |arglist| and commence This command will place the marked files on the |arglist| and commence
editing them. One may return the to explorer window with |:Rexplore|. editing them. One may return the to explorer window with |:Rexplore|.
MARKED FILES: HIDING AND UNHIDING BY SUFFIX *netrw-mh* {{{2
(See |netrw-mf| and |netrw-mr| for how to mark files)
This command extracts the suffices of the marked files and toggles their
presence on the hiding list. Please note that marking the same suffix
this way multiple times will result in the suffix's presence being toggled
for each file (so an even quantity of marked files having the same suffix
is the same as not having bothered to select them at all).
Related topics: |netrw-a| |g:netrw_list_hide|
MARKED FILES: MOVING *netrw-mm* {{{2 MARKED FILES: MOVING *netrw-mm* {{{2
(See |netrw-mf| and |netrw-mr| for how to mark files) (See |netrw-mf| and |netrw-mr| for how to mark files)
@ -1485,7 +1515,7 @@ select file(s) (see |netrw-mf|), and press "mm".
Associated setting variable: |g:netrw_localmovecmd| |g:netrw_ssh_cmd| Associated setting variable: |g:netrw_localmovecmd| |g:netrw_ssh_cmd|
MARKED FILES: PRINTING *netrw-mp* {{{2 MARKED FILES: PRINTING *netrw-mp* {{{2
(See |netrw-mf| and |netrw-mr| for how to mark files) (See |netrw-mf| and |netrw-mr| for how to mark files)
Netrw will apply the |:hardcopy| command to marked files. What it does Netrw will apply the |:hardcopy| command to marked files. What it does
@ -1493,7 +1523,13 @@ is open each file in a one-line window, execute hardcopy, then close the
one-line window. one-line window.
MARKED FILES: TAGGING *netrw-mT* {{{2 MARKED FILES: SOURCING *netrw-ms* {{{2
(See |netrw-mf| and |netrw-mr| for how to mark files)
Netrw will source the marked files (using vim's |:source| command)
MARKED FILES: TAGGING *netrw-mT* {{{2
(See |netrw-mf| and |netrw-mr| for how to mark files) (See |netrw-mf| and |netrw-mr| for how to mark files)
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, its
@ -1518,19 +1554,31 @@ edit the desired file and go to the tag.
Associated setting variables: |g:netrw_ctags| |g:netrw_ssh_cmd| Associated setting variables: |g:netrw_ctags| |g:netrw_ssh_cmd|
MARKED FILES: SETTING TARGET DIRECTORY *netrw-mt* {{{2 MARKED FILES: SETTING THE TARGET DIRECTORY *netrw-mt* {{{2
(See |netrw-mf| and |netrw-mr| for how to mark files) (See |netrw-mf| and |netrw-mr| for how to mark files)
Set the marked file move/copy target (see |netrw-mc| and |netrw-mm|). Set the marked file copy/move-to target (see |netrw-mc| and |netrw-mm|):
* if the cursor is atop a file name, then the netrw window's currently
displayed directory is used for the copy/move-to target.
MARKED FILES: UNMARKING *netrw-mu* {{{2 * also, if the cursor is in the banner, then the netrw window's currently
displayed directory is used for the copy/move-to target.
* however, if the cursor is atop a directory name, then that directory is
used for the copy/move-to target
There is only one copy/move-to target per vim session; ie. the target is a
script variable (see |s:var|) and is shared between all netrw windows (in an
instance of vim).
MARKED FILES: UNMARKING *netrw-mu* {{{2
(See |netrw-mf| and |netrw-mr| for how to mark files) (See |netrw-mf| and |netrw-mr| for how to mark files)
The "mu" mapping will unmark all currently marked files. The "mu" mapping will unmark all currently marked files.
MARKING FILES *netrw-mf* {{{2 MARKING FILES *netrw-mf* {{{2
(also see |netrw-mr|) (also see |netrw-mr|)
One may mark files with the cursor atop a filename and then pressing "mf". One may mark files with the cursor atop a filename and then pressing "mf".
@ -1549,7 +1597,7 @@ Two commands, |netrw-mc| and |netrw-mm|, copy/move marked files to a
target directory (which can be set with |netrw-mt|). target directory (which can be set with |netrw-mt|).
MARKING FILES BY REGULAR EXPRESSION *netrw-mr* {{{2 MARKING FILES BY REGULAR EXPRESSION *netrw-mr* {{{2
(also see |netrw-mf|) (also see |netrw-mf|)
One may also mark files by pressing "mr"; netrw will then issue a prompt, One may also mark files by pressing "mr"; netrw will then issue a prompt,
@ -1676,6 +1724,7 @@ your browsing preferences. (see also: |netrw-settings|)
= 3: tree style listing = 3: tree style listing
*g:netrw_list_hide* comma separated pattern list for hiding files *g:netrw_list_hide* comma separated pattern list for hiding files
Patterns are regular expressions (see |regexp|) Patterns are regular expressions (see |regexp|)
Example: let g:netrw_list_hide= '.*\.swp$'
default: "" default: ""
*g:netrw_localcopycmd* ="cp" Linux/Unix/MacOS/Cygwin *g:netrw_localcopycmd* ="cp" Linux/Unix/MacOS/Cygwin
@ -1704,9 +1753,11 @@ your browsing preferences. (see also: |netrw-settings|)
*g:netrw_mkdir_cmd* command for making a remote directory *g:netrw_mkdir_cmd* command for making a remote directory
default: "ssh USEPORT HOSTNAME mkdir" default: "ssh USEPORT HOSTNAME mkdir"
*g:netrw_noretmap* if it exists and is set to one, then *g:netrw_retmap* if it exists and is set to one, then
<2-leftmouse> will not be mapped for easy <2-leftmouse> will be mapped for easy
return to the netrw browser window. return to the netrw browser window.
(example: click once to select and open
a file, double-click to return)
default: =0 default: =0
*g:netrw_rm_cmd* command for removing files *g:netrw_rm_cmd* command for removing files
@ -1729,6 +1780,28 @@ your browsing preferences. (see also: |netrw-settings|)
default: '[\/]$,*,\.bak$,\.o$,\.h$, default: '[\/]$,*,\.bak$,\.o$,\.h$,
\.info$,\.swp$,\.obj$' \.info$,\.swp$,\.obj$'
*g:netrw_special_syntax* If true, then certain files will be shown
in special syntax in the browser:
netrwBak : *.bak
netrwCompress: *.gz *.bz2 *.Z *.zip
netrwData : *.dat
netrwHdr : *.h
netrwLib : *.a *.so *.lib *.dll
netrwMakefile: [mM]akefile *.mak
netrwObj : *.o *.obj
netrwTags : tags ANmenu ANtags
netrwTilde : *~
netrwTmp : tmp* *tmp
These syntax highlighting groups are linked
to Folded or DiffChange by default
(see |hl-Folded| and |hl-DiffChange|), but
one may put lines like >
hi link netrwCompress Visual
< into one's <.vimrc> to use one's own
preferences.
*g:netrw_ssh_cmd* One may specify an executable command *g:netrw_ssh_cmd* One may specify an executable command
to use instead of ssh for remote actions to use instead of ssh for remote actions
such as listing, file removal, etc. such as listing, file removal, etc.
@ -1759,7 +1832,9 @@ your browsing preferences. (see also: |netrw-settings|)
" %a %Y-%m-%d %I-%M-%S %p" " %a %Y-%m-%d %I-%M-%S %p"
default: "%c" default: "%c"
*g:netrw_winsize* specify initial size of new o/v windows *g:netrw_winsize* specify initial size of new windows made with
"o" (see |netrw-o|), "v" (see |netrw-v|),
|:Hexplore| or |:Vexplore|.
default: "" default: ""
*g:NetrwTopLvlMenu* This variable specifies the top level *g:NetrwTopLvlMenu* This variable specifies the top level
@ -2162,6 +2237,61 @@ which is loaded automatically at startup (assuming :set nocp).
============================================================================== ==============================================================================
12. History *netrw-history* {{{1 12. History *netrw-history* {{{1
v122: Feb 12, 2008 * bugfix - first sorting sequence match now has
priority
Feb 14, 2008 * bugfix - sorting sequence was effectively ignoring
sequencing priority of anything following '*'
* toggling a marked file was showing incorrect list
(list was correct, but displayed matches weren't)
* |g:netrw_special_syntax| implemented
v121: Feb 11, 2008 * Bram M reported that :e file ... :e . would not
retain the alternate file. Fixed -- I hope!
* bugfix -- apparently v120 broke an explicit
:Explore dirname
v120: Jan 21, 2008 * |netrw-mt| changed to allow for target selection
based on whether or not word under cursor is a
directory or file, or if cursor is in banner
area.
* |netrw-mh| included (hiding by marked-file suffix)
* functions moved about a bit (improved
categorization)
* 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).
* |netrw-mu| implemented (unmarking marked files)
* many bugs have been removed from the marked file
system (tnx to Mark S. for feedback)
* |netrw-ms| implemented (sourcing marked files)
* fixed use of P with tree listing style
* multiple tree listing now supported
* ./ suppressed
* changed q -> qb (query bookmarks)
* implemented |netrw-qf|
* Explore now has four special list-generation
modes: */filepat **/filepat
*//pattern **//pattern
* gh (|netrw-gh|) is a shortcut for toggling the
hiding of files and directories beginning with a
dot
v119: Jan 10, 2008 * When g:netrw_keepdir is false,
NetrwOptionsRestore() had a problem
(Bill McCarthy)
Jan 11, 2008 * Netrw now shows symbolic links with a trailing
"@" and special highlighting.
Jan 15, 2008 * Changed g:netrw_noretmap -> |g:netrw_retmap|.
Changed: disabled by default at Bram's
preference.
v118: Jan 02, 2008 * Fixed a problem with Windows;
:Explore c:/path/ would not work,
but :Explore c:/path would.
* Fixed a bug in s:NetrwOptionRestore() - lcd's
argument wasn't being properly escaped so it
wouldn't handle spaces in directory names.
(Gary Johnson)
v117: Jan 02, 2008 * Fixed a problem with P; had to include
a b:netrw_curdir bypass (Bram Moolenaar)
v116: Nov 27, 2007 * netrw#LocalBrowseCheck() has &ft=="netrw" v116: Nov 27, 2007 * netrw#LocalBrowseCheck() has &ft=="netrw"
check to prevent doing a directory listing check to prevent doing a directory listing
(was getting unexpected directory refreshes (was getting unexpected directory refreshes

View File

@ -1,7 +1,20 @@
'go' Align.txt /*'go'*
:Explore pi_netrw.txt /*:Explore* :Explore pi_netrw.txt /*:Explore*
:GLVS pi_getscript.txt /*:GLVS* :GLVS pi_getscript.txt /*:GLVS*
:GetLatestVimScripts_dat pi_getscript.txt /*:GetLatestVimScripts_dat* :GetLatestVimScripts_dat pi_getscript.txt /*:GetLatestVimScripts_dat*
:Hexplore pi_netrw.txt /*:Hexplore* :Hexplore pi_netrw.txt /*:Hexplore*
:I visincr.txt /*:I*
:IA visincr.txt /*:IA*
:ID visincr.txt /*:ID*
:II visincr.txt /*:II*
:IIO visincr.txt /*:IIO*
:IIR visincr.txt /*:IIR*
:IIX visincr.txt /*:IIX*
:IM visincr.txt /*:IM*
:IO visincr.txt /*:IO*
:IPOW visincr.txt /*:IPOW*
:IR visincr.txt /*:IR*
:IX visincr.txt /*:IX*
:LP LogiPat.txt /*:LP* :LP LogiPat.txt /*:LP*
:LPF LogiPat.txt /*:LPF* :LPF LogiPat.txt /*:LPF*
:LogiPat LogiPat.txt /*:LogiPat* :LogiPat LogiPat.txt /*:LogiPat*
@ -10,6 +23,11 @@
:NetrwClean pi_netrw.txt /*:NetrwClean* :NetrwClean pi_netrw.txt /*:NetrwClean*
:Nexplore pi_netrw.txt /*:Nexplore* :Nexplore pi_netrw.txt /*:Nexplore*
:Pexplore pi_netrw.txt /*:Pexplore* :Pexplore pi_netrw.txt /*:Pexplore*
:RI visincr.txt /*:RI*
:RID visincr.txt /*:RID*
:RIDMY visincr.txt /*:RIDMY*
:RIPOW visincr.txt /*:RIPOW*
:RM visincr.txt /*:RM*
:Rexplore pi_netrw.txt /*:Rexplore* :Rexplore pi_netrw.txt /*:Rexplore*
:RmVimball pi_vimball.txt /*:RmVimball* :RmVimball pi_vimball.txt /*:RmVimball*
:Sexplore pi_netrw.txt /*:Sexplore* :Sexplore pi_netrw.txt /*:Sexplore*
@ -22,23 +40,13 @@
:UseVimball pi_vimball.txt /*:UseVimball* :UseVimball pi_vimball.txt /*:UseVimball*
:Vexplore pi_netrw.txt /*:Vexplore* :Vexplore pi_netrw.txt /*:Vexplore*
:VimballList pi_vimball.txt /*:VimballList* :VimballList pi_vimball.txt /*:VimballList*
Align-copyright Align.txt /*Align-copyright*
C-Reference crefvim.txt /*C-Reference* C-Reference crefvim.txt /*C-Reference*
GetLatestVimScripts pi_getscript.txt /*GetLatestVimScripts* GetLatestVimScripts pi_getscript.txt /*GetLatestVimScripts*
GetLatestVimScripts-copyright pi_getscript.txt /*GetLatestVimScripts-copyright* GetLatestVimScripts-copyright pi_getscript.txt /*GetLatestVimScripts-copyright*
GetLatestVimScripts_dat pi_getscript.txt /*GetLatestVimScripts_dat* GetLatestVimScripts_dat pi_getscript.txt /*GetLatestVimScripts_dat*
I visincr.txt /*I*
IA visincr.txt /*IA*
ID visincr.txt /*ID*
IDMY visincr.txt /*IDMY* IDMY visincr.txt /*IDMY*
II visincr.txt /*II*
IIO visincr.txt /*IIO*
IIR visincr.txt /*IIR*
IIX visincr.txt /*IIX*
IM visincr.txt /*IM*
IMDY visincr.txt /*IMDY* IMDY visincr.txt /*IMDY*
IO visincr.txt /*IO*
IR visincr.txt /*IR*
IX visincr.txt /*IX*
IYMD visincr.txt /*IYMD* IYMD visincr.txt /*IYMD*
LogiPat() LogiPat.txt /*LogiPat()* LogiPat() LogiPat.txt /*LogiPat()*
LogiPat-flags LogiPat.txt /*LogiPat-flags* LogiPat-flags LogiPat.txt /*LogiPat-flags*
@ -46,10 +54,93 @@ MatchError matchit.txt /*MatchError*
Nread pi_netrw.txt /*Nread* Nread pi_netrw.txt /*Nread*
Nsource pi_netrw.txt /*Nsource* Nsource pi_netrw.txt /*Nsource*
Nwrite pi_netrw.txt /*Nwrite* Nwrite pi_netrw.txt /*Nwrite*
SR SrchRplcHiGrp.txt /*SR*
SRChooseHiGrp SrchRplcHiGrp.txt /*SRChooseHiGrp*
SRDispHiGrp SrchRplcHiGrp.txt /*SRDispHiGrp*
SRHiGrp SrchRplcHiGrp.txt /*SRHiGrp*
SRSearch SrchRplcHiGrp.txt /*SRSearch*
SrchRplcHiGrp.txt SrchRplcHiGrp.txt /*SrchRplcHiGrp.txt*
TCommentDefineType() tComment.txt /*TCommentDefineType()* TCommentDefineType() tComment.txt /*TCommentDefineType()*
Vimball-copyright pi_vimball.txt /*Vimball-copyright* Vimball-copyright pi_vimball.txt /*Vimball-copyright*
[% matchit.txt /*[%* [% matchit.txt /*[%*
]% matchit.txt /*]%* ]% matchit.txt /*]%*
align Align.txt /*align*
align-align Align.txt /*align-align*
align-codepoint Align.txt /*align-codepoint*
align-command Align.txt /*align-command*
align-commands Align.txt /*align-commands*
align-concept Align.txt /*align-concept*
align-concepts Align.txt /*align-concepts*
align-contents Align.txt /*align-contents*
align-control Align.txt /*align-control*
align-history Align.txt /*align-history*
align-manual Align.txt /*align-manual*
align-maps Align.txt /*align-maps*
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-utf Align.txt /*align-utf*
align-utf8 Align.txt /*align-utf8*
align.txt Align.txt /*align.txt*
alignctrl Align.txt /*alignctrl*
alignctrl- Align.txt /*alignctrl-*
alignctrl-+ Align.txt /*alignctrl-+*
alignctrl-- Align.txt /*alignctrl--*
alignctrl-: Align.txt /*alignctrl-:*
alignctrl-< Align.txt /*alignctrl-<*
alignctrl-= Align.txt /*alignctrl-=*
alignctrl-> Align.txt /*alignctrl->*
alignctrl-C Align.txt /*alignctrl-C*
alignctrl-I Align.txt /*alignctrl-I*
alignctrl-P Align.txt /*alignctrl-P*
alignctrl-W Align.txt /*alignctrl-W*
alignctrl-c Align.txt /*alignctrl-c*
alignctrl-g Align.txt /*alignctrl-g*
alignctrl-l Align.txt /*alignctrl-l*
alignctrl-m Align.txt /*alignctrl-m*
alignctrl-no-option Align.txt /*alignctrl-no-option*
alignctrl-p Align.txt /*alignctrl-p*
alignctrl-r Align.txt /*alignctrl-r*
alignctrl-separators Align.txt /*alignctrl-separators*
alignctrl-settings Align.txt /*alignctrl-settings*
alignctrl-v Align.txt /*alignctrl-v*
alignctrl-w Align.txt /*alignctrl-w*
alignman Align.txt /*alignman*
alignmanual Align.txt /*alignmanual*
alignmap-Htd Align.txt /*alignmap-Htd*
alignmap-T= Align.txt /*alignmap-T=*
alignmap-a, Align.txt /*alignmap-a,*
alignmap-a< Align.txt /*alignmap-a<*
alignmap-a= Align.txt /*alignmap-a=*
alignmap-a? Align.txt /*alignmap-a?*
alignmap-abox Align.txt /*alignmap-abox*
alignmap-acom Align.txt /*alignmap-acom*
alignmap-adcom Align.txt /*alignmap-adcom*
alignmap-adec Align.txt /*alignmap-adec*
alignmap-adef Align.txt /*alignmap-adef*
alignmap-afnc Align.txt /*alignmap-afnc*
alignmap-anum Align.txt /*alignmap-anum*
alignmap-aocom Align.txt /*alignmap-aocom*
alignmap-ascom Align.txt /*alignmap-ascom*
alignmap-history Align.txt /*alignmap-history*
alignmap-m= Align.txt /*alignmap-m=*
alignmap-t# Align.txt /*alignmap-t#*
alignmap-t, Align.txt /*alignmap-t,*
alignmap-t: Align.txt /*alignmap-t:*
alignmap-t; Align.txt /*alignmap-t;*
alignmap-t< Align.txt /*alignmap-t<*
alignmap-t= Align.txt /*alignmap-t=*
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-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:match_col matchit.txt /*b:match_col* b:match_col matchit.txt /*b:match_col*
b:match_debug matchit.txt /*b:match_debug* b:match_debug matchit.txt /*b:match_debug*
b:match_ignorecase matchit.txt /*b:match_ignorecase* b:match_ignorecase matchit.txt /*b:match_ignorecase*
@ -1332,9 +1423,9 @@ g:netrw_maxfilenamelen pi_netrw.txt /*g:netrw_maxfilenamelen*
g:netrw_menu pi_netrw.txt /*g:netrw_menu* g:netrw_menu pi_netrw.txt /*g:netrw_menu*
g:netrw_mkdir_cmd pi_netrw.txt /*g:netrw_mkdir_cmd* g:netrw_mkdir_cmd pi_netrw.txt /*g:netrw_mkdir_cmd*
g:netrw_nogx pi_netrw.txt /*g:netrw_nogx* g:netrw_nogx pi_netrw.txt /*g:netrw_nogx*
g:netrw_noretmap pi_netrw.txt /*g:netrw_noretmap*
g:netrw_preview pi_netrw.txt /*g:netrw_preview* g:netrw_preview pi_netrw.txt /*g:netrw_preview*
g:netrw_rcp_cmd pi_netrw.txt /*g:netrw_rcp_cmd* g:netrw_rcp_cmd pi_netrw.txt /*g:netrw_rcp_cmd*
g:netrw_retmap pi_netrw.txt /*g:netrw_retmap*
g:netrw_rm_cmd pi_netrw.txt /*g:netrw_rm_cmd* g:netrw_rm_cmd pi_netrw.txt /*g:netrw_rm_cmd*
g:netrw_rmdir_cmd pi_netrw.txt /*g:netrw_rmdir_cmd* g:netrw_rmdir_cmd pi_netrw.txt /*g:netrw_rmdir_cmd*
g:netrw_rmf_cmd pi_netrw.txt /*g:netrw_rmf_cmd* g:netrw_rmf_cmd pi_netrw.txt /*g:netrw_rmf_cmd*
@ -1347,6 +1438,7 @@ g:netrw_silent pi_netrw.txt /*g:netrw_silent*
g:netrw_sort_by pi_netrw.txt /*g:netrw_sort_by* g:netrw_sort_by pi_netrw.txt /*g:netrw_sort_by*
g:netrw_sort_direction pi_netrw.txt /*g:netrw_sort_direction* g:netrw_sort_direction pi_netrw.txt /*g:netrw_sort_direction*
g:netrw_sort_sequence pi_netrw.txt /*g:netrw_sort_sequence* g:netrw_sort_sequence pi_netrw.txt /*g:netrw_sort_sequence*
g:netrw_special_syntax pi_netrw.txt /*g:netrw_special_syntax*
g:netrw_ssh_browse_reject pi_netrw.txt /*g:netrw_ssh_browse_reject* g:netrw_ssh_browse_reject pi_netrw.txt /*g:netrw_ssh_browse_reject*
g:netrw_ssh_cmd pi_netrw.txt /*g:netrw_ssh_cmd* g:netrw_ssh_cmd pi_netrw.txt /*g:netrw_ssh_cmd*
g:netrw_sshport pi_netrw.txt /*g:netrw_sshport* g:netrw_sshport pi_netrw.txt /*g:netrw_sshport*
@ -1471,6 +1563,7 @@ netrw-file pi_netrw.txt /*netrw-file*
netrw-fixup pi_netrw.txt /*netrw-fixup* netrw-fixup pi_netrw.txt /*netrw-fixup*
netrw-ftp pi_netrw.txt /*netrw-ftp* netrw-ftp pi_netrw.txt /*netrw-ftp*
netrw-gb pi_netrw.txt /*netrw-gb* netrw-gb pi_netrw.txt /*netrw-gb*
netrw-gh pi_netrw.txt /*netrw-gh*
netrw-gx pi_netrw.txt /*netrw-gx* netrw-gx pi_netrw.txt /*netrw-gx*
netrw-handler pi_netrw.txt /*netrw-handler* netrw-handler pi_netrw.txt /*netrw-handler*
netrw-help pi_netrw.txt /*netrw-help* netrw-help pi_netrw.txt /*netrw-help*
@ -1490,11 +1583,13 @@ netrw-mc pi_netrw.txt /*netrw-mc*
netrw-md pi_netrw.txt /*netrw-md* netrw-md pi_netrw.txt /*netrw-md*
netrw-me pi_netrw.txt /*netrw-me* netrw-me pi_netrw.txt /*netrw-me*
netrw-mf pi_netrw.txt /*netrw-mf* netrw-mf pi_netrw.txt /*netrw-mf*
netrw-mh pi_netrw.txt /*netrw-mh*
netrw-ml_get pi_netrw.txt /*netrw-ml_get* netrw-ml_get pi_netrw.txt /*netrw-ml_get*
netrw-mm pi_netrw.txt /*netrw-mm* netrw-mm pi_netrw.txt /*netrw-mm*
netrw-move pi_netrw.txt /*netrw-move* netrw-move pi_netrw.txt /*netrw-move*
netrw-mp pi_netrw.txt /*netrw-mp* netrw-mp pi_netrw.txt /*netrw-mp*
netrw-mr pi_netrw.txt /*netrw-mr* netrw-mr pi_netrw.txt /*netrw-mr*
netrw-ms pi_netrw.txt /*netrw-ms*
netrw-mt pi_netrw.txt /*netrw-mt* netrw-mt pi_netrw.txt /*netrw-mt*
netrw-mu pi_netrw.txt /*netrw-mu* netrw-mu pi_netrw.txt /*netrw-mu*
netrw-mx pi_netrw.txt /*netrw-mx* netrw-mx pi_netrw.txt /*netrw-mx*
@ -1528,7 +1623,8 @@ netrw-prvwin pi_netrw.txt /*netrw-prvwin*
netrw-pscp pi_netrw.txt /*netrw-pscp* netrw-pscp pi_netrw.txt /*netrw-pscp*
netrw-psftp pi_netrw.txt /*netrw-psftp* netrw-psftp pi_netrw.txt /*netrw-psftp*
netrw-putty pi_netrw.txt /*netrw-putty* netrw-putty pi_netrw.txt /*netrw-putty*
netrw-q pi_netrw.txt /*netrw-q* netrw-qb pi_netrw.txt /*netrw-qb*
netrw-qf pi_netrw.txt /*netrw-qf*
netrw-r pi_netrw.txt /*netrw-r* netrw-r pi_netrw.txt /*netrw-r*
netrw-read pi_netrw.txt /*netrw-read* netrw-read pi_netrw.txt /*netrw-read*
netrw-ref pi_netrw.txt /*netrw-ref* netrw-ref pi_netrw.txt /*netrw-ref*
@ -1542,6 +1638,7 @@ netrw-sort pi_netrw.txt /*netrw-sort*
netrw-sortsequence pi_netrw.txt /*netrw-sortsequence* netrw-sortsequence pi_netrw.txt /*netrw-sortsequence*
netrw-source pi_netrw.txt /*netrw-source* netrw-source pi_netrw.txt /*netrw-source*
netrw-ssh-hack pi_netrw.txt /*netrw-ssh-hack* netrw-ssh-hack pi_netrw.txt /*netrw-ssh-hack*
netrw-star pi_netrw.txt /*netrw-star*
netrw-starpat pi_netrw.txt /*netrw-starpat* netrw-starpat pi_netrw.txt /*netrw-starpat*
netrw-starstar pi_netrw.txt /*netrw-starstar* netrw-starstar pi_netrw.txt /*netrw-starstar*
netrw-starstarpat pi_netrw.txt /*netrw-starstarpat* netrw-starstarpat pi_netrw.txt /*netrw-starstarpat*
@ -1579,6 +1676,10 @@ rsync pi_netrw.txt /*rsync*
s:netrw_passwd pi_netrw.txt /*s:netrw_passwd* s:netrw_passwd pi_netrw.txt /*s:netrw_passwd*
scp pi_netrw.txt /*scp* scp pi_netrw.txt /*scp*
sftp pi_netrw.txt /*sftp* sftp pi_netrw.txt /*sftp*
srchrplchigrp SrchRplcHiGrp.txt /*srchrplchigrp*
srchrplchigrp-commands SrchRplcHiGrp.txt /*srchrplchigrp-commands*
srchrplchigrp-contents SrchRplcHiGrp.txt /*srchrplchigrp-contents*
srchrplchigrp-examples SrchRplcHiGrp.txt /*srchrplchigrp-examples*
tComment-Installation tComment.txt /*tComment-Installation* tComment-Installation tComment.txt /*tComment-Installation*
tComment-Key-Bindings tComment.txt /*tComment-Key-Bindings* tComment-Key-Bindings tComment.txt /*tComment-Key-Bindings*
tComment-Usage tComment.txt /*tComment-Usage* tComment-Usage tComment.txt /*tComment-Usage*
@ -1602,11 +1703,13 @@ visincr-ID visincr.txt /*visincr-ID*
visincr-IDMY visincr.txt /*visincr-IDMY* visincr-IDMY visincr.txt /*visincr-IDMY*
visincr-II visincr.txt /*visincr-II* visincr-II visincr.txt /*visincr-II*
visincr-IIO visincr.txt /*visincr-IIO* visincr-IIO visincr.txt /*visincr-IIO*
visincr-IIPOW visincr.txt /*visincr-IIPOW*
visincr-IIR visincr.txt /*visincr-IIR* visincr-IIR visincr.txt /*visincr-IIR*
visincr-IIX visincr.txt /*visincr-IIX* visincr-IIX visincr.txt /*visincr-IIX*
visincr-IM visincr.txt /*visincr-IM* visincr-IM visincr.txt /*visincr-IM*
visincr-IMDY visincr.txt /*visincr-IMDY* visincr-IMDY visincr.txt /*visincr-IMDY*
visincr-IO visincr.txt /*visincr-IO* visincr-IO visincr.txt /*visincr-IO*
visincr-IPOW visincr.txt /*visincr-IPOW*
visincr-IR visincr.txt /*visincr-IR* visincr-IR visincr.txt /*visincr-IR*
visincr-IX visincr.txt /*visincr-IX* visincr-IX visincr.txt /*visincr-IX*
visincr-IYMD visincr.txt /*visincr-IYMD* visincr-IYMD visincr.txt /*visincr-IYMD*
@ -1614,8 +1717,10 @@ visincr-RI visincr.txt /*visincr-RI*
visincr-RID visincr.txt /*visincr-RID* visincr-RID visincr.txt /*visincr-RID*
visincr-RIDMY visincr.txt /*visincr-RIDMY* visincr-RIDMY visincr.txt /*visincr-RIDMY*
visincr-RII visincr.txt /*visincr-RII* visincr-RII visincr.txt /*visincr-RII*
visincr-RIIPOW visincr.txt /*visincr-RIIPOW*
visincr-RIM visincr.txt /*visincr-RIM* visincr-RIM visincr.txt /*visincr-RIM*
visincr-RIMDY visincr.txt /*visincr-RIMDY* visincr-RIMDY visincr.txt /*visincr-RIMDY*
visincr-RIPOW visincr.txt /*visincr-RIPOW*
visincr-RIYMD visincr.txt /*visincr-RIYMD* visincr-RIYMD visincr.txt /*visincr-RIYMD*
visincr-calutil visincr.txt /*visincr-calutil* visincr-calutil visincr.txt /*visincr-calutil*
visincr-copyright visincr.txt /*visincr-copyright* visincr-copyright visincr.txt /*visincr-copyright*
@ -1628,5 +1733,6 @@ visincr-increment visincr.txt /*visincr-increment*
visincr-leaddate visincr.txt /*visincr-leaddate* visincr-leaddate visincr.txt /*visincr-leaddate*
visincr-options visincr.txt /*visincr-options* visincr-options visincr.txt /*visincr-options*
visincr-raggedright visincr.txt /*visincr-raggedright* visincr-raggedright visincr.txt /*visincr-raggedright*
visincr-restrict visincr.txt /*visincr-restrict*
visincr-usage visincr.txt /*visincr-usage* visincr-usage visincr.txt /*visincr-usage*
visincr.txt visincr.txt /*visincr.txt* visincr.txt visincr.txt /*visincr.txt*

View File

@ -1,8 +1,8 @@
*visincr.txt* The Visual Incrementing Tool Sep 19, 2006 *visincr.txt* The Visual Incrementing Tool Oct 17, 2007
Author: Charles E. Campbell, Jr. <NdrchipO@ScampbellPfamily.AbizM> Author: Charles E. Campbell, Jr. <NdrchipO@ScampbellPfamily.AbizM>
(remove NOSPAM from Campbell's email before using) (remove NOSPAM from Campbell's email before using)
Copyright: (c) 2004-2005 by Charles E. Campbell, Jr. *visincr-copyright* Copyright: (c) 2004-2007 by Charles E. Campbell, Jr. *visincr-copyright*
The VIM LICENSE applies to visincr.vim and visincr.txt The VIM LICENSE applies to visincr.vim and visincr.txt
(see |copyright|) except use "visincr" instead of "Vim" (see |copyright|) except use "visincr" instead of "Vim"
No warranty, express or implied. Use At-Your-Own-Risk. No warranty, express or implied. Use At-Your-Own-Risk.
@ -25,6 +25,8 @@ Copyright: (c) 2004-2005 by Charles E. Campbell, Jr. *visincr-copyright*
:IA [#] ...................: |visincr-IA| :IA [#] ...................: |visincr-IA|
:ID [#] ...................: |visincr-ID| :ID [#] ...................: |visincr-ID|
:IM [#] ...................: |visincr-IM| :IM [#] ...................: |visincr-IM|
:IPOW [#] ...................: |visincr-IPOW|
:IIPOW [#] ..................: |visincr-IIPOW|
4. Examples.....................: |visincr-examples| 4. Examples.....................: |visincr-examples|
:I ..........................: |ex-viscinr-I| :I ..........................: |ex-viscinr-I|
:II .........................: |ex-viscinr-II| :II .........................: |ex-viscinr-II|
@ -112,14 +114,21 @@ Copyright: (c) 2004-2005 by Charles E. Campbell, Jr. *visincr-copyright*
then only three-letter abbreviations will be used. then only three-letter abbreviations will be used.
For more: see |visincr-IM| For more: see |visincr-IM|
*:RI* :*RII* :*RIMDY* *:RIDMY* *:RID* *:RM* *visincr-restrict*
:RI RII RIYMD RIMDY RIDMY RID RM :RI RII RIYMD RIMDY RIDMY RID RM
Restricted variants of the above commands - requires Restricted variants of the above commands - requires
that the visual block on the current line start with that the visual block on the current line start with
an appropriate pattern (ie. a number for :I, a an appropriate pattern (ie. a number for :I, a
dayname for :ID, a monthname for :IM, etc). dayname for :ID, a monthname for :IM, etc).
For more, see |visincr-RI|, |visincr-RII|, |visincr-RIYMD|, For more, see
|visincr-RIMDY|, |visincr-RIDMY|, |visincr-RID|, and
|visincr-M|. Restricted left-justified incrementing......|visincr-RI|
Restricted right-justified incrementing.....|visincr-RII|
Restricted year/month/day incrementing......|visincr-RIYMD|
Restricted month/day/year incrementing......|visincr-RIMDY|
Restricted day/month/year incrementing......|visincr-RIDMY|
Restricted dayname incrementing.............|visincr-RID|
Restricted monthname incrementing...........|visincr-M|
============================================================================== ==============================================================================
@ -129,7 +138,7 @@ Copyright: (c) 2004-2005 by Charles E. Campbell, Jr. *visincr-copyright*
The visincr plugin facilitates making a column of increasing or decreasing The visincr plugin facilitates making a column of increasing or decreasing
numbers, dates, or daynames. numbers, dates, or daynames.
LEFT JUSTIFIED INCREMENTING *I* *viscinr-I* LEFT JUSTIFIED INCREMENTING *:I* *viscinr-I*
:I [#] Will use the first line's number as a starting point to build :I [#] Will use the first line's number as a starting point to build
a column of increasing numbers (or decreasing numbers if the a column of increasing numbers (or decreasing numbers if the
increment is negative). increment is negative).
@ -139,21 +148,21 @@ numbers, dates, or daynames.
The IX variant supports hexadecimal incrementing. The IX variant supports hexadecimal incrementing.
*visincr-RI* *visincr-RI*
The restricted version (:RI) applies number incrementing only The restricted version (:RI) applies number incrementing only
to those lines in the visual block that begin with a number. to those lines in the visual block that begin with a number.
See |visincr-raggedright| for a discussion on ragged-right See |visincr-raggedright| for a discussion on ragged-right
handling. handling.
*IX* *visincr-IX* *IO* *visincr-IO* *:IX* *visincr-IX* *:IO* *visincr-IO*
The following two commands are variants of :I : > The following two commands are variants of :I : >
:IO [#] left justified octal incrementing :IO [#] left justified octal incrementing
:IX [#] left justified hexadecimal incrementing :IX [#] left justified hexadecimal incrementing
< The increments are in octal or hexadecimal for their < The increments are in octal or hexadecimal for their
respective commands. respective commands.
*IR* *visincr-IR* *IIR* *visincr-IIR* *:IR* *visincr-IR* *:IIR* *visincr-IIR*
These commands do left (IR) and right (IIR) justified These commands do left (IR) and right (IIR) justified
Roman numeral enumeration. The increment for these Roman numeral enumeration. The increment for these
commands is in the usual arabic numerals (ie. decimal) commands is in the usual arabic numerals (ie. decimal)
@ -162,7 +171,7 @@ numbers, dates, or daynames.
RIGHT JUSTIFIED INCREMENTING *II* *visincr-II* RIGHT JUSTIFIED INCREMENTING *:II* *visincr-II*
:II [# [zfill]] Will use the first line's number as a starting point :II [# [zfill]] Will use the first line's number as a starting point
to build a column of increasing numbers (or decreasing numbers to build a column of increasing numbers (or decreasing numbers
if the increment is negative). if the increment is negative).
@ -172,14 +181,14 @@ numbers, dates, or daynames.
Zfill : left padding will be done with the given Zfill : left padding will be done with the given
character, typically a zero. character, typically a zero.
*IIX* *visincr-IIX* *IIO* *visincr-IIO* *:IIX* *visincr-IIX* *:IIO* *visincr-IIO*
The following two commands are variants of :II : The following two commands are variants of :II :
:IIO [# [zfill]] right justified octal incrementing :IIO [# [zfill]] right justified octal incrementing
:IIX [# [zfill]] right justified hexadecimal incrementing :IIX [# [zfill]] right justified hexadecimal incrementing
*visincr-RII* *visincr-RII*
The restricted version (:RII) applies number incrementing only to The restricted version (:RII) applies number incrementing only
those lines in the visual block that begin with zero or more to those lines in the visual block that begin with zero or more
spaces and end with a number. spaces and end with a number.
RAGGED RIGHT HANDLING FOR I AND II *visincr-raggedright* RAGGED RIGHT HANDLING FOR I AND II *visincr-raggedright*
@ -227,10 +236,13 @@ numbers, dates, or daynames.
words. words.
*g:visincr_datedivset* *g:visincr_datedivset*
By default, the date dividers are: given by: > By default, the date dividers are: given by: >
let g:visincr_datedivset= '[-./]' let g:visincr_datedivset= '[-./_:~,+*^]\='
< You may change the set in your <.vimrc>. The separator actually < You may change the set in your <.vimrc>. The separator actually
used is the first one found in your date column. used is the first one found in your date column. A date
divider is no longer strictly required (note that \= in the
date divider set). For :IMDY and :IDMY and no date dividers,
the year may be 2 or 4 digits. For :IYMD, the year must be
four digits if there are no date dividers.
SINGLE DIGIT DAYS OR MONTHS *visincr-leaddate* SINGLE DIGIT DAYS OR MONTHS *visincr-leaddate*
@ -253,11 +265,11 @@ numbers, dates, or daynames.
http://mysite.verizon.net/astronaut/vim/index.html#VimFuncs http://mysite.verizon.net/astronaut/vim/index.html#VimFuncs
ALPHABETIC INCREMENTING *IA* *visincr-IA* ALPHABETIC INCREMENTING *:IA* *visincr-IA*
:IA Will produce an increasing/decreasing list of alphabetic :IA Will produce an increasing/decreasing list of alphabetic
characters. characters.
DAYNAME INCREMENTING *ID* *visincr-ID* *visincr-RID* DAYNAME INCREMENTING *:ID* *visincr-ID* *visincr-RID*
:ID [#] Will produce an increasing/decreasing list of daynames. :ID [#] Will produce an increasing/decreasing list of daynames.
Three-letter daynames will be used if the first day on the Three-letter daynames will be used if the first day on the
first line is a three letter dayname; otherwise, full names first line is a three letter dayname; otherwise, full names
@ -267,7 +279,7 @@ numbers, dates, or daynames.
to those lines in the visual block that begin with a dayname to those lines in the visual block that begin with a dayname
(mon tue wed thu fri sat). (mon tue wed thu fri sat).
MONTHNAME INCREMENTING *IM* *visincr-IM* *visincr-RIM* MONTHNAME INCREMENTING *:IM* *visincr-IM* *visincr-RIM*
:IM [#] will produce an increasing/decreasing list of monthnames. :IM [#] will produce an increasing/decreasing list of monthnames.
Monthnames may be three-letter versions (jan feb etc) or Monthnames may be three-letter versions (jan feb etc) or
fully-spelled out monthnames. fully-spelled out monthnames.
@ -276,6 +288,16 @@ numbers, dates, or daynames.
to those lines in the visual block that begin with a to those lines in the visual block that begin with a
monthname (jan feb mar etc). monthname (jan feb mar etc).
POWER INCREMENTING *:IPOW* *visincr-IPOW* *visincr-IIPOW*
*:RIPOW* *visincr-RIPOW* *visincr-RIIPOW*
:IPOW [#] will produce an increasing/decreasing list of powers times
the starting point. The multiplier(divisor)'s default value
is 2.
Restricted versions (:RIPOW and :RIIPOW) applies only
to those lines in the visual block that begin with
a number.
============================================================================== ==============================================================================
4. Examples: *visincr-examples* 4. Examples: *visincr-examples*
@ -414,6 +436,10 @@ numbers, dates, or daynames.
============================================================================== ==============================================================================
6. History: *visincr-history* {{{1 6. History: *visincr-history* {{{1
v18: 02/13/07 : included IPOW and variants
02/15/07 * date dividers are no longer required
10/17/07 * calutil.vim and calutil.txt included, and they
use vim 7's autoload feature
v17: 07/26/06 : -complete=expression added to all visincr v17: 07/26/06 : -complete=expression added to all visincr
commands commands
07/27/06 * g:visincr_datedivset support included 07/27/06 * g:visincr_datedivset support included

View File

@ -0,0 +1,506 @@
" AlignMaps: Alignment maps based upon <Align.vim>
" Maintainer: Dr. Charles E. Campbell, Jr. <Charles.Campbell@gsfc.nasa.gov>
" Date: Mar 06, 2008
" Version: 39
"
" NOTE: the code herein needs vim 6.0 or later
" needs <Align.vim> v6 or later
" needs <cecutil.vim> v5 or later
" Copyright: Copyright (C) 1999-2007 Charles E. Campbell, Jr. {{{1
" Permission is hereby granted to use and distribute this code,
" with or without modifications, provided that this copyright
" notice is copied with it. Like anything else that's free,
" AlignMaps.vim is provided *as is* and comes with no warranty
" of any kind, either expressed or implied. 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.
"
" Usage: {{{1
" Use 'a to mark beginning of to-be-aligned region, Alternative: use v
" move cursor to end of region, and execute map. (visual mode) to mark
" The maps also set up marks 'y and 'z, and retain region, execute same map.
" 'a at the beginning of region. Uses 'a, 'y, and 'z.
"
" Although the comments indicate the maps use a leading backslash,
" actually they use <Leader> (:he mapleader), so the user can
" specify that the maps start how he or she prefers.
"
" Note: these maps all use <Align.vim>.
"
" Romans 1:20 For the invisible things of Him since the creation of the {{{1
" world are clearly seen, being perceived through the things that are
" made, even His everlasting power and divinity; that they may be
" without excuse.
" ---------------------------------------------------------------------
" Load Once: {{{1
if exists("g:loaded_alignmaps") || &cp
finish
endif
let g:loaded_alignmaps = "v39"
let s:keepcpo = &cpo
set cpo&vim
" ---------------------------------------------------------------------
" WS: wrapper start map (internal) {{{1
" Produces a blank line above and below, marks with 'y and 'z
if !hasmapto('<Plug>WrapperStart')
nmap <unique> <SID>WS <Plug>AlignMapsWrapperStart
endif
nmap <silent> <script> <Plug>AlignMapsWrapperStart :set lz<CR>:call AlignWrapperStart()<CR>
" ---------------------------------------------------------------------
" AlignWrapperStart: {{{1
fun! AlignWrapperStart()
" call Dfunc("AlignWrapperStart()")
if line("'y") == 0 || line("'z") == 0 || !exists("s:alignmaps_wrapcnt") || s:alignmaps_wrapcnt <= 0
" call Decho("wrapper initialization")
let s:alignmaps_wrapcnt = 1
let s:alignmaps_keepgd = &gdefault
let s:alignmaps_keepsearch = @/
let s:alignmaps_keepch = &ch
let s:alignmaps_keepmy = SaveMark("'y")
let s:alignmaps_keepmz = SaveMark("'z")
let s:alignmaps_posn = SaveWinPosn(0)
" set up fencepost blank lines
put =''
norm! mz'a
put! =''
ky
let s:alignmaps_zline = line("'z")
exe "'y,'zs/@/\177/ge"
else
" call Decho("embedded wrapper")
let s:alignmaps_wrapcnt = s:alignmaps_wrapcnt + 1
norm! 'yjma'zk
endif
" change some settings to align-standard values
set nogd
set ch=2
AlignPush
norm! 'zk
" call Dret("AlignWrapperStart : alignmaps_wrapcnt=".s:alignmaps_wrapcnt." my=".line("'y")." mz=".line("'z"))
endfun
" ---------------------------------------------------------------------
" WE: wrapper end (internal) {{{1
" Removes guard lines, restores marks y and z, and restores search pattern
if !hasmapto('<Plug>WrapperEnd')
nmap <unique> <SID>WE <Plug>AlignMapsWrapperEnd
endif
nmap <silent> <script> <Plug>AlignMapsWrapperEnd :call AlignWrapperEnd()<CR>:set nolz<CR>
" ---------------------------------------------------------------------
" AlignWrapperEnd: {{{1
fun! AlignWrapperEnd()
" call Dfunc("AlignWrapperEnd() alignmaps_wrapcnt=".s:alignmaps_wrapcnt." my=".line("'y")." mz=".line("'z"))
" remove trailing white space introduced by whatever in the modification zone
'y,'zs/ \+$//e
" restore AlignCtrl settings
AlignPop
let s:alignmaps_wrapcnt= s:alignmaps_wrapcnt - 1
if s:alignmaps_wrapcnt <= 0
" initial wrapper ending
exe "'y,'zs/\177/@/ge"
" if the 'z line hasn't moved, then go ahead and restore window position
let zstationary= s:alignmaps_zline == line("'z")
" remove fencepost blank lines.
" restore 'a
norm! 'yjmakdd'zdd
" restore original 'y, 'z, and window positioning
call RestoreMark(s:alignmaps_keepmy)
call RestoreMark(s:alignmaps_keepmz)
if zstationary > 0
call RestoreWinPosn(s:alignmaps_posn)
" call Decho("restored window positioning")
endif
" restoration of options
let &gd= s:alignmaps_keepgd
let &ch= s:alignmaps_keepch
let @/ = s:alignmaps_keepsearch
" remove script variables
unlet s:alignmaps_keepch
unlet s:alignmaps_keepsearch
unlet s:alignmaps_keepmy
unlet s:alignmaps_keepmz
unlet s:alignmaps_keepgd
unlet s:alignmaps_posn
endif
" call Dret("AlignWrapperEnd : alignmaps_wrapcnt=".s:alignmaps_wrapcnt." my=".line("'y")." mz=".line("'z"))
endfun
" ---------------------------------------------------------------------
" Complex C-code alignment maps: {{{1
map <silent> <Leader>a? <SID>WS:AlignCtrl mIp1P1lC ? : : : : <CR>:'a,.Align<CR>:'a,'z-1s/\(\s\+\)? /?\1/e<CR><SID>WE
map <silent> <Leader>a, <SID>WS:'y,'zs/\(\S\)\s\+/\1 /ge<CR>'yjma'zk<Leader>jnr,<CR>:silent 'y,'zg/,/call <SID>FixMultiDec()<CR>'z<Leader>adec<SID>WE
map <silent> <Leader>a< <SID>WS:AlignCtrl mIp1P1=l << >><CR>:'a,.Align<CR><SID>WE
map <silent> <Leader>a= <SID>WS:AlignCtrl mIp1P1=l<CR>:AlignCtrl g :=<CR>:'a,'zAlign :\==<CR><SID>WE
map <silent> <Leader>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> <Leader>acom <SID>WS:'a,.s/\/[*/]\/\=/@&@/e<CR>:'a,.s/\*\//@&/e<CR>:'y,'zs/^\( *\) @/\1@/e<CR>'zk<Leader>tW@:'y,'zs/^\(\s*\) @/\1/e<CR>:'y,'zs/ @//eg<CR><SID>WE
map <silent> <Leader>adcom <SID>WS:'a,.v/^\s*\/[/*]/s/\/[*/]\*\=/@&@/e<CR>:'a,.v/^\s*\/[/*]/s/\*\//@&/e<CR>:'y,'zv/^\s*\/[/*]/s/^\( *\) @/\1@/e<CR>'zk<Leader>tdW@:'y,'zv/^\s*\/[/*]/s/^\(\s*\) @/\1/e<CR>:'y,'zs/ @//eg<CR><SID>WE
map <silent> <Leader>aocom :AlignPush<CR>:AlignCtrl g /[*/]<CR><Leader>acom:AlignPop<CR>
map <silent> <Leader>ascom <SID>WS:'a,.s/\/[*/]/@&@/e<CR>:'a,.s/\*\//@&/e<CR>:silent! 'a,.g/^\s*@\/[*/]/s/@//ge<CR>:AlignCtrl v ^\s*\/[*/]<CR>:AlignCtrl g \/[*/]<CR>'zk<Leader>tW@:'y,'zs/^\(\s*\) @/\1/e<CR>:'y,'zs/ @//eg<CR><SID>WE
map <silent> <Leader>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><Leader>t@:'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> <Leader>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<Leader>t@'yjma'zk:'a,.v/^\s*\(\/\*\<bar>\/\/\)/s/ @//g<CR><SID>WE
map <silent> <Leader>afnc :set lz<CR>:silent call <SID>Afnc()<CR>:set nolz<CR>
if exists("g:alignmaps_usanumber")
" map <silent> <Leader>anum <SID>WS
" \:'a,'zs/\([-+]\)\=\(\d\+\%([eE][-+]\=\d\+\)\=\)\ze\%($\|[^@]\)/@\1@\2@@#/ge<CR>
" \:'a,'zs/\([-+]\)\=\(\d*\)\(\.\)\(\d*\([eE][-+]\=\d\+\)\=\)/@\1@\2@\3@\4#/ge<CR>
" \:AlignCtrl mp0P0r<CR>
" \:'a,'zAlign [@#]<CR>
" \:'a,'zs/@//ge<CR>
" \:'a,'zs/#/ /ge<CR>
" \<SID>WE
map <silent> <Leader>anum <SID>WS:'a,'zs/\([0-9.]\)\s\+\zs\([-+]\=\d\)/@\1/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
elseif exists("g:alignmaps_euronumber")
map <silent> <Leader>anum <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
else
map <silent> <Leader>anum <SID>WS:'a,'zs/\([0-9.]\)\s\+\([-+]\=[.,]\=\d\)/\1@\2/ge<CR>:'a,'zs/\.@/\.0@/ge<CR>:AlignCtrl mp0P0<CR>:'a,'zAlign [.,@]<CR>:'a,'zs/\([-0-9.,]*\)\(\s*\)\([.,]\)/\2\1\3/g<CR>:'a,'zs/@/ /ge<CR>:'a,'zs/\([eE]\)\(\s\+\)\([0-9+\-+]\+\)/\1\3\2/ge<CR><SID>WE
endif
map <silent> <Leader>aunum <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> <Leader>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
" ---------------------------------------------------------------------
" html table alignment {{{1
map <silent> <Leader>Htd <SID>WS:'y,'zs%<[tT][rR]><[tT][dD][^>]\{-}>\<Bar></[tT][dD]><[tT][dD][^>]\{-}>\<Bar></[tT][dD]></[tT][rR]>%@&@%g<CR>'yjma'zk:AlignCtrl m=Ilp1P0 @<CR>:'a,.Align<CR>:'y,'zs/ @/@/<CR>:'y,'zs/@ <[tT][rR]>/<[tT][rR]>/ge<CR>:'y,'zs/@//ge<CR><SID>WE
" ---------------------------------------------------------------------
" character-based right-justified alignment maps {{{1
map <silent> <Leader>T| <SID>WS:AlignCtrl mIp0P0=r <Bar><CR>:'a,.Align<CR><SID>WE
map <silent> <Leader>T# <SID>WS:AlignCtrl mIp0P0=r #<CR>:'a,.Align<CR><SID>WE
map <silent> <Leader>T, <SID>WS:AlignCtrl mIp0P1=r ,<CR>:'a,.Align<CR><SID>WE
map <silent> <Leader>Ts, <SID>WS:AlignCtrl mIp0P1=r ,<CR>:'a,.Align<CR>:'a,.s/\(\s*\),/,\1/ge<CR><SID>WE
map <silent> <Leader>T: <SID>WS:AlignCtrl mIp1P1=r :<CR>:'a,.Align<CR><SID>WE
map <silent> <Leader>T; <SID>WS:AlignCtrl mIp0P0=r ;<CR>:'a,.Align<CR><SID>WE
map <silent> <Leader>T< <SID>WS:AlignCtrl mIp0P0=r <<CR>:'a,.Align<CR><SID>WE
map <silent> <Leader>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<Leader>acom
map <silent> <Leader>T? <SID>WS:AlignCtrl mIp0P0=r ?<CR>:'a,.Align<CR>:'y,'zs/ \( *\);/;\1/ge<CR><SID>WE
map <silent> <Leader>T@ <SID>WS:AlignCtrl mIp0P0=r @<CR>:'a,.Align<CR><SID>WE
map <silent> <Leader>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
map <silent> <Leader>Tsp <SID>WS:'a,.s/^\(\s*\)\(.*\)/\=submatch(1).escape(substitute(submatch(2),'\s\+','@','g'),'\')/<CR>:AlignCtrl mI=r @<CR>:'a,.Align<CR>:'y+1,'z-1s/@/ /g<CR><SID>WE
map <silent> <Leader>T~ <SID>WS:AlignCtrl mIp0P0=r ~<CR>:'a,.Align<CR>:'y,'zs/ \( *\);/;\1/ge<CR><SID>WE
" ---------------------------------------------------------------------
" character-based left-justified alignment maps {{{1
map <silent> <Leader>t| <SID>WS:AlignCtrl mIp0P0=l <Bar><CR>:'a,.Align<CR><SID>WE
map <silent> <Leader>t# <SID>WS:AlignCtrl mIp0P0=l #<CR>:'a,.Align<CR><SID>WE
map <silent> <Leader>t, <SID>WS:AlignCtrl mIp0P1=l ,<CR>:'a,.Align<CR><SID>WE
map <silent> <Leader>ts, <SID>WS:AlignCtrl mIp0P1=l ,<CR>:'a,.Align<CR>:'a,.s/\(\s*\),/,\1/ge<CR><SID>WE
map <silent> <Leader>t: <SID>WS:AlignCtrl mIp1P1=l :<CR>:'a,.Align<CR><SID>WE
map <silent> <Leader>t; <SID>WS:AlignCtrl mIp0P1=l ;<CR>:'a,.Align<CR>:'y,'zs/\( *\);/;\1/ge<CR><SID>WE
map <silent> <Leader>t< <SID>WS:AlignCtrl mIp0P0=l <<CR>:'a,.Align<CR><SID>WE
map <silent> <Leader>t= <SID>WS:call <SID>Equals()<CR><SID>WE
map <silent> <Leader>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<Leader>t@:'y,'zs/^\(\s*\) @/\1/e<CR>:'a,'z-1g/=/s/\xff/=/ge<CR>:'y,'zg/=/s/ @//eg<CR><SID>WE
map <silent> <Leader>t? <SID>WS:AlignCtrl mIp0P0=l ?<CR>:'a,.Align<CR>:.,'zs/ \( *\);/;\1/ge<CR><SID>WE
map <silent> <Leader>t~ <SID>WS:AlignCtrl mIp0P0=l ~<CR>:'a,.Align<CR>:'y,'zs/ \( *\);/;\1/ge<CR><SID>WE
map <silent> <Leader>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<Leader>t@:'y,'zs/^\(\s*\) @/\1/e<CR>:'a,'z-1s/\xff/=/ge<CR>:'y,'zs/ @//eg<CR><SID>WE
map <silent> <Leader>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> <Leader>tml <SID>WS:AlignCtrl mWp1P0=l \\\@<!\\\s*$<CR>:'a,.Align<CR><SID>WE
map <silent> <Leader>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> <Leader>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
map <silent> <Leader>tt <SID>WS:AlignCtrl mIp1P1=l \\\@<!& \\\\<CR>:'a,.Align<CR><SID>WE
" ---------------------------------------------------------------------
" plain Align maps; these two are used in <Leader>acom..\afnc {{{1
map <silent> <Leader>t@ :AlignCtrl mIp1P1=l @<CR>:'a,.Align<CR>
map <silent> <Leader>tW@ :AlignCtrl mWp1P1=l @<CR>:'a,.Align<CR>
map <silent> <Leader>tdW@ :AlignCtrl v ^\s*/[/*]<CR>:AlignCtrl mWp1P1=l @<CR>:'a,.Align<CR>
" ---------------------------------------------------------------------
" Joiner : maps used above {{{1
map <silent> <Leader>jnr= :call <SID>CharJoiner("=")<CR>
map <silent> <Leader>jnr, :call <SID>CharJoiner(",")<CR>
" ---------------------------------------------------------------------
" visual-line mode variants: {{{1
vmap <silent> <Leader>T| :<BS><BS><BS><CR>ma'><Leader>T|
vmap <silent> <Leader>T, :<BS><BS><BS><CR>ma'><Leader>T,
vmap <silent> <Leader>Ts, :<BS><BS><BS><CR>ma'><Leader>Ts,
vmap <silent> <Leader>T: :<BS><BS><BS><CR>ma'><Leader>T:
vmap <silent> <Leader>T< :<BS><BS><BS><CR>ma'><Leader>T<
vmap <silent> <Leader>T= :<BS><BS><BS><CR>ma'><Leader>T=
vmap <silent> <Leader>T@ :<BS><BS><BS><CR>ma'><Leader>T@
vmap <silent> <Leader>Tsp :<BS><BS><BS><CR>ma'><Leader>Tsp
vmap <silent> <Leader>a? :<BS><BS><BS><CR>ma'><Leader>a?
vmap <silent> <Leader>a, :<BS><BS><BS><CR>ma'><Leader>a,
vmap <silent> <Leader>a< :<BS><BS><BS><CR>ma'><Leader>a<
vmap <silent> <Leader>a= :<BS><BS><BS><CR>ma'><Leader>a=
vmap <silent> <Leader>abox :<BS><BS><BS><CR>ma'><Leader>abox
vmap <silent> <Leader>acom :<BS><BS><BS><CR>ma'><Leader>acom
vmap <silent> <Leader>aocom :<BS><BS><BS><CR>ma'><Leader>aocom
vmap <silent> <Leader>ascom :<BS><BS><BS><CR>ma'><Leader>ascom
vmap <silent> <Leader>adec :<BS><BS><BS><CR>ma'><Leader>adec
vmap <silent> <Leader>adef :<BS><BS><BS><CR>ma'><Leader>adef
vmap <silent> <Leader>afnc :<BS><BS><BS><CR>ma'><Leader>afnc
vmap <silent> <Leader>anum :<BS><BS><BS><CR>ma'><Leader>anum
"vmap <silent> <Leader>anum :B s/\(\d\)\s\+\(-\=[.,]\=\d\)/\1@\2/ge<CR>:AlignCtrl mp0P0<CR>gv:Align [.,@]<CR>:'<,'>s/\([-0-9.,]*\)\(\s\+\)\([.,]\)/\2\1\3/ge<CR>:'<,'>s/@/ /ge<CR>
vmap <silent> <Leader>t| :<BS><BS><BS><CR>ma'><Leader>t|
vmap <silent> <Leader>t, :<BS><BS><BS><CR>ma'><Leader>t,
vmap <silent> <Leader>ts, :<BS><BS><BS><CR>ma'><Leader>ts,
vmap <silent> <Leader>t: :<BS><BS><BS><CR>ma'><Leader>t:
vmap <silent> <Leader>t; :<BS><BS><BS><CR>ma'><Leader>t;
vmap <silent> <Leader>t< :<BS><BS><BS><CR>ma'><Leader>t<
vmap <silent> <Leader>t= :<BS><BS><BS><CR>ma'><Leader>t=
vmap <silent> <Leader>t? :<BS><BS><BS><CR>ma'><Leader>t?
vmap <silent> <Leader>t@ :<BS><BS><BS><CR>ma'><Leader>t@
vmap <silent> <Leader>tab :<BS><BS><BS><CR>ma'><Leader>tab
vmap <silent> <Leader>tml :<BS><BS><BS><CR>ma'><Leader>tml
vmap <silent> <Leader>tsp :<BS><BS><BS><CR>ma'><Leader>tsp
vmap <silent> <Leader>tsq :<BS><BS><BS><CR>ma'><Leader>tsq
vmap <silent> <Leader>tp@ :<BS><BS><BS><CR>ma'><Leader>tp@
vmap <silent> <Leader>tt :<BS><BS><BS><CR>ma'><Leader>tt
vmap <silent> <Leader>Htd :<BS><BS><BS><CR>ma'><Leader>Htd
" ---------------------------------------------------------------------
" Menu Support: {{{1
" ma ..move.. use menu
" v V or ctrl-v ..move.. use menu
if has("menu") && has("gui_running") && &go =~ 'm' && !exists("s:firstmenu")
let s:firstmenu= 1
if !exists("g:DrChipTopLvlMenu")
let g:DrChipTopLvlMenu= "DrChip."
endif
if g:DrChipTopLvlMenu != ""
exe 'menu '.g:DrChipTopLvlMenu.'AlignMaps.<<\ and\ >> <Leader>a<'
exe 'menu '.g:DrChipTopLvlMenu.'AlignMaps.Assignment\ = <Leader>t='
exe 'menu '.g:DrChipTopLvlMenu.'AlignMaps.Assignment\ := <Leader>a='
exe 'menu '.g:DrChipTopLvlMenu.'AlignMaps.Backslashes <Leader>tml'
exe 'menu '.g:DrChipTopLvlMenu.'AlignMaps.Breakup\ Comma\ Declarations <Leader>a,'
exe 'menu '.g:DrChipTopLvlMenu.'AlignMaps.C\ Comment\ Box <Leader>abox'
exe 'menu '.g:DrChipTopLvlMenu.'AlignMaps.Commas <Leader>t,'
exe 'menu '.g:DrChipTopLvlMenu.'AlignMaps.Commas <Leader>ts,'
exe 'menu '.g:DrChipTopLvlMenu.'AlignMaps.Commas\ With\ Strings <Leader>tsq'
exe 'menu '.g:DrChipTopLvlMenu.'AlignMaps.Comments <Leader>acom'
exe 'menu '.g:DrChipTopLvlMenu.'AlignMaps.Comments\ Only <Leader>aocom'
exe 'menu '.g:DrChipTopLvlMenu.'AlignMaps.Declaration\ Comments <Leader>adcom'
exe 'menu '.g:DrChipTopLvlMenu.'AlignMaps.Declarations <Leader>adec'
exe 'menu '.g:DrChipTopLvlMenu.'AlignMaps.Definitions <Leader>adef'
exe 'menu '.g:DrChipTopLvlMenu.'AlignMaps.Function\ Header <Leader>afnc'
exe 'menu '.g:DrChipTopLvlMenu.'AlignMaps.Html\ Tables <Leader>Htd'
exe 'menu '.g:DrChipTopLvlMenu.'AlignMaps.(\.\.\.)?\.\.\.\ :\ \.\.\. <Leader>a?'
exe 'menu '.g:DrChipTopLvlMenu.'AlignMaps.Numbers <Leader>anum'
exe 'menu '.g:DrChipTopLvlMenu.'AlignMaps.Numbers\ (American-Style) <Leader>aunum <Leader>aunum'
exe 'menu '.g:DrChipTopLvlMenu.'AlignMaps.Numbers\ (Euro-Style) <Leader>aenum'
exe 'menu '.g:DrChipTopLvlMenu.'AlignMaps.Spaces\ (Left\ Justified) <Leader>tsp'
exe 'menu '.g:DrChipTopLvlMenu.'AlignMaps.Spaces\ (Right\ Justified) <Leader>Tsp'
exe 'menu '.g:DrChipTopLvlMenu.'AlignMaps.Statements\ With\ Percent\ Style\ Comments <Leader>m='
exe 'menu '.g:DrChipTopLvlMenu.'AlignMaps.Symbol\ < <Leader>t<'
exe 'menu '.g:DrChipTopLvlMenu.'AlignMaps.Symbol\ \| <Leader>t|'
exe 'menu '.g:DrChipTopLvlMenu.'AlignMaps.Symbol\ @ <Leader>t@'
exe 'menu '.g:DrChipTopLvlMenu.'AlignMaps.Symbol\ # <Leader>t#'
exe 'menu '.g:DrChipTopLvlMenu.'AlignMaps.Tabs <Leader>tab'
endif
endif
" ---------------------------------------------------------------------
" CharJoiner: joins lines which end in the given character (spaces {{{1
" at end are ignored)
fun! <SID>CharJoiner(chr)
" call Dfunc("CharJoiner(chr=".a:chr.")")
let aline = line("'a")
let rep = line(".") - aline
while rep > 0
norm! 'a
while match(getline(aline),a:chr . "\s*$") != -1 && rep >= 0
" while = at end-of-line, delete it and join with next
norm! 'a$
j!
let rep = rep - 1
endwhile
" update rep(eat) count
let rep = rep - 1
if rep <= 0
" terminate loop if at end-of-block
break
endif
" prepare for next line
norm! jma
let aline = line("'a")
endwhile
" call Dret("CharJoiner")
endfun
" ---------------------------------------------------------------------
" s:Equals: {{{2
fun! s:Equals()
" call Dfunc("s:Equals()")
'a,'zs/\s\+\([*/+\-%|&\~^]\==\)/ \1/e
'a,'zs@ \+\([*/+\-%|&\~^]\)=@\1=@ge
'a,'zs/==/\="\<Char-0xff>\<Char-0xff>"/ge
'a,'zs/!=/\="!\<Char-0xff>"/ge
norm g'zk
AlignCtrl mIp1P1=l =
AlignCtrl g =
'a,'z-1Align
'a,'z-1s@\([*/+\-%|&\~^!=]\)\( \+\)=@\2\1=@ge
'a,'z-1s/\( \+\);/;\1/ge
if &ft == "c" || &ft == "cpp"
'a,'z-1v/^\s*\/[*/]/s/\/[*/]/@&@/e
'a,'z-1v/^\s*\/[*/]/s/\*\//@&/e
exe norm "'zk<Leader>t@"
'y,'zs/^\(\s*\) @/\1/e
endif
'a,'z-1s/<Char-0xff>/=/ge
'y,'zs/ @//eg
" call Dret("s:Equals")
endfun
" ---------------------------------------------------------------------
" Afnc: useful for splitting one-line function beginnings {{{1
" into one line per argument format
fun! s:Afnc()
" call Dfunc("Afnc()")
" keep display quiet
let chkeep = &ch
let gdkeep = &gd
let vekeep = &ve
set ch=2 nogd ve=
" will use marks y,z ; save current values
let mykeep = SaveMark("'y")
let mzkeep = SaveMark("'z")
" Find beginning of function -- be careful to skip over comments
let cmmntid = synIDtrans(hlID("Comment"))
let stringid = synIDtrans(hlID("String"))
exe "norm! ]]"
while search(")","bW") != 0
" call Decho("line=".line(".")." col=".col("."))
let parenid= synIDtrans(synID(line("."),col("."),1))
if parenid != cmmntid && parenid != stringid
break
endif
endwhile
norm! %my
s/(\s*\(\S\)/(\r \1/e
exe "norm! `y%"
s/)\s*\(\/[*/]\)/)\r\1/e
exe "norm! `y%mz"
'y,'zs/\s\+$//e
'y,'zs/^\s\+//e
'y+1,'zs/^/ /
" insert newline after every comma only one parenthesis deep
sil! exe "norm! `y\<right>h"
let parens = 1
let cmmnt = 0
let cmmntline= -1
while parens >= 1
" call Decho("parens=".parens." @a=".@a)
exe 'norm! ma "ay`a '
if @a == "("
let parens= parens + 1
elseif @a == ")"
let parens= parens - 1
" comment bypass: /* ... */ or //...
elseif cmmnt == 0 && @a == '/'
let cmmnt= 1
elseif cmmnt == 1
if @a == '/'
let cmmnt = 2 " //...
let cmmntline= line(".")
elseif @a == '*'
let cmmnt= 3 " /*...
else
let cmmnt= 0
endif
elseif cmmnt == 2 && line(".") != cmmntline
let cmmnt = 0
let cmmntline= -1
elseif cmmnt == 3 && @a == '*'
let cmmnt= 4
elseif cmmnt == 4
if @a == '/'
let cmmnt= 0 " ...*/
elseif @a != '*'
let cmmnt= 3
endif
elseif @a == "," && parens == 1 && cmmnt == 0
exe "norm! i\<CR>\<Esc>"
endif
endwhile
norm! `y%mz%
sil! 'y,'zg/^\s*$/d
" perform substitutes to mark fields for Align
sil! 'y+1,'zv/^\//s/^\s\+\(\S\)/ \1/e
sil! 'y+1,'zv/^\//s/\(\S\)\s\+/\1 /eg
sil! 'y+1,'zv/^\//s/\* \+/*/ge
" func
" ws <- declaration -> <-ptr -> <-var-> <-[array][] -> <-glop-> <-end->
sil! 'y+1,'zv/^\//s/^\s*\(\(\K\k*\s*\)\+\)\s\+\([(*]*\)\s*\(\K\k*\)\s*\(\(\[.\{-}]\)*\)\s*\(.\{-}\)\=\s*\([,)]\)\s*$/ \1@#\3@\4\5@\7\8/e
sil! 'y+1,'z+1g/^\s*\/[*/]/norm! kJ
sil! 'y+1,'z+1s%/[*/]%@&@%ge
sil! 'y+1,'z+1s%*/%@&%ge
AlignCtrl mIp0P0=l @
sil! 'y+1,'zAlign
sil! 'y,'zs%@\(/[*/]\)@%\t\1 %e
sil! 'y,'zs%@\*/% */%e
sil! 'y,'zs/@\([,)]\)/\1/
sil! 'y,'zs/@/ /
AlignCtrl mIlrp0P0= # @
sil! 'y+1,'zAlign
sil! 'y+1,'zs/#/ /
sil! 'y+1,'zs/@//
sil! 'y+1,'zs/\(\s\+\)\([,)]\)/\2\1/e
" Restore
call RestoreMark(mykeep)
call RestoreMark(mzkeep)
let &ch= chkeep
let &gd= gdkeep
let &ve= vekeep
" call Dret("Afnc")
endfun
" ---------------------------------------------------------------------
" FixMultiDec: converts a type arg,arg,arg; line to multiple lines {{{1
fun! s:FixMultiDec()
" call Dfunc("FixMultiDec()")
" save register x
let xkeep = @x
let curline = getline(".")
" call Decho("curline<".curline.">")
" Get the type. I'm assuming one type per line (ie. int x; double y; on one line will not be handled properly)
let @x=substitute(curline,'^\(\s*[a-zA-Z_ \t][a-zA-Z0-9_ \t]*\)\s\+[(*]*\h.*$','\1','')
" call Decho("@x<".@x.">")
" transform line
exe 's/,/;\r'.@x.' /ge'
"restore register x
let @x= xkeep
" call Dret("FixMultiDec : my=".line("'y")." mz=".line("'z"))
endfun
let &cpo= s:keepcpo
unlet s:keepcpo
" ------------------------------------------------------------------------------
" vim: ts=4 nowrap fdm=marker

View File

@ -0,0 +1,41 @@
" AlignPlugin: tool to align multiple fields based on one or more separators
" Author: Charles E. Campbell, Jr.
" Date: Nov 15, 2007
" GetLatestVimScripts: 294 1 :AutoInstall: Align.vim
" GetLatestVimScripts: 1066 1 :AutoInstall: cecutil.vim
" Copyright: Copyright (C) 1999-2007 Charles E. Campbell, Jr. {{{1
" Permission is hereby granted to use and distribute this code,
" with or without modifications, provided that this copyright
" notice is copied with it. Like anything else that's free,
" Align.vim is provided *as is* and comes with no warranty
" of any kind, either expressed or implied. 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.
"
" Romans 1:16,17a : For I am not ashamed of the gospel of Christ, for it is {{{1
" the power of God for salvation for everyone who believes; for the Jew first,
" and also for the Greek. For in it is revealed God's righteousness from
" faith to faith.
" ---------------------------------------------------------------------
" Load Once: {{{1
if &cp || exists("g:loaded_alignPlugin")
finish
endif
let g:loaded_alignPlugin = 1
let s:keepcpo = &cpo
set cpo&vim
" ---------------------------------------------------------------------
" Public Interface: {{{1
com! -bang -range -nargs=* Align <line1>,<line2>call Align#Align(<bang>0,<q-args>)
com! -range -nargs=0 AlignReplaceQuotedSpaces <line1>,<line2>call Align#AlignReplaceQuotedSpaces()
com! -nargs=* AlignCtrl call Align#AlignCtrl(<q-args>)
com! -nargs=0 AlignPush call Align#AlignPush()
com! -nargs=0 AlignPop call Align#AlignPop()
" ---------------------------------------------------------------------
" Restore: {{{1
let &cpo= s:keepcpo
unlet s:keepcpo
" vim: ts=4 fdm=marker

View File

@ -185,20 +185,23 @@ let s:licenseTag = s:licenseTag . "along with this program; if not, write to the
let s:licenseTag = s:licenseTag . "Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\<enter>" let s:licenseTag = s:licenseTag . "Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\<enter>"
" Common standard constants " Common standard constants
if !exists("g:DoxygenToolkit_commandTag")
let g:DoxygenToolkit_commandTag = "@"
endif
if !exists("g:DoxygenToolkit_briefTag_pre") if !exists("g:DoxygenToolkit_briefTag_pre")
let g:DoxygenToolkit_briefTag_pre = "@brief " let g:DoxygenToolkit_briefTag_pre = g:DoxygenToolkit_commandTag . "brief "
endif endif
if !exists("g:DoxygenToolkit_briefTag_post") if !exists("g:DoxygenToolkit_briefTag_post")
let g:DoxygenToolkit_briefTag_post = "" let g:DoxygenToolkit_briefTag_post = ""
endif endif
if !exists("g:DoxygenToolkit_paramTag_pre") if !exists("g:DoxygenToolkit_paramTag_pre")
let g:DoxygenToolkit_paramTag_pre = "@param " let g:DoxygenToolkit_paramTag_pre = g:DoxygenToolkit_commandTag . "param "
endif endif
if !exists("g:DoxygenToolkit_paramTag_post") if !exists("g:DoxygenToolkit_paramTag_post")
let g:DoxygenToolkit_paramTag_post = " " let g:DoxygenToolkit_paramTag_post = " "
endif endif
if !exists("g:DoxygenToolkit_returnTag") if !exists("g:DoxygenToolkit_returnTag")
let g:DoxygenToolkit_returnTag = "@return " let g:DoxygenToolkit_returnTag = g:DoxygenToolkit_commandTag . "return "
endif endif
if !exists("g:DoxygenToolkit_blockHeader") if !exists("g:DoxygenToolkit_blockHeader")
let g:DoxygenToolkit_blockHeader = "" let g:DoxygenToolkit_blockHeader = ""
@ -210,22 +213,25 @@ if !exists("g:DoxygenToolkit_licenseTag")
let g:DoxygenToolkit_licenseTag = s:licenseTag let g:DoxygenToolkit_licenseTag = s:licenseTag
endif endif
if !exists("g:DoxygenToolkit_fileTag") if !exists("g:DoxygenToolkit_fileTag")
let g:DoxygenToolkit_fileTag = "@file " let g:DoxygenToolkit_fileTag = g:DoxygenToolkit_commandTag . "file "
endif endif
if !exists("g:DoxygenToolkit_authorTag") if !exists("g:DoxygenToolkit_authorTag")
let g:DoxygenToolkit_authorTag = "@author " let g:DoxygenToolkit_authorTag = g:DoxygenToolkit_commandTag . "author "
endif endif
if !exists("g:DoxygenToolkit_dateTag") if !exists("g:DoxygenToolkit_dateTag")
let g:DoxygenToolkit_dateTag = "@date " let g:DoxygenToolkit_dateTag = g:DoxygenToolkit_commandTag . "date "
endif
if !exists("g:DoxygenToolkit_dateFormat")
let g:DoxygenToolkit_dateFormat = "%Y-%m-%d "
endif endif
if !exists("g:DoxygenToolkit_undocTag") if !exists("g:DoxygenToolkit_undocTag")
let g:DoxygenToolkit_undocTag = "DOX_SKIP_BLOCK" let g:DoxygenToolkit_undocTag = "DOX_SKIP_BLOCK"
endif endif
if !exists("g:DoxygenToolkit_blockTag") if !exists("g:DoxygenToolkit_blockTag")
let g:DoxygenToolkit_blockTag = "@name " let g:DoxygenToolkit_blockTag = g:DoxygenToolkit_commandTag . "name "
endif endif
if !exists("g:DoxygenToolkit_classTag") if !exists("g:DoxygenToolkit_classTag")
let g:DoxygenToolkit_classTag = "@class " let g:DoxygenToolkit_classTag = g:DoxygenToolkit_commandTag . "class "
endif endif
if !exists("g:DoxygenToolkit_cinoptions") if !exists("g:DoxygenToolkit_cinoptions")
@ -254,6 +260,18 @@ else
let g:DoxygenToolkit_commentType = "C" let g:DoxygenToolkit_commentType = "C"
endif endif
if !exists("g:DoxygenToolkit_descriptionTag ")
let g:DoxygenToolkit_descriptionTag = "Description"
endif
if !exists("g:DoxygenToolkit_attentionTag ")
let g:DoxygenToolkit_attentionTag = g:DoxygenToolkit_commandTag . "attention "
endif
if !exists("g:DoxygenToolkit_saTag ")
let g:DoxygenToolkit_saTag = g:DoxygenToolkit_commandTag . "sa "
endif
if !exists("g:DoxygenToolkit_ignoreForReturn") if !exists("g:DoxygenToolkit_ignoreForReturn")
let g:DoxygenToolkit_ignoreForReturn = "inline static virtual void" let g:DoxygenToolkit_ignoreForReturn = "inline static virtual void"
else else
@ -270,6 +288,31 @@ if !exists("g:DoxygenToolkit_briefTag_funcName")
let g:DoxygenToolkit_briefTag_funcName = "no" let g:DoxygenToolkit_briefTag_funcName = "no"
endif endif
" Add name of function after pre brief tag if you want
"if !exists("g:DoxygenToolkit_briefTag_funcName")
" let g:DoxygenToolkit_briefTag_funcName = "no"
"endif
" Add description to DoxAuthor if you want
if !exists("g:DoxygenToolkit_author_description")
let g:DoxygenToolkit_author_description = "no"
endif
" Add description to Dox if you want
if !exists("g:DoxygenToolkit_dox_description")
let g:DoxygenToolkit_dox_description = "no"
endif
" Add attention to Dox if you want
if !exists("g:DoxygenToolkit_dox_attention")
let g:DoxygenToolkit_dox_attention = "no"
endif
" Add sa to Dox if you want
if !exists("g:DoxygenToolkit_dox_sa")
let g:DoxygenToolkit_dox_sa = "yes"
endif
"""""""""""""""""""""""""" """"""""""""""""""""""""""
" Doxygen comment function " Doxygen comment function
@ -349,6 +392,7 @@ function! <SID>DoxygenCommentFunc()
endif endif
endif endif
mark d mark d
if ( g:DoxygenToolkit_endCommentTag != "" ) if ( g:DoxygenToolkit_endCommentTag != "" )
exec "normal o" . g:DoxygenToolkit_endCommentTag exec "normal o" . g:DoxygenToolkit_endCommentTag
endif endif
@ -406,6 +450,13 @@ function! <SID>DoxygenCommentFunc()
" Now can add brief post tag " Now can add brief post tag
exec "normal A" . g:DoxygenToolkit_briefTag_post exec "normal A" . g:DoxygenToolkit_briefTag_post
" Add description
if g:DoxygenToolkit_dox_description == "yes"
exec "normal o" . g:DoxygenToolkit_interCommentTag
exec "normal o" . g:DoxygenToolkit_interCommentTag . g:DoxygenToolkit_descriptionTag
endif
mark e
" Add return tag if function do not return void " Add return tag if function do not return void
let l:beginArgPos = match(l:lineBuffer, l:argBegin) let l:beginArgPos = match(l:lineBuffer, l:argBegin)
let l:beginP = 0 " Name can start at the beginning of l:lineBuffer, it is usually between whitespaces or space and parenthesis let l:beginP = 0 " Name can start at the beginning of l:lineBuffer, it is usually between whitespaces or space and parenthesis
@ -437,8 +488,19 @@ function! <SID>DoxygenCommentFunc()
exec "normal o" . g:DoxygenToolkit_interCommentTag . g:DoxygenToolkit_returnTag exec "normal o" . g:DoxygenToolkit_interCommentTag . g:DoxygenToolkit_returnTag
endif endif
" Add attention
if g:DoxygenToolkit_dox_attention == "yes"
exec "normal o" . g:DoxygenToolkit_interCommentTag
exec "normal o" . g:DoxygenToolkit_interCommentTag . g:DoxygenToolkit_attentionTag
endif
" Add sa
if g:DoxygenToolkit_dox_sa == "yes"
exec "normal o" . g:DoxygenToolkit_interCommentTag . g:DoxygenToolkit_saTag
endif
" Looking for argument name in line buffer " Looking for argument name in line buffer
exec "normal `d" exec "normal `e"
let l:argList = 0 " ==0 -> no argument, !=0 -> at least one arg let l:argList = 0 " ==0 -> no argument, !=0 -> at least one arg
let l:beginP = 0 let l:beginP = 0
@ -493,7 +555,7 @@ function! <SID>DoxygenCommentFunc()
" Add blank line if necessary " Add blank line if necessary
if ( l:argList != 0 ) if ( l:argList != 0 )
exec "normal `do" . g:DoxygenToolkit_interCommentTag exec "normal `eo" . g:DoxygenToolkit_interCommentTag
endif endif
" move the cursor to the correct position (after brief tag) " move the cursor to the correct position (after brief tag)
@ -561,8 +623,12 @@ function! <SID>DoxygenAuthorFunc()
exec "normal o" . g:DoxygenToolkit_interCommentTag . g:DoxygenToolkit_briefTag_pre exec "normal o" . g:DoxygenToolkit_interCommentTag . g:DoxygenToolkit_briefTag_pre
mark d mark d
exec "normal o" . g:DoxygenToolkit_interCommentTag . g:DoxygenToolkit_authorTag . g:DoxygenToolkit_authorName exec "normal o" . g:DoxygenToolkit_interCommentTag . g:DoxygenToolkit_authorTag . g:DoxygenToolkit_authorName
let l:date = strftime("%Y-%m-%d") let l:date = strftime(g:DoxygenToolkit_dateFormat)
exec "normal o" . g:DoxygenToolkit_interCommentTag . g:DoxygenToolkit_dateTag . l:date exec "normal o" . g:DoxygenToolkit_interCommentTag . g:DoxygenToolkit_dateTag . l:date
if ( g:DoxygenToolkit_author_description == "yes" )
exec "normal o" . g:DoxygenToolkit_interCommentTag
exec "normal o" . g:DoxygenToolkit_interCommentTag . g:DoxygenToolkit_descriptionTag
endif
if ( g:DoxygenToolkit_endCommentTag == "" ) if ( g:DoxygenToolkit_endCommentTag == "" )
exec "normal o" . g:DoxygenToolkit_interCommentTag exec "normal o" . g:DoxygenToolkit_interCommentTag
else else
@ -619,8 +685,8 @@ function! <SID>DoxygenBlockFunc()
exec "normal o" . g:DoxygenToolkit_startCommentTag exec "normal o" . g:DoxygenToolkit_startCommentTag
exec "normal o" . g:DoxygenToolkit_interCommentTag . g:DoxygenToolkit_blockTag exec "normal o" . g:DoxygenToolkit_interCommentTag . g:DoxygenToolkit_blockTag
mark d mark d
exec "normal o" . g:DoxygenToolkit_interCommentTag . "@{ " . g:DoxygenToolkit_endCommentTag exec "normal o" . g:DoxygenToolkit_interCommentTag . g:DoxygenToolkit_commandTag . "{ " . g:DoxygenToolkit_endCommentTag
exec "normal o" . g:DoxygenToolkit_startCommentTag . " @} " . g:DoxygenToolkit_endCommentTag exec "normal o" . g:DoxygenToolkit_startCommentTag . " " . g:DoxygenToolkit_commandTag . "} " . g:DoxygenToolkit_endCommentTag
exec "normal `d" exec "normal `d"
" Restore standard comment expension " Restore standard comment expension

View File

@ -0,0 +1,488 @@
" SrchRplcHiGrp.vim - Search and Replace based on a highlight group
"
" Version: 4.0
" Author: David Fishburn <fishburn@ianywhere.com>
" Last Changed: Mon 21 Jan 2008 06:17:14 PM Eastern Standard Time
" Created: Tue Dec 02 2003 10:11:07 PM
" Description: Search and Replace based on a syntax highlight group
" Script: http://www.vim.org/script.php?script_id=848
" License: GPL (http://www.gnu.org/licenses/gpl.html)
"
" Command Help: {{{
" Ensure you have updated the help system:
" :helptags $VIM/vimfiles/doc (Windows)
" :helptags $VIM/.vim/doc (*nix)
"
" :h SRHiGrp
" }}}
" If syntax is not enabled, do not bother loading this plugin
if exists('g:loaded_srhg') || &cp || !exists("syntax_on")
finish
endif
let g:loaded_srhg = 1
" Default the highlight group to 0
let s:srhg_group_id = 0
let s:srhg_firstline = 0
let s:srhg_lastline = 0
" Functions: "{{{
" SRWarningMsg:
function! <SID>SRWarningMsg(msg) "{{{
echohl WarningMsg
echomsg a:msg
echohl None
endfunction "}}}
" SRDispHiGrp:
" Echos the currently selected highlight group name to the screen.
" If a parameter is supplied, it will display the message in the
" colour of the group name.
function! <SID>SRDispHiGrp(...) "{{{
if s:srhg_group_id != 0
if s:srhg_group_id < 0
let gid = -s:srhg_group_id
else
let gid = s:srhg_group_id
endif
if a:0 > 0 && strlen(a:1) > 0
let msg = a:1
else
let msg = "SRHiGrp - Group ID: " .gid . " Name: " . synIDattr(gid,"name")
endif
exec 'echohl ' . synIDattr(gid, "name")
exec "echomsg '" . msg . "'"
echohl None
else
echo "No highlight group has been choosen yet"
endif
endfunction "}}}
" SRChooseHiGrp:
" Sets the script variable s:srhg_group_id to the value
" of the highlight group underneath the current cursor
" position.
function! <SID>SRChooseHiGrp(use_top_level) "{{{
if(a:use_top_level == 1)
let cursynid = -synID(line("."),col("."),1)
else
let cursynid = synIDtrans(synID(line("."),col("."),1))
endif
if cursynid == 0
call s:SRWarningMsg(
\ 'There is no syntax group specified ' .
\ 'under the cursor'
\ )
else
let s:srhg_group_id = cursynid
call s:SRDispHiGrp()
endif
endfunction "}}}
" SRSetVisualRange:
" Redefines the visual range if the user called the functions
" with 1,5SR*
function! <SID>SRSetVisualRange() "{{{
" If the current line position is not at the beginning
" or the end of the visual region
if line(".") != line("'<") && line(".") != line("'>")
" Visually select the rows to ensure the correct
" range is operated on.
" This handles the case that SRHiGrp was run as:
" :SRHiGrp
" :1,5SRHiGrp
" instead of:
" :'<,'>SRHiGrp
exec 'normal! '.s:srhg_firstline."GV"
if s:srhg_lastline > s:srhg_firstline
exec "normal! " .
\ (s:srhg_lastline - s:srhg_firstline) .
\ "j"
endif
exec "normal! \<Esc>"
endif
return 1
endfunction "}}}
" SRPositionWord:
" Places the cursor on the next match following the
" previous line and column passed in.
function! <SID>SRPositionWord(prvline, prvcol, bfirsttime) "{{{
let prvline = a:prvline
let prvcol = a:prvcol
" echo 'L:'. col("'<") . ' R:' . col("'>")
" echo 'Visual Mode:'. visualmode()
if (prvline == 0) && (prvcol == 0)
call s:SRSetVisualRange()
let leftcol = col("'<") - 1
" exe 'norm! '.s:srhg_firstline."G\<bar>".leftcol.(leftcol>0 ? 'l' : '' )
call cursor(s:srhg_firstline,leftcol)
return 1
endif
while 1==1
if visualmode() ==# 'v'
if line(".") == s:srhg_firstline
" let leftcol = col("'<") - 1
let leftcol = col("'<")
else
let leftcol = 1
endif
if line(".") == s:srhg_lastline
let rightcol = col("'>")
else
let rightcol = col("$")
endif
elseif visualmode() ==# 'V'
let leftcol = 1
let rightcol = col("$")
elseif visualmode() ==# "\<C-V>"
let leftcol = col("'<") - 1
let leftcol = col("'<")
let rightcol = col("'>")
endif
" echo 'PrvLine:'.prvline.' prvcol:'.prvcol.
" \' L:'.leftcol.' R:'.rightcol.
" \' VL:'.leftcol.' VR:'.rightcol
" Position cursor on leftcol
" on each new line based on visual mode
if col(".") == leftcol && a:bfirsttime == 1
" The cursor is already at it starting position,
" do not move the cursor
elseif col(".") < leftcol
" exe 'norm! '.line(".")."G\<bar>".leftcol.(leftcol>0 ? 'l' : '' )
call cursor(line("."),leftcol)
else
normal! w
endif
" Add additional check to see if the cursor has
" moved after the above, if not, exit.
if (col(".") == prvcol) && (line(".") == prvline && a:bfirsttime != 1)
return -1
endif
if col(".") >= leftcol &&
\ col(".") <= rightcol &&
\ line(".") <= s:srhg_lastline
return 1
elseif col(".") > rightcol && line(".") < s:srhg_lastline
let prvline = prvline + 1
" Position the cursor on the next line and move
" to the start of the visual region
" exe 'norm! '.prvline."G\<bar>".leftcol.(leftcol>0 ? 'l' : '' )
call cursor(prvline,leftcol)
break
elseif col(".") < leftcol && line(".") <= s:srhg_lastline
" outside of visual area, move to next word
continue
else
return -1
endif
endwhile
return 1
endfunction "}}}
" SRHiGrp:
" Traverses the region selected and performs all search and
" replaces over the region for the selected highlight group.
function! <SID>SRHiGrp(...) range "{{{
let s:srhg_firstline = a:firstline
let s:srhg_lastline = a:lastline
if s:srhg_group_id == 0
call s:SRWarningMsg(
\ 'You must specify a syntax group name ' .
\ 'by placing the cursor on a character ' .
\ 'that is highlighted the way you want ' .
\ 'and execute :SRChooseHiGrp or ' .
\ ':SRChooseHiGrp!'
\ )
return
endif
let group_name = synIDattr(s:srhg_group_id, 'name')
if group_name == ''
let group_name = synIDattr(-s:srhg_group_id, 'name')
endif
if(a:0 > 0)
if( a:1 == 0 || a:1 == 1)
let match_group = a:1
endif
else
" Default to operate on syntax groups that match
let match_group = 1
endif
if(a:0 > 1)
let match_exp = a:2
else
let match_exp = '\(\w\+\>\)'
let dialog_msg = "Enter match expression (default word at cursor - " .
\ match_exp .
\ "): "
let l:var_val = inputdialog(dialog_msg, match_exp)
let response = 1
" Ok or Cancel result in an empty string
if l:var_val == ""
call s:SRWarningMsg(
\ 'You must provide a match expression which ' .
\ 'includes a submatch'
\ )
return
endif
let match_exp = l:var_val
endif
if(a:0 > 2)
let replace_exp = a:3
else
let replace_exp = '\U\1'
let dialog_msg = "Enter replacement expression for the submatch " .
\ "(ie capitalize word - \\U\\1): "
let l:var_val = inputdialog(dialog_msg, replace_exp)
let response = 1
" Ok or Cancel result in an empty string
if l:var_val == ""
" If empty, check if they want to leave it empty
" of skip this variable
let response = confirm("Your value is empty!"
\ , "&Use blank\n&Cancel", response)
endif
if response == 1
" Replace the variable with what was entered
let replace_exp = l:var_val
else
" Cancel
return
endif
endif
" let higrpid = synIDtrans(hlID(s:srhg_group_id))
let found = 0
let firsttime = 1
let lastline = line("$")
let orgline = line(".")
let orgcol = col(".")
let curline = line(".")
let curcol = col(".")
let fenkeep = &fen
let saveSearch = @/
let saveFoldEnable = &foldenable
setlocal nofoldenable
" Reset visual range if necessary
call s:SRSetVisualRange()
" Restore the cursor position since resetting
" the visual area could have moved the cursor
call cursor(orgline, orgcol)
if s:SRPositionWord(orgline,(orgcol-1), firsttime) == -1
call s:SRWarningMsg(
\ 'Please reselect the visual area (ie gv)'
\ )
return
endif
let firsttime = 0
let gid = s:srhg_group_id
if(gid < 0)
let gid = -s:srhg_group_id
endif
while line(".") <= a:lastline
let curcol = col(".")
let curline = line(".")
let cursynid = (s:srhg_group_id < 0) ?
\ -synID(line("."),col("."),1) :
\ synIDtrans(synID(line("."),col("."),1))
let cursynid = (s:srhg_group_id < 0) ? synID(line("."),col("."),1) : synIDtrans(synID(line("."),col("."),1))
" Useful debugging statement:
" echo col(".").':'.getline(".")[col(".")-1].':'.cursynid.':'.getline(".")
if line(".") == curline
if match_group == 1 && cursynid == gid
" Perform the subtitution, but do not report an error
" if the match fails
exec 's/\%#'.match_exp.'/'.replace_exp.'/e'
" Since this command can move the cursor, put the cursor
" back to its original position
" exe 'norm! '.curline."G\<bar>".(curcol-1)."l"
call cursor(curline,curcol)
let found = 1
elseif match_group == 0 && cursynid != gid
" Perform the subtitution, but do not report an error
" if the match fails
exec 's/\%#'.match_exp.'/'.replace_exp.'/e'
" Since this command can move the cursor, put the cursor
" back to its original position
exe 'norm! '.curline."G\<bar>".(curcol-1)."l"
endif
endif
let prvcol = curcol
let prvline = curline
if s:SRPositionWord(prvline, prvcol, firsttime) == -1
break
endif
endwhile
if found == 0
call s:SRWarningMsg('Did not find highlight group: "'.group_name.'"')
endif
" cleanup
let &fen = fenkeep
if foldlevel(".") > 0
norm! zO
endif
let &foldenable = saveFoldEnable
unlet curcol
" unlet higrpid
unlet lastline
let @/ = saveSearch
if exists("prvcol")
unlet prvcol
endif
endfunction "}}}
"}}}
" SRSearch:
" Finds the next occurrence of the highlight group within
" the range selected from the current cursor position.
function! <SID>SRSearch(fline, lline, ...) "{{{
let s:srhg_firstline = a:fline
let s:srhg_lastline = a:lline
if a:0 > 0 && strlen(a:1) > 0
let s:srhg_group_id = -hlID(a:1)
let group_name = a:1
else
let group_name = synIDattr(-s:srhg_group_id, 'name')
endif
if s:srhg_group_id == 0
call s:SRWarningMsg(
\ 'You must specify a syntax group name ' .
\ 'on the command line (<Tab> to complete) ' .
\ 'or by placing the cursor on a character ' .
\ 'that is highlighted the way you want ' .
\ 'and execute :SRChooseHiGrp or ' .
\ ':SRChooseHiGrp!'
\ )
return
endif
" let higrpid = synIDtrans(hlID(s:srhg_group_id))
let found = 0
let lastline = line("$")
let orgline = line(".")
let orgcol = col(".")
let curline = line(".")
let curcol = col(".")
let fenkeep = &fen
let saveSearch = @/
let saveFoldEnable = &foldenable
setlocal nofoldenable
" Set this to false, to force the search to move the cursor
" this prevents the user from having to manually move the
" cursor between recursive calls.
let firsttime = 0
" Reset visual range if necessary
call s:SRSetVisualRange()
" Restore the cursor position since resetting
" the visual area could have moved the cursor
call cursor(orgline, orgcol)
if s:SRPositionWord(orgline,orgcol,firsttime) == -1
call s:SRWarningMsg(
\ 'Please reselect the visual area (ie gv)'
\ )
return
endif
let gid = s:srhg_group_id
if(gid < 0)
let gid = -s:srhg_group_id
endif
while line(".") <= s:srhg_lastline
let curcol = col(".")
let curline = line(".")
let cursynid = (s:srhg_group_id < 0) ?
\ -synID(line("."),col("."),1) :
\ synIDtrans(synID(line("."),col("."),1))
let cursynid = (s:srhg_group_id < 0) ? synID(line("."),col("."),1) : synIDtrans(synID(line("."),col("."),1))
" Useful debugging statement:
" echo col(".").':'.getline(".")[col(".")-1].':'.cursynid.':'.getline(".")
if line(".") == curline
if cursynid == gid
call s:SRDispHiGrp( "SRSearch - Match found - Group ID: " .
\ gid . " Name: " . synIDattr(gid,"name")
\ )
let found = 1
break
endif
endif
let prvcol = curcol
let prvline = curline
if s:SRPositionWord(prvline, prvcol, firsttime) == -1
break
endif
endwhile
if found == 0
call s:SRDispHiGrp( "SRSearch - Match NOT found - Group ID: " .
\ gid . " Name: " . synIDattr(gid,"name")
\ )
call cursor(orgline, orgcol)
endif
" cleanup
let &fen = fenkeep
if foldlevel(".") > 0
norm! zO
endif
let &foldenable = saveFoldEnable
unlet curcol
" unlet higrpid
unlet lastline
let @/ = saveSearch
if exists("prvcol")
unlet prvcol
endif
endfunction "}}}
"}}}
" Commands: {{{
command! -range -bang -nargs=* SRHiGrp <line1>,<line2>call s:SRHiGrp(<bang>1,<args>)
command! -bang -nargs=0 SRChooseHiGrp :call s:SRChooseHiGrp(<bang>1)
command! -nargs=0 SRDispHiGrp :call s:SRDispHiGrp()
command! -range=% -nargs=? -complete=highlight SRSearch call s:SRSearch(<line1>,<line2>,<q-args>)
"}}}
" vim:fdm=marker:nowrap:ts=4:

482
vimfiles/plugin/cecutil.vim Normal file
View File

@ -0,0 +1,482 @@
" cecutil.vim : save/restore window position
" save/restore mark position
" save/restore selected user maps
" Author: Charles E. Campbell, Jr.
" Version: 17
" Date: Sep 04, 2007
"
" Saving Restoring Destroying Marks: {{{1
" call SaveMark(markname) let savemark= SaveMark(markname)
" call RestoreMark(markname) call RestoreMark(savemark)
" call DestroyMark(markname)
" commands: SM RM DM
"
" Saving Restoring Destroying Window Position: {{{1
" call SaveWinPosn() let winposn= SaveWinPosn()
" call RestoreWinPosn() call RestoreWinPosn(winposn)
" \swp : save current window/buffer's position
" \rwp : restore current window/buffer's previous position
" commands: SWP RWP
"
" Saving And Restoring User Maps: {{{1
" call SaveUserMaps(mapmode,maplead,mapchx,suffix)
" call RestoreUserMaps(suffix)
"
" GetLatestVimScripts: 1066 1 :AutoInstall: cecutil.vim
"
" You believe that God is one. You do well. The demons also {{{1
" believe, and shudder. But do you want to know, vain man, that
" faith apart from works is dead? (James 2:19,20 WEB)
" Load Once: {{{1
if &cp || exists("g:loaded_cecutil")
finish
endif
let g:loaded_cecutil = "v17"
let s:keepcpo = &cpo
set cpo&vim
"DechoVarOn
" -----------------------
" Public Interface: {{{1
" -----------------------
" Map Interface: {{{2
if !hasmapto('<Plug>SaveWinPosn')
map <unique> <Leader>swp <Plug>SaveWinPosn
endif
if !hasmapto('<Plug>RestoreWinPosn')
map <unique> <Leader>rwp <Plug>RestoreWinPosn
endif
nmap <silent> <Plug>SaveWinPosn :call SaveWinPosn()<CR>
nmap <silent> <Plug>RestoreWinPosn :call RestoreWinPosn()<CR>
" Command Interface: {{{2
com! -bar -nargs=0 SWP call SaveWinPosn()
com! -bar -nargs=0 RWP call RestoreWinPosn()
com! -bar -nargs=1 SM call SaveMark(<q-args>)
com! -bar -nargs=1 RM call RestoreMark(<q-args>)
com! -bar -nargs=1 DM call DestroyMark(<q-args>)
if v:version < 630
let s:modifier= "sil "
else
let s:modifier= "sil keepj "
endif
" ---------------------------------------------------------------------
" SaveWinPosn: {{{1
" let winposn= SaveWinPosn() will save window position in winposn variable
" call SaveWinPosn() will save window position in b:cecutil_winposn{b:cecutil_iwinposn}
" let winposn= SaveWinPosn(0) will *only* save window position in winposn variable (no stacking done)
fun! SaveWinPosn(...)
" call Dfunc("SaveWinPosn() a:0=".a:0)
if line(".") == 1 && getline(1) == ""
" call Dfunc("SaveWinPosn : empty buffer")
return ""
endif
let so_keep = &so
let siso_keep = &siso
let ss_keep = &ss
set so=0 siso=0 ss=0
let swline = line(".")
let swcol = col(".")
let swwline = winline() - 1
let swwcol = virtcol(".") - wincol()
let savedposn = "call GoWinbufnr(".winbufnr(0).")|silent ".swline
let savedposn = savedposn."|".s:modifier."norm! 0z\<cr>"
if swwline > 0
let savedposn= savedposn.":".s:modifier."norm! ".swwline."\<c-y>\<cr>"
endif
if swwcol > 0
let savedposn= savedposn.":".s:modifier."norm! 0".swwcol."zl\<cr>"
endif
let savedposn = savedposn.":".s:modifier."call cursor(".swline.",".swcol.")\<cr>"
" save window position in
" b:cecutil_winposn_{iwinposn} (stack)
" only when SaveWinPosn() is used
if a:0 == 0
if !exists("b:cecutil_iwinposn")
let b:cecutil_iwinposn= 1
else
let b:cecutil_iwinposn= b:cecutil_iwinposn + 1
endif
" call Decho("saving posn to SWP stack")
let b:cecutil_winposn{b:cecutil_iwinposn}= savedposn
endif
let &so = so_keep
let &siso = siso_keep
let &ss = ss_keep
" if exists("b:cecutil_iwinposn") " Decho
" call Decho("b:cecutil_winpos{".b:cecutil_iwinposn."}[".b:cecutil_winposn{b:cecutil_iwinposn}."]")
" else " Decho
" call Decho("b:cecutil_iwinposn doesn't exist")
" endif " Decho
" call Dret("SaveWinPosn [".savedposn."]")
return savedposn
endfun
" ---------------------------------------------------------------------
" RestoreWinPosn: {{{1
fun! RestoreWinPosn(...)
" call Dfunc("RestoreWinPosn() a:0=".a:0)
" call Decho("getline(1)<".getline(1).">")
" call Decho("line(.)=".line("."))
if line(".") == 1 && getline(1) == ""
" call Dfunc("RestoreWinPosn : empty buffer")
return ""
endif
let so_keep = &so
let siso_keep = &siso
let ss_keep = &ss
set so=0 siso=0 ss=0
if a:0 == 0 || a:1 == ""
" use saved window position in b:cecutil_winposn{b:cecutil_iwinposn} if it exists
if exists("b:cecutil_iwinposn") && exists("b:cecutil_winposn{b:cecutil_iwinposn}")
" call Decho("using stack b:cecutil_winposn{".b:cecutil_iwinposn."}<".b:cecutil_winposn{b:cecutil_iwinposn}.">")
try
exe "silent! ".b:cecutil_winposn{b:cecutil_iwinposn}
catch /^Vim\%((\a\+)\)\=:E749/
" ignore empty buffer error messages
endtry
" normally drop top-of-stack by one
" but while new top-of-stack doesn't exist
" drop top-of-stack index by one again
if b:cecutil_iwinposn >= 1
unlet b:cecutil_winposn{b:cecutil_iwinposn}
let b:cecutil_iwinposn= b:cecutil_iwinposn - 1
while b:cecutil_iwinposn >= 1 && !exists("b:cecutil_winposn{b:cecutil_iwinposn}")
let b:cecutil_iwinposn= b:cecutil_iwinposn - 1
endwhile
if b:cecutil_iwinposn < 1
unlet b:cecutil_iwinposn
endif
endif
else
echohl WarningMsg
echomsg "***warning*** need to SaveWinPosn first!"
echohl None
endif
else " handle input argument
" call Decho("using input a:1<".a:1.">")
" use window position passed to this function
exe "silent ".a:1
" remove a:1 pattern from b:cecutil_winposn{b:cecutil_iwinposn} stack
if exists("b:cecutil_iwinposn")
let jwinposn= b:cecutil_iwinposn
while jwinposn >= 1 " search for a:1 in iwinposn..1
if exists("b:cecutil_winposn{jwinposn}") " if it exists
if a:1 == b:cecutil_winposn{jwinposn} " and the pattern matches
unlet b:cecutil_winposn{jwinposn} " unlet it
if jwinposn == b:cecutil_iwinposn " if at top-of-stack
let b:cecutil_iwinposn= b:cecutil_iwinposn - 1 " drop stacktop by one
endif
endif
endif
let jwinposn= jwinposn - 1
endwhile
endif
endif
" seems to be something odd: vertical motions after RWP
" cause jump to first column. Following fixes that
if wincol() > 1
silent norm! hl
elseif virtcol(".") < virtcol("$")
silent norm! lh
endif
let &so = so_keep
let &siso = siso_keep
let &ss = ss_keep
" call Dret("RestoreWinPosn")
endfun
" ---------------------------------------------------------------------
" GoWinbufnr: go to window holding given buffer (by number) {{{1
" Prefers current window; if its buffer number doesn't match,
" then will try from topleft to bottom right
fun! GoWinbufnr(bufnum)
" call Dfunc("GoWinbufnr(".a:bufnum.")")
if winbufnr(0) == a:bufnum
" call Dret("GoWinbufnr : winbufnr(0)==a:bufnum")
return
endif
winc t
let first=1
while winbufnr(0) != a:bufnum && (first || winnr() != 1)
winc w
let first= 0
endwhile
" call Dret("GoWinbufnr")
endfun
" ---------------------------------------------------------------------
" SaveMark: sets up a string saving a mark position. {{{1
" For example, SaveMark("a")
" Also sets up a global variable, g:savemark_{markname}
fun! SaveMark(markname)
" call Dfunc("SaveMark(markname<".a:markname.">)")
let markname= a:markname
if strpart(markname,0,1) !~ '\a'
let markname= strpart(markname,1,1)
endif
" call Decho("markname=".markname)
let lzkeep = &lz
set lz
if 1 <= line("'".markname) && line("'".markname) <= line("$")
let winposn = SaveWinPosn(0)
exe s:modifier."norm! `".markname
let savemark = SaveWinPosn(0)
let g:savemark_{markname} = savemark
let savemark = markname.savemark
call RestoreWinPosn(winposn)
else
let g:savemark_{markname} = ""
let savemark = ""
endif
let &lz= lzkeep
" call Dret("SaveMark : savemark<".savemark.">")
return savemark
endfun
" ---------------------------------------------------------------------
" RestoreMark: {{{1
" call RestoreMark("a") -or- call RestoreMark(savemark)
fun! RestoreMark(markname)
" call Dfunc("RestoreMark(markname<".a:markname.">)")
if strlen(a:markname) <= 0
" call Dret("RestoreMark : no such mark")
return
endif
let markname= strpart(a:markname,0,1)
if markname !~ '\a'
" handles 'a -> a styles
let markname= strpart(a:markname,1,1)
endif
" call Decho("markname=".markname." strlen(a:markname)=".strlen(a:markname))
let lzkeep = &lz
set lz
let winposn = SaveWinPosn(0)
if strlen(a:markname) <= 2
if exists("g:savemark_{markname}") && strlen(g:savemark_{markname}) != 0
" use global variable g:savemark_{markname}
" call Decho("use savemark list")
call RestoreWinPosn(g:savemark_{markname})
exe "norm! m".markname
endif
else
" markname is a savemark command (string)
" call Decho("use savemark command")
let markcmd= strpart(a:markname,1)
call RestoreWinPosn(markcmd)
exe "norm! m".markname
endif
call RestoreWinPosn(winposn)
let &lz = lzkeep
" call Dret("RestoreMark")
endfun
" ---------------------------------------------------------------------
" DestroyMark: {{{1
" call DestroyMark("a") -- destroys mark
fun! DestroyMark(markname)
" call Dfunc("DestroyMark(markname<".a:markname.">)")
" save options and set to standard values
let reportkeep= &report
let lzkeep = &lz
set lz report=10000
let markname= strpart(a:markname,0,1)
if markname !~ '\a'
" handles 'a -> a styles
let markname= strpart(a:markname,1,1)
endif
" call Decho("markname=".markname)
let curmod = &mod
let winposn = SaveWinPosn(0)
1
let lineone = getline(".")
exe "k".markname
d
put! =lineone
let &mod = curmod
call RestoreWinPosn(winposn)
" restore options to user settings
let &report = reportkeep
let &lz = lzkeep
" call Dret("DestroyMark")
endfun
" ---------------------------------------------------------------------
" QArgSplitter: to avoid \ processing by <f-args>, <q-args> is needed. {{{1
" However, <q-args> doesn't split at all, so this one returns a list
" with splits at all whitespace (only!), plus a leading length-of-list.
" The resulting list: qarglist[0] corresponds to a:0
" qarglist[i] corresponds to a:{i}
fun! QArgSplitter(qarg)
" call Dfunc("QArgSplitter(qarg<".a:qarg.">)")
let qarglist = split(a:qarg)
let qarglistlen = len(qarglist)
let qarglist = insert(qarglist,qarglistlen)
" call Dret("QArgSplitter ".string(qarglist))
return qarglist
endfun
" ---------------------------------------------------------------------
" ListWinPosn:
"fun! ListWinPosn() " Decho
" if !exists("b:cecutil_iwinposn") || b:cecutil_iwinposn == 0 " Decho
" call Decho("nothing on SWP stack") " Decho
" else " Decho
" let jwinposn= b:cecutil_iwinposn " Decho
" while jwinposn >= 1 " Decho
" if exists("b:cecutil_winposn{jwinposn}") " Decho
" call Decho("winposn{".jwinposn."}<".b:cecutil_winposn{jwinposn}.">") " Decho
" else " Decho
" call Decho("winposn{".jwinposn."} -- doesn't exist") " Decho
" endif " Decho
" let jwinposn= jwinposn - 1 " Decho
" endwhile " Decho
" endif " Decho
"endfun " Decho
"com! -nargs=0 LWP call ListWinPosn() " Decho
" ---------------------------------------------------------------------
" SaveUserMaps: this function sets up a script-variable (s:restoremap) {{{1
" which can be used to restore user maps later with
" call RestoreUserMaps()
"
" mapmode - see :help maparg for its list
" ex. "n" = Normal
" If the first letter is u, then unmapping will be done
" ex. "un" = Normal + unmapping
" maplead - see mapchx
" mapchx - "<something>" handled as a single map item.
" ex. "<left>"
" - "string" a string of single letters which are actually
" multiple two-letter maps (using the maplead:
" maplead . each_character_in_string)
" ex. maplead="\" and mapchx="abc" saves user mappings for
" \a, \b, and \c
" Of course, if maplead is "", then for mapchx="abc",
" mappings for a, b, and c are saved.
" - :something handled as a single map item, w/o the ":"
" ex. mapchx= ":abc" will save a mapping for "abc"
" suffix - a string unique to your plugin
" ex. suffix= "DrawIt"
fun! SaveUserMaps(mapmode,maplead,mapchx,suffix)
" call Dfunc("SaveUserMaps(mapmode<".a:mapmode."> maplead<".a:maplead."> mapchx<".a:mapchx."> suffix<".a:suffix.">)")
if !exists("s:restoremap_{a:suffix}")
" initialize restoremap_suffix to null string
let s:restoremap_{a:suffix}= ""
endif
" set up dounmap: if 1, then save and unmap (a:mapmode leads with a "u")
" if 0, save only
if a:mapmode =~ '^u'
let dounmap= 1
let mapmode= strpart(a:mapmode,1)
else
let dounmap= 0
let mapmode= a:mapmode
endif
" save single map :...something...
if strpart(a:mapchx,0,1) == ':'
let amap= strpart(a:mapchx,1)
if amap == "|" || amap == "\<c-v>"
let amap= "\<c-v>".amap
endif
let amap = a:maplead.amap
let s:restoremap_{a:suffix} = s:restoremap_{a:suffix}."|:silent! ".mapmode."unmap ".amap
if maparg(amap,mapmode) != ""
let maprhs = substitute(maparg(amap,mapmode),'|','<bar>','ge')
let s:restoremap_{a:suffix} = s:restoremap_{a:suffix}."|:".mapmode."map ".amap." ".maprhs
endif
if dounmap
exe "silent! ".mapmode."unmap ".amap
endif
" save single map <something>
elseif strpart(a:mapchx,0,1) == '<'
let amap = a:mapchx
if amap == "|" || amap == "\<c-v>"
let amap= "\<c-v>".amap
endif
let s:restoremap_{a:suffix} = s:restoremap_{a:suffix}."|silent! ".mapmode."unmap ".amap
if maparg(a:mapchx,mapmode) != ""
let maprhs = substitute(maparg(amap,mapmode),'|','<bar>','ge')
let s:restoremap_{a:suffix} = s:restoremap_{a:suffix}."|".mapmode."map ".amap." ".maprhs
endif
if dounmap
exe "silent! ".mapmode."unmap ".amap
endif
" save multiple maps
else
let i= 1
while i <= strlen(a:mapchx)
let amap= a:maplead.strpart(a:mapchx,i-1,1)
if amap == "|" || amap == "\<c-v>"
let amap= "\<c-v>".amap
endif
let s:restoremap_{a:suffix} = s:restoremap_{a:suffix}."|silent! ".mapmode."unmap ".amap
if maparg(amap,mapmode) != ""
let maprhs = substitute(maparg(amap,mapmode),'|','<bar>','ge')
let s:restoremap_{a:suffix} = s:restoremap_{a:suffix}."|".mapmode."map ".amap." ".maprhs
endif
if dounmap
exe "silent! ".mapmode."unmap ".amap
endif
let i= i + 1
endwhile
endif
" call Dret("SaveUserMaps : restoremap_".a:suffix.": ".s:restoremap_{a:suffix})
endfun
" ---------------------------------------------------------------------
" RestoreUserMaps: {{{1
" Used to restore user maps saved by SaveUserMaps()
fun! RestoreUserMaps(suffix)
" call Dfunc("RestoreUserMaps(suffix<".a:suffix.">)")
if exists("s:restoremap_{a:suffix}")
let s:restoremap_{a:suffix}= substitute(s:restoremap_{a:suffix},'|\s*$','','e')
if s:restoremap_{a:suffix} != ""
" call Decho("exe ".s:restoremap_{a:suffix})
exe "silent! ".s:restoremap_{a:suffix}
endif
unlet s:restoremap_{a:suffix}
endif
" call Dret("RestoreUserMaps")
endfun
" ---------------------------------------------------------------------
" Restore: {{{1
let &cpo= s:keepcpo
unlet s:keepcpo
" ---------------------------------------------------------------------
" Modelines: {{{1
" vim: ts=4 fdm=marker

View File

@ -1,7 +1,7 @@
" --------------------------------------------------------------------- " ---------------------------------------------------------------------
" getscriptPlugin.vim " getscriptPlugin.vim
" Author: Charles E. Campbell, Jr. " Author: Charles E. Campbell, Jr.
" Date: Jul 18, 2006 " Date: Jan 07, 2008
" Installing: :help glvs-install " Installing: :help glvs-install
" Usage: :help glvs " Usage: :help glvs
" "
@ -19,8 +19,7 @@ if &cp || exists("g:loaded_getscriptPlugin")
endif endif
finish finish
endif endif
let g:loaded_getscriptPlugin = 1 let g:loaded_getscriptPlugin = "v29"
let s:keepfo = &fo
let s:keepcpo = &cpo let s:keepcpo = &cpo
set cpo&vim set cpo&vim
@ -30,9 +29,10 @@ com! -nargs=0 GetLatestVimScripts call getscript#GetLatestVimScripts()
com! -nargs=0 GetScripts call getscript#GetLatestVimScripts() com! -nargs=0 GetScripts call getscript#GetLatestVimScripts()
silent! com -nargs=0 GLVS call getscript#GetLatestVimScripts() silent! com -nargs=0 GLVS call getscript#GetLatestVimScripts()
" ---------------------------------------------------------------------
" Restore Options: {{{1 " Restore Options: {{{1
let &fo = s:keepfo
let &cpo= s:keepcpo let &cpo= s:keepcpo
unlet s:keepcpo
" --------------------------------------------------------------------- " ---------------------------------------------------------------------
" vim: ts=8 sts=2 fdm=marker nowrap " vim: ts=8 sts=2 fdm=marker nowrap

View File

@ -1,7 +1,7 @@
" matchit.vim: (global plugin) Extended "%" matching " matchit.vim: (global plugin) Extended "%" matching
" Last Change: Sun Sep 09 09:00 AM 2007 EDT " Last Change: Fri Jan 25 10:00 AM 2008 EST
" Maintainer: Benji Fisher PhD <benji@member.AMS.org> " Maintainer: Benji Fisher PhD <benji@member.AMS.org>
" Version: 1.13.1, for Vim 6.3+ " Version: 1.13.2, for Vim 6.3+
" URL: http://www.vim.org/script.php?script_id=39 " URL: http://www.vim.org/script.php?script_id=39
" Documentation: " Documentation:
@ -398,6 +398,7 @@ fun! s:ParseWords(groups)
endwhile " Now, tail has been used up. endwhile " Now, tail has been used up.
let parsed = parsed . "," let parsed = parsed . ","
endwhile " groups =~ '[^,:]' endwhile " groups =~ '[^,:]'
let parsed = substitute(parsed, ',$', '', '')
return parsed return parsed
endfun endfun

View File

@ -1,5 +1,15 @@
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" svndiff 2.0 (C) 2007 Ico Doornekamp " 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 " Introduction
" ------------ " ------------
@ -8,11 +18,11 @@
" "
" An small vim 7.0 plugin for showing svn diff information in a file while " An small vim 7.0 plugin for showing svn diff information in a file while
" editing. This plugin runs a diff between the current buffer and the original " editing. This plugin runs a diff between the current buffer and the original
" subversion file, and shows coloured tags indicating where the buffer differs " subversion file, and shows coloured signs indicating where the buffer
" from the original file from the subversion repository. The original text is " differs from the original file from the subversion repository. The original
" not shown, only signs are used to indicate where changes were made. " text is not shown, only signs are used to indicate where changes were made.
" "
" The following symbols and syntax highlight groups are used for the tags: " The following symbols and syntax highlight groups are used for the signs:
" "
" > DiffAdd: Newly added lines. (default=blue) " > DiffAdd: Newly added lines. (default=blue)
" "
@ -24,18 +34,16 @@
" ----- " -----
" "
" The plugin defines one function: Svndiff(). This function figures out the " The plugin defines one function: Svndiff(). This function figures out the
" difference between the current file and it's subversion original, and adds " difference between the current buffer and it's subversion original, and adds
" the tags at the places where the buffer differs from the original file from " the signs at the places where the buffer differs from the original file from
" subversion. You'll need to call this function after making changes to update " subversion. You'll need to call this function after making changes to update
" the highlighting. " the highlighting.
" "
" " The function takes one argument specifying an additional action to perform:
" The function takes an optional argument specifying an additional action to
" perform:
" "
" "prev" : jump to the previous different block " "prev" : jump to the previous different block
" "next" : jump to the next different block " "next" : jump to the next different block
" "clear" : clean up all tags " "clear" : clean up all signs
" "
" You might want to map some keys to run the Svndiff function. For " You might want to map some keys to run the Svndiff function. For
" example, add to your .vimrc: " example, add to your .vimrc:
@ -44,6 +52,33 @@
" noremap <F4> :call Svndiff("next")<CR> " noremap <F4> :call Svndiff("next")<CR>
" noremap <F5> :call Svndiff("clear")<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 " Colors
" ------ " ------
" "
@ -64,54 +99,75 @@
" "
" 1.2 2007-06-14 Updated diff arguments from -u0 (obsolete) to -U0 " 1.2 2007-06-14 Updated diff arguments from -u0 (obsolete) to -U0
" "
" 2.0 2007-08-16 Changed from syntax highlighting to using tags, thanks " 2.0 2007-08-16 Changed from syntax highlighting to using signs, thanks
" to Noah Spurrier for the idea. NOTE: the name of the " to Noah Spurrier for the idea. NOTE: the name of the
" function changed from Svndiff_show() to Svndiff(), so " function changed from Svndiff_show() to Svndiff(), so
" you might need to update your .vimrc mappings! " 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.
"
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
if v:version < 700
finish
endif
function! Svndiff(...)
let cmd = exists("a:1") ? a:1 : '' 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: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
"
" Do the diff and update signs.
"
function s:Svndiff_update(...)
let fname = bufname("%") let fname = bufname("%")
let jump_to = 0
if ! exists("s:is_active[fname]")
return 0
end
" Check if this file is managed by subversion, exit otherwise " Check if this file is managed by subversion, exit otherwise
let info = system("svn info " . fname) let info = system("LANG=C svn info " . fname)
if match(info, "Path") == -1 if match(info, "Path") == -1
echom "Svndiff: Warning, file " . fname . " is not managed by subversion, or error running svn." echom "Svndiff: Warning, file " . fname . " is not managed by subversion, or error running svn."
return unlet s:is_active[fname]
return 0
end end
" Check if the changedticks changed since the last invocation of this
" function. If nothing changed, there's no need to update the signs.
" Remove all signs. If the cmd is 'clear', return right away. NOTE: this if exists("s:changedtick[fname]") && s:changedtick[fname] == b:changedtick
" command removes all signs from the file, also if they were not placed by return 1
" the this plugin. If this bothers your, tell me and I'll fix it. end
let s:changedtick[fname] = b:changedtick
sign unplace *
if cmd == 'clear'
return
endif
" Define sign characters and colors
sign define svnadd text=> texthl=diffAdd
sign define svndelete text=< texthl=diffDelete
sign define svnchange text=! texthl=diffChange
" 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 " This is where the magic happens: pipe the current buffer contents to a
" shell command calculating the diff in a friendly parsable format. " shell command calculating the diff in a friendly parsable format.
let contents = join(getbufline("%", 1, "$"), "\n") let contents = join(getbufline("%", 1, "$"), "\n")
let diff = system("diff -U0 <(svn cat " . fname . ") <(cat;echo)", contents) let diff = system("diff -U0 <(svn cat " . 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 " Parse the output of the diff command and put signs at changed, added and
" removed lines " removed lines
@ -131,56 +187,150 @@ function! Svndiff(...)
if old_count == 0 if old_count == 0
let from = new_from let from = new_from
let to = new_from + new_count - 1 let to = new_from + new_count - 1
let name = 'svnadd' let name = 'svndiff_add'
let info = new_count . " lines added"
elseif new_count == 0 elseif new_count == 0
let from = new_from let from = new_from
let to = new_from + 1 let to = new_from
let name = 'svndelete' let name = 'svndiff_delete'
let info = old_count . " lines deleted"
if ! exists("g:svndiff_one_sign_delete")
let to += 1
endif
else else
let from = new_from let from = new_from
let to = new_from + new_count - 1 let to = new_from + new_count - 1
let name = 'svnchange' let name = 'svndiff_change'
let info = new_count . " lines changed"
endif endif
let id = from + s:sign_base
let s:diff_blocks[fname] += [{ 'id': id, 'info': info }]
" Add signs to mark the changed lines " Add signs to mark the changed lines
let line = from let line = from
while line <= to while line <= to
exec 'sign place ' . from . ' line=' . line . ' name=' . name . ' file=' . fname 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 let line = line + 1
endwhile endwhile
" Check if we need to jump to prev/next diff block
if cmd == 'prev'
if from < line(".")
let jump_to = from
endif
endif
if cmd == 'next'
if from > line(".")
if jump_to == 0
let jump_to = from
endif
endif
endif
endif endif
endfor endfor
endfunction
" Set the cursor to the new position, if requested
if jump_to > 0
call setpos(".", [ 0, jump_to, 1, 0 ]) "
" 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 endif
endfunction 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 " vi: ts=2 sw=2

View File

@ -13,58 +13,73 @@
if &cp || exists("g:loaded_visincrPlugin") if &cp || exists("g:loaded_visincrPlugin")
finish finish
endif endif
let g:loaded_visincrPlugin = 1 let g:loaded_visincrPlugin = "v19"
let s:keepcpo = &cpo let s:keepcpo = &cpo
set cpo&vim set cpo&vim
" --------------------------------------------------------------------- " ---------------------------------------------------------------------
" Methods: {{{1 " Methods: {{{1
let s:I = 0 let s:I = 0
let s:II = 1 let s:II = 1
let s:IMDY = 2 let s:IMDY = 2
let s:IYMD = 3 let s:IYMD = 3
let s:IDMY = 4 let s:IDMY = 4
let s:ID = 5 let s:ID = 5
let s:IM = 6 let s:IM = 6
let s:IA = 7 let s:IA = 7
let s:IX = 8 let s:IX = 8
let s:IIX = 9 let s:IIX = 9
let s:IO = 10 let s:IO = 10
let s:IIO = 11 let s:IIO = 11
let s:IR = 12 let s:IR = 12
let s:IIR = 13 let s:IIR = 13
let s:RI = 14 let s:IPOW = 14
let s:RII = 15 let s:IIPOW = 15
let s:RIMDY = 16 let s:RI = 16
let s:RIYMD = 17 let s:RII = 17
let s:RIDMY = 18 let s:RIMDY = 18
let s:RID = 19 let s:RIYMD = 19
let s:RIM = 20 let s:RIDMY = 20
let s:RID = 21
let s:RIM = 22
let s:RIA = 23
let s:RIX = 24
let s:RIIX = 25
let s:RIO = 26
let s:RIIO = 27
let s:RIR = 28
let s:RIIR = 29
let s:RIPOW = 30
let s:RIIPOW = 31
" ------------------------------------------------------------------------------ " ------------------------------------------------------------------------------
" Public Interface: {{{1 " Public Interface: {{{1
com! -ra -complete=expression -na=? I call visincr#VisBlockIncr(s:I , <f-args>) com! -ra -complete=expression -na=? I call visincr#VisBlockIncr(s:I , <f-args>)
com! -ra -complete=expression -na=* II call visincr#VisBlockIncr(s:II , <f-args>) com! -ra -complete=expression -na=* II call visincr#VisBlockIncr(s:II , <f-args>)
com! -ra -complete=expression -na=* IMDY call visincr#VisBlockIncr(s:IMDY , <f-args>) com! -ra -complete=expression -na=* IMDY call visincr#VisBlockIncr(s:IMDY , <f-args>)
com! -ra -complete=expression -na=* IYMD call visincr#VisBlockIncr(s:IYMD , <f-args>) com! -ra -complete=expression -na=* IYMD call visincr#VisBlockIncr(s:IYMD , <f-args>)
com! -ra -complete=expression -na=* IDMY call visincr#VisBlockIncr(s:IDMY , <f-args>) com! -ra -complete=expression -na=* IDMY call visincr#VisBlockIncr(s:IDMY , <f-args>)
com! -ra -complete=expression -na=? ID call visincr#VisBlockIncr(s:ID , <f-args>) com! -ra -complete=expression -na=? ID call visincr#VisBlockIncr(s:ID , <f-args>)
com! -ra -complete=expression -na=? IM call visincr#VisBlockIncr(s:IM , <f-args>) com! -ra -complete=expression -na=? IM call visincr#VisBlockIncr(s:IM , <f-args>)
com! -ra -complete=expression -na=? IA call visincr#VisBlockIncr(s:IA , <f-args>) com! -ra -complete=expression -na=? IA call visincr#VisBlockIncr(s:IA , <f-args>)
com! -ra -complete=expression -na=? IX call visincr#VisBlockIncr(s:IX , <f-args>) com! -ra -complete=expression -na=? IX call visincr#VisBlockIncr(s:IX , <f-args>)
com! -ra -complete=expression -na=? IIX call visincr#VisBlockIncr(s:IIX , <f-args>) com! -ra -complete=expression -na=? IIX call visincr#VisBlockIncr(s:IIX , <f-args>)
com! -ra -complete=expression -na=? IO call visincr#VisBlockIncr(s:IO , <f-args>) com! -ra -complete=expression -na=? IO call visincr#VisBlockIncr(s:IO , <f-args>)
com! -ra -complete=expression -na=? IIO call visincr#VisBlockIncr(s:IIO , <f-args>) com! -ra -complete=expression -na=? IIO call visincr#VisBlockIncr(s:IIO , <f-args>)
com! -ra -complete=expression -na=? IR call visincr#VisBlockIncr(s:IR , <f-args>) com! -ra -complete=expression -na=? IR call visincr#VisBlockIncr(s:IR , <f-args>)
com! -ra -complete=expression -na=? IIR call visincr#VisBlockIncr(s:IIR , <f-args>) com! -ra -complete=expression -na=? IIR call visincr#VisBlockIncr(s:IIR , <f-args>)
com! -ra -complete=expression -na=? IPOW call visincr#VisBlockIncr(s:IPOW , <f-args>)
com! -ra -complete=expression -na=? IIPOW call visincr#VisBlockIncr(s:IIPOW , <f-args>)
com! -ra -complete=expression -na=? RI call visincr#VisBlockIncr(s:RI , <f-args>) com! -ra -complete=expression -na=? RI call visincr#VisBlockIncr(s:RI , <f-args>)
com! -ra -complete=expression -na=* RII call visincr#VisBlockIncr(s:RII , <f-args>) com! -ra -complete=expression -na=* RII call visincr#VisBlockIncr(s:RII , <f-args>)
com! -ra -complete=expression -na=* RIMDY call visincr#VisBlockIncr(s:RIMDY, <f-args>) com! -ra -complete=expression -na=* RIMDY call visincr#VisBlockIncr(s:RIMDY , <f-args>)
com! -ra -complete=expression -na=* RIYMD call visincr#VisBlockIncr(s:RIYMD, <f-args>) com! -ra -complete=expression -na=* RIYMD call visincr#VisBlockIncr(s:RIYMD , <f-args>)
com! -ra -complete=expression -na=* RIDMY call visincr#VisBlockIncr(s:RIDMY, <f-args>) com! -ra -complete=expression -na=* RIDMY call visincr#VisBlockIncr(s:RIDMY , <f-args>)
com! -ra -complete=expression -na=? RID call visincr#VisBlockIncr(s:RID , <f-args>) com! -ra -complete=expression -na=? RID call visincr#VisBlockIncr(s:RID , <f-args>)
com! -ra -complete=expression -na=? RIM call visincr#VisBlockIncr(s:RIM , <f-args>) com! -ra -complete=expression -na=? RIM call visincr#VisBlockIncr(s:RIM , <f-args>)
com! -ra -complete=expression -na=? RIPOW call visincr#VisBlockIncr(s:RIPOW , <f-args>)
com! -ra -complete=expression -na=* RIIPOW call visincr#VisBlockIncr(s:RIIPOW , <f-args>)
" --------------------------------------------------------------------- " ---------------------------------------------------------------------
" Restoration And Modelines: {{{1 " Restoration And Modelines: {{{1

View File

@ -1,7 +1,7 @@
" Language : Netrw Remote-Directory Listing Syntax " Language : Netrw Remote-Directory Listing Syntax
" Maintainer : Charles E. Campbell, Jr. " Maintainer : Charles E. Campbell, Jr.
" Last change: Aug 08, 2007 " Last change: Feb 06, 2008
" Version : 10 " Version : 12
" --------------------------------------------------------------------- " ---------------------------------------------------------------------
" Syntax Clearing: {{{1 " Syntax Clearing: {{{1
@ -13,23 +13,24 @@ endif
" --------------------------------------------------------------------- " ---------------------------------------------------------------------
" Directory List Syntax Highlighting: {{{1 " Directory List Syntax Highlighting: {{{1
syn cluster NetrwGroup contains=netrwHide,netrwSortBy,netrwSortSeq,netrwQuickHelp,netrwVersion,netrwCopyTgt 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 netrwSpecial "\%(\S\+ \)*\S\+[*|=]\ze\%(\s\{2,}\|$\)" contains=netrwClassify
syn match netrwDir "\.\{1,2}/" contains=netrwClassify syn match netrwDir "\.\{1,2}/" contains=netrwClassify
syn match netrwDir "\%(\S\+ \)*\S\+/" contains=netrwClassify syn match netrwDir "\%(\S\+ \)*\S\+/" contains=netrwClassify
syn match netrwDir "^\S*/" contains=netrwClassify syn match netrwSizeDate "\<\d\+\s\d\{1,2}/\d\{1,2}/\d\{4}\s" contains=netrwDateSep skipwhite nextgroup=netrwTime
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 netrwSymLink "\%(\S\+ \)*\S\+@\ze\%(\s\{2,}\|$\)" contains=netrwClassify syn match netrwExe "\%(\S\+ \)*\S\+\*\ze\%(\s\{2,}\|$\)" contains=netrwClassify
syn match netrwExe "\%(\S\+ \)*\S\+\*\ze\%(\s\{2,}\|$\)" contains=netrwClassify,netrwTreeIgnore syn match netrwTreeBar "^\%(| \)*" contains=netrwTreeBarSpace nextgroup=@netrwTreeGroup
syn match netrwTreeIgnore contained "^\%(| \)*" syn match netrwTreeBarSpace " " contained
syn match netrwClassify "[*=|@/]\ze\%(\s\{2,}\|$\)" contained syn match netrwClassify "[*=|@/]\ze\%(\s\{2,}\|$\)" contained
syn match netrwDateSep "/" contained syn match netrwDateSep "/" contained
syn match netrwTime "\d\{1,2}:\d\{2}:\d\{2}" contained contains=netrwTimeSep syn match netrwTime "\d\{1,2}:\d\{2}:\d\{2}" contained contains=netrwTimeSep
syn match netrwTimeSep ":" syn match netrwTimeSep ":"
syn match netrwComment '".*\%(\t\|$\)' contains=@NetrwGroup syn match netrwComment '".*\%(\t\|$\)' contains=@NetrwGroup
syn match netrwHide '^"\s*\(Hid\|Show\)ing:' skipwhite nextgroup=netrwHidePat syn match netrwHide '^"\s*\(Hid\|Show\)ing:' skipwhite nextgroup=netrwHidePat
syn match netrwSlash "/" contained syn match netrwSlash "/" contained
syn match netrwHidePat "[^,]\+" contained skipwhite nextgroup=netrwHideSep syn match netrwHidePat "[^,]\+" contained skipwhite nextgroup=netrwHideSep
@ -37,14 +38,31 @@ syn match netrwHideSep "," contained transparent skipwhite nextgroup=netrwH
syn match netrwSortBy "Sorted by" contained transparent skipwhite nextgroup=netrwList syn match netrwSortBy "Sorted by" contained transparent skipwhite nextgroup=netrwList
syn match netrwSortSeq "Sort sequence:" 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 netrwCopyTgt "Copy/Move Tgt:" contained transparent skipwhite nextgroup=netrwList
syn match netrwList ".*$" contained contains=netrwComma syn match netrwList ".*$" contained contains=netrwComma
syn match netrwComma "," contained syn match netrwComma "," contained
syn region netrwQuickHelp matchgroup=Comment start="Quick Help:\s\+" end="$" contains=netrwHelpCmd keepend 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 match netrwHelpCmd "\S\ze:" contained skipwhite nextgroup=netrwCmdSep
syn match netrwCmdSep ":" contained nextgroup=netrwCmdNote syn match netrwCmdSep ":" contained nextgroup=netrwCmdNote
syn match netrwCmdNote ".\{-}\ze " contained syn match netrwCmdNote ".\{-}\ze " contained
syn match netrwVersion "(netrw.*)" contained syn match netrwVersion "(netrw.*)" contained
" -----------------------------
" Special filetype highlighting {{{1
" -----------------------------
if exists("g:netrw_special_syntax") && netrw_special_syntax
syn match netrwBak "\(\S\+ \)*\S\+\.bak\>"
syn match netrwCompress "\(\S\+ \)*\S\+\.\%(gz\|bz2\|Z\|zip\)\>"
syn match netrwData "\(\S\+ \)*\S\+\.dat\>"
syn match netrwHdr "\(\S\+ \)*\S\+\.h\>"
syn match netrwLib "\(\S\+ \)*\S*\.\%(a\|so\|lib\|dll\)\>"
syn match netrwMakeFile "\<[mM]akefile\>\|\(\S\+ \)*\S\+\.mak\>"
syn match netrwObj "\(\S\+ \)*\S*\.\%(o\|obj\)\>"
syn match netrwTags "\<tags\>"
syn match netrwTags "\<\(ANmenu\|ANtags\)\>"
syn match netrwTilde "\(\S\+ \)*\S\+\~\>"
syn match netrwTmp "\<tmp\(\S\+ \)*\S\+\>\|\(\S\+ \)*\S*tmp\>"
endif
" --------------------------------------------------------------------- " ---------------------------------------------------------------------
" Highlighting Links: {{{1 " Highlighting Links: {{{1
if !exists("did_drchip_netrwlist_syntax") if !exists("did_drchip_netrwlist_syntax")
@ -57,14 +75,26 @@ if !exists("did_drchip_netrwlist_syntax")
hi link netrwHidePat Statement hi link netrwHidePat Statement
hi link netrwList Statement hi link netrwList Statement
hi link netrwVersion Identifier hi link netrwVersion Identifier
hi link netrwSymLink Special hi link netrwSymLink Question
hi link netrwExe PreProc hi link netrwExe PreProc
hi link netrwDateSep Delimiter hi link netrwDateSep Delimiter
hi link netrwTreeBar Special
hi link netrwTimeSep netrwDateSep hi link netrwTimeSep netrwDateSep
hi link netrwComma netrwComment hi link netrwComma netrwComment
hi link netrwHide netrwComment hi link netrwHide netrwComment
hi link netrwMarkFile Identifier hi link netrwMarkFile Identifier
" special syntax highlighting (see :he g:netrw_special_syntax)
hi link netrwBak NonText
hi link netrwCompress Folded
hi link netrwData DiffChange
hi link netrwLib DiffChange
hi link netrwMakefile DiffChange
hi link netrwObj Folded
hi link netrwTilde Folded
hi link netrwTmp Folded
hi link netrwTags Folded
endif endif
" Current Syntax: {{{1 " Current Syntax: {{{1