r1290 - in /trunk/packages/vim-scripts: autoload/Align.vim autoload/AlignMaps.vim debian/changelog debian/vim-scripts.status doc/Align.txt html/index.html html/plugin_AlignPlugin.vim.html plugin/AlignMaps.vim plugin/AlignMapsPlugin.vim plugin/cecutil.vim

jamessan at users.alioth.debian.org jamessan at users.alioth.debian.org
Fri Dec 5 19:59:30 UTC 2008


Author: jamessan
Date: Fri Dec  5 19:59:30 2008
New Revision: 1290

URL: http://svn.debian.org/wsvn/pkg-vim/?sc=1&rev=1290
Log:
Update Align

Added:
    trunk/packages/vim-scripts/autoload/AlignMaps.vim
    trunk/packages/vim-scripts/plugin/AlignMapsPlugin.vim   (contents, props changed)
      - copied, changed from r1284, trunk/packages/vim-scripts/plugin/AlignMaps.vim
Removed:
    trunk/packages/vim-scripts/plugin/AlignMaps.vim
Modified:
    trunk/packages/vim-scripts/autoload/Align.vim
    trunk/packages/vim-scripts/debian/changelog
    trunk/packages/vim-scripts/debian/vim-scripts.status
    trunk/packages/vim-scripts/doc/Align.txt
    trunk/packages/vim-scripts/html/index.html
    trunk/packages/vim-scripts/html/plugin_AlignPlugin.vim.html
    trunk/packages/vim-scripts/plugin/cecutil.vim

Modified: trunk/packages/vim-scripts/autoload/Align.vim
URL: http://svn.debian.org/wsvn/pkg-vim/trunk/packages/vim-scripts/autoload/Align.vim?rev=1290&op=diff
==============================================================================
--- trunk/packages/vim-scripts/autoload/Align.vim (original)
+++ trunk/packages/vim-scripts/autoload/Align.vim Fri Dec  5 19:59:30 2008
@@ -1,7 +1,7 @@
 " Align: tool to align multiple fields based on one or more separators
 "   Author:		Charles E. Campbell, Jr.
-"   Date:		Dec 20, 2007
-"   Version:	33
+"   Date:		Oct 08, 2008
+"   Version:	34
 " GetLatestVimScripts: 294 1 :AutoInstall: Align.vim
 " GetLatestVimScripts: 1066 1 :AutoInstall: cecutil.vim
 " Copyright:    Copyright (C) 1999-2007 Charles E. Campbell, Jr. {{{1
@@ -24,19 +24,23 @@
 if exists("g:loaded_align") || &cp
  finish
 endif
-let g:loaded_align = "v33"
-let s:keepcpo      = &cpo
+let g:loaded_align = "v34"
+if v:version < 700
+ echohl WarningMsg
+ echo "***warning*** this version of Align needs vim 7.0"
+ echohl Normal
+ finish
+endif
+let s:keepcpo= &cpo
 set cpo&vim
 "DechoTabOn
 
 " ---------------------------------------------------------------------
 " Debugging Support:
-"if !exists("g:loaded_Decho") "Decho
-" runtime plugin/Decho.vim
-"endif	" Decho
-
-" ---------------------------------------------------------------------
-" AlignCtrl: enter alignment patterns here {{{1
+"if !exists("g:loaded_Decho") | runtime plugin/Decho.vim | endif
+
+" ---------------------------------------------------------------------
+" Align#AlignCtrl: enter alignment patterns here {{{1
 "
 "   Styles   =  all alignment-break patterns are equivalent
 "            C  cycle through alignment-break pattern(s)
@@ -135,6 +139,9 @@
    " ----------------------
    " List current selection
    " ----------------------
+   if !exists("s:AlignPatQty")
+	let s:AlignPatQty= 0
+   endif
    echo "AlignCtrl<".s:AlignCtrl."> qty=".s:AlignPatQty." AlignStyle<".s:AlignStyle."> Padding<".s:AlignPrePad."|".s:AlignPostPad."> LeadingWS=".s:AlignLeadKeep." AlignSep=".s:AlignSep
 "   call Decho("AlignCtrl<".s:AlignCtrl."> qty=".s:AlignPatQty." AlignStyle<".s:AlignStyle."> Padding<".s:AlignPrePad."|".s:AlignPostPad."> LeadingWS=".s:AlignLeadKeep." AlignSep=".s:AlignSep)
    if      exists("s:AlignGPat") && !exists("s:AlignVPat")
@@ -308,7 +315,7 @@
 endfun
 
 " ---------------------------------------------------------------------
-" MakeSpace: returns a string with spacecnt blanks {{{1
+" s:MakeSpace: returns a string with spacecnt blanks {{{1
 fun! s:MakeSpace(spacecnt)
 "  call Dfunc("MakeSpace(spacecnt=".a:spacecnt.")")
   let str      = ""
@@ -448,8 +455,8 @@
 "  call Decho("lines[".begline.",".endline."] col[".begcol.",".endcol."] ragged=".ragged." AlignCtrl<".s:AlignCtrl.">")
 
   " Keep user options
-  let etkeep   = &et
-  let pastekeep= &paste
+  let etkeep   = &l:et
+  let pastekeep= &l:paste
   setlocal et paste
 
   " convert selected range of lines to use spaces instead of tabs
@@ -735,8 +742,8 @@
 "  call Decho("end of two pass loop")
 
   " Restore user options
-  let &et    = etkeep
-  let &paste = pastekeep
+  let &l:et    = etkeep
+  let &l:paste = pastekeep
 
   if exists("s:DoAlignPop")
    " AlignCtrl Map support
@@ -754,7 +761,7 @@
 endfun
 
 " ---------------------------------------------------------------------
-" AlignPush: this command/function pushes an alignment control string onto a stack {{{1
+" Align#AlignPush: this command/function pushes an alignment control string onto a stack {{{1
 fun! Align#AlignPush()
 "  call Dfunc("AlignPush()")
 
@@ -766,6 +773,9 @@
   endif
 
   " construct an AlignCtrlStack entry
+  if !exists("s:AlignSep")
+   let s:AlignSep= ''
+  endif
   let s:AlignCtrlStack_{s:AlignCtrlStackQty}= s:AlignCtrl.'p'.s:AlignPrePad.'P'.s:AlignPostPad.s:AlignLeadKeep.s:AlignStyle.s:AlignSep
 "  call Decho("AlignPush: AlignCtrlStack_".s:AlignCtrlStackQty."<".s:AlignCtrlStack_{s:AlignCtrlStackQty}.">")
 
@@ -785,7 +795,7 @@
 endfun
 
 " ---------------------------------------------------------------------
-" AlignPop: this command/function pops an alignment pattern from a stack {{1
+" Align#AlignPop: this command/function pops an alignment pattern from a stack {{{1
 "           and into the AlignCtrl variables.
 fun! Align#AlignPop()
 "  call Dfunc("Align#AlignPop()")
@@ -831,7 +841,7 @@
 endfun
 
 " ---------------------------------------------------------------------
-" AlignReplaceQuotedSpaces: {{{1
+" Align#AlignReplaceQuotedSpaces: {{{1
 fun! Align#AlignReplaceQuotedSpaces() 
 "  call Dfunc("AlignReplaceQuotedSpaces()")
 
@@ -876,13 +886,76 @@
 
 " ---------------------------------------------------------------------
 " s: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.
+" However, <q-args> doesn't split at all, so this function returns a list
+" of arguments which has been:
+"   * split at whitespace
+"   * unless inside "..."s.  One may escape characters with a backslash inside double quotes.
+" along with a leading length-of-list.
+"
+"   Examples:   %Align "\""   will align on "s
+"               %Align " "    will align on spaces
+"
 " The resulting list:  qarglist[0] corresponds to a:0
 "                      qarglist[i] corresponds to a:{i}
 fun! s:QArgSplitter(qarg)
 "  call Dfunc("s:QArgSplitter(qarg<".a:qarg.">)")
-  let qarglist   = split(a:qarg)
+
+  if a:qarg =~ '".*"'
+   " handle "..." args, which may include whitespace
+   let qarglist = []
+   let args     = a:qarg
+"   call Decho("handle quoted arguments: args<".args.">")
+   while args != ""
+	let iarg   = 0
+	let arglen = strlen(args)
+"	call Decho("args[".iarg."]<".args[iarg]."> arglen=".arglen)
+	" find index to first not-escaped '"'
+	while args[iarg] != '"' && iarg < arglen
+	 if args[iarg] == '\'
+	  let args= strpart(args,1)
+	 endif
+	 let iarg= iarg + 1
+	endwhile
+"	call Decho("args<".args."> iarg=".iarg." arglen=".arglen)
+
+	if iarg > 0
+	 " handle left of quote or remaining section
+"	 call Decho("handle left of quote or remaining section")
+	 if args[iarg] == '"'
+	  let qarglist= qarglist + split(strpart(args,0,iarg-1))
+	 else
+	  let qarglist= qarglist + split(strpart(args,0,iarg))
+	 endif
+	 let args    = strpart(args,iarg)
+	 let arglen  = strlen(args)
+
+	elseif iarg < arglen && args[0] == '"'
+	 " handle "quoted" section
+"	 call Decho("handle quoted section")
+	 let iarg= 1
+	 while args[iarg] != '"' && iarg < arglen
+	  if args[iarg] == '\'
+	   let args= strpart(args,1)
+	  endif
+	  let iarg= iarg + 1
+	 endwhile
+"	 call Decho("args<".args."> iarg=".iarg." arglen=".arglen)
+	 if args[iarg] == '"'
+	  call add(qarglist,strpart(args,1,iarg-1))
+	  let args= strpart(args,iarg+1)
+	 else
+	  let qarglist = qarglist + split(args)
+	  let args     = ""
+	 endif
+	endif
+"	call Decho("qarglist".string(qarglist)." iarg=".iarg." args<".args.">")
+   endwhile
+
+  else
+   " split at all whitespace
+   let qarglist= split(a:qarg)
+  endif
+
   let qarglistlen= len(qarglist)
   let qarglist   = insert(qarglist,qarglistlen)
 "  call Dret("s:QArgSplitter ".string(qarglist))
@@ -891,7 +964,7 @@
 
 " ---------------------------------------------------------------------
 " s:Strlen: this function returns the length of a string, even if its {{{1
-"           using two-byte etc characters.  Depends on virtcol().
+"           using two-byte etc characters.
 "           Currently, its only used if g:Align_xstrlen is set to a
 "           nonzero value.  Solution from Nicolai Weibull, vim docs
 "           (:help strlen()), Tony Mechelynck, and my own invention.

Added: trunk/packages/vim-scripts/autoload/AlignMaps.vim
URL: http://svn.debian.org/wsvn/pkg-vim/trunk/packages/vim-scripts/autoload/AlignMaps.vim?rev=1290&op=file
==============================================================================
--- trunk/packages/vim-scripts/autoload/AlignMaps.vim (added)
+++ trunk/packages/vim-scripts/autoload/AlignMaps.vim Fri Dec  5 19:59:30 2008
@@ -1,0 +1,330 @@
+" AlignMaps.vim : support functions for AlignMaps
+"   Author: Charles E. Campbell, Jr.
+"   Date:   Oct 24, 2008
+" Version:           40
+" ---------------------------------------------------------------------
+"  Load Once: {{{1
+if &cp || exists("g:loaded_AlignMaps")
+ finish
+endif
+let g:loaded_AlignMaps= "v40"
+let s:keepcpo         = &cpo
+set cpo&vim
+
+" =====================================================================
+" Functions: {{{1
+
+" ---------------------------------------------------------------------
+" AlignMaps#WrapperStart: {{{2
+fun! AlignMaps#WrapperStart(vis)
+"  call Dfunc("AlignMaps#WrapperStart(vis=".a:vis.")")
+
+  if a:vis
+   norm! '<ma'>
+  endif
+
+  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("AlignMaps#WrapperStart : alignmaps_wrapcnt=".s:alignmaps_wrapcnt." my=".line("'y")." mz=".line("'z"))
+endfun
+
+" ---------------------------------------------------------------------
+" AlignMaps#WrapperEnd:	{{{2
+fun! AlignMaps#WrapperEnd()
+"  call Dfunc("AlignMaps#WrapperEnd() alignmaps_wrapcnt=".s:alignmaps_wrapcnt." my=".line("'y")." mz=".line("'z"))
+
+  " remove trailing white space introduced by whatever in the modification zone
+  '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("AlignMaps#WrapperEnd : alignmaps_wrapcnt=".s:alignmaps_wrapcnt." my=".line("'y")." mz=".line("'z"))
+endfun
+
+" ---------------------------------------------------------------------
+" AlignMaps#StdAlign: some semi-standard align calls {{{2
+fun! AlignMaps#StdAlign(mode)
+"  call Dfunc("AlignMaps#StdAlign(mode=".a:mode.")")
+  if     a:mode == 1
+   " align on @
+"   call Decho("align on @")
+   AlignCtrl mIp1P1=l @
+   'a,.Align
+  elseif a:mode == 2
+   " align on @, retaining all initial white space on each line
+"   call Decho("align on @, retaining all initial white space on each line")
+   AlignCtrl mWp1P1=l @
+   'a,.Align
+  elseif a:mode == 3
+   " like mode 2, but ignore /* */-style comments
+"   call Decho("like mode 2, but ignore /* */-style comments")
+   AlignCtrl v ^\s*/[/*]
+   AlignCtrl mWp1P1=l @
+   'a,.Align
+  else
+   echoerr "(AlignMaps) AlignMaps#StdAlign doesn't support mode#".a:mode
+  endif
+"  call Dret("AlignMaps#StdAlign")
+endfun
+
+" ---------------------------------------------------------------------
+" AlignMaps#CharJoiner: joins lines which end in the given character (spaces {{{2
+"             at end are ignored)
+fun! AlignMaps#CharJoiner(chr)
+"  call Dfunc("AlignMaps#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("AlignMaps#CharJoiner")
+endfun
+
+" ---------------------------------------------------------------------
+" AlignMaps#Equals: supports \t= and \T= {{{2
+fun! AlignMaps#Equals()
+"  call Dfunc("AlignMaps#Equals()")
+  'a,'zs/\s\+\([*/+\-%|&\~^]\==\)/ \1/e
+  'a,'zs@ \+\([*/+\-%|&\~^]\)=@\1=@ge
+  'a,'zs/==/\="\<Char-0xff>\<Char-0xff>"/ge
+  'a,'zs/!=/\="!\<Char-0xff>"/ge
+  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"
+"   call Decho("exception for ".&ft)
+   'a,'z-1v/^\s*\/[*/]/s/\/[*/]/@&@/e
+   'a,'z-1v/^\s*\/[*/]/s/\*\//@&/e
+   if exists("g:mapleader")
+	exe "norm 'zk"
+	call AlignMaps#StdAlign(1)
+   else
+	exe "norm 'zk"
+	call AlignMaps#StdAlign(1)
+   endif
+   'y,'zs/^\(\s*\) @/\1/e
+  endif
+  'a,'z-1s/\%xff/=/ge
+  'y,'zs/ @//eg
+"  call Dret("AlignMaps#Equals")
+endfun
+
+" ---------------------------------------------------------------------
+" AlignMaps#Afnc: useful for splitting one-line function beginnings {{{2
+"            into one line per argument format
+fun! AlignMaps#Afnc()
+"  call Dfunc("AlignMaps#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=". at 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
+  sil! 'y+1,'zv/^\//s/\w\zs\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("AlignMaps#Afnc")
+endfun
+
+" ---------------------------------------------------------------------
+"  AlignMaps#FixMultiDec: converts a   type arg,arg,arg;   line to multiple lines {{{2
+fun! AlignMaps#FixMultiDec()
+"  call Dfunc("AlignMaps#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<". at x.">")
+
+  " transform line
+  exe 's/,/;\r'. at x.' /ge'
+
+  "restore register x
+  let @x= xkeep
+
+"  call Dret("AlignMaps#FixMultiDec : my=".line("'y")." mz=".line("'z"))
+endfun
+
+" ---------------------------------------------------------------------
+"  Restore: {{{1
+let &cpo= s:keepcpo
+unlet s:keepcpo
+" vim: ts=4 fdm=marker

Modified: trunk/packages/vim-scripts/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-vim/trunk/packages/vim-scripts/debian/changelog?rev=1290&op=diff
==============================================================================
--- trunk/packages/vim-scripts/debian/changelog (original)
+++ trunk/packages/vim-scripts/debian/changelog Fri Dec  5 19:59:30 2008
@@ -1,7 +1,7 @@
 vim-scripts (20081205-1) UNRELEASED; urgency=low
 
   * Updated addons:
-    - supertab, NERD_commenter, xmledit (Closes: #503707), vcscommand
+    - supertab, NERD_commenter, xmledit (Closes: #503707), vcscommand, Align
   * Renamed addons:
     - themes => color_sample_pack
 

Modified: trunk/packages/vim-scripts/debian/vim-scripts.status
URL: http://svn.debian.org/wsvn/pkg-vim/trunk/packages/vim-scripts/debian/vim-scripts.status?rev=1290&op=diff
==============================================================================
--- trunk/packages/vim-scripts/debian/vim-scripts.status (original)
+++ trunk/packages/vim-scripts/debian/vim-scripts.status Fri Dec  5 19:59:30 2008
@@ -113,10 +113,10 @@
 author:      Charles Campbell
 author_url:  http://www.vim.org/account/profile.php?user_id=96
 email:       drchip at campbellfamily.biz
-license:     GNU GPL, see /usr/share/common-licenses/GPL-2
-extras:	     doc/Align.txt, plugin/AlignMaps.vim, plugin/cecutil.vim, autoload/Align.vim
+license:     licese [4], see below
+extras:	     doc/Align.txt, plugin/AlignMapsPlugin.vim, plugin/cecutil.vim, autoload/Align.vim, autoload/AlignMaps.vim
 disabledby:  let loaded_alignPlugin = 1
-version:     33/39
+version:     34/40
 
 script_name: plugin/cvsmenu.vim
 addon:       cvsmenu

Modified: trunk/packages/vim-scripts/doc/Align.txt
URL: http://svn.debian.org/wsvn/pkg-vim/trunk/packages/vim-scripts/doc/Align.txt?rev=1290&op=diff
==============================================================================
--- trunk/packages/vim-scripts/doc/Align.txt (original)
+++ trunk/packages/vim-scripts/doc/Align.txt Fri Dec  5 19:59:30 2008
@@ -1,11 +1,11 @@
-*align.txt*	The Alignment Tool			Dec 20, 2007
-
-Author:  Charles E. Campbell, Jr.  <NdrOchip at ScampbellPfamily.AbizM>
-	  (remove NOSPAM from Campbell's email first)
-Copyright: (c) 2004-2007 by Charles E. Campbell, Jr.	*Align-copyright*
+*align.txt*	The Alignment Tool			Oct 29, 2008
+
+Author:    Charles E. Campbell, Jr.  <NdrOchip at ScampbellPfamily.AbizM>
+           (remove NOSPAM from Campbell's email first)
+Copyright: (c) 2004-2008 by Charles E. Campbell, Jr.	*Align-copyright*
            The VIM LICENSE applies to Align.vim, AlignMaps.vim, and Align.txt
            (see |copyright|) except use "Align and AlignMaps" instead of "Vim"
-	   No warranty, express or implied.  Use At-Your-Own-Risk.
+           NO WARRANTY, EXPRESS OR IMPLIED.  USE AT-YOUR-OWN-RISK.
 
 ==============================================================================
 1. Contents					*align* *align-contents* {{{1
@@ -13,6 +13,8 @@
 	1. Contents.................: |align-contents|
 	2. Alignment Manual.........: |align-manual|
 	3. Alignment Usage..........: |align-usage|
+	   Alignment Concepts.......: |align-concepts|
+	   Alignment Commands.......: |align-commands|
 	   Alignment Control........: |align-control|
 	     Separators.............: |alignctrl-separators|
 	     Initial Whitespace.....: |alignctrl-w| |alignctrl-W| |alignctrl-I|
@@ -25,7 +27,7 @@
 	     Padding................: |alignctrl-p| |alignctrl-P|
 	     Current Options........: |alignctrl-settings| |alignctrl-|
 	   Alignment................: |align-align|
-	   Maps.....................: |align-maps|
+	4. Alignment Maps...........: |align-maps|
 	     \a,....................: |alignmap-a,|
 	     \a?....................: |alignmap-a?|
 	     \a<....................: |alignmap-a<|
@@ -44,7 +46,7 @@
 	     \t=....................: |alignmap-t=|
 	     \T=....................: |alignmap-T=|
 	     \Htd...................: |alignmap-Htd|
-	4. Alignment Tool History...: |align-history|
+	5. Alignment Tool History...: |align-history|
 
 ==============================================================================
 2. Align Manual			*alignman* *alignmanual* *align-manual* {{{1
@@ -130,7 +132,73 @@
 ==============================================================================
 3. Alignment Usage				*alignusage* *align-usage* {{{1
 
-COMMANDS						{{{2
+
+ALIGNMENT CONCEPTS			*align-concept* *align-concepts* {{{2
+
+	The typical text to be aligned is considered to be:
+
+		* composed of two or more fields
+		* separated by one or more separator pattern(s):
+		* two or more lines
+>
+		ws field ws separator ws field ws separator ...
+		ws field ws separator ws field ws separator ...
+<
+	where "ws" stands for "white space" such as blanks and/or tabs,
+	and "fields" are arbitrary text.  For example, consider >
+
+		x= y= z= 3;
+		xx= yy= zz= 4;
+		zzz= yyy= zzz= 5;
+		a= b= c= 3;
+<
+	Assume that it is desired to line up all the "=" signs; these,
+	then, are the separators.  The fields are composed of all the
+	alphameric text.  Assuming they lie on lines 1-4, one may align
+	those "=" signs with: >
+		:AlignCtrl l
+		:1,4Align =
+<	The result is: >
+		x   = y   = z   = 3;
+		xx  = yy  = zz  = 4;
+		zzz = yyy = zzz = 5;
+		a   = b   = c   = 3;
+
+<	Note how each "=" sign is surrounded by a single space; the
+	default padding is p1P1 (p1 means one space before the separator,
+	and P1 means one space after it).  If you wish to change the
+	padding, say to no padding, use  (see |alignctrl-p|) >
+		:AlignCtrl lp0P0
+
+<	Next, note how each field is left justified; that's what the "l"
+	(a small letter "ell") does.  If right-justification of the fields
+	had been desired, an "r" could've been used: >
+		:AlignCtrl r
+<	yielding >
+		  x =   y =   z = 3;
+		 xx =  yy =  zz = 4;
+		zzz = yyy = zzz = 5;
+		  a =   b =   c = 3;
+<	There are more options available for field justification: see
+	|alignctrl-c|.
+
+	Separators, although commonly only one character long, are actually
+	specified by regular expressions (see |regexp|), and one may left
+	justify, right justify, or center them, too (see |alignctrl-<|).
+
+	Assume that for some reason a left-right-left-right-... justification
+	sequence was wished.  This wish is simply achieved with >
+		:AlignCtrl lr
+		:1,4Align =
+<	because the justification commands are considered to be "cylic"; ie.
+	lr is the same as lrlrlrlrlrlrlr...
+
+	There's a lot more discussed under |alignctrl|; hopefully the examples
+	there will help, too.
+
+
+ALIGNMENT COMMANDS			*align-command* *align-commands* {{{2
+
         The <Align.vim> script includes two primary commands and two
 	minor commands:
 
@@ -158,10 +226,13 @@
 			ex. :%Align! p2P2 =
 <		      This will align all "=" in the file with two padding
 		      spaces on both sides of each "=" sign.
-		      NOTE ON PATTERNS:~
-		      Align and AlignCtrl use |<f-args>| to obtain their
-		      input patterns; hence, to get a \ you'll need to enter
-		      two backslashes: \\.
+
+		      NOTE ON USING PATTERNS WITH ALIGN:~
+		      Align and AlignCtrl use |<q-args>| to obtain their
+		      input patterns and they use an internal function to 
+		      split arguments at whitespace unless inside "..."s.
+		      One may escape characters inside a double-quote string
+		      by preceding such characters with a backslash.
 
 	  AlignPush : this command/function pushes the current AlignCtrl
 	              state onto an internal stack. >
@@ -179,10 +250,11 @@
 			    restores the AlignCtrl settings when AlignPush
 			    was last used.
 <
-ALIGNMENT OPTIONS			*align-options*	{{{2
-
-		    *align-utf8* *align-utf* *align-codepoint* *align-strlen*
-	For those of you who are using 2-byte (or more) characters such as is
+
+ALIGNMENT OPTIONS			*align-option* *align-options* {{{2
+    *align-utf8* *align-utf* *align-codepoint* *align-strlen* *align-multibyte*
+
+	For those of you who are using 2-byte (or more) characters such as are
 	available with utf-8, Align now provides a special option which you
 	may choose based upon your needs:
 
@@ -190,32 +262,31 @@
 >
 			let g:Align_xstrlen= 1:
 <
-	Number of spacing codepoints (Latin a + combining circumflex is one spacing~
-	codepoint; a hard tab is one; wide and narrow CJK are one each; etc.)~
+	Number of spacing codepoints (Latin a + combining circumflex is one~
+	spacing codepoint; a hard tab is one; wide and narrow CJK are one~
+	each; etc.)~
 >
 			let g:Align_xstrlen= 2
 <
 	Virtual length (counting, for instance, tabs as anything between 1 and~
-	'tabstop', wide CJK as 2 rather than 1, Arabic alif as zero when immediately~
-	preceded by lam, one otherwise, etc.)~
+	'tabstop', wide CJK as 2 rather than 1, Arabic alif as zero when~
+	immediately preceded by lam, one otherwise, etc.)~
 >
-			let g:Align_xstrlen= 2
+			let g:Align_xstrlen= 3
 <
 	By putting one of these settings into your <.vimrc>, Align will use an
 	internal (interpreted) function to determine a string's length instead
 	of the Vim's built-in |strlen()| function.  As the function is
 	interpreted, Align will run a bit slower but will handle such strings
-	correctly.  The last setting (g:Align_xstrlen= 2) probably will run
-	the slowest but be the most accurate.
-
-
-ALIGNMENT CONTROL			*alignctrl* *align-control*	{{{2
->
-	AlignCtrl   [=Clrc-+:pPIWw] [..list-of-separator-patterns..]
-<
-	The AlignCtrl command doesn't do the alignment operation itself; instead,
-	it permits the user to specify various alignment options before the
-	alignment is done.
+	correctly.  The last setting (g:Align_xstrlen= 3) probably will run
+	the slowest but be the most accurate.  (thanks to Tony Mechelynck for
+	these)
+
+
+ALIGNMENT CONTROL				*alignctrl* *align-control* {{{2
+
+	This command doesn't do the alignment operation itself; instead, it
+	controls the subsequent alignment operation(s).
 
 	The first argument to AlignCtrl is a string which may contain one or
 	more alignment control commands.  Most of the commands are single
@@ -223,17 +294,17 @@
 	interpret digits following the p or P as specifying padding about the
 	separator.
 
-	
-	Separators				*alignctrl-separators* {{{3
-
 	The typical text line is considered to be composed of two or more
 	fields separated by one or more separator pattern(s):
 >
-		ws field ws separator ws field ws separator ...  < where "ws"
-<
-	stands for "white space" such as blanks and/or tabs.
-
-	As a result, separators may  not have white space (tabs or blanks) on
+		ws field ws separator ws field ws separator ...
+<
+	where "ws" stands for "white space" such as blanks and/or tabs.
+
+	
+	SEPARATORS				*alignctrl-separators* {{{3
+
+	As a result, separators may not have white space (tabs or blanks) on
 	their outsides (ie.  ":  :" is fine as a separator, but " :: " is
 	not).  Usually such separators are not needed.
 
@@ -243,14 +314,14 @@
 	(ie. @), and then perform a substitute to revert the separators back
 	to their desired condition (ie. s/@/  ::  /g).
 
-	The Align() function will first convert tabs over the region into
+	The Align#Align() function will first convert tabs over the region into
 	spaces and then apply alignment control.  Except for initial white
 	space, white space surrounding the fields is ignored.  One has three
 	options just for handling initial white space:
 
 
-	--- 						*alignctrl-w* {{{3
-	wWI 	INITIAL WHITE SPACE			*alignctrl-W*
+	--- 						*alignctrl-w*
+	wWI 	INITIAL WHITE SPACE			*alignctrl-W* {{{3
 	--- 						*alignctrl-I*
 		w : ignore all selected lines' initial white space
 		W : retain all selected lines' initial white space
@@ -258,25 +329,25 @@
 		    re-use it for subsequent lines
 
 	Example: Leading white space options: >
-                         +---------------+-------------------+----------------+
-	                 |AlignCtrl w= :=|  AlignCtrl W= :=  |AlignCtrl I= := |
-      +------------------+---------------+-------------------+----------------+
-      |     Original     |   w option    |     W option      |    I option    |
-      +------------------+---------------+-------------------+----------------+
-      |   a := baaa      |a     := baaa  |   a      : = baaa |  a     := baaa |
-      | caaaa := deeee   |caaaa := deeee | caaaa    : = deeee|  caaaa := deeee|
-      |       ee := f    |ee    := f     |       ee : = f    |  ee    := f    |
-      +------------------+---------------+-------------------+----------------+
+                         +---------------+-------------------+-----------------+
+	                 |AlignCtrl w= :=|  AlignCtrl W= :=  | AlignCtrl I= := |
+      +------------------+---------------+-------------------+-----------------+
+      |     Original     |   w option    |     W option      |     I option    |
+      +------------------+---------------+-------------------+-----------------+
+      |   a := baaa      |a     := baaa  |   a      : = baaa |   a     := baaa |
+      | caaaa := deeee   |caaaa := deeee | caaaa    : = deeee|   caaaa := deeee|
+      |       ee := f    |ee    := f     |       ee : = f    |   ee    := f    |
+      +------------------+---------------+-------------------+-----------------+
 <
 	The original has at least one leading white space on every line.
 	Using Align with w eliminated each line's leading white space.
 	Using Align with W preserved  each line's leading white space.
-	Using Align with I applied the first line's leading two spaces
-	to each line.
-
-
-	------						*alignctrl-l* {{{3
-	lrc-+:	FIELD JUSTIFICATION			*alignctrl-r*
+	Using Align with I applied the first line's leading white space
+	                   (three spaces) to each line.
+
+
+	------						*alignctrl-l*
+	lrc-+:	FIELD JUSTIFICATION			*alignctrl-r* {{{3
 	------						*alignctrl-c*
 
 	With "lrc", the fields will be left-justified, right-justified, or
@@ -311,9 +382,9 @@
 
 	Even more separator control is available.  With "-+:":
 
-	    - : skip treating the separator as a separator.	*alignctrl--* {{{3
-	    + : repeat use of the last "lrc" justification	*alignctrl-+*
-	    : : treat the rest of the line as a single field	*alignctrl-:*
+	    - : skip treating the separator as a separator.   *alignctrl--*
+	    + : repeat use of the last "lrc" justification    *alignctrl-+*
+	    : : treat the rest of the line as a single field  *alignctrl-:*
 
      Example: More justification options:  Align = >
      +------------+---------------+--------------------+---------------+
@@ -359,8 +430,8 @@
 	    etc.
 
 
-	---							*alignctrl-=* {{{3
-	=C	CYCLIC VS ALL-ACTIVE SEPARATORS			*alignctrl-C*
+	---						     *alignctrl-=*
+	=C	CYCLIC VS ALL-ACTIVE SEPARATORS		     *alignctrl-C* {{{3
 	---
 
 	The separators themselves may be considered as equivalent and
@@ -456,8 +527,8 @@
 	field | field | field & field - field | field | field & field - ...
 <
 
-	---						*alignctrl-<* {{{3
-	<>|	SEPARATOR JUSTIFICATION			*alignctrl->*
+	---						*alignctrl-<*
+	<>|	SEPARATOR JUSTIFICATION			*alignctrl->* {{{3
 	---						*alignctrl-|*
 
 	Separators may be of differing lengths as shown in the example below.
@@ -484,15 +555,15 @@
 	+---------------------+---------------------+---------------------+
 <
 
-	---						*alignctrl-g* {{{3
-	gv	SELECTIVE APPLICATION			*alignctrl-v*
+	---						*alignctrl-g*
+	gv	SELECTIVE APPLICATION			*alignctrl-v* {{{3
 	---
 
 
 	These two options provide a way to select (g) or to deselect (v) lines
 	based on a pattern.  Ideally :g/pat/Align  would work; unfortunately
-	it results in Align() being called on each line satisfying the pattern
-	separately. >
+	it results in Align#Align() being called on each line satisfying the
+	pattern separately. >
 
 		AlignCtrl g pattern
 <
@@ -533,17 +604,17 @@
 	 m	MAP SUPPORT				*alignctrl-m* {{{3
 	---
 
-	This option primarily supports the development of maps.  The AlignCtrl
-	call will first do an AlignPush() (ie. retain current alignment
-	control settings).  The next Align() will, in addition to its
-	alignment job, finish up with an AlignPop().  Thus the AlignCtrl
-	settings that follow the "m" are only temporarily in effect for just
-	the next Align().
+	This option primarily supports the development of maps.  The
+	Align#AlignCtrl() call will first do an Align#AlignPush() (ie. retain
+	current alignment control settings).  The next Align#Align() will, in
+	addition to its alignment job, finish up with an Align#AlignPop().
+	Thus the Align#AlignCtrl settings that follow the "m" are only
+	temporarily in effect for just the next Align#Align().
 
 
 	---
-	p###						*alignctrl-p* {{{3
-	P###	PADDING					*alignctrl-P*
+	p###						*alignctrl-p*
+	P###	PADDING					*alignctrl-P* {{{3
 	---
 
 	These two options control pre-padding and post-padding with blanks
@@ -570,8 +641,8 @@
 		pre-pad the sixth  "=" with two blanks,
 	        etc.
 
-	---------------				*alignctrl-settings* {{{3
-	No option given		DISPLAY STATUS	*alignctrl-*
+	---------------				*alignctrl-settings*
+	No option given		DISPLAY STATUS	*alignctrl-*		{{{3
 	---------------				*alignctrl-no-option*
 
 	AlignCtrl, when called with no arguments, will display the current
@@ -587,48 +658,47 @@
 
 	One may get a string which can be fed back into AlignCtrl: >
 
-		:let alignctrl= AlignCtrl()
+		:let alignctrl= Align#AlignCtrl()
 <
 	This form will put a string describing the current AlignCtrl options,
-	except for the "g" and "v" patterns, into a variable.  The AlignCtrl()
-	function will still echo its settings, however.  One can feed any
-	non-supported "option" to AlignCtrl() to prevent this, however: >
-
-		:let alignctrl= AlignCtrl("d")
+	except for the "g" and "v" patterns, into a variable.  The
+	Align#AlignCtrl() function will still echo its settings, however.  One
+	can feed any non-supported "option" to AlignCtrl() to prevent this,
+	however: >
+
+		:let alignctrl= Align#AlignCtrl("d")
 <
 
 ALIGNMENT						*align-align* {{{2
->
-	[range]Align  [..list-of-separators..]
-	[range]Align! [AlignCtrl settings] [..list-of-separators..]
-<
-	Once the alignment control options (see |alignctrl|) have been
-	entered, the user specifies a range of lines for the Align
-	command/function to do its thing.  Alignment is often done on a
-	line-range basis, but one may also restrict alignment to a visual
-	block using ctrl-v.  For any visual mode, one types the colon (:) and
-	then "Align".
-
-	One may, of course, specify a range of lines where the |range| is the
-	usual Vim-powered set of possibilities; the list of separators is the
-	same as that provided via AlignCtrl.  There is only one list of
-	separators, but either :AlignCtrl or :Align can be used to specify that
-	list.
-
-	The alternative form of the Align command can handle both alignment
+
+	Once the alignment control has been determined, the user specifies a
+	range of lines for the Align command/function to do its thing.
+	Alignment is often done on a line-range basis, but one may also
+	restrict alignment to a visual block using ctrl-v.  For any visual
+	mode, one types the colon (:) and then "Align".  One may, of course,
+	specify a range of lines: >
+
+		:[range]Align [list-of-separators]
+<
+	where the |range| is the usual Vim-powered set of possibilities; the
+	list of separators is the same as the AlignCtrl capability.  There is
+	only one list of separators, but either AlignCtrl or Align can be used
+	to specify that list.
+
+	An alternative form of the Align command can handle both alignment
 	control and the separator list: >
 
 		:[range]Align! [alignment-control-string] [list-of-separators]
 <
-	The alignment control string provided this way will be applied only
-	for this particular application of Align (it uses |alignctrl-m|).  The
-	"g pattern" and "v pattern" alignment controls (see |alignctrl-g| and
-	|alignctrl-v|) are also available via this form of the Align command.
+	The alignment control string will be applied only for this particular
+	application of Align (it uses |alignctrl-m|).  The "g pattern" and
+	"v pattern" alignment controls (see |alignctrl-g| and |alignctrl-v|)
+	are also available via this form of the Align command.
 
 	Align makes two passes over the text to be aligned.  The first pass
 	determines how many fields there are and determines the maximum sizes
 	of each field; these sizes are then stored in a vector.  The second
-	pass pads the fields (left/right/centered as specified) to bring its
+	pass pads the field (left/right/centered as specified) to bring its
 	length up to the maximum size of the field.  Then the separator and
 	its AlignCtrl-specified padding is appended.
 
@@ -648,23 +718,34 @@
 		 || Append separator with AlignCtrl-specified separator padding
 		 || Delete current line, install newly aligned line
 
-	The g and v AlignCtrl patterns cause the passes skip over lines for
-	alignment, either by requiring that the g-pattern be present or that
-	the v-pattern not be present.
+	The g and v AlignCtrl patterns cause the passes not to consider lines
+	for alignment, either by requiring that the g-pattern be present or
+	that the v-pattern not be present.
 
 	The whitespace on either side of a separator is ignored.
 
 
-ALIGNMENT MAPS				*alignmaps* *align-maps* {{{2
-
-	There are a number of maps using AlignCtrl() and Align() in the
+==============================================================================
+4. Alignment Maps				*alignmaps* *align-maps* {{{1
+
+	There are a number of maps using Align#AlignCtrl() and Align#Align() in the
 	<AlignMaps.vim> file.  This file may also be put into the plugins
 	subdirectory.  Since AlignCtrl and Align supercede textab and its
 	<ttalign.vim> file, the maps either have a leading "t" (for "textab")
 	or the more complicated ones an "a" (for "alignment") for backwards
 	compatibility.
 
-	ALIGNMENT MAP LISTING	{{{3 ~
+	Thee maps are shown below with a leading backslash (\).  Actually,
+	the <Leader> construct is used (see :help mapleader), so the leading
+	map kick-off character is easily customized.
+
+	Furthermore, all AlignMaps.vim maps use the <Plug> construct (see
+	|<Plug>|and |<usr_41.txt|).  Hence, if one wishes to override the
+	mapping entirely, one may do that, too.  As an example: >
+		map <Leader>ACOM	<Plug>AM_acom
+<	would have \ACOM do what \acom previously did (assuming that the
+	mapleader has been left at its default value of a backslash).
+
 	  \a,   : useful for breaking up comma-separated
 	          declarations prior to \adec			|alignmap-a,|
 	  \a?   : aligns (...)? ...:... expressions on ? and :	|alignmap-a?|
@@ -675,13 +756,13 @@
 	  \adcom: useful for aligning comments in declarations  |alignmap-adcom|
 	  \anum : useful for aligning numbers 			|alignmap-anum|
 	          NOTE: For the visual-mode use of \anum, <vis.vim> is needed!
-		  See http://mysite.verizon.net/astronaut/vim/index.html#VIS
+		    See http://mysite.verizon.net/astronaut/vim/index.html#VIS
 	  \aenum: align a European-style number			|alignmap-anum|
 	  \aunum: align a USA-style number			|alignmap-anum|
 	  \adec : useful for aligning declarations		|alignmap-adec|
 	  \adef : useful for aligning definitions		|alignmap-adef|
-	  \afnc : useful for aligning ansi-c style functions'	|alignmap-afnc|
-	          argument lists
+	  \afnc : useful for aligning ansi-c style functions'
+	          argument lists				|alignmap-afnc|
 	  \adcom: a variant of \acom, restricted to comment     |alignmap-adcom|
 	          containing lines only, but also only for
 		  those which don't begin with a comment.
@@ -713,131 +794,44 @@
 	          character "x" where "x" is: ,:<=@#		|alignmap-T=|
 	  \m=   : like \t= but aligns with %... style comments
 
-	The leading backslash is actually <leader> (see |mapleader| on how to
-	customize the leader to be whatever you prefer).  These maps all use
-	the <Align.vim> package and are defined in the <AlignMaps.vim> file.
+	The leading backslash is actually <leader> (see |mapleader| for how to
+	customize the leader to be whatever you like).  These maps use the
+	<Align.vim> package and are defined in the <AlignMaps.vim> file.
 	Although the maps use AlignCtrl options, they typically use the "m"
-	option which pushes and pops the current options (AlignPush).  The
-	associated Align call which follows will then AlignPop the user's
-	original options back.
-
-	ALIGNMENT MAP USE WITH MARK AND MOVE {{{3 ~
+	option which pushes the options (AlignPush).  The associated Align
+	call which follows will then AlignPop the user's original options
+	back.
+
+	ALIGNMENT MAP USE WITH MARK AND MOVE~
 	In the examples below, one may select the text with a "ma" at the
 	first line, move to the last line, then execute the map.
 
-	ALIGNMENT MAP USE WITH VISUAL MODE {{{3 ~
+	ALIGNMENT MAP USE WITH VISUAL MODE~
 	Alternatively, one may select the text with the "V" visual mode
 	selector.
 
-	ALIGNMENT MAP USE WITH MENUS {{{3 ~
+	ALIGNMENT MAP USE WITH MENUS~
 	One may use the mark-and-move style (ma, move, use the menu) or
 	the visual mode style (use the V visual mode, move, then select
 	the alignment map with menu selection).  The alignment map menu
-	items are under the heading "DrChip.AlignMaps".
+	items are under DrChip.AlignMaps .
 
 	One may change the top level menu name to whatever is wished; by
 	default, its >
 		let g:DrChipTopLvlMenu= "DrChip."
 <	If you set the variable to the empty string (""), then no menu items
 	will be produced.  Of course, one must have a vim with +menu, the gui
-	must be running, and *'go'* must have the menu bar suboption (ie. m
+	must be running, and |'go'| must have the menu bar suboption (ie. m
 	must be included).
 
-	COMPLEX ALIGNMENT MAP METHOD {{{3 ~
+	COMPLEX ALIGNMENT MAP METHOD~
 	For those complex alignment maps which do alignment on constructs
 	(e.g. \acom, \adec, etc), a series of substitutes is used to insert
-	"@" symbols in appropriate locations.  Align() is then used to do
+	"@" symbols in appropriate locations.  Align#Align() is then used to do
 	alignment directly on "@"s; then it is followed by further substitutes
 	to do clean-up.  However, the maps \WS and \WE protect any original
 	embedded "@" symbols by first converting them to <DEL> characters,
 	doing the requested job, and then converting them back.
-
-	As an example, consider \adec (as of v39b of AlignMaps.vim):
-
-	  map <silent> <Leader>adec	The map is set up to be silent (ie.
-	  				not report on qty of substitutes made,
-					etc).  The <Leader> (see |mapleader|)
-					allows the user to specify his/her
-					preferred map-leader character.
-
-	  <SID>WS			The wrapper-start map calls the
-	  				AlignWrapperStart() function, which
-					saves certain problematic user
-					options, sets up fencepost blank lines
-					around the area to be processed, and
-					sets some friendly-to-align options.
-					It also pushes the user's Alignment
-					options on a stack.
-
-	  :'a,'zs/\([^ \t/(]\)\([*&]\)/\1 \2/e<CR>
-	  				This substitute retains any initial
-					whitespace and insures that there is
-					separation between any leading *&
-					characters and the beginning of the
-					line.
-
-	  :'y,'zv/^\//s/\([^ \t]\)\s\+/\1 /ge<CR>
-	  				For any line not a comment, leading
-					non-white space characters are forced
-					to be followed by a single space (as
-					opposed to multiple whitespace
-					characters).
-
-	  :'y,'zv/^\s*[*/]/s/\([^/][*&]\)\s\+/\1/ge<CR>
-	  				For any lines not a comment (or part
-					of a multi-line C comment), whitespace
-					following a [not-a-/][*&] is removed.
-
-	  :'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>
-	  				This substitute (all one line, but
-					split so it can fit on a help page),
-					is the declaration-construct recognition
-					workhorse.  Basically it splits a
-					declaration into components separated
-					by @ and # signs.
-
-	  :'y,'zv/^\s*[*/]/s/\*\/\s*$/@*\//e<CR>
-	  				Places an @ sign before the ending ...*/
-					in C comments (except for those lines
-					that are just beginning of line
-					followed by spaces to */).
-
-	  :'y,'zv/^\s*[*/]/s/^\s\+\*/@@@@@* /e<CR>
-	  				For those lines without comments, @s
-					are placed at the end-of-line.
-
-	  :'y,'zv/^\s*[*/]/s/^@@@@@\*\(.*[^*/]\)$/&@*/e<CR>
-	  				Cleans up some situations where the
-					previous @@@@@ appending ended up
-					at the beginning of lines and there's
-					continuing comment involved.
-	  				
-	  'yjma'zk			Preparation for alignment by marking
-	  				the region.
-
-	  :AlignCtrl v ^\s*[*/#]<CR>	Don't align comment-only lines.
-
-	  <Leader>t@			Align all the @s inserted above.
-
-	  :'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>
-	  				These are all clean-up substitutes,
-					removing @s and #s, some unnecessary
-					spaces, etc.
-
-	  <SID>WE			Reverse the AlignWrapperStart() with
-	  				AlignWrapperEnd(): AlignPop the
-					alignment settings, restore window
-					position, remove fencepost lines, and
-					restore user options.
 
 
 	---------------------------
@@ -1275,9 +1269,13 @@
 4. Alignment Tool History				*align-history* {{{1
 
 ALIGN HISTORY								{{{2
+	34 : Jul 08, 2008 * using :AlignCtrl before entering any alignment
+			    control commands was causing an error.
 	33 : Sep 20, 2007 * s:Strlen() introduced to support various ways
 			    used to represent characters and their effects
 			    on string lengths.  See |align-strlen|.
+			  * Align now accepts "..." -- so it can accept
+			    whitespace as separators.
 	32 : Aug 18, 2007 * uses |<q-args>| instead of |<f-args>| plus a
 	                    custom argument splitter to allow patterns with
 			    backslashes to slide in unaltered.
@@ -1337,6 +1335,17 @@
 	 9 : Jun 25, 2002 : implemented cyclic padding
 
 ALIGNMENT MAP HISTORY					*alignmap-history* {{{2
+       v40    Oct 21, 2008   * Modified AlignMaps so that its maps use <Plug>s
+			       and <script>s.  \t@ and related maps have been
+			       changed to call StdAlign() instead.  The
+			       WrapperStart function now takes an argument and
+			       handles being called via visual mode.  The
+			       former nmaps and vmaps have thus been replaced
+			       with a simple map.
+	      Oct 24, 2008   * broke AlignMaps into a plugin and autoload
+			       pair of scripts.
+	v39   Mar 06, 2008 : * \t= only does /* ... */ aligning when in *.c
+	                       *.cpp files.
 	v38   Aug 18, 2007 : * \tt altered so that it works with the new
 	                       use of |<q-args>| plus a custom argument
 			       splitter
@@ -1345,7 +1354,7 @@
 	      May 15, 2007   * \anum and variants improved
 	v35   Sep 01, 2006 : * \t= and cousins used "`"s.  They now use \xff
 	                       characters.
-	                     * \acom can now work with doxygen style /// comments
+	                     * \acom now works with doxygen style /// comments
 	                     * <char-0xff> used in \t= \T= \w= and \m= instead
 	                       of backquotes.
 	v34   Feb 23, 2006 : * AlignMaps now converted to vim 7.0 style using

Modified: trunk/packages/vim-scripts/html/index.html
URL: http://svn.debian.org/wsvn/pkg-vim/trunk/packages/vim-scripts/html/index.html?rev=1290&op=diff
==============================================================================
--- trunk/packages/vim-scripts/html/index.html (original)
+++ trunk/packages/vim-scripts/html/index.html Fri Dec  5 19:59:30 2008
@@ -51,7 +51,7 @@
    <li><a href="syntax_mkd.vim.html">syntax/mkd.vim.html</a></li>
   </ul>
   <p>
-  Page generated on Fri, 05 Dec 2008 13:59:57 -0500
+  Page generated on Fri, 05 Dec 2008 14:57:57 -0500
 .
   </p>
  </body>

Modified: trunk/packages/vim-scripts/html/plugin_AlignPlugin.vim.html
URL: http://svn.debian.org/wsvn/pkg-vim/trunk/packages/vim-scripts/html/plugin_AlignPlugin.vim.html?rev=1290&op=diff
==============================================================================
--- trunk/packages/vim-scripts/html/plugin_AlignPlugin.vim.html (original)
+++ trunk/packages/vim-scripts/html/plugin_AlignPlugin.vim.html Fri Dec  5 19:59:30 2008
@@ -153,8 +153,8 @@
 <tr>
   <td class="lightbg"><b>&nbsp;script karma&nbsp;</b></td>
   <td>
-    Rating <b>935/283</b>,
-    Downloaded by 9720  </td>
+    Rating <b>1041/320</b>,
+    Downloaded by 12450  </td>
 </tr>
 </table>
 <p>
@@ -167,7 +167,7 @@
 <tr><td>utility</td></tr>
 <tr><td>&nbsp;</td></tr>
 <tr><td class="prompt">description</td></tr>
-<tr><td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[ALIGN/ALIGNMAPS NEEDS VIM 7.0 AS OF V29/34]
<br>
<br>Align and AlignMaps lets you align statements on their equal signs, make comment boxes, align comments, align declarations, etc.
<br>
<br>Note: this plugin is not a left&right margin justification tool!&nbsp;&nbsp;See <a href="/scripts/script.php?script_id=177">vimscript#177</a> for that.
<br>Note: if you have vim 7.1 or later, your vimball should unpack just fine without having to update it.
<br>
<br>There are two basic commands provided by this package:
<br>
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;AlignCtrl options sep1 sep2 sep3 ...
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[range]Align sep1 sep2 sep3 ...
<br>
<br>The &quot;sep#&quot; are regular expressions which describe separators that delineate fields; Align will line up the separators. The range may be any Vim range, _including_ visual-blocks.&nbsp;&nbsp;Align works on lines of the form:
<br>(ws==whitespace, sep==separator, field==text)
<br>
<br>&nbsp;&nbsp;&nbsp;&nbsp;ws-field-ws-sep-ws-field-ws-sep-ws-field-...
<br>&nbsp;&nbsp;&nbsp;&nbsp;ws-field-ws-sep-ws-field-ws-sep-ws-field-...
<br>
<br>Note that white-space (ws) surrounding separators is ignored.
<br>
<br>The Align package includes:
<br>
<br>&nbsp;&nbsp;Align : the basic alignment command
<br>&nbsp;&nbsp;AlignCtrl : provides options for the next call to :Align
<br>&nbsp;&nbsp;AlignMaps : many three or four key maps which support aligning C/C++ style declarations, ()?..:.., expressions, C/C++ comments, numbers, C preprocessor definitions, tables based on tabs or spaces, and more.
<br>
<br>In addition, AutoAlign (<a href="/scripts/script.php?script_id=884">vimscript#884</a>) uses the Align function to align =s as you type.
<br>
<br>Align handles alignment on multiple separators, not just the first one, and the separators may be the same across the line or different.&nbsp;&nbsp;With AlignCtrl one may specify that separators are cyclic (re-used sequentially) or equivalent (all separators are simultaneously active).
<br>
<br>There are several options to help with deciding what to do with initial white space.&nbsp;&nbsp; By default Align re-uses the first line's initial white space, but one may use AlignCtrl to retain or remove each line's initial white space.
<br>
<br>The &lt;Align.vim&gt; and &lt;AlignMaps.vim&gt; files are plugins and require vim 6.1 or higher.
<br>
<br>
<br>EXAMPLES:
<br>
<br>:5,10Align =
<br>&nbsp;&nbsp;&nbsp;&nbsp;Align on '=' signs
<br>
<br>:'&lt;,'&gt;Align = + - \* /
<br>&nbsp;&nbsp;&nbsp;&nbsp;Align on any of the five separator characters shown.
<br>&nbsp;&nbsp;&nbsp;&nbsp;Note that visual block mode was used to fire off Align.
<br>
<br>:AlignCtrl =lp1P1I
<br>&nbsp;&nbsp;&nbsp;&nbsp;which means:
<br>&nbsp;&nbsp;&nbsp;&nbsp;= all separators are equivalent
<br>&nbsp;&nbsp;&nbsp;&nbsp;l fields will be left-justified
<br>&nbsp;&nbsp;&nbsp;&nbsp;p1 pad one space before each separator
<br>&nbsp;&nbsp;&nbsp;&nbsp;P1 pad one space after each separator
<br>&nbsp;&nbsp;&nbsp;&nbsp;I&nbsp;&nbsp;preserve and apply the first line's leading white space to all
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Align'd lines
<br>
<br>:help align
<br>&nbsp;&nbsp;&nbsp;&nbsp;Gives help for Align
<br>
<br>
<br>ALIGNMENT CONTROL
<br>
<br>Alignment control allows for left or right justification or centering of fields, cyclic (sequentially active) or equivalent (simultaneously active) regular expressions to specify field separators, initial white space control, optional visual-block use (ie. apply Alignment only within a block), user-specified white-space padding about separators, and multiple separators.
<br>
<br>MANY ALIGNMENT MAPS
<br>
<br>AlignMaps.vim provides a number of maps which make using this package easy.&nbsp;&nbsp;They typically either apply to the range 'a,. (from mark a to current line) or use the visual-selection (V, v, or ctrl-v selected):
<br>
<br>	\t=&nbsp;&nbsp;: align assignments (don't count logic, like == or !=)
<br>	\t,&nbsp;&nbsp;: align on commas
<br>	\t|&nbsp;&nbsp;: align on vertical bars (|)
<br>	\tsp : align on whitespace
<br>	\tt&nbsp;&nbsp;: align LaTeX tabular tables
<br>
<br>AlignMaps also provides some internally complex maps for aligning C declarations, Ansi C function arguments, html tables, LaTeX tabulars, and trailing comments:
<br>
<br>	\acom : align comments
<br>	\adec : align C declarations (one variable per line)
<br>	\afnc : align ansi-style C function input arguments
<br>	\Htd&nbsp;&nbsp;: align html tables
<br>	
<br>To see some examples of this, check out
<br>
<br>&nbsp;&nbsp;&nbsp;&nbsp;<a target="_blank" href="http://mysite.verizon.net/astronaut/vim/align.html#Examples">http://mysite.verizon.net/astronaut/vim/align.html#Examples</A>
<br>
<br>(the proportional fonts used by most browsers in showing you this page preclude showing the examples here). The help for Align and AlignCtrl also contains many examples.
<br>
<br>ALIGNMENT ON VISUAL BLOCKS AND g,v-LIKE CONTROL
<br>
<br>Sometimes one wants to align only a subset of text in a range, based on patterns or column extents.&nbsp;&nbsp;Align supports both types of restrictions!
<br>&nbsp;&nbsp;&nbsp;&nbsp;
<br>&nbsp;&nbsp;&nbsp;&nbsp;Visual-block selection may be used to restrict Align to operate only
<br>&nbsp;&nbsp;&nbsp;&nbsp;within that visual block.
<br>&nbsp;&nbsp;&nbsp;&nbsp;
<br>&nbsp;&nbsp;&nbsp;&nbsp;AlignCtrl supports &quot;g&quot; and &quot;v&quot; patterns that restrict Align to
<br>
<br>&nbsp;&nbsp;&nbsp;&nbsp;operate on lines which match (or don't match, respectively) those
<br>&nbsp;&nbsp;&nbsp;&nbsp;patterns.
<br>
<br>NEW STUFF:
<br>
<br>There's a number of new AlignCtrl options:
<br>&nbsp;&nbsp;&nbsp;&nbsp;
<br>&nbsp;&nbsp;&nbsp;&nbsp;- allows one to skip a separator (treat it as part of a field)
<br>&nbsp;&nbsp;&nbsp;&nbsp;+ repeat the last lrc justification (ex. lr+ == lrrrrrr... )
<br>&nbsp;&nbsp;&nbsp;&nbsp;: treat the rest of the line as a field; acts as a modifier
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;to the last lrc. 
<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt; left-justify the separator
<br>&nbsp;&nbsp;&nbsp;&nbsp;&gt; right-justify the separator
<br>&nbsp;&nbsp;&nbsp;&nbsp;| center the separator
<br>
<br>These are, except for the &quot;:&quot;, cyclic parameters.&nbsp;&nbsp;In other words, &gt;&lt; is equivalent to &gt;&lt;&gt;&lt;&gt;&lt;&gt;&lt;... .&nbsp;&nbsp;Thus separators can be of differing lengths (ex.&nbsp;&nbsp;-\+ as a separator pattern can match -, --, ---, etc and the separators will be left/right/center justified as you wish).
<br>
<br>To get automatic, as-you-type, aligning of = in the C, vimL, and other languages, check out <a href="/scripts/script.php?script_id=884">vimscript#884</a> for several ftplugins (which use Align).
<br>
<br>
<br>Alternative Aligners:
<br>&nbsp;&nbsp;&nbsp;&nbsp;Gergely Kontra's <a href="/scripts/script.php?script_id=176">vimscript#176</a>
<br>&nbsp;&nbsp;&nbsp;&nbsp;Mohsin Ahmed's <a href="/tips/tip.php?tip_id=570">vimtip#570</a>
<br>
<br>Thank you for rating Align!
<br>
<br>---------------------------------------
<br>DISCUSSION and COMMENTS:
<br>---------------------------------------
<br>
<br>Use <a href="/tips/tip.php?tip_id=139">vimtip#139</a> for discussion and comments.&nbsp;&nbsp;Please use email for bugs.&nbsp;&nbsp;Enjoy!
<br>
<br></td></tr>
+<tr><td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[ALIGN/ALIGNMAPS NEEDS VIM 7.0 AS OF V29/34]
<br>
<br>Align and AlignMaps lets you align statements on their equal signs, make comment boxes, align comments, align declarations, etc.
<br>
<br>Note: this plugin is not a left&right margin justification tool!&nbsp;&nbsp;See <a href="/scripts/script.php?script_id=177">vimscript#177</a> or <a href="/scripts/script.php?script_id=2324">vimscript#2324</a> for that.
<br>Note: if you have vim 7.1 or later, your vimball should unpack just fine without having to update it.
<br>
<br>There are two basic commands provided by this package:
<br>
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;AlignCtrl options sep1 sep2 sep3 ...
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[range]Align sep1 sep2 sep3 ...
<br>
<br>The &quot;sep#&quot; are regular expressions which describe separators that delineate fields; Align will line up the separators. The range may be any Vim range, _including_ visual-blocks.&nbsp;&nbsp;Align works on lines of the form:
<br>(ws==whitespace, sep==separator, field==text)
<br>
<br>&nbsp;&nbsp;&nbsp;&nbsp;ws-field-ws-sep-ws-field-ws-sep-ws-field-...
<br>&nbsp;&nbsp;&nbsp;&nbsp;ws-field-ws-sep-ws-field-ws-sep-ws-field-...
<br>
<br>Note that white-space (ws) surrounding separators is ignored.
<br>
<br>The Align package includes:
<br>
<br>&nbsp;&nbsp;Align : the basic alignment command
<br>&nbsp;&nbsp;AlignCtrl : provides options for the next call to :Align
<br>&nbsp;&nbsp;AlignMaps : many three or four key maps which support aligning C/C++ style declarations, ()?..:.., expressions, C/C++ comments, numbers, C preprocessor definitions, tables based on tabs or spaces, and more.
<br>
<br>In addition, AutoAlign (<a href="/scripts/script.php?script_id=884">vimscript#884</a>) uses the Align function to align =s as you type.
<br>
<br>Align handles alignment on multiple separators, not just the first one, and the separators may be the same across the line or different.&nbsp;&nbsp;With AlignCtrl one may specify that separators are cyclic (re-used sequentially) or equivalent (all separators are simultaneously active).
<br>
<br>There are several options to help with deciding what to do with initial white space.&nbsp;&nbsp; By default Align re-uses the first line's initial white space, but one may use AlignCtrl to retain or remove each line's initial white space.
<br>
<br>The &lt;Align.vim&gt; and &lt;AlignMaps.vim&gt; files are plugins and require vim 6.1 or higher.
<br>
<br>
<br>EXAMPLES:
<br>
<br>:5,10Align =
<br>&nbsp;&nbsp;&nbsp;&nbsp;Align on '=' signs
<br>
<br>:'&lt;,'&gt;Align = + - \* /
<br>&nbsp;&nbsp;&nbsp;&nbsp;Align on any of the five separator characters shown.
<br>&nbsp;&nbsp;&nbsp;&nbsp;Note that visual block mode was used to fire off Align.
<br>
<br>:AlignCtrl =lp1P1I
<br>&nbsp;&nbsp;&nbsp;&nbsp;which means:
<br>&nbsp;&nbsp;&nbsp;&nbsp;= all separators are equivalent
<br>&nbsp;&nbsp;&nbsp;&nbsp;l fields will be left-justified
<br>&nbsp;&nbsp;&nbsp;&nbsp;p1 pad one space before each separator
<br>&nbsp;&nbsp;&nbsp;&nbsp;P1 pad one space after each separator
<br>&nbsp;&nbsp;&nbsp;&nbsp;I&nbsp;&nbsp;preserve and apply the first line's leading white space to all
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Align'd lines
<br>
<br>:help align
<br>&nbsp;&nbsp;&nbsp;&nbsp;Gives help for Align
<br>
<br>
<br>ALIGNMENT CONTROL
<br>
<br>Alignment control allows for left or right justification or centering of fields, cyclic (sequentially active) or equivalent (simultaneously active) regular expressions to specify field separators, initial white space control, optional visual-block use (ie. apply Alignment only within a block), user-specified white-space padding about separators, and multiple separators.
<br>
<br>MANY ALIGNMENT MAPS
<br>
<br>AlignMaps.vim provides a number of maps which make using this package easy.&nbsp;&nbsp;They typically either apply to the range 'a,. (from mark a to current line) or use the visual-selection (V, v, or ctrl-v selected):
<br>
<br>	\t=&nbsp;&nbsp;: align assignments (don't count logic, like == or !=)
<br>	\t,&nbsp;&nbsp;: align on commas
<br>	\t|&nbsp;&nbsp;: align on vertical bars (|)
<br>	\tsp : align on whitespace
<br>	\tt&nbsp;&nbsp;: align LaTeX tabular tables
<br>
<br>AlignMaps also provides some internally complex maps for aligning C declarations, Ansi C function arguments, html tables, LaTeX tabulars, and trailing comments:
<br>
<br>	\acom : align comments
<br>	\adec : align C declarations (one variable per line)
<br>	\afnc : align ansi-style C function input arguments
<br>	\Htd&nbsp;&nbsp;: align html tables
<br>	
<br>To see some examples of this, check out
<br>
<br>&nbsp;&nbsp;&nbsp;&nbsp;<a target="_blank" href="http://mysite.verizon.net/astronaut/vim/align.html#Examples">http://mysite.verizon.net/astronaut/vim/align.html#Examples</A>
<br>
<br>(the proportional fonts used by most browsers in showing you this page preclude showing the examples here). The help for Align and AlignCtrl also contains many examples.
<br>
<br>ALIGNMENT ON VISUAL BLOCKS AND g,v-LIKE CONTROL
<br>
<br>Sometimes one wants to align only a subset of text in a range, based on patterns or column extents.&nbsp;&nbsp;Align supports both types of restrictions!
<br>&nbsp;&nbsp;&nbsp;&nbsp;
<br>&nbsp;&nbsp;&nbsp;&nbsp;Visual-block selection may be used to restrict Align to operate only
<br>&nbsp;&nbsp;&nbsp;&nbsp;within that visual block.
<br>&nbsp;&nbsp;&nbsp;&nbsp;
<br>&nbsp;&nbsp;&nbsp;&nbsp;AlignCtrl supports &quot;g&quot; and &quot;v&quot; patterns that restrict Align to
<br>
<br>&nbsp;&nbsp;&nbsp;&nbsp;operate on lines which match (or don't match, respectively) those
<br>&nbsp;&nbsp;&nbsp;&nbsp;patterns.
<br>
<br>NEW STUFF:
<br>
<br>There's a number of new AlignCtrl options:
<br>&nbsp;&nbsp;&nbsp;&nbsp;
<br>&nbsp;&nbsp;&nbsp;&nbsp;- allows one to skip a separator (treat it as part of a field)
<br>&nbsp;&nbsp;&nbsp;&nbsp;+ repeat the last lrc justification (ex. lr+ == lrrrrrr... )
<br>&nbsp;&nbsp;&nbsp;&nbsp;: treat the rest of the line as a field; acts as a modifier
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;to the last lrc. 
<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt; left-justify the separator
<br>&nbsp;&nbsp;&nbsp;&nbsp;&gt; right-justify the separator
<br>&nbsp;&nbsp;&nbsp;&nbsp;| center the separator
<br>
<br>These are, except for the &quot;:&quot;, cyclic parameters.&nbsp;&nbsp;In other words, &gt;&lt; is equivalent to &gt;&lt;&gt;&lt;&gt;&lt;&gt;&lt;... .&nbsp;&nbsp;Thus separators can be of differing lengths (ex.&nbsp;&nbsp;-\+ as a separator pattern can match -, --, ---, etc and the separators will be left/right/center justified as you wish).
<br>
<br>To get automatic, as-you-type, aligning of = in the C, vimL, and other languages, check out <a href="/scripts/script.php?script_id=884">vimscript#884</a> for several ftplugins (which use Align).
<br>
<br>
<br>Alternative Aligners:
<br>&nbsp;&nbsp;&nbsp;&nbsp;Gergely Kontra's <a href="/scripts/script.php?script_id=176">vimscript#176</a>
<br>
<br>Thank you for rating Align!
<br>
<br>---------------------------------------
<br>DISCUSSION and COMMENTS:
<br>---------------------------------------
<br>
<br>Please use email for bugs.&nbsp;&nbsp;Enjoy!
<br>
<br></td></tr>
 <tr><td>&nbsp;</td></tr>
 <tr><td class="prompt">install details</td></tr>
 <tr><td>1. Using vim 7.1:
<br>&nbsp;&nbsp;vim Align.vba.gz
<br>&nbsp;&nbsp; :so %
<br>&nbsp;&nbsp; :q
<br>2. Using vim 7.0: see <a target="_blank" href="http://mysite.verizon.net/astronaut/vim/index.html#VIMBALL">http://mysite.verizon.net/astronaut/vim/index.html#VIMBALL</A> to get and install an up-to-date version of vimball.&nbsp;&nbsp;Then follow the simple directions for installation of Align/AlignMaps above!
<br>
<br>(this version of Align/AlignMaps requires vim 7.0)
<br></td></tr>
@@ -204,68 +204,76 @@
     <th valign="top">release notes</th>
 </tr>
 <tr>
-        <td class="rowodd" valign="top" nowrap><a href="download_script.php?src_id=8076">Align.vba.gz</a></td>
-    <td class="rowodd" valign="top" nowrap><b>33/39</b></td>
-    <td class="rowodd" valign="top" nowrap><i>2007-12-20</i></td>
+        <td class="rowodd" valign="top" nowrap><a href="download_script.php?src_id=9414">Align.vba.gz</a></td>
+    <td class="rowodd" valign="top" nowrap><b>34/40</b></td>
+    <td class="rowodd" valign="top" nowrap><i>2008-10-29</i></td>
     <td class="rowodd" valign="top" nowrap>7.0</td>
     <td class="rowodd" valign="top"><i><a href="/account/profile.php?user_id=96">Charles Campbell</a></i></td>
-    <td class="rowodd" valign="top" width="2000">* Align now handles alignment of text with codepoints and whatnot: see :help align-utf to set a variable &quot;g:Align_xstrlen&quot; to facilitate the type of alignment you'd like
<br>
<br>* bugfix: \tt now uses the new &lt;q-args&gt; and custom argument splitter to align LaTeX tables
<br>
<br>* Align/AlignMap's help page now extensively uses marker-based folding to facilitate finding things</td>
-</tr>
-<tr>
-        <td class="roweven" valign="top" nowrap><a href="download_script.php?src_id=7531">Align.vba.gz</a></td>
-    <td class="roweven" valign="top" nowrap><b>32/38</b></td>
-    <td class="roweven" valign="top" nowrap><i>2007-08-20</i></td>
+    <td class="rowodd" valign="top" width="2000">(AlignMaps) split into plugin/ and autoload/ sections (faster [g]vim startup)
<br>(AlignMaps) maps use &lt;Plug&gt;s and &lt;script&gt;s: allowing users to invoke the maps how they wish, and preventing user maps from interfering with the internal workings of the maps.
<br>(Align)&nbsp;&nbsp;&nbsp;&nbsp; bugfix - using :AlignCtrl before entering any alignment ctrl cmds was causing an error
<br></td>
+</tr>
+<tr>
+        <td class="roweven" valign="top" nowrap><a href="download_script.php?src_id=8407">Align.vba.gz</a></td>
+    <td class="roweven" valign="top" nowrap><b>33/39</b></td>
+    <td class="roweven" valign="top" nowrap><i>2008-03-06</i></td>
+    <td class="roweven" valign="top" nowrap>6.0</td>
+    <td class="roweven" valign="top"><i><a href="/account/profile.php?user_id=96">Charles Campbell</a></i></td>
+    <td class="roweven" valign="top" width="2000">* Align now aligns multi-byte characters correctly (see :help align-strlen) -- choose g:Align_xstrlen for the type of codepoint you want handled.
<br>
<br>* Align now accepts \&quot;...\&quot; arguments, so one can pass whitespace to Align as a separator
<br>
<br>* AlignMaps&#039 \\t= map now avoids comment aligning when the filetype is not *.c or *.cpp</td>
+</tr>
+<tr>
+        <td class="rowodd" valign="top" nowrap><a href="download_script.php?src_id=7531">Align.vba.gz</a></td>
+    <td class="rowodd" valign="top" nowrap><b>32/38</b></td>
+    <td class="rowodd" valign="top" nowrap><i>2007-08-20</i></td>
+    <td class="rowodd" valign="top" nowrap>7.0</td>
+    <td class="rowodd" valign="top"><i><a href="/account/profile.php?user_id=96">Charles Campbell</a></i></td>
+    <td class="rowodd" valign="top" width="2000">The &lt;leader&gt;tt map wasn't working right; Align now uses &lt;q-args&gt; instead of &lt;f-args&gt;, so it does the argument splitting itself, thus allowing patterns containing backslashes to be used without lots of backslash-duplication.&nbsp;&nbsp;This allows the \tt map in AlignMaps to work, and to work without a lot of extra backslashes.</td>
+</tr>
+<tr>
+        <td class="roweven" valign="top" nowrap><a href="download_script.php?src_id=7511">Align.vba.gz</a></td>
+    <td class="roweven" valign="top" nowrap><b>31/36</b></td>
+    <td class="roweven" valign="top" nowrap><i>2007-08-16</i></td>
     <td class="roweven" valign="top" nowrap>7.0</td>
     <td class="roweven" valign="top"><i><a href="/account/profile.php?user_id=96">Charles Campbell</a></i></td>
-    <td class="roweven" valign="top" width="2000">The &lt;leader&gt;tt map wasn't working right; Align now uses &lt;q-args&gt; instead of &lt;f-args&gt;, so it does the argument splitting itself, thus allowing patterns containing backslashes to be used without lots of backslash-duplication.&nbsp;&nbsp;This allows the \tt map in AlignMaps to work, and to work without a lot of extra backslashes.</td>
-</tr>
-<tr>
-        <td class="rowodd" valign="top" nowrap><a href="download_script.php?src_id=7511">Align.vba.gz</a></td>
-    <td class="rowodd" valign="top" nowrap><b>31/36</b></td>
-    <td class="rowodd" valign="top" nowrap><i>2007-08-16</i></td>
+    <td class="roweven" valign="top" width="2000">New feature -- one can embed AlignCtrl settings into Align (as a one-shot):
<br>
<br>&nbsp;&nbsp; [range]Align! [AlignCtrl settings] pattern(s)
<br>
<br>Plus some small improvements to some of the AlignMaps.</td>
+</tr>
+<tr>
+        <td class="rowodd" valign="top" nowrap><a href="download_script.php?src_id=6210">Align.vba.gz</a></td>
+    <td class="rowodd" valign="top" nowrap><b>30/35</b></td>
+    <td class="rowodd" valign="top" nowrap><i>2006-09-20</i></td>
     <td class="rowodd" valign="top" nowrap>7.0</td>
     <td class="rowodd" valign="top"><i><a href="/account/profile.php?user_id=96">Charles Campbell</a></i></td>
-    <td class="rowodd" valign="top" width="2000">New feature -- one can embed AlignCtrl settings into Align (as a one-shot):
<br>
<br>&nbsp;&nbsp; [range]Align! [AlignCtrl settings] pattern(s)
<br>
<br>Plus some small improvements to some of the AlignMaps.</td>
-</tr>
-<tr>
-        <td class="roweven" valign="top" nowrap><a href="download_script.php?src_id=6210">Align.vba.gz</a></td>
-    <td class="roweven" valign="top" nowrap><b>30/35</b></td>
-    <td class="roweven" valign="top" nowrap><i>2006-09-20</i></td>
+    <td class="rowodd" valign="top" width="2000">* \acom can now work with doxygen style /// comments
<br>* \t= and cousins used &quot;`&quot;s.&nbsp;&nbsp;They now use \xff characters.
<br>* &lt;char-0xff&gt; used in \t= \T= \w= and \m= instead of backquotes.
<br></td>
+</tr>
+<tr>
+        <td class="roweven" valign="top" nowrap><a href="download_script.php?src_id=5608">Align.vba.gz</a></td>
+    <td class="roweven" valign="top" nowrap><b>29/34</b></td>
+    <td class="roweven" valign="top" nowrap><i>2006-04-25</i></td>
     <td class="roweven" valign="top" nowrap>7.0</td>
     <td class="roweven" valign="top"><i><a href="/account/profile.php?user_id=96">Charles Campbell</a></i></td>
-    <td class="roweven" valign="top" width="2000">* \acom can now work with doxygen style /// comments
<br>* \t= and cousins used &quot;`&quot;s.&nbsp;&nbsp;They now use \xff characters.
<br>* &lt;char-0xff&gt; used in \t= \T= \w= and \m= instead of backquotes.
<br></td>
-</tr>
-<tr>
-        <td class="rowodd" valign="top" nowrap><a href="download_script.php?src_id=5608">Align.vba.gz</a></td>
-    <td class="rowodd" valign="top" nowrap><b>29/34</b></td>
-    <td class="rowodd" valign="top" nowrap><i>2006-04-25</i></td>
-    <td class="rowodd" valign="top" nowrap>7.0</td>
-    <td class="rowodd" valign="top"><i><a href="/account/profile.php?user_id=96">Charles Campbell</a></i></td>
-    <td class="rowodd" valign="top" width="2000">Align and AlignMaps now use vim 7.0 style autoloading (quicker startup, loads only when used)
<br>cecutil updated to use keepjumps
<br>Now being distributed as a vimball - simply :so % it after decompressing it to install
<br></td>
-</tr>
-<tr>
-        <td class="roweven" valign="top" nowrap><a href="download_script.php?src_id=4788">Align.tar.gz</a></td>
-    <td class="roweven" valign="top" nowrap><b>28/33</b></td>
-    <td class="roweven" valign="top" nowrap><i>2005-11-21</i></td>
+    <td class="roweven" valign="top" width="2000">Align and AlignMaps now use vim 7.0 style autoloading (quicker startup, loads only when used)
<br>cecutil updated to use keepjumps
<br>Now being distributed as a vimball - simply :so % it after decompressing it to install
<br></td>
+</tr>
+<tr>
+        <td class="rowodd" valign="top" nowrap><a href="download_script.php?src_id=4788">Align.tar.gz</a></td>
+    <td class="rowodd" valign="top" nowrap><b>28/33</b></td>
+    <td class="rowodd" valign="top" nowrap><i>2005-11-21</i></td>
+    <td class="rowodd" valign="top" nowrap>6.0</td>
+    <td class="rowodd" valign="top"><i><a href="/account/profile.php?user_id=96">Charles Campbell</a></i></td>
+    <td class="rowodd" valign="top" width="2000">bugfix: (Align) Align now works around the report option setting.
<br>bugfix: (Align) AlignCtrl l: wasn't behaving as expected; fixed!
<br>bugfix: (AlignMap) \ts, now uses P1 in its AlignCtrl call
<br></td>
+</tr>
+<tr>
+        <td class="roweven" valign="top" nowrap><a href="download_script.php?src_id=4421">Align.tar.gz</a></td>
+    <td class="roweven" valign="top" nowrap><b>27/32</b></td>
+    <td class="roweven" valign="top" nowrap><i>2005-07-12</i></td>
     <td class="roweven" valign="top" nowrap>6.0</td>
     <td class="roweven" valign="top"><i><a href="/account/profile.php?user_id=96">Charles Campbell</a></i></td>
-    <td class="roweven" valign="top" width="2000">bugfix: (Align) Align now works around the report option setting.
<br>bugfix: (Align) AlignCtrl l: wasn't behaving as expected; fixed!
<br>bugfix: (AlignMap) \ts, now uses P1 in its AlignCtrl call
<br></td>
-</tr>
-<tr>
-        <td class="rowodd" valign="top" nowrap><a href="download_script.php?src_id=4421">Align.tar.gz</a></td>
-    <td class="rowodd" valign="top" nowrap><b>27/32</b></td>
-    <td class="rowodd" valign="top" nowrap><i>2005-07-12</i></td>
+    <td class="roweven" valign="top" width="2000">Align v27 : cpo and ignorecase workarounds
<br>AlignMaps v32: s:WrapperStart() -&gt; AlignWrapperStart(), s:WrapperEnd() -&gt; AlignWrapperEnd()
<br> These changes let the wrappers be used outside of AlignMaps.vim (customized map support)
<br></td>
+</tr>
+<tr>
+        <td class="rowodd" valign="top" nowrap><a href="download_script.php?src_id=4167">Align.tar.gz</a></td>
+    <td class="rowodd" valign="top" nowrap><b>27/31</b></td>
+    <td class="rowodd" valign="top" nowrap><i>2005-04-15</i></td>
     <td class="rowodd" valign="top" nowrap>6.0</td>
     <td class="rowodd" valign="top"><i><a href="/account/profile.php?user_id=96">Charles Campbell</a></i></td>
-    <td class="rowodd" valign="top" width="2000">Align v27 : cpo and ignorecase workarounds
<br>AlignMaps v32: s:WrapperStart() -&gt; AlignWrapperStart(), s:WrapperEnd() -&gt; AlignWrapperEnd()
<br> These changes let the wrappers be used outside of AlignMaps.vim (customized map support)
<br></td>
-</tr>
-<tr>
-        <td class="roweven" valign="top" nowrap><a href="download_script.php?src_id=4167">Align.tar.gz</a></td>
-    <td class="roweven" valign="top" nowrap><b>27/31</b></td>
-    <td class="roweven" valign="top" nowrap><i>2005-04-15</i></td>
-    <td class="roweven" valign="top" nowrap>6.0</td>
-    <td class="roweven" valign="top"><i><a href="/account/profile.php?user_id=96">Charles Campbell</a></i></td>
-    <td class="roweven" valign="top" width="2000">Align: GetLatestVimScripts/AutoInstall supported
<br>AlignMaps: new map: \\adcom (align declaration-style comments), \\a, now wors across multiple lines with different types, cecutil.vim now used, more number alignment maps (\\aenum, \\aunum)
<br></td>
+    <td class="rowodd" valign="top" width="2000">Align: GetLatestVimScripts/AutoInstall supported
<br>AlignMaps: new map: \\adcom (align declaration-style comments), \\a, now wors across multiple lines with different types, cecutil.vim now used, more number alignment maps (\\aenum, \\aunum)
<br></td>
 </tr>
 </table>
 <!-- finish off the framework -->
@@ -273,6 +281,7 @@
         </tr>
       </table>
     </td>
+
   </tr>
 </table>
 
@@ -311,8 +320,7 @@
           </td>
 
     <td align="right" valign="top">
-      	<a href="http://www.webconceptgroup.net"><img src="/images/logo_sponsor_wcg.jpg" width="131" height="30" border="0" alt="Sponsored by Web Concept Group Inc."></a>
-	<a href="http://sourceforge.net"><img src="http://sflogo.sourceforge.net/sflogo.php?group_id=8&type=1" width="88" height="31" border="0" alt="SourceForge.net Logo" /></a>
+      		<a href="http://sourceforge.net" rel="nofollow"><img src="http://sflogo.sourceforge.net/sflogo.php?group_id=8&type=1" width="88" height="31" border="0" alt="SourceForge.net Logo" /></a>
     </td>
 
     <td><img src="/images/spacer.gif" width="5" height="1" alt=""></td>

Copied: trunk/packages/vim-scripts/plugin/AlignMapsPlugin.vim (from r1284, trunk/packages/vim-scripts/plugin/AlignMaps.vim)
URL: http://svn.debian.org/wsvn/pkg-vim/trunk/packages/vim-scripts/plugin/AlignMapsPlugin.vim?rev=1290&op=diff
==============================================================================
--- trunk/packages/vim-scripts/plugin/AlignMaps.vim (original)
+++ trunk/packages/vim-scripts/plugin/AlignMapsPlugin.vim Fri Dec  5 19:59:30 2008
@@ -1,12 +1,11 @@
-" AlignMaps:   Alignment maps based upon <Align.vim>
-" Maintainer:  Dr. Charles E. Campbell, Jr. <Charles.Campbell at gsfc.nasa.gov>
-" Date:        Dec 20, 2007
-" Version:     39
+" AlignMapsPlugin:   Alignment maps based upon <Align.vim> and <AlignMaps.vim>
+" Maintainer:        Dr. Charles E. Campbell, Jr. <NdrOchipS at PcampbellAfamily.Mbiz>
+" Date:              Oct 24, 2008
 "
 " 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
+" Copyright:    Copyright (C) 1999-2008 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,
@@ -17,10 +16,12 @@
 "               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.
+" Use 'a to mark beginning of to-be-aligned region,   Alternative:  use V
+" move cursor to end of region, and execute map.      (linewise visual mode) to
+" The maps also set up marks 'y and 'z, and retain    mark region, execute same
+" 'a at the beginning of region.                      map.  Uses 'a, 'y, and 'z.
+"
+" The start/end wrappers save and restore marks 'y and 'z.
 "
 " Although the comments indicate the maps use a leading backslash,
 " actually they use <Leader> (:he mapleader), so the user can
@@ -32,235 +33,149 @@
 " 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
+if &cp
  finish
 endif
-let g:loaded_alignmaps = "v39"
-let s:keepcpo          = &cpo
+let s:keepcpo= &cpo
 set cpo&vim
 
-" ---------------------------------------------------------------------
-" WS: wrapper start map (internal)  {{{1
+" =====================================================================
+"  Maps: {{{1
+
+" ---------------------------------------------------------------------
+" WS: wrapper start map (internal)  {{{2
 " 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
+ map <unique> <SID>WS	<Plug>AlignMapsWrapperStart
+endif
+nmap <silent> <script> <Plug>AlignMapsWrapperStart	:set lz<CR>:call AlignMaps#WrapperStart(0)<CR>
+vmap <silent> <script> <Plug>AlignMapsWrapperStart	:<c-u>set lz<CR>:call AlignMaps#WrapperStart(1)<CR>
+
+" ---------------------------------------------------------------------
+" WE: wrapper end (internal)   {{{2
 " 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/\([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
+nmap <silent> <script> <Plug>AlignMapsWrapperEnd	:call AlignMaps#WrapperEnd()<CR>:set nolz<CR>
+
+" ---------------------------------------------------------------------
+" Complex C-code alignment maps: {{{2!= ""
+if !hasmapto('<Plug>AM_a?')   |map <unique> <Leader>a?		<Plug>AM_a?|endif
+if !hasmapto('<Plug>AM_a,')   |map <unique> <Leader>a,		<Plug>AM_a,|endif
+if !hasmapto('<Plug>AM_a<')   |map <unique> <Leader>a<		<Plug>AM_a<|endif
+if !hasmapto('<Plug>AM_a=')   |map <unique> <Leader>a=		<Plug>AM_a=|endif
+if !hasmapto('<Plug>AM_abox') |map <unique> <Leader>abox	<Plug>AM_abox|endif
+if !hasmapto('<Plug>AM_acom') |map <unique> <Leader>acom	<Plug>AM_acom|endif
+if !hasmapto('<Plug>AM_adcom')|map <unique> <Leader>adcom	<Plug>AM_adcom|endif
+if !hasmapto('<Plug>AM_aocom')|map <unique> <Leader>aocom	<Plug>AM_aocom|endif
+if !hasmapto('<Plug>AM_ascom')|map <unique> <Leader>ascom	<Plug>AM_ascom|endif
+if !hasmapto('<Plug>AM_adec') |map <unique> <Leader>adec	<Plug>AM_adec|endif
+if !hasmapto('<Plug>AM_adef') |map <unique> <Leader>adef	<Plug>AM_adef|endif
+if !hasmapto('<Plug>AM_afnc') |map <unique> <Leader>afnc	<Plug>AM_afnc|endif
+if !hasmapto('<Plug>AM_afnc') |map <unique> <Leader>afnc	<Plug>AM_afnc|endif
+if !hasmapto('<Plug>AM_aunum')|map <unique> <Leader>aunum	<Plug>AM_aenum|endif
+if !hasmapto('<Plug>AM_aenum')|map <unique> <Leader>aenum	<Plug>AM_aunum|endif
+if exists("g:alignmaps_euronumber") && !exists("g:alignmaps_usanumber")
+ if !hasmapto('<Plug>AM_anum')|map <unique> <Leader>anum	<Plug>AM_aenum|endif
 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:'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-1v/^\s*\/[*/]/s/\/[*/]/@&@/e<CR>:'a,'z-1v/^\s*\/[*/]/s/\*\//@&/e<CR>'zk<Leader>t@:'y,'zs/^\(\s*\) @/\1/e<CR>:'a,'z-1s/<Char-0xff>/=/ge<CR>:'y,'zs/ @//eg<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
-
-" ---------------------------------------------------------------------
+ if !hasmapto('<Plug>AM_anum')|map <unique> <Leader>anum	<Plug>AM_aunum|endif
+endif
+
+map <silent> <script> <Plug>AM_a?		<SID>WS:AlignCtrl mIp1P1lC ? : : : : <CR>:'a,.Align<CR>:'a,'z-1s/\(\s\+\)? /?\1/e<CR><SID>WE
+map <silent> <script> <Plug>AM_a,		<SID>WS:'y,'zs/\(\S\)\s\+/\1 /ge<CR>'yjma'zk:call AlignMaps#CharJoiner(",")<cr>:silent 'y,'zg/,/call AlignMaps#FixMultiDec()<CR>'z:exe "norm \<Plug>AM_adec"<cr><SID>WE
+map <silent> <script> <Plug>AM_a<		<SID>WS:AlignCtrl mIp1P1=l << >><CR>:'a,.Align<CR><SID>WE
+map <silent> <script> <Plug>AM_a=		<SID>WS:AlignCtrl mIp1P1=l<CR>:AlignCtrl g :=<CR>:'a,'zAlign :\==<CR><SID>WE
+map <silent> <script> <Plug>AM_abox		<SID>WS:let g:alignmaps_iws=substitute(getline("'a"),'^\(\s*\).*$','\1','e')<CR>:'a,'z-1s/^\s\+//e<CR>:'a,'z-1s/^.*$/@&@/<CR>:AlignCtrl m=p01P0w @<CR>:'a,.Align<CR>:'a,'z-1s/@/ * /<CR>:'a,'z-1s/@$/*/<CR>'aYP:s/./*/g<CR>0r/'zkYp:s/./*/g<CR>0r A/<Esc>:exe "'a-1,'z-1s/^/".g:alignmaps_iws."/e"<CR><SID>WE
+map <silent> <script> <Plug>AM_acom		<SID>WS:'a,.s/\/[*/]\/\=/@&@/e<CR>:'a,.s/\*\//@&/e<CR>:'y,'zs/^\( *\) @/\1@/e<CR>'zk:call AlignMaps#StdAlign(2)<CR>:'y,'zs/^\(\s*\) @/\1/e<CR>:'y,'zs/ @//eg<CR><SID>WE
+map <silent> <script> <Plug>AM_adcom	<SID>WS:'a,.v/^\s*\/[/*]/s/\/[*/]\*\=/@&@/e<CR>:'a,.v/^\s*\/[/*]/s/\*\//@&/e<CR>:'y,'zv/^\s*\/[/*]/s/^\( *\) @/\1@/e<CR>'zk:call AlignMaps#StdAlign(3)<cr>:'y,'zv/^\s*\/[/*]/s/^\(\s*\) @/\1/e<CR>:'y,'zs/ @//eg<CR><SID>WE
+map <silent> <script> <Plug>AM_aocom	<SID>WS:AlignPush<CR>:AlignCtrl g /[*/]<CR>:exe "norm \<Plug>AM_acom"<cr>:AlignPop<CR><SID>WE
+map <silent> <script> <Plug>AM_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:call AlignMaps#StdAlign(2)<cr>:'y,'zs/^\(\s*\) @/\1/e<CR>:'y,'zs/ @//eg<CR><SID>WE
+map <silent> <script> <Plug>AM_adec		<SID>WS:'a,'zs/\([^ \t/(]\)\([*&]\)/\1 \2/e<CR>:'y,'zv/^\//s/\([^ \t]\)\s\+/\1 /ge<CR>:'y,'zv/^\s*[*/]/s/\([^/][*&]\)\s\+/\1/ge<CR>:'y,'zv/^\s*[*/]/s/^\(\s*\%(\K\k*\s\+\%([a-zA-Z_*(&]\)\@=\)\+\)\([*(&]*\)\s*\([a-zA-Z0-9_()]\+\)\s*\(\(\[.\{-}]\)*\)\s*\(=\)\=\s*\(.\{-}\)\=\s*;/\1@\2#@\3\4@\6@\7;@/e<CR>:'y,'zv/^\s*[*/]/s/\*\/\s*$/@*\//e<CR>:'y,'zv/^\s*[*/]/s/^\s\+\*/@@@@@* /e<CR>:'y,'zv/^\s*[*/]/s/^@@@@@\*\(.*[^*/]\)$/&@*/e<CR>'yjma'zk:AlignCtrl v ^\s*[*/#]<CR>:call AlignMaps#StdAlign(1)<cr>:'y,'zv/^\s*[*/]/s/@ //ge<CR>:'y,'zv/^\s*[*/]/s/\(\s*\);/;\1/e<CR>:'y,'zv/^#/s/# //e<CR>:'y,'zv/^\s\+[*/#]/s/\([^/*]\)\(\*\+\)\( \+\)/\1\3\2/e<CR>:'y,'zv/^\s\+[*/#]/s/\((\+\)\( \+\)\*/\2\1*/e<CR>:'y,'zv/^\s\+[*/#]/s/^\(\s\+\) \*/\1*/e<CR>:'y,'zv/^\s\+[*/#]/s/[ \t@]*$//e<CR>:'y,'zs/^[*]/ */e<CR><SID>WE
+map <silent> <script> <Plug>AM_adef		<SID>WS:AlignPush<CR>:AlignCtrl v ^\s*\(\/\*\<bar>\/\/\)<CR>:'a,.v/^\s*\(\/\*\<bar>\/\/\)/s/^\(\s*\)#\(\s\)*define\s*\(\I[a-zA-Z_0-9(),]*\)\s*\(.\{-}\)\($\<Bar>\/\*\)/#\1\2define @\3@\4@\5/e<CR>:'a,.v/^\s*\(\/\*\<bar>\/\/\)/s/\($\<Bar>\*\/\)/@&/e<CR>'zk:call AlignMaps#StdAlign(1)<cr>'yjma'zk:'a,.v/^\s*\(\/\*\<bar>\/\/\)/s/ @//g<CR><SID>WE
+map <silent> <script> <Plug>AM_afnc		:<c-u>set lz<CR>:silent call AlignMaps#Afnc()<CR>:set nolz<CR>
+map <silent> <script> <Plug>AM_aunum	<SID>WS:'a,'zs/\%([0-9.]\)\s\+\zs\([-+.]\=\d\)/@\1/ge<CR>:'a,'zs/\(\(^\|\s\)\d\+\)\(\s\+\)@/\1@\3@/ge<CR>:'a,'zs/\.@/\.0@/ge<CR>:AlignCtrl mp0P0r<CR>:'a,'zAlign [.@]<CR>:'a,'zs/@/ /ge<CR>:'a,'zs/\(\.\)\(\s\+\)\([0-9.,eE+]\+\)/\1\3\2/ge<CR>:'a,'zs/\([eE]\)\(\s\+\)\([0-9+\-+]\+\)/\1\3\2/ge<CR><SID>WE
+map <silent> <script> <Plug>AM_aenum	<SID>WS:'a,'zs/\%([0-9.]\)\s\+\([-+]\=\d\)/\1@\2/ge<CR>:'a,'zs/\.@/\.0@/ge<CR>:AlignCtrl mp0P0r<CR>:'a,'zAlign [,@]<CR>:'a,'zs/@/ /ge<CR>:'a,'zs/\(,\)\(\s\+\)\([-0-9.,eE+]\+\)/\1\3\2/ge<CR>:'a,'zs/\([eE]\)\(\s\+\)\([0-9+\-+]\+\)/\1\3\2/ge<CR><SID>WE
+
+" ---------------------------------------------------------------------
+" html table alignment	{{{2
+if !hasmapto('<Plug>AM_Htd')|map <unique> <Leader>Htd	<Plug>AM_Htd|endif
+map <silent> <script> <Plug>AM_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 {{{2
+if !hasmapto('<Plug>AM_T|')|map <unique> <Leader>T|		<Plug>AM_T||endif
+if !hasmapto('<Plug>AM_T#')	 |map <unique> <Leader>T#		<Plug>AM_T#|endif
+if !hasmapto('<Plug>AM_T,')	 |map <unique> <Leader>T,		<Plug>AM_T,o|endif
+if !hasmapto('<Plug>AM_Ts,') |map <unique> <Leader>Ts,		<Plug>AM_Ts,|endif
+if !hasmapto('<Plug>AM_T:')	 |map <unique> <Leader>T:		<Plug>AM_T:|endif
+if !hasmapto('<Plug>AM_T;')	 |map <unique> <Leader>T;		<Plug>AM_T;|endif
+if !hasmapto('<Plug>AM_T<')	 |map <unique> <Leader>T<		<Plug>AM_T<|endif
+if !hasmapto('<Plug>AM_T=')	 |map <unique> <Leader>T=		<Plug>AM_T=|endif
+if !hasmapto('<Plug>AM_T?')	 |map <unique> <Leader>T?		<Plug>AM_T?|endif
+if !hasmapto('<Plug>AM_T@')	 |map <unique> <Leader>T@		<Plug>AM_T@|endif
+if !hasmapto('<Plug>AM_Tab') |map <unique> <Leader>Tab		<Plug>AM_Tab|endif
+if !hasmapto('<Plug>AM_Tsp') |map <unique> <Leader>Tsp		<Plug>AM_Tsp|endif
+if !hasmapto('<Plug>AM_T~')	 |map <unique> <Leader>T~		<Plug>AM_T~|endif
+
+map <silent> <script> <Plug>AM_T| <SID>WS:AlignCtrl mIp0P0=r <Bar><CR>:'a,.Align<CR><SID>WE
+map <silent> <script> <Plug>AM_T#   <SID>WS:AlignCtrl mIp0P0=r #<CR>:'a,.Align<CR><SID>WE
+map <silent> <script> <Plug>AM_T,   <SID>WS:AlignCtrl mIp0P1=r ,<CR>:'a,.Align<CR><SID>WE
+map <silent> <script> <Plug>AM_Ts,  <SID>WS:AlignCtrl mIp0P1=r ,<CR>:'a,.Align<CR>:'a,.s/\(\s*\),/,\1/ge<CR><SID>WE
+map <silent> <script> <Plug>AM_T:   <SID>WS:AlignCtrl mIp1P1=r :<CR>:'a,.Align<CR><SID>WE
+map <silent> <script> <Plug>AM_T;   <SID>WS:AlignCtrl mIp0P0=r ;<CR>:'a,.Align<CR><SID>WE
+map <silent> <script> <Plug>AM_T<   <SID>WS:AlignCtrl mIp0P0=r <<CR>:'a,.Align<CR><SID>WE
+map <silent> <script> <Plug>AM_T=   <SID>WS:'a,'z-1s/\s\+\([*/+\-%<Bar>&\~^]\==\)/ \1/e<CR>:'a,'z-1s@ \+\([*/+\-%<Bar>&\~^]\)=@\1=@ge<CR>:'a,'z-1s/; */;@/e<CR>:'a,'z-1s/==/\="\<Char-0xff>\<Char-0xff>"/ge<CR>:'a,'z-1s/!=/\x="!\<Char-0xff>"/ge<CR>:AlignCtrl mIp1P1=r = @<CR>:AlignCtrl g =<CR>:'a,'z-1Align<CR>:'a,'z-1s/; *@/;/e<CR>:'a,'z-1s/; *$/;/e<CR>:'a,'z-1s@\([*/+\-%<Bar>&\~^]\)\( \+\)=@\2\1=@ge<CR>:'a,'z-1s/\( \+\);/;\1/ge<CR>:'a,'z-1s/\xff/=/ge<CR><SID>WE:exe "norm <Plug>acom"
+map <silent> <script> <Plug>AM_T?   <SID>WS:AlignCtrl mIp0P0=r ?<CR>:'a,.Align<CR>:'y,'zs/ \( *\);/;\1/ge<CR><SID>WE
+map <silent> <script> <Plug>AM_T@   <SID>WS:AlignCtrl mIp0P0=r @<CR>:'a,.Align<CR><SID>WE
+map <silent> <script> <Plug>AM_Tab  <SID>WS:'a,.s/^\(\t*\)\(.*\)/\=submatch(1).escape(substitute(submatch(2),'\t','@','g'),'\')/<CR>:AlignCtrl mI=r @<CR>:'a,.Align<CR>:'y+1,'z-1s/@/ /g<CR><SID>WE
+map <silent> <script> <Plug>AM_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> <script> <Plug>AM_T~   <SID>WS:AlignCtrl mIp0P0=r ~<CR>:'a,.Align<CR>:'y,'zs/ \( *\);/;\1/ge<CR><SID>WE
+
+" ---------------------------------------------------------------------
+" character-based left-justified alignment maps {{{2
+if !hasmapto('<Plug>AM_t|')	|map <unique> <Leader>t|	<Plug>AM_t||endif
+if !hasmapto('<Plug>AM_t#')		|map <unique> <Leader>t#	<Plug>AM_t#|endif
+if !hasmapto('<Plug>AM_t,')		|map <unique> <Leader>t,	<Plug>AM_t,|endif
+if !hasmapto('<Plug>AM_ts,')	|map <unique> <Leader>ts,	<Plug>AM_ts,|endif
+if !hasmapto('<Plug>AM_t:')		|map <unique> <Leader>t:	<Plug>AM_t:|endif
+if !hasmapto('<Plug>AM_t;')		|map <unique> <Leader>t;	<Plug>AM_t;|endif
+if !hasmapto('<Plug>AM_t<')		|map <unique> <Leader>t<	<Plug>AM_t<|endif
+if !hasmapto('<Plug>AM_t=')		|map <unique> <Leader>t=	<Plug>AM_t=|endif
+if !hasmapto('<Plug>AM_w=')		|map <unique> <Leader>w=	<Plug>AM_w=|endif
+if !hasmapto('<Plug>AM_t?')		|map <unique> <Leader>t?	<Plug>AM_t?|endif
+if !hasmapto('<Plug>AM_t~')		|map <unique> <Leader>t~	<Plug>AM_t~|endif
+if !hasmapto('<Plug>AM_t@')		|map <unique> <Leader>t@	<Plug>AM_t@|endif
+if !hasmapto('<Plug>AM_m=')		|map <unique> <Leader>m=	<Plug>AM_m=|endif
+if !hasmapto('<Plug>AM_tab')	|map <unique> <Leader>tab	<Plug>AM_tab|endif
+if !hasmapto('<Plug>AM_tml')	|map <unique> <Leader>tml	<Plug>AM_tml|endif
+if !hasmapto('<Plug>AM_tsp')	|map <unique> <Leader>tsp	<Plug>AM_tsp|endif
+if !hasmapto('<Plug>AM_tsq')	|map <unique> <Leader>tsq	<Plug>AM_tsq|endif
+if !hasmapto('<Plug>AM_tt')		|map <unique> <Leader>tt	<Plug>AM_tt|endif
+
+map <silent> <script> <Plug>AM_t|		<SID>WS:AlignCtrl mIp0P0=l <Bar><CR>:'a,.Align<CR><SID>WE
+map <silent> <script> <Plug>AM_t#		<SID>WS:AlignCtrl mIp0P0=l #<CR>:'a,.Align<CR><SID>WE
+map <silent> <script> <Plug>AM_t,		<SID>WS:AlignCtrl mIp0P1=l ,<CR>:'a,.Align<CR><SID>WE
+map <silent> <script> <Plug>AM_ts,		<SID>WS:AlignCtrl mIp0P1=l ,<CR>:'a,.Align<CR>:'a,.s/\(\s*\),/,\1/ge<CR><SID>WE
+map <silent> <script> <Plug>AM_t:		<SID>WS:AlignCtrl mIp1P1=l :<CR>:'a,.Align<CR><SID>WE
+map <silent> <script> <Plug>AM_t;		<SID>WS:AlignCtrl mIp0P1=l ;<CR>:'a,.Align<CR>:'y,'zs/\( *\);/;\1/ge<CR><SID>WE
+map <silent> <script> <Plug>AM_t<		<SID>WS:AlignCtrl mIp0P0=l <<CR>:'a,.Align<CR><SID>WE
+map <silent> <script> <Plug>AM_t=		<SID>WS:call AlignMaps#Equals()<CR><SID>WE
+map <silent> <script> <Plug>AM_w=		<SID>WS:'a,'zg/=/s/\s\+\([*/+\-%<Bar>&\~^]\==\)/ \1/e<CR>:'a,'zg/=/s@ \+\([*/+\-%<Bar>&\~^]\)=@\1=@ge<CR>:'a,'zg/=/s/==/\="\<Char-0xff>\<Char-0xff>"/ge<CR>:'a,'zg/=/s/!=/\="!\<Char-0xff>"/ge<CR>'zk:AlignCtrl mWp1P1=l =<CR>:AlignCtrl g =<CR>:'a,'z-1g/=/Align<CR>:'a,'z-1g/=/s@\([*/+\-%<Bar>&\~^!=]\)\( \+\)=@\2\1=@ge<CR>:'a,'z-1g/=/s/\( \+\);/;\1/ge<CR>:'a,'z-1v/^\s*\/[*/]/s/\/[*/]/@&@/e<CR>:'a,'z-1v/^\s*\/[*/]/s/\*\//@&/e<CR>'zk:call AlignMaps#StdAlign(1)<cr>:'y,'zs/^\(\s*\) @/\1/e<CR>:'a,'z-1g/=/s/\xff/=/ge<CR>:'y,'zg/=/s/ @//eg<CR><SID>WE
+map <silent> <script> <Plug>AM_t?		<SID>WS:AlignCtrl mIp0P0=l ?<CR>:'a,.Align<CR>:.,'zs/ \( *\);/;\1/ge<CR><SID>WE
+map <silent> <script> <Plug>AM_t~		<SID>WS:AlignCtrl mIp0P0=l ~<CR>:'a,.Align<CR>:'y,'zs/ \( *\);/;\1/ge<CR><SID>WE
+map <silent> <script> <Plug>AM_t@		<SID>WS::call AlignMaps#StdAlign(1)<cr>:<SID>WE
+map <silent> <script> <Plug>AM_m=		<SID>WS:'a,'zs/\s\+\([*/+\-%<Bar>&\~^]\==\)/ \1/e<CR>:'a,'zs@ \+\([*/+\-%<Bar>&\~^]\)=@\1=@ge<CR>:'a,'zs/==/\="\<Char-0xff>\<Char-0xff>"/ge<CR>:'a,'zs/!=/\="!\<Char-0xff>"/ge<CR>'zk:AlignCtrl mIp1P1=l =<CR>:AlignCtrl g =<CR>:'a,'z-1Align<CR>:'a,'z-1s@\([*/+\-%<Bar>&\~^!=]\)\( \+\)=@\2\1=@ge<CR>:'a,'z-1s/\( \+\);/;\1/ge<CR>:'a,'z-s/%\ze[^=]/ @%@ /e<CR>'zk:call AlignMaps#StdAlign(1)<cr>:'y,'zs/^\(\s*\) @/\1/e<CR>:'a,'z-1s/\xff/=/ge<CR>:'y,'zs/ @//eg<CR><SID>WE
+map <silent> <script> <Plug>AM_tab		<SID>WS:'a,.s/^\(\t*\)\(.*\)$/\=submatch(1).escape(substitute(submatch(2),'\t',"\<Char-0xff>",'g'),'\')/<CR>:if &ts == 1<bar>exe "AlignCtrl mI=lp0P0 \<Char-0xff>"<bar>else<bar>exe "AlignCtrl mI=l \<Char-0xff>"<bar>endif<CR>:'a,.Align<CR>:exe "'y+1,'z-1s/\<Char-0xff>/".((&ts == 1)? '\t' : ' ')."/g"<CR><SID>WE
+map <silent> <script> <Plug>AM_tml		<SID>WS:AlignCtrl mWp1P0=l \\\@<!\\\s*$<CR>:'a,.Align<CR><SID>WE
+map <silent> <script> <Plug>AM_tsp		<SID>WS:'a,.s/^\(\s*\)\(.*\)/\=submatch(1).escape(substitute(submatch(2),'\s\+','@','g'),'\')/<CR>:AlignCtrl mI=lp0P0 @<CR>:'a,.Align<CR>:'y+1,'z-1s/@/ /g<CR><SID>WE
+map <silent> <script> <Plug>AM_tsq		<SID>WS:'a,.AlignReplaceQuotedSpaces<CR>:'a,.s/^\(\s*\)\(.*\)/\=submatch(1).substitute(submatch(2),'\s\+','@','g')/<CR>:AlignCtrl mIp0P0=l @<CR>:'a,.Align<CR>:'y+1,'z-1s/[%@]/ /g<CR><SID>WE
+map <silent> <script> <Plug>AM_tt		<SID>WS:AlignCtrl mIp1P1=l \\\@<!& \\\\<CR>:'a,.Align<CR><SID>WE
+
+" =====================================================================
 " Menu Support: {{{1
 "   ma ..move.. use menu
 "   v V or ctrl-v ..move.. use menu
@@ -270,201 +185,46 @@
   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'
+  let s:mapleader = exists("g:mapleader")? g:mapleader : '\'
+  let s:emapleader= escape(s:mapleader,'\ ')
+  exe 'menu '.g:DrChipTopLvlMenu.'AlignMaps.<<\ and\ >><tab>'.s:emapleader.'a<	'.s:mapleader.'a<'
+  exe 'menu '.g:DrChipTopLvlMenu.'AlignMaps.Assignment\ =<tab>'.s:emapleader.'t=	'.s:mapleader.'t='
+  exe 'menu '.g:DrChipTopLvlMenu.'AlignMaps.Assignment\ :=<tab>'.s:emapleader.'a=	'.s:mapleader.'a='
+  exe 'menu '.g:DrChipTopLvlMenu.'AlignMaps.Backslashes<tab>'.s:emapleader.'tml	'.s:mapleader.'tml'
+  exe 'menu '.g:DrChipTopLvlMenu.'AlignMaps.Breakup\ Comma\ Declarations<tab>'.s:emapleader.'a,	'.s:mapleader.'a,'
+  exe 'menu '.g:DrChipTopLvlMenu.'AlignMaps.C\ Comment\ Box<tab>'.s:emapleader.'abox	'.s:mapleader.'abox'
+  exe 'menu '.g:DrChipTopLvlMenu.'AlignMaps.Commas<tab>'.s:emapleader.'t,	'.s:mapleader.'t,'
+  exe 'menu '.g:DrChipTopLvlMenu.'AlignMaps.Commas<tab>'.s:emapleader.'ts,	'.s:mapleader.'ts,'
+  exe 'menu '.g:DrChipTopLvlMenu.'AlignMaps.Commas\ With\ Strings<tab>'.s:emapleader.'tsq	'.s:mapleader.'tsq'
+  exe 'menu '.g:DrChipTopLvlMenu.'AlignMaps.Comments<tab>'.s:emapleader.'acom	'.s:mapleader.'acom'
+  exe 'menu '.g:DrChipTopLvlMenu.'AlignMaps.Comments\ Only<tab>'.s:emapleader.'aocom	'.s:mapleader.'aocom'
+  exe 'menu '.g:DrChipTopLvlMenu.'AlignMaps.Declaration\ Comments<tab>'.s:emapleader.'adcom	'.s:mapleader.'adcom'
+  exe 'menu '.g:DrChipTopLvlMenu.'AlignMaps.Declarations<tab>'.s:emapleader.'adec	'.s:mapleader.'adec'
+  exe 'menu '.g:DrChipTopLvlMenu.'AlignMaps.Definitions<tab>'.s:emapleader.'adef	'.s:mapleader.'adef'
+  exe 'menu '.g:DrChipTopLvlMenu.'AlignMaps.Function\ Header<tab>'.s:emapleader.'afnc	'.s:mapleader.'afnc'
+  exe 'menu '.g:DrChipTopLvlMenu.'AlignMaps.Html\ Tables<tab>'.s:emapleader.'Htd	'.s:mapleader.'Htd'
+  exe 'menu '.g:DrChipTopLvlMenu.'AlignMaps.(\.\.\.)?\.\.\.\ :\ \.\.\.<tab>'.s:emapleader.'a?	'.s:mapleader.'a?'
+  exe 'menu '.g:DrChipTopLvlMenu.'AlignMaps.Numbers<tab>'.s:emapleader.'anum	'.s:mapleader.'anum'
+  exe 'menu '.g:DrChipTopLvlMenu.'AlignMaps.Numbers\ (American-Style)<tab>'.s:emapleader.'aunum	<Leader>aunum	'.s:mapleader.'aunum	<Leader>aunum'
+  exe 'menu '.g:DrChipTopLvlMenu.'AlignMaps.Numbers\ (Euro-Style)<tab>'.s:emapleader.'aenum	'.s:mapleader.'aenum'
+  exe 'menu '.g:DrChipTopLvlMenu.'AlignMaps.Spaces\ (Left\ Justified)<tab>'.s:emapleader.'tsp	'.s:mapleader.'tsp'
+  exe 'menu '.g:DrChipTopLvlMenu.'AlignMaps.Spaces\ (Right\ Justified)<tab>'.s:emapleader.'Tsp	'.s:mapleader.'Tsp'
+  exe 'menu '.g:DrChipTopLvlMenu.'AlignMaps.Statements\ With\ Percent\ Style\ Comments<tab>'.s:emapleader.'m=	'.s:mapleader.'m='
+  exe 'menu '.g:DrChipTopLvlMenu.'AlignMaps.Symbol\ <<tab>'.s:emapleader.'t<	'.s:mapleader.'t<'
+  exe 'menu '.g:DrChipTopLvlMenu.'AlignMaps.Symbol\ \|<tab>'.s:emapleader.'t\|	'.s:mapleader.'t|'
+  exe 'menu '.g:DrChipTopLvlMenu.'AlignMaps.Symbol\ @<tab>'.s:emapleader.'t@	'.s:mapleader.'t@'
+  exe 'menu '.g:DrChipTopLvlMenu.'AlignMaps.Symbol\ #<tab>'.s:emapleader.'t#	'.s:mapleader.'t#'
+  exe 'menu '.g:DrChipTopLvlMenu.'AlignMaps.Tabs<tab>'.s:emapleader.'tab	'.s:mapleader.'tab'
+  unlet s:mapleader
+  unlet s:emapleader
  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
-
-" ---------------------------------------------------------------------
-" Afnc: useful for splitting one-line function beginnings {{{1
-"            into one line per argument format
-fun! <SID>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=". at 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<". at x.">")
-
-  " transform line
-  exe 's/,/;\r'. at x.' /ge'
-
-  "restore register x
-  let @x= xkeep
-
-"  call Dret("FixMultiDec : my=".line("'y")." mz=".line("'z"))
-endfun
-
+" =====================================================================
+"  Restore: {{{1
 let &cpo= s:keepcpo
 unlet s:keepcpo
-" ------------------------------------------------------------------------------
+
+" ==============================================================================
+"  Modelines: {{{1
 " vim: ts=4 nowrap fdm=marker

Propchange: trunk/packages/vim-scripts/plugin/AlignMapsPlugin.vim
------------------------------------------------------------------------------
    svn:mergeinfo = 

Modified: trunk/packages/vim-scripts/plugin/cecutil.vim
URL: http://svn.debian.org/wsvn/pkg-vim/trunk/packages/vim-scripts/plugin/cecutil.vim?rev=1290&op=diff
==============================================================================
--- trunk/packages/vim-scripts/plugin/cecutil.vim (original)
+++ trunk/packages/vim-scripts/plugin/cecutil.vim Fri Dec  5 19:59:30 2008
@@ -2,8 +2,8 @@
 "               save/restore mark position
 "               save/restore selected user maps
 "  Author:	Charles E. Campbell, Jr.
-"  Version:	17
-"  Date:	Sep 04, 2007
+"  Version:	18b	ASTRO-ONLY
+"  Date:	Aug 27, 2008
 "
 "  Saving Restoring Destroying Marks: {{{1
 "       call SaveMark(markname)       let savemark= SaveMark(markname)
@@ -28,19 +28,21 @@
 " 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 g:loaded_cecutil = "v18b"
 let s:keepcpo        = &cpo
 set cpo&vim
-"DechoVarOn
-
-" -----------------------
+"DechoTabOn
+
+" =======================
 "  Public Interface: {{{1
-" -----------------------
-
+" =======================
+
+" ---------------------------------------------------------------------
 "  Map Interface: {{{2
 if !hasmapto('<Plug>SaveWinPosn')
  map <unique> <Leader>swp <Plug>SaveWinPosn
@@ -51,6 +53,7 @@
 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()
@@ -64,8 +67,12 @@
  let s:modifier= "sil keepj "
 endif
 
-" ---------------------------------------------------------------------
-" SaveWinPosn: {{{1
+" ===============
+" Functions: {{{1
+" ===============
+
+" ---------------------------------------------------------------------
+" SaveWinPosn: {{{2
 "    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)
@@ -75,10 +82,10 @@
 "   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 so_keep   = &l:so
+  let siso_keep = &l:siso
+  let ss_keep   = &l:ss
+  setlocal so=0 siso=0 ss=0
 
   let swline    = line(".")
   let swcol     = col(".")
@@ -107,9 +114,9 @@
    let b:cecutil_winposn{b:cecutil_iwinposn}= savedposn
   endif
 
-  let &so   = so_keep
-  let &siso = siso_keep
-  let &ss   = ss_keep
+  let &l:so   = so_keep
+  let &l:siso = siso_keep
+  let &l:ss   = ss_keep
 
 "  if exists("b:cecutil_iwinposn")	 " Decho
 "   call Decho("b:cecutil_winpos{".b:cecutil_iwinposn."}[".b:cecutil_winposn{b:cecutil_iwinposn}."]")
@@ -121,7 +128,7 @@
 endfun
 
 " ---------------------------------------------------------------------
-" RestoreWinPosn: {{{1
+" RestoreWinPosn: {{{2
 fun! RestoreWinPosn(...)
 "  call Dfunc("RestoreWinPosn() a:0=".a:0)
 "  call Decho("getline(1)<".getline(1).">")
@@ -130,10 +137,10 @@
 "   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
+  let so_keep   = &l:so
+  let siso_keep = &l:siso
+  let ss_keep   = &l:ss
+  setlocal 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
@@ -184,23 +191,25 @@
    endif
   endif
 
-  " seems to be something odd: vertical motions after RWP
-  " cause jump to first column.  Following fixes that
-  if wincol() > 1
+  " Seems to be something odd: vertical motions after RWP
+  " cause jump to first column.  The following fixes that.
+  " Note: was using wincol()>1, but with signs, a cursor
+  " at column 1 yields wincol()==3.  Beeping ensued.
+  if virtcol('.') > 1
    silent norm! hl
   elseif virtcol(".") < virtcol("$")
    silent norm! lh
   endif
 
-  let &so   = so_keep
-  let &siso = siso_keep
-  let &ss   = ss_keep
+  let &l:so   = so_keep
+  let &l:siso = siso_keep
+  let &l:ss   = ss_keep
 
 "  call Dret("RestoreWinPosn")
 endfun
 
 " ---------------------------------------------------------------------
-" GoWinbufnr: go to window holding given buffer (by number) {{{1
+" GoWinbufnr: go to window holding given buffer (by number) {{{2
 "   Prefers current window; if its buffer number doesn't match,
 "   then will try from topleft to bottom right
 fun! GoWinbufnr(bufnum)
@@ -219,7 +228,7 @@
 endfun
 
 " ---------------------------------------------------------------------
-" SaveMark: sets up a string saving a mark position. {{{1
+" SaveMark: sets up a string saving a mark position. {{{2
 "           For example, SaveMark("a")
 "           Also sets up a global variable, g:savemark_{markname}
 fun! SaveMark(markname)
@@ -252,7 +261,7 @@
 endfun
 
 " ---------------------------------------------------------------------
-" RestoreMark: {{{1
+" RestoreMark: {{{2
 "   call RestoreMark("a")  -or- call RestoreMark(savemark)
 fun! RestoreMark(markname)
 "  call Dfunc("RestoreMark(markname<".a:markname.">)")
@@ -294,7 +303,7 @@
 endfun
 
 " ---------------------------------------------------------------------
-" DestroyMark: {{{1
+" DestroyMark: {{{2
 "   call DestroyMark("a")  -- destroys mark
 fun! DestroyMark(markname)
 "  call Dfunc("DestroyMark(markname<".a:markname.">)")
@@ -329,7 +338,7 @@
 endfun
 
 " ---------------------------------------------------------------------
-" QArgSplitter: to avoid \ processing by <f-args>, <q-args> is needed. {{{1
+" QArgSplitter: to avoid \ processing by <f-args>, <q-args> is needed. {{{2
 " 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
@@ -344,7 +353,7 @@
 endfun
 
 " ---------------------------------------------------------------------
-" ListWinPosn:
+" ListWinPosn: {{{2
 "fun! ListWinPosn()                                                        " Decho 
 "  if !exists("b:cecutil_iwinposn") || b:cecutil_iwinposn == 0             " Decho 
 "   call Decho("nothing on SWP stack")                                     " Decho
@@ -363,14 +372,19 @@
 "com! -nargs=0 LWP	call ListWinPosn()                                    " Decho 
 
 " ---------------------------------------------------------------------
-" SaveUserMaps: this function sets up a script-variable (s:restoremap) {{{1
+" SaveUserMaps: this function sets up a script-variable (s:restoremap) {{{2
 "          which can be used to restore user maps later with
 "          call RestoreUserMaps()
 "
-"          mapmode - see :help maparg for its list
+"          mapmode - see :help maparg for details (n v o i c l "")
 "                    ex. "n" = Normal
-"                    If the first letter is u, then unmapping will be done
-"                    ex. "un" = Normal + unmapping
+"                    The letters "b" and "u" are optional prefixes;
+"                    The "u" means that the map will also be unmapped
+"                    The "b" means that the map has a <buffer> qualifier
+"                    ex. "un"  = Normal + unmapping
+"                    ex. "bn"  = Normal + <buffer>
+"                    ex. "bun" = Normal + <buffer> + unmapping
+"                    ex. "ubn" = Normal + <buffer> + unmapping
 "          maplead - see mapchx
 "          mapchx  - "<something>" handled as a single map item.
 "                    ex. "<left>"
@@ -395,60 +409,70 @@
 
   " 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
+  let mapmode  = a:mapmode
+  let dounmap  = 0
+  let dobuffer = ""
+  while mapmode =~ '^[bu]'
+   if     mapmode =~ '^u'
+    let dounmap= 1
+    let mapmode= strpart(a:mapmode,1)
+   elseif mapmode =~ '^b'
+    let dobuffer= "<buffer> "
+    let mapmode= strpart(a:mapmode,1)
+   endif
+  endwhile
+"  call Decho("dounmap=".dounmap."  dobuffer<".dobuffer.">")
  
   " save single map :...something...
   if strpart(a:mapchx,0,1) == ':'
+"   call Decho("save single map :...something...")
    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
+   let s:restoremap_{a:suffix} = s:restoremap_{a:suffix}."|:silent! ".mapmode."unmap ".dobuffer.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
+	let s:restoremap_{a:suffix} = s:restoremap_{a:suffix}."|:".mapmode."map ".dobuffer.amap." ".maprhs
    endif
    if dounmap
-    exe "silent! ".mapmode."unmap ".amap
+	exe "silent! ".mapmode."unmap ".dobuffer.amap
    endif
  
   " save single map <something>
   elseif strpart(a:mapchx,0,1) == '<'
+"   call Decho("save single map <something>")
    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
+"	call Decho("amap[[".amap."]]")
+   endif
+   let s:restoremap_{a:suffix} = s:restoremap_{a:suffix}."|silent! ".mapmode."unmap ".dobuffer.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
+	let s:restoremap_{a:suffix} = s:restoremap_{a:suffix}."|".mapmode."map ".amap." ".dobuffer.maprhs
    endif
    if dounmap
-    exe "silent! ".mapmode."unmap ".amap
+	exe "silent! ".mapmode."unmap ".dobuffer.amap
    endif
  
   " save multiple maps
   else
+"   call Decho("save multiple maps")
    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
+	let s:restoremap_{a:suffix} = s:restoremap_{a:suffix}."|silent! ".mapmode."unmap ".dobuffer.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
+	 let s:restoremap_{a:suffix} = s:restoremap_{a:suffix}."|".mapmode."map ".amap." ".dobuffer.maprhs
     endif
 	if dounmap
-     exe "silent! ".mapmode."unmap ".amap
+	 exe "silent! ".mapmode."unmap ".dobuffer.amap
 	endif
     let i= i + 1
    endwhile
@@ -457,7 +481,7 @@
 endfun
 
 " ---------------------------------------------------------------------
-" RestoreUserMaps: {{{1
+" RestoreUserMaps: {{{2
 "   Used to restore user maps saved by SaveUserMaps()
 fun! RestoreUserMaps(suffix)
 "  call Dfunc("RestoreUserMaps(suffix<".a:suffix.">)")
@@ -472,11 +496,13 @@
 "  call Dret("RestoreUserMaps")
 endfun
 
-" ---------------------------------------------------------------------
+" ==============
 "  Restore: {{{1
+" ==============
 let &cpo= s:keepcpo
 unlet s:keepcpo
 
-" ---------------------------------------------------------------------
+" ================
 "  Modelines: {{{1
+" ================
 " vim: ts=4 fdm=marker




More information about the pkg-vim-maintainers mailing list