r1174 - in /trunk/packages/vim-scripts: autoload/ debian/ doc/ plugin/
jamessan at users.alioth.debian.org
jamessan at users.alioth.debian.org
Fri Jan 25 05:40:29 UTC 2008
Author: jamessan
Date: Fri Jan 25 05:40:28 2008
New Revision: 1174
URL: http://svn.debian.org/wsvn/pkg-vim/?sc=1&rev=1174
Log:
- Bufexplorer (Closes: #455883), NERD Commenter, Supertab, Align, cvsmenu,
and gnupg.
Modified:
trunk/packages/vim-scripts/autoload/Align.vim
trunk/packages/vim-scripts/autoload/deb.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/doc/NERD_commenter.txt
trunk/packages/vim-scripts/doc/bufexplorer.txt
trunk/packages/vim-scripts/plugin/AlignMaps.vim
trunk/packages/vim-scripts/plugin/AlignPlugin.vim
trunk/packages/vim-scripts/plugin/NERD_commenter.vim
trunk/packages/vim-scripts/plugin/bufexplorer.vim
trunk/packages/vim-scripts/plugin/cecutil.vim
trunk/packages/vim-scripts/plugin/cvsmenu.vim
trunk/packages/vim-scripts/plugin/gnupg.vim
trunk/packages/vim-scripts/plugin/supertab.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=1174&op=diff
==============================================================================
--- trunk/packages/vim-scripts/autoload/Align.vim (original)
+++ trunk/packages/vim-scripts/autoload/Align.vim Fri Jan 25 05:40:28 2008
@@ -1,10 +1,10 @@
" Align: tool to align multiple fields based on one or more separators
" Author: Charles E. Campbell, Jr.
-" Date: Aug 20, 2007
-" Version: 32
+" Date: Dec 20, 2007
+" Version: 33
" GetLatestVimScripts: 294 1 :AutoInstall: Align.vim
-" GetLatestVimScripts: 1066 1 cecutil.vim
-" Copyright: Copyright (C) 1999-2005 Charles E. Campbell, Jr. {{{1
+" GetLatestVimScripts: 1066 1 :AutoInstall: cecutil.vim
+" Copyright: Copyright (C) 1999-2007 Charles E. Campbell, Jr. {{{1
" Permission is hereby granted to use and distribute this code,
" with or without modifications, provided that this copyright
" notice is copied with it. Like anything else that's free,
@@ -14,79 +14,6 @@
" holder be liable for any damages resulting from the use
" of this software.
"
-" Usage: Functions {{{1
-" AlignCtrl(style,..list..)
-"
-" "default" : Sets AlignCtrl to its default values and clears stack
-" AlignCtrl "Ilp1P1=<" '='
-"
-" Separators
-" "=" : all alignment demarcation patterns (separators) are
-" equivalent and simultaneously active. The list of
-" separators is composed of such patterns
-" (regular expressions, actually).
-" "C" : cycle through alignment demarcation patterns
-" "<" : separators aligned to left if of differing lengths
-" ">" : separators aligned to right if of differing lengths
-" "|" : separators aligned to center if of differing lengths
-"
-" Alignment/Justification
-" "l" : left justify (no list needed)
-" "r" : right justify (no list needed)
-" "c" : center (no list needed)
-" Justification styles are cylic: ie. "lcr" would
-" mean first field is left-justifed,
-" second field is centered,
-" third field is right-justified,
-" fourth field is left-justified, etc.
-" "-" : skip this separator+ws+field
-" "+" : repeat last alignment/justification indefinitely
-" ":" : no more alignment/justifcation
-"
-" Map Support
-" "m" : next call to Align will AlignPop at end.
-" AlignCtrl will AlignPush first.
-"
-" Padding
-" "p" : current argument supplies pre-field-padding parameter;
-" ie. that many blanks will be applied before
-" the field separator. ex. call AlignCtrl("p2").
-" Can have 0-9 spaces. Will be cycled through.
-" "P" : current argument supplies post-field-padding parameter;
-" ie. that many blanks will be applied after
-" the field separator. ex. call AlignCtrl("P3")
-" Can have 0-9 spaces. Will be cycled through.
-"
-" Initial White Space
-" "I" : preserve first line's leading whitespace and re-use
-" subsequently
-" "W" : preserve leading whitespace on every line
-" "w" : don't preserve leading whitespace
-"
-" Selection Patterns
-" "g" : restrict alignment to pattern
-" "v" : restrict alignment to not-pattern
-"
-" If no arguments are supplied, AlignCtrl() will list
-" current settings.
-"
-" [range]Align(..list..)
-" Takes a range and performs the specified alignment on the
-" text. The range may be :line1,line2 etc, or visually selected.
-" The list is a list of patterns; the current s:AlignCtrl
-" will be used ('=' or 'C').
-"
-" Usage: Commands {{{1
-" AlignCtrl : lists current alignment settings
-" AlignCtrl style ..list.. : set alignment separators
-" AlignCtrl {gv} pattern : apply alignment only to lines which match (g)
-" or don't match (v) the given pattern
-" [range]Align ..list.. : applies Align() over the specified range
-" The range may be specified via
-" visual-selection as well as the usual
-" [range] specification. The ..list..
-" is a list of alignment separators.
-"
" Romans 1:16,17a : For I am not ashamed of the gospel of Christ, for it is {{{1
" the power of God for salvation for everyone who believes; for the Jew first,
" and also for the Greek. For in it is revealed God's righteousness from
@@ -97,9 +24,10 @@
if exists("g:loaded_align") || &cp
finish
endif
-let g:loaded_align = "v32"
+let g:loaded_align = "v33"
let s:keepcpo = &cpo
set cpo&vim
+"DechoTabOn
" ---------------------------------------------------------------------
" Debugging Support:
@@ -158,7 +86,8 @@
let s:Align_gavemsg= 1
echomsg "Align needs at least Vim version 6.2 to clear visual-mode selection"
endif
- else
+ elseif exists("s:dovisclear")
+" call Decho("clearing visual mode a:0=".a:0." a:1<".a:1.">")
let clearvmode= visualmode(1)
endif
@@ -243,8 +172,9 @@
call Align#AlignCtrl("Ilp1P1=<",'=')
call Align#AlignCtrl("g")
call Align#AlignCtrl("v")
- let &ic= keep_ic
- let @/ = keep_search
+ let s:dovisclear = 1
+ let &ic = keep_ic
+ let @/ = keep_search
" call Dret("AlignCtrl")
return
endif
@@ -392,9 +322,16 @@
endfun
" ---------------------------------------------------------------------
-" Align: align selected text based on alignment pattern(s) {{{1
+" Align#Align: align selected text based on alignment pattern(s) {{{1
fun! Align#Align(hasctrl,...) range
-" call Dfunc("Align(hasctrl=".a:hasctrl.",...) a:0=".a:0)
+" call Dfunc("Align#Align(hasctrl=".a:hasctrl.",...) a:0=".a:0)
+
+ " sanity check
+ if string(a:hasctrl) != "0" && string(a:hasctrl) != "1"
+ echohl Error|echo 'usage: Align#Align(hasctrl<'.a:hasctrl.'> (should be 0 or 1),"separator(s)" (you have '.a:0.') )'|echohl None
+" call Dret("Align#Align")
+ return
+ endif
" set up a list akin to an argument list
if a:0 > 0
@@ -406,6 +343,7 @@
" if :Align! was used, then the first argument is (should be!) an AlignCtrl string
" Note that any alignment control set this way will be temporary.
let hasctrl= a:hasctrl
+" call Decho("hasctrl=".hasctrl)
if a:hasctrl && A[0] >= 1
" call Decho("Align! : using A[1]<".A[1]."> for AlignCtrl")
if A[1] =~ '[gv]'
@@ -425,7 +363,7 @@
while ipat <= A[0]
if "" =~ A[ipat]
echoerr "Align: separator<".A[ipat]."> matches zero-length string"
-" call Dret("Align")
+" call Dret("Align#Align")
return
endif
let ipat= ipat + 1
@@ -445,11 +383,11 @@
"= : consider all separators to be equivalent
" call Decho("AlignCtrl: record list of equivalent alignment patterns")
let s:AlignCtrl = '='
- let s:AlignPat_1 = a:{1 + hasctrl}
+ let s:AlignPat_1 = A[1 + hasctrl]
let s:AlignPatQty= 1
let ipat = 2 + hasctrl
while ipat <= A[0]
- let s:AlignPat_1 = s:AlignPat_1.'\|'.a:{ipat}
+ let s:AlignPat_1 = s:AlignPat_1.'\|'.A[ipat]
let ipat = ipat + 1
endwhile
let s:AlignPat_1= '\('.s:AlignPat_1.'\)'
@@ -462,7 +400,7 @@
let s:AlignPatQty= A[0] - hasctrl
let ipat = 1
while ipat <= s:AlignPatQty
- let s:AlignPat_{ipat}= a:{(ipat + hasctrl)}
+ let s:AlignPat_{ipat}= A[(ipat + hasctrl)]
" call Decho("AlignCtrl<".s:AlignCtrl."> AlignQty=".s:AlignPatQty." AlignPat_".ipat."<".s:AlignPat_{ipat}.">")
let ipat= ipat + 1
endwhile
@@ -480,17 +418,24 @@
let begcol = virtcol("'>")-1
let endcol = virtcol("'<")-1
endif
+" call Decho("begcol=".begcol." endcol=".endcol)
let begline = a:firstline
let endline = a:lastline
if begline > endline
let begline = a:lastline
let endline = a:firstline
endif
+" call Decho("begline=".begline." endline=".endline)
let fieldcnt = 0
if (begline == line("'>") && endline == line("'<")) || (begline == line("'<") && endline == line("'>"))
let vmode= visualmode()
+" call Decho("vmode=".vmode)
if vmode == "\<c-v>"
- let ragged = ( col("'>") > strlen(getline("'>")) || col("'<") > strlen(getline("'<")) )
+ if exists("g:Align_xstrlen") && g:Align_xstrlen
+ let ragged = ( col("'>") > s:Strlen(getline("'>")) || col("'<") > s:Strlen(getline("'<")) )
+ else
+ let ragged = ( col("'>") > strlen(getline("'>")) || col("'<") > strlen(getline("'<")) )
+ endif
else
let ragged= 1
endif
@@ -500,12 +445,12 @@
if ragged
let begcol= 0
endif
-" call Decho("Align() lines[".begline.",".endline."] col[".begcol.",".endcol."] ragged=".ragged." AlignCtrl<".s:AlignCtrl.">")
+" call Decho("lines[".begline.",".endline."] col[".begcol.",".endcol."] ragged=".ragged." AlignCtrl<".s:AlignCtrl.">")
" Keep user options
let etkeep = &et
let pastekeep= &paste
- set et paste
+ setlocal et paste
" convert selected range of lines to use spaces instead of tabs
" but if first line's initial white spaces are to be retained
@@ -561,7 +506,11 @@
endif
" Extract visual-block selected text (init bgntxt, endtxt)
- let txtlen= strlen(txt)
+ if exists("g:Align_xstrlen") && g:Align_xstrlen
+ let txtlen= s:Strlen(txt)
+ else
+ let txtlen= strlen(txt)
+ endif
if begcol > 0
" Record text to left of selected area
let bgntxt= strpart(txt,0,begcol)
@@ -585,6 +534,11 @@
" call Decho("Pass".pass.": bgntxt<".bgntxt.">")
" call Decho("Pass".pass.": txt<". txt .">")
" call Decho("Pass".pass.": endtxt<".endtxt.">")
+ if !exists("s:AlignPat_{1}")
+ echohl Error|echo "no separators specified!"|echohl None
+" call Dret("Align#Align")
+ return
+ endif
" Initialize for both passes
let seppat = s:AlignPat_{1}
@@ -661,7 +615,11 @@
let field = bgntxt.field
let bgntxt= ""
endif
- let fieldlen = strlen(field)
+ if exists("g:Align_xstrlen") && g:Align_xstrlen
+ let fieldlen = s:Strlen(field)
+ else
+ let fieldlen = strlen(field)
+ endif
let sFieldSize = "FieldSize_".ifield
if !exists(sFieldSize)
let FieldSize_{ifield}= fieldlen
@@ -695,7 +653,11 @@
let prepad = 0
let postpad= 0
endif
- let fieldlen = strlen(field)
+ if exists("g:Align_xstrlen") && g:Align_xstrlen
+ let fieldlen = s:Strlen(field)
+ else
+ let fieldlen = strlen(field)
+ endif
let sep = s:MakeSpace(prepad).strpart(txt,endfield,sepfield-endfield).s:MakeSpace(postpad)
if seplen < SepSize_{ifield}
if alignsepop == "<"
@@ -787,7 +749,7 @@
let &ic = keep_ic
let &report = keep_report
-" call Dret("Align")
+" call Dret("Align#Align")
return
endfun
@@ -874,7 +836,11 @@
" call Dfunc("AlignReplaceQuotedSpaces()")
let l:line = getline(line("."))
- let l:linelen = strlen(l:line)
+ if exists("g:Align_xstrlen") && g:Align_xstrlen
+ let l:linelen = s:Strlen(l:line)
+ else
+ let l:linelen = strlen(l:line)
+ endif
let l:startingPos = 0
let l:startQuotePos = 0
let l:endQuotePos = 0
@@ -924,12 +890,49 @@
endfun
" ---------------------------------------------------------------------
+" s:Strlen: this function returns the length of a string, even if its {{{1
+" using two-byte etc characters. Depends on virtcol().
+" 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.
+fun! s:Strlen(x)
+" call Dfunc("s:Strlen(x<".a:x.">")
+ if g:Align_xstrlen == 1
+ " number of codepoints (Latin a + combining circumflex is two codepoints)
+ " (comment from TM, solution from NW)
+ let ret= strlen(substitute(a:x,'.','c','g'))
+
+ elseif g:Align_xstrlen == 2
+ " 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.)
+ " (comment from TM, solution from TM)
+ let ret=strlen(substitute(a:x, '.\Z', 'x', 'g'))
+
+ elseif g:Align_xstrlen == 3
+ " 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.)
+ " (comment from TM, solution from me)
+ let modkeep= &mod
+ exe "norm! o\<esc>"
+ call setline(line("."),a:x)
+ let ret= virtcol("$") - 1
+ d
+ let &mod= modkeep
+
+ else
+ " at least give a decent default
+ ret= strlen(a:x)
+ endif
+" call Dret("s:Strlen ".ret)
+ return ret
+endfun
+
+" ---------------------------------------------------------------------
" Set up default values: {{{1
"call Decho("-- Begin AlignCtrl Initialization --")
call Align#AlignCtrl("default")
"call Decho("-- End AlignCtrl Initialization --")
-" Set up default values: {{{1
-call Align#AlignCtrl("default")
" ---------------------------------------------------------------------
" Restore: {{{1
Modified: trunk/packages/vim-scripts/autoload/deb.vim
URL: http://svn.debian.org/wsvn/pkg-vim/trunk/packages/vim-scripts/autoload/deb.vim?rev=1174&op=diff
==============================================================================
--- trunk/packages/vim-scripts/autoload/deb.vim (original)
+++ trunk/packages/vim-scripts/autoload/deb.vim Fri Jan 25 05:40:28 2008
@@ -1,7 +1,7 @@
" Vim autoload file for browsing debian package.
" copyright (C) 2007, arno renevier <arenevier at fdn.fr>
" Distributed under the GNU General Public License (version 2 or above)
-" Last Change: 2007 december 07
+" Last Change: 2007 december 21
"
" Inspired by autoload/tar.vim by Charles E Campbell
"
@@ -13,7 +13,7 @@
if &cp || exists("g:loaded_deb") || v:version < 700
finish
endif
-let g:loaded_deb= "v1.2"
+let g:loaded_deb= "v1.3"
" return 1 if cmd exists
" display error message and return 0 otherwise
@@ -68,13 +68,32 @@
endif
endif
- " unzip .gz as they are very common inside debian packages
let l:gunzip_cmd = ""
- if l:target =~ '.*\.gz$'
+
+ "
+ " unzip man pages
+ "
+ if l:target =~ "\.\/usr\/share\/man\/.*\.gz$"
+
+ " try to fail gracefully if a command is not available
+ if !s:hascmd("gzip")
+ return
+ elseif !s:hascmd("nroff")
+ let l:gunzip_cmd = "| gzip -cd"
+ elseif !s:hascmd("col")
+ let l:gunzip_cmd = "| gzip -cd | nroff -mandoc"
+ else
+ let l:gunzip_cmd = "| gzip -cd | nroff -mandoc | col -b"
+ endif
+
+ "
+ " unzip other .gz files
+ "
+ elseif l:target =~ '.*\.gz$'
if !s:hascmd("gzip")
return
endif
- let l:gunzip_cmd = "| gzip -cd "
+ let l:gunzip_cmd = "| gzip -cd"
endif
" read content
@@ -185,9 +204,11 @@
filetype detect
- " it's .gz file, so is is unziped in deb#read, but filetype detect did not
- " work. Anyway, it must be a changelog
- if l:fname =~ "\.\/usr\/share\/doc\/.*\/changelog.Debian.gz$"
+ " zipped files, are unziped in deb#read, but filetype may not
+ " automatically work.
+ if l:fname =~ "\.\/usr\/share\/man\/.*\.gz$"
+ set filetype=man
+ elseif l:fname =~ "\.\/usr\/share\/doc\/.*\/changelog.Debian.gz$"
set filetype=debchangelog
endif
Modified: trunk/packages/vim-scripts/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-vim/trunk/packages/vim-scripts/debian/changelog?rev=1174&op=diff
==============================================================================
--- trunk/packages/vim-scripts/debian/changelog (original)
+++ trunk/packages/vim-scripts/debian/changelog Fri Jan 25 05:40:28 2008
@@ -1,7 +1,8 @@
vim-scripts (7.1.5) UNRELEASED; urgency=low
* Updated addons:
- - Bufexplorer (Closes: #455883) and NERD Commenter.
+ - Bufexplorer (Closes: #455883), NERD Commenter, Supertab, Align, cvsmenu,
+ and gnupg.
* New addons:
- debPlugin (Closes: #442865) and python-indent
* debian/control:
@@ -12,7 +13,7 @@
* Add disabledby-pythonindent patch, which allows blacklisting the
python-indent script.
- -- James Vega <jamessan at debian.org> Wed, 12 Dec 2007 10:37:48 -0500
+ -- James Vega <jamessan at debian.org> Fri, 25 Jan 2008 00:39:05 -0500
vim-scripts (7.1.4) unstable; urgency=low
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=1174&op=diff
==============================================================================
--- trunk/packages/vim-scripts/debian/vim-scripts.status (original)
+++ trunk/packages/vim-scripts/debian/vim-scripts.status Fri Jan 25 05:40:28 2008
@@ -47,7 +47,7 @@
license: license [2], see below
extras: doc/bufexplorer.txt
disabledby: let loaded_bufexplorer = 1
-version: 7.1.6
+version: 7.1.7
script_name: plugin/minibufexpl.vim
addon: minibufexplorer
@@ -67,9 +67,9 @@
author: Markus Braun
author_url: http://www.vim.org/account/profile.php?user_id=1120
email: markus.braun at krawel.de
-license: no license
+license: GNU GPL, see /usr/share/common-licenses/GPL
disabledby: let loaded_gnupg = 1
-version: 1605
+version: 1933
script_name: plugin/taglist.vim
addon: taglist
@@ -116,7 +116,7 @@
license: GNU GPL, see /usr/share/common-licenses/GPL-2
extras: doc/Align.txt, plugin/AlignMaps.vim, plugin/cecutil.vim, autoload/Align.vim
disabledby: let loaded_alignPlugin = 1
-version: 32/38
+version: 33/39
script_name: plugin/cvsmenu.vim
addon: cvsmenu
@@ -127,7 +127,7 @@
email: adah at sh163.net
license: GNU LGPL, see /usr/share/common-licenses/LGPL-2
disabledby: let loaded_cvsmenu = 1
-version: 1.144
+version: 1.145
script_name: plugin/vcscommand.vim
addon: vcscommand
@@ -253,7 +253,7 @@
license: no license
extras: doc/NERD_commenter.txt
disabledby: let loaded_nerd_comments = 1
-version: 2.1.7
+version: 2.1.9
script_name: plugin/project.vim
addon: project
@@ -331,7 +331,7 @@
email: ervandew at yahoo.com
license: BSD, see /usr/share/common-licenses/BSD
disabledby: let loaded_supertab = 1
-version: 0.44
+version: 0.45
script_name: plugin/lbdbq.vim
addon: lbdbq
@@ -354,7 +354,7 @@
license: GNU GPL, see /usr/share/common-licenses/GPL-2
extras: autoload/deb.vim syntax/deb.vim
disabledby: let loaded_debPlugin = 1
-version: 1.2
+version: 1.3
script_name: indent/python.vim
addon: python-indent
Modified: trunk/packages/vim-scripts/doc/Align.txt
URL: http://svn.debian.org/wsvn/pkg-vim/trunk/packages/vim-scripts/doc/Align.txt?rev=1174&op=diff
==============================================================================
--- trunk/packages/vim-scripts/doc/Align.txt (original)
+++ trunk/packages/vim-scripts/doc/Align.txt Fri Jan 25 05:40:28 2008
@@ -1,4 +1,4 @@
-*align.txt* The Alignment Tool Aug 18, 2007
+*align.txt* The Alignment Tool Dec 20, 2007
Author: Charles E. Campbell, Jr. <NdrOchip at ScampbellPfamily.AbizM>
(remove NOSPAM from Campbell's email first)
@@ -8,7 +8,7 @@
No warranty, express or implied. Use At-Your-Own-Risk.
==============================================================================
-1. Contents *align* *align-contents*
+1. Contents *align* *align-contents* {{{1
1. Contents.................: |align-contents|
2. Alignment Manual.........: |align-manual|
@@ -47,16 +47,16 @@
4. Alignment Tool History...: |align-history|
==============================================================================
-2. Align Manual *alignman* *alignmanual* *align-manual*
+2. Align Manual *alignman* *alignmanual* *align-manual* {{{1
To Enable: put <Align.vim> and <AlignMaps.vim> into your .vim/plugin
To see a user's guide, see |align-usage|
To see examples, see |alignctrl| and |alignmaps|
>
-/===============+=============================================================\
-|| |Dflt| ||
-|| Commands |Val-| Explanation ||
-|| | ue | ||
+/=============+=========+=====================================================\
+|| \ Default/ ||
+|| Commands \ Value/ Explanation ||
+|| | | ||
++==============+====+=======================================================++
|| AlignCtrl | | =Clrc-+:pPIWw [..list-of-separator-patterns..] ||
|| | +-------------------------------------------------------+|
@@ -128,8 +128,9 @@
\=============================================================================/
==============================================================================
-3. Alignment Usage *alignusage* *align-usage*
-
+3. Alignment Usage *alignusage* *align-usage* {{{1
+
+COMMANDS {{{2
The <Align.vim> script includes two primary commands and two
minor commands:
@@ -178,11 +179,43 @@
restores the AlignCtrl settings when AlignPush
was last used.
<
-
-ALIGNMENT CONTROL *alignctrl* *align-control*
-
- This command doesn't do the alignment operation itself, it provides
- various alignment options.
+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
+ available with utf-8, Align now provides a special option which you
+ may choose based upon your needs:
+
+ Number of codepoints (Latin a + combining circumflex is two codepoints)~
+>
+ 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.)~
+>
+ 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.)~
+>
+ let g:Align_xstrlen= 2
+<
+ By putting one of these settings into your <.vimrc>, Align will use an
+ internal (interpreted) function to determine a string's length instead
+ of the Vim's built-in |strlen()| function. As the function is
+ 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.
The first argument to AlignCtrl is a string which may contain one or
more alignment control commands. Most of the commands are single
@@ -190,14 +223,15 @@
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.
-
-
- Separators *alignctrl-separators*
+<
+ stands for "white space" such as blanks and/or tabs.
As a result, separators may not have white space (tabs or blanks) on
their outsides (ie. ": :" is fine as a separator, but " :: " is
@@ -215,7 +249,7 @@
options just for handling initial white space:
- --- *alignctrl-w*
+ --- *alignctrl-w* {{{3
wWI INITIAL WHITE SPACE *alignctrl-W*
--- *alignctrl-I*
w : ignore all selected lines' initial white space
@@ -241,7 +275,7 @@
to each line.
- ------ *alignctrl-l*
+ ------ *alignctrl-l* {{{3
lrc-+: FIELD JUSTIFICATION *alignctrl-r*
------ *alignctrl-c*
@@ -277,7 +311,7 @@
Even more separator control is available. With "-+:":
- - : skip treating the separator as a separator. *alignctrl--*
+ - : 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-:*
@@ -325,7 +359,7 @@
etc.
- --- *alignctrl-=*
+ --- *alignctrl-=* {{{3
=C CYCLIC VS ALL-ACTIVE SEPARATORS *alignctrl-C*
---
@@ -422,7 +456,7 @@
field | field | field & field - field | field | field & field - ...
<
- --- *alignctrl-<*
+ --- *alignctrl-<* {{{3
<>| SEPARATOR JUSTIFICATION *alignctrl->*
--- *alignctrl-|*
@@ -450,7 +484,7 @@
+---------------------+---------------------+---------------------+
<
- --- *alignctrl-g*
+ --- *alignctrl-g* {{{3
gv SELECTIVE APPLICATION *alignctrl-v*
---
@@ -496,7 +530,7 @@
<
---
- m MAP SUPPORT *alignctrl-m*
+ m MAP SUPPORT *alignctrl-m* {{{3
---
This option primarily supports the development of maps. The AlignCtrl
@@ -508,7 +542,7 @@
---
- p### *alignctrl-p*
+ p### *alignctrl-p* {{{3
P### PADDING *alignctrl-P*
---
@@ -536,7 +570,7 @@
pre-pad the sixth "=" with two blanks,
etc.
- --------------- *alignctrl-settings*
+ --------------- *alignctrl-settings* {{{3
No option given DISPLAY STATUS *alignctrl-*
--------------- *alignctrl-no-option*
@@ -563,38 +597,38 @@
:let alignctrl= AlignCtrl("d")
<
-
-
-ALIGNMENT *align-align*
-
- 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
+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
control and the separator list: >
:[range]Align! [alignment-control-string] [list-of-separators]
<
- 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.
+ 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.
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 field (left/right/centered as specified) to bring its
+ pass pads the fields (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.
@@ -614,14 +648,14 @@
|| Append separator with AlignCtrl-specified separator padding
|| Delete current line, install newly aligned line
- 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 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 whitespace on either side of a separator is ignored.
-ALIGNMENT MAPS *alignmaps* *align-maps*
+ALIGNMENT MAPS *alignmaps* *align-maps* {{{2
There are a number of maps using AlignCtrl() and Align() in the
<AlignMaps.vim> file. This file may also be put into the plugins
@@ -630,6 +664,7 @@
or the more complicated ones an "a" (for "alignment") for backwards
compatibility.
+ ALIGNMENT MAP LISTING {{{3 ~
\a, : useful for breaking up comma-separated
declarations prior to \adec |alignmap-a,|
\a? : aligns (...)? ...:... expressions on ? and : |alignmap-a?|
@@ -640,15 +675,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#VimFuncs
- at the label "Visual Block Commands"
+ 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'
- argument lists |alignmap-afnc|
+ \afnc : useful for aligning ansi-c style functions' |alignmap-afnc|
+ argument lists
\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.
@@ -680,27 +713,27 @@
character "x" where "x" is: ,:<=@# |alignmap-T=|
\m= : like \t= but aligns with %... style comments
- 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.
+ 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.
Although the maps use AlignCtrl options, they typically use the "m"
- 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~
+ 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 ~
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~
+ ALIGNMENT MAP USE WITH VISUAL MODE {{{3 ~
Alternatively, one may select the text with the "V" visual mode
selector.
- ALIGNMENT MAP USE WITH MENUS~
+ ALIGNMENT MAP USE WITH MENUS {{{3 ~
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 DrChip.AlignMaps .
+ items are under the heading "DrChip.AlignMaps".
One may change the top level menu name to whatever is wished; by
default, its >
@@ -710,7 +743,7 @@
must be running, and *'go'* must have the menu bar suboption (ie. m
must be included).
- COMPLEX ALIGNMENT MAP METHOD~
+ COMPLEX ALIGNMENT MAP METHOD {{{3 ~
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
@@ -719,9 +752,96 @@
embedded "@" symbols by first converting them to <DEL> characters,
doing the requested job, and then converting them back.
-
- ---------------------------
- Alignment Map Examples: \a, *alignmap-a,*
+ 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.
+
+
+ ---------------------------
+ Alignment Map Examples: \a, *alignmap-a,* {{{3
---------------------------
Original: illustrates comma-separated declaration splitting: >
@@ -737,7 +857,7 @@
<
---------------------------
- Alignment Map Examples: \a? *alignmap-a?*
+ Alignment Map Examples: \a? *alignmap-a?* {{{3
---------------------------
Original: illustrates ()?: aligning >
@@ -754,7 +874,7 @@
<
---------------------------
- Alignment Map Examples: \a< *alignmap-a<*
+ Alignment Map Examples: \a< *alignmap-a<* {{{3
---------------------------
Original: illustrating aligning of << and >> >
@@ -771,7 +891,7 @@
<
---------------------------
- Alignment Map Examples: \a= *alignmap-a=*
+ Alignment Map Examples: \a= *alignmap-a=* {{{3
---------------------------
Original: illustrates how to align := assignments >
@@ -786,7 +906,7 @@
<
---------------------------
- Alignment Map Examples: \abox *alignmap-abox*
+ Alignment Map Examples: \abox *alignmap-abox* {{{3
---------------------------
Original: illustrates how to comment-box some text >
@@ -805,7 +925,7 @@
<
---------------------------
- Alignment Map Examples: \acom *alignmap-acom*
+ Alignment Map Examples: \acom *alignmap-acom* {{{3
---------------------------
Original: illustrates aligning C-style comments (works for //, too) >
@@ -822,7 +942,7 @@
---------------------------
- Alignment Map Examples: \anum *alignmap-anum*
+ Alignment Map Examples: \anum *alignmap-anum* {{{3
---------------------------
Original: illustrates how to get numbers lined up >
@@ -874,7 +994,7 @@
---------------------------
- Alignment Map Examples: \ascom *alignmap-ascom*
+ Alignment Map Examples: \ascom *alignmap-ascom* {{{3
---------------------------
Original: >
@@ -889,7 +1009,7 @@
<
---------------------------
- Alignment Map Examples: \adec *alignmap-adec*
+ Alignment Map Examples: \adec *alignmap-adec* {{{3
---------------------------
Original: illustrates how to clean up C/C++ declarations >
@@ -934,7 +1054,7 @@
<
---------------------------
- Alignment Map Examples: \adef *alignmap-adef*
+ Alignment Map Examples: \adef *alignmap-adef* {{{3
---------------------------
Original: illustrates how to line up #def'initions >
@@ -951,7 +1071,7 @@
<
---------------------------
- Alignment Map Examples: \afnc *alignmap-afnc*
+ Alignment Map Examples: \afnc *alignmap-afnc* {{{3
---------------------------
This map is an exception to the usual selection rules.
@@ -981,7 +1101,7 @@
<
---------------------------
- Alignment Map Examples: \adcom *alignmap-adcom*
+ Alignment Map Examples: \adcom *alignmap-adcom* {{{3
---------------------------
Original: illustrates aligning comments that don't begin
@@ -1004,7 +1124,7 @@
<
---------------------------
- Alignment Map Examples: \aocom *alignmap-aocom*
+ Alignment Map Examples: \aocom *alignmap-aocom* {{{3
---------------------------
Original: illustrates how to align C-style comments (works for //, too)
@@ -1023,7 +1143,7 @@
---------------------------
- Alignment Map Examples: \tsp *alignmap-tsp*
+ Alignment Map Examples: \tsp *alignmap-tsp* {{{3
---------------------------
Normally Align can't use white spaces for field separators as such
@@ -1047,7 +1167,7 @@
<
---------------------------
- Alignment Map Examples: \tsq *alignmap-tsq*
+ Alignment Map Examples: \tsq *alignmap-tsq* {{{3
---------------------------
The \tsp map is useful for aligning tables based on white space,
@@ -1065,7 +1185,7 @@
<
---------------------------
- Alignment Map Examples: \tt *alignmap-tt*
+ Alignment Map Examples: \tt *alignmap-tt* {{{3
---------------------------
Original: illustrates aligning a LaTex Table >
@@ -1089,7 +1209,7 @@
<
----------------------------
- Alignment Map Examples: \tml *alignmap-tml*
+ Alignment Map Examples: \tml *alignmap-tml* {{{3
----------------------------
Original: illustrates aligning multi-line continuation marks >
@@ -1110,7 +1230,7 @@
<
---------------------------
- Alignment Map Examples: \t= *alignmap-t=*
+ Alignment Map Examples: \t= *alignmap-t=* {{{3
---------------------------
Original: illustrates left-justified aligning of = >
@@ -1125,7 +1245,7 @@
<
---------------------------
- Alignment Map Examples: \T= *alignmap-T=*
+ Alignment Map Examples: \T= *alignmap-T=* {{{3
---------------------------
Original: illustrates right-justified aligning of = >
@@ -1140,7 +1260,7 @@
<
---------------------------
- Alignment Map Examples: \Htd *alignmap-Htd*
+ Alignment Map Examples: \Htd *alignmap-Htd* {{{3
---------------------------
Original: for aligning tables with html >
@@ -1154,7 +1274,10 @@
==============================================================================
4. Alignment Tool History *align-history* {{{1
-ALIGN HISTORY {{{2
+ALIGN HISTORY {{{2
+ 33 : Sep 20, 2007 * s:Strlen() introduced to support various ways
+ used to represent characters and their effects
+ on string lengths. See |align-strlen|.
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.
Modified: trunk/packages/vim-scripts/doc/NERD_commenter.txt
URL: http://svn.debian.org/wsvn/pkg-vim/trunk/packages/vim-scripts/doc/NERD_commenter.txt?rev=1174&op=diff
==============================================================================
--- trunk/packages/vim-scripts/doc/NERD_commenter.txt (original)
+++ trunk/packages/vim-scripts/doc/NERD_commenter.txt Fri Jan 25 05:40:28 2008
@@ -744,7 +744,7 @@
------------------------------------------------------------------------------
*NERDDefaultNesting*
Values: 0 or 1.
-Default 0.
+Default 1.
When this option is set to 1, comments are nested automatically. That is, if
you hit ,cc on a line that is already commented it will be commented
@@ -860,6 +860,24 @@
==============================================================================
8. Changelog *NERDComChangelog*
+2.1.9
+ - added support for mrxvtrc and aap, thx to Marco for the emails
+ - added dummy support for SVNAnnotate, SVKAnnotate and CVSAnnotate, thx to
+ nicothakis for posting the issue
+
+2.1.8
+ - fixed a couple of bugs with the NERDSpaceDelims option, thx to
+ David Miani and Jeremy Hinegardner
+ - added dummy support for lhaskell, thx to pipp for posting the issue
+ - added an alternative set of delims for the plsql filetype, thx to Kuchma
+ Michael
+ - added support for spectre, thx to Brett Warneke
+ - added support for scala, thx to Renald Buter
+ - added support for asymptote, thx to Vladimir Lomov
+ - made NERDDefaultNesting enabled by default as this seems more intuitive,
+ thx to marco for the suggestion
+
+
2.1.7
- added support for haml, thx to Greb Weber
- added support for asterisk, thx to Laurent ARNOUD
@@ -1122,6 +1140,14 @@
Cheers to Cheng Fang for the bug reports :D
Cheers to Yongwei Wu for a bug report about the passwd filetype.
+
+Thanks to David Miani for reporting a space-removal bug when using the
+NERDSpaceDelims option.
+
+Thanks to Jeremy Hinegardner for emailing me about a bug with aligned
+comments and the NERDSpaceDelims option.
+
+Thanks to marco for suggesting NERDDefaultNesting be set by default.
Not to forget! Thanks to the following people for sending me new filetypes to
support :D
@@ -1165,3 +1191,10 @@
timberke cobol
Aaron Schaefer factor
Laurent ARNOUD asterisk
+Kuchma Michael plsql
+Brett Warneke spectre
+Pipp lhaskell
+Renald Buter scala
+Vladimir Lomov asymptote
+Marco mrxvtrc, aap
+nicothakis SVNAnnotate, CVSAnnotate, SVKAnnotate
Modified: trunk/packages/vim-scripts/doc/bufexplorer.txt
URL: http://svn.debian.org/wsvn/pkg-vim/trunk/packages/vim-scripts/doc/bufexplorer.txt?rev=1174&op=diff
==============================================================================
--- trunk/packages/vim-scripts/doc/bufexplorer.txt (original)
+++ trunk/packages/vim-scripts/doc/bufexplorer.txt Fri Jan 25 05:40:28 2008
@@ -1,7 +1,7 @@
-*bufexplorer.txt* Buffer Explorer Last Change: 02 Dec 2007
+*bufexplorer.txt* Buffer Explorer Last Change: 21 Dec 2007
Buffer Explorer *buffer-explorer* *bufexplorer*
- Version 7.1.6
+ Version 7.1.7
Plugin for easily exploring (or browsing) Vim |:buffers|.
@@ -146,6 +146,9 @@
===============================================================================
CHANGE LOG *bufexplorer-changelog*
+7.1.7 - Fixes:
+ * TaCahiroy fixed several issues related to opening a buffer in a
+ tab.
7.1.6 - Fixes:
* Removed ff=unix from modeline in bufexplorer.txt. Found by Bill
McCarthy.
Modified: trunk/packages/vim-scripts/plugin/AlignMaps.vim
URL: http://svn.debian.org/wsvn/pkg-vim/trunk/packages/vim-scripts/plugin/AlignMaps.vim?rev=1174&op=diff
==============================================================================
--- trunk/packages/vim-scripts/plugin/AlignMaps.vim (original)
+++ trunk/packages/vim-scripts/plugin/AlignMaps.vim Fri Jan 25 05:40:28 2008
@@ -1,12 +1,12 @@
" AlignMaps: Alignment maps based upon <Align.vim>
" Maintainer: Dr. Charles E. Campbell, Jr. <Charles.Campbell at gsfc.nasa.gov>
-" Date: Aug 20, 2007
-" Version: 38
+" Date: Dec 20, 2007
+" Version: 39
"
" NOTE: the code herein needs vim 6.0 or later
" needs <Align.vim> v6 or later
" needs <cecutil.vim> v5 or later
-" Copyright: Copyright (C) 1999-2005 Charles E. Campbell, Jr. {{{1
+" Copyright: Copyright (C) 1999-2007 Charles E. Campbell, Jr. {{{1
" Permission is hereby granted to use and distribute this code,
" with or without modifications, provided that this copyright
" notice is copied with it. Like anything else that's free,
@@ -38,7 +38,7 @@
if exists("g:loaded_alignmaps") || &cp
finish
endif
-let g:loaded_alignmaps = "v38"
+let g:loaded_alignmaps = "v39"
let s:keepcpo = &cpo
set cpo&vim
@@ -99,7 +99,7 @@
" 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/\s\+$//e
+ 'y,'zs/ \+$//e
" restore AlignCtrl settings
AlignPop
@@ -148,7 +148,7 @@
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>t@:'y,'zs/^\(\s*\) @/\1/e<CR>:'y,'zs/ @//eg<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
@@ -156,7 +156,7 @@
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\+\([-+]\=\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>anum <SID>WS:'a,'zs/\([0-9.]\)\s\+\zs\([-+]\=\d\)/@\1/ge<CR>:'a,'zs/\.@/\.0@/ge<CR>:AlignCtrl mp0P0r<CR>:'a,'zAlign [.@]<CR>:'a,'zs/@/ /ge<CR>:'a,'zs/\(\.\)\(\s\+\)\([0-9.,eE+]\+\)/\1\3\2/ge<CR>:'a,'zs/\([eE]\)\(\s\+\)\([0-9+\-+]\+\)/\1\3\2/ge<CR><SID>WE
elseif exists("g:alignmaps_euronumber")
map <silent> <Leader>anum <SID>WS:'a,'zs/\([0-9.]\)\s\+\([-+]\=\d\)/\1@\2/ge<CR>:'a,'zs/\.@/\.0@/ge<CR>:AlignCtrl mp0P0r<CR>:'a,'zAlign [,@]<CR>:'a,'zs/@/ /ge<CR>:'a,'zs/\(,\)\(\s\+\)\([-0-9.,eE+]\+\)/\1\3\2/ge<CR>:'a,'zs/\([eE]\)\(\s\+\)\([0-9+\-+]\+\)/\1\3\2/ge<CR><SID>WE
else
@@ -192,14 +192,18 @@
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 mIp0P0=l ;<CR>:'a,.Align<CR>:.,'zs/ \( *\);/;\1/ge<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','@','g'),'\')/<CR>:AlignCtrl mI=l @<CR>:'a,.Align<CR>:'y+1,'z-1s/@/ /g<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
@@ -238,6 +242,7 @@
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,
@@ -254,7 +259,6 @@
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
-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>
" ---------------------------------------------------------------------
" Menu Support: {{{1
Modified: trunk/packages/vim-scripts/plugin/AlignPlugin.vim
URL: http://svn.debian.org/wsvn/pkg-vim/trunk/packages/vim-scripts/plugin/AlignPlugin.vim?rev=1174&op=diff
==============================================================================
--- trunk/packages/vim-scripts/plugin/AlignPlugin.vim (original)
+++ trunk/packages/vim-scripts/plugin/AlignPlugin.vim Fri Jan 25 05:40:28 2008
@@ -1,9 +1,9 @@
" AlignPlugin: tool to align multiple fields based on one or more separators
" Author: Charles E. Campbell, Jr.
-" Date: Jul 18, 2006
+" Date: Nov 15, 2007
" GetLatestVimScripts: 294 1 :AutoInstall: Align.vim
-" GetLatestVimScripts: 1066 1 cecutil.vim
-" Copyright: Copyright (C) 1999-2005 Charles E. Campbell, Jr. {{{1
+" GetLatestVimScripts: 1066 1 :AutoInstall: cecutil.vim
+" Copyright: Copyright (C) 1999-2007 Charles E. Campbell, Jr. {{{1
" Permission is hereby granted to use and distribute this code,
" with or without modifications, provided that this copyright
" notice is copied with it. Like anything else that's free,
@@ -12,79 +12,6 @@
" plugin, you agree that in no event will the copyright
" holder be liable for any damages resulting from the use
" of this software.
-"
-" Usage: Functions {{{1
-" AlignCtrl(style,..list..)
-"
-" "default" : Sets AlignCtrl to its default values and clears stack
-" AlignCtrl "Ilp1P1=<" '='
-"
-" Separators
-" "=" : all alignment demarcation patterns (separators) are
-" equivalent and simultaneously active. The list of
-" separators is composed of such patterns
-" (regular expressions, actually).
-" "C" : cycle through alignment demarcation patterns
-" "<" : separators aligned to left if of differing lengths
-" ">" : separators aligned to right if of differing lengths
-" "|" : separators aligned to center if of differing lengths
-"
-" Alignment/Justification
-" "l" : left justify (no list needed)
-" "r" : right justify (no list needed)
-" "c" : center (no list needed)
-" Justification styles are cylic: ie. "lcr" would
-" mean first field is left-justifed,
-" second field is centered,
-" third field is right-justified,
-" fourth field is left-justified, etc.
-" "-" : skip this separator+ws+field
-" "+" : repeat last alignment/justification indefinitely
-" ":" : no more alignment/justifcation
-"
-" Map Support
-" "m" : next call to Align will AlignPop at end.
-" AlignCtrl will AlignPush first.
-"
-" Padding
-" "p" : current argument supplies pre-field-padding parameter;
-" ie. that many blanks will be applied before
-" the field separator. ex. call AlignCtrl("p2").
-" Can have 0-9 spaces. Will be cycled through.
-" "P" : current argument supplies post-field-padding parameter;
-" ie. that many blanks will be applied after
-" the field separator. ex. call AlignCtrl("P3")
-" Can have 0-9 spaces. Will be cycled through.
-"
-" Initial White Space
-" "I" : preserve first line's leading whitespace and re-use
-" subsequently
-" "W" : preserve leading whitespace on every line
-" "w" : don't preserve leading whitespace
-"
-" Selection Patterns
-" "g" : restrict alignment to pattern
-" "v" : restrict alignment to not-pattern
-"
-" If no arguments are supplied, AlignCtrl() will list
-" current settings.
-"
-" [range]Align(..list..)
-" Takes a range and performs the specified alignment on the
-" text. The range may be :line1,line2 etc, or visually selected.
-" The list is a list of patterns; the current s:AlignCtrl
-" will be used ('=' or 'C').
-"
-" Usage: Commands {{{1
-" AlignCtrl : lists current alignment settings
-" AlignCtrl style ..list.. : set alignment separators
-" AlignCtrl {gv} pattern : apply alignment only to lines which match (g)
-" or don't match (v) the given pattern
-" [range]Align ..list.. : applies Align() over the specified range
-" The range may be specified via
-" visual-selection as well as the usual
-" [range] specification. The ..list..
-" is a list of alignment separators.
"
" Romans 1:16,17a : For I am not ashamed of the gospel of Christ, for it is {{{1
" the power of God for salvation for everyone who believes; for the Jew first,
Modified: trunk/packages/vim-scripts/plugin/NERD_commenter.vim
URL: http://svn.debian.org/wsvn/pkg-vim/trunk/packages/vim-scripts/plugin/NERD_commenter.vim?rev=1174&op=diff
==============================================================================
--- trunk/packages/vim-scripts/plugin/NERD_commenter.vim (original)
+++ trunk/packages/vim-scripts/plugin/NERD_commenter.vim Fri Jan 25 05:40:28 2008
@@ -1,7 +1,7 @@
" vim global plugin that provides easy code commenting for various file types
-" Last Change: 26 oct 2007
+" Last Change: 18 jan 2008
" Maintainer: Martin Grenfell <martin_grenfell at msn.com>
-let s:NERD_commenter_version = 2.1.7
+let s:NERD_commenter_version = 2.1.9
" For help documentation type :help NERDCommenter. If this fails, Restart vim
" and try again. If it sill doesnt work... the help page is at the bottom
@@ -54,7 +54,7 @@
call s:InitVariable("g:NERDBlockComIgnoreEmpty", 0)
call s:InitVariable("g:NERDCommentWholeLinesInVMode", 0)
call s:InitVariable("g:NERDCompactSexyComs", 0)
-call s:InitVariable("g:NERDDefaultNesting", 0)
+call s:InitVariable("g:NERDDefaultNesting", 1)
call s:InitVariable("g:NERDMenuMode", 3)
call s:InitVariable("g:NERDLPlace", "[>")
call s:InitVariable("g:NERDUsePlaceHolders", 1)
@@ -132,6 +132,8 @@
"hardcoded the comment delimiters to use
if a:filetype == ""
call s:MapDelimiters('', '')
+ elseif a:filetype == "aap"
+ call s:MapDelimiters('#', '')
elseif a:filetype == "abaqus"
call s:MapDelimiters('**', '')
elseif a:filetype == "abc"
@@ -166,6 +168,8 @@
call s:MapDelimiters('''', '')
elseif a:filetype == "asterisk"
call s:MapDelimiters(';', '')
+ elseif a:filetype == "asy"
+ call s:MapDelimiters('//', '')
elseif a:filetype == "atlas"
call s:MapDelimiters('C','$')
elseif a:filetype == "autohotkey"
@@ -246,6 +250,8 @@
call s:MapDelimiters('','')
elseif a:filetype == "cvs"
call s:MapDelimiters('CVS:','')
+ elseif a:filetype == "CVSAnnotate"
+ call s:MapDelimiters('','')
elseif a:filetype == "d"
call s:MapDelimitersWithAlternative('//','', '/*','*/')
elseif a:filetype == "dcl"
@@ -416,6 +422,8 @@
call s:MapDelimiters('/*','*/')
elseif a:filetype == "lftp"
call s:MapDelimiters('#', '')
+ elseif a:filetype == "lhaskell"
+ call s:MapDelimiters('','')
elseif a:filetype == "lifelines"
call s:MapDelimiters('/*','*/')
elseif a:filetype == "lilo"
@@ -478,6 +486,8 @@
call s:MapDelimiters('(*','*)')
elseif a:filetype == "monk"
call s:MapDelimiters(';', '')
+ elseif a:filetype == "mrxvtrc"
+ call s:MapDelimiters('#', '')
elseif a:filetype == "mush"
call s:MapDelimiters('#', '')
elseif a:filetype == "muttrc"
@@ -553,7 +563,7 @@
elseif a:filetype == "plm"
call s:MapDelimitersWithAlternative('//','', '/*','*/')
elseif a:filetype == "plsql"
- call s:MapDelimiters('--', '')
+ call s:MapDelimitersWithAlternative('--', '', '/*', '*/')
elseif a:filetype == "po"
call s:MapDelimiters('#', '')
elseif a:filetype == "postscr"
@@ -620,6 +630,8 @@
call s:MapDelimitersWithAlternative('//','', '/*', '')
elseif a:filetype == "sather"
call s:MapDelimiters('--', '')
+ elseif a:filetype == "scala"
+ call s:MapDelimitersWithAlternative('//','', '/*','*/')
elseif a:filetype == "scheme"
call s:MapDelimiters(';', '')
elseif a:filetype == "scilab"
@@ -676,6 +688,8 @@
call s:MapDelimiters('#', '')
elseif a:filetype == "specman"
call s:MapDelimiters('//', '')
+ elseif a:filetype == "spectre"
+ call s:MapDelimitersWithAlternative('//', '', '*', '')
elseif a:filetype == "spice"
call s:MapDelimiters('$', '')
elseif a:filetype == "sql"
@@ -694,7 +708,11 @@
call s:MapDelimiters('--', '')
elseif a:filetype == "strace"
call s:MapDelimiters('/*','*/')
+ elseif a:filetype == "SVKAnnotate"
+ call s:MapDelimiters('','')
elseif a:filetype == "svn"
+ call s:MapDelimiters('','')
+ elseif a:filetype == "SVNAnnotate"
call s:MapDelimiters('','')
elseif a:filetype == "SVNcommitlog"
call s:MapDelimiters('','')
@@ -1102,12 +1120,12 @@
" check if we can comment this line
if !isCommented || g:NERDUsePlaceHolders || s:Multipart()
if a:alignLeft
- let theLine = s:AddLeftDelimAligned(b:left, theLine, leftAlignIndx)
+ let theLine = s:AddLeftDelimAligned(s:GetLeft(0,1,0), theLine, leftAlignIndx)
else
let theLine = s:AddLeftDelim(s:GetLeft(0,1,0), theLine)
endif
if a:alignRight
- let theLine = s:AddRightDelimAligned(b:right, theLine, rightAlignIndx)
+ let theLine = s:AddRightDelimAligned(s:GetRight(0,1,0), theLine, rightAlignIndx)
else
let theLine = s:AddRightDelim(s:GetRight(0,1,0), theLine)
endif
@@ -1834,15 +1852,15 @@
let line = a:line
"get the comment status on the line so we know how it is commented
- let lineCommentStatus = s:IsCommentedOuttermost(b:leftAlt, b:rightAlt, b:left, b:right, line)
+ let lineCommentStatus = s:IsCommentedOuttermost(b:left, b:right, b:leftAlt, b:rightAlt, line)
"it is commented with b:left and b:right so remove these delims
if lineCommentStatus == 1
- let line = s:RemoveDelimiters(b:leftAlt, b:rightAlt, line)
+ let line = s:RemoveDelimiters(b:left, b:right, line)
"it is commented with b:leftAlt and b:rightAlt so remove these delims
elseif lineCommentStatus == 2 && g:NERDRemoveAltComs
- let line = s:RemoveDelimiters(b:left, b:right, line)
+ let line = s:RemoveDelimiters(b:leftAlt, b:rightAlt, line)
"it is not properly commented with any delims so we check if it has
"any random left or right delims on it and remove the outtermost ones
Modified: trunk/packages/vim-scripts/plugin/bufexplorer.vim
URL: http://svn.debian.org/wsvn/pkg-vim/trunk/packages/vim-scripts/plugin/bufexplorer.vim?rev=1174&op=diff
==============================================================================
--- trunk/packages/vim-scripts/plugin/bufexplorer.vim (original)
+++ trunk/packages/vim-scripts/plugin/bufexplorer.vim Fri Jan 25 05:40:28 2008
@@ -10,7 +10,7 @@
" Name Of File: bufexplorer.vim
" Description: Buffer Explorer Vim Plugin
" Maintainer: Jeff Lanzarotta (delux256-vim at yahoo dot com)
-" Last Changed: Sunday, 02 December 2007
+" Last Changed: Friday, 21 December 2007
" Version: See g:bufexplorer_version for version number.
" Usage: This file should reside in the plugin directory and be
" automatically sourced.
@@ -34,7 +34,7 @@
"1}}}
" Version number
-let g:bufexplorer_version = "7.1.6"
+let g:bufexplorer_version = "7.1.7"
" Check for Vim version 700 or greater {{{1
if v:version < 700
@@ -62,7 +62,6 @@
return 0
endfunction
-"1}}}
" Default values {{{1
call s:Set("g:bufExplorerDefaultHelp", 1) " Show default help?
@@ -81,6 +80,7 @@
let s:sort_by = ["number", "name", "fullpath", "mru", "extension"]
let s:tabSpace = []
let s:types = {"fullname": ':p', "path": ':p:h', "relativename": ':~:.', "relativepath": ':~:.:h', "shortname": ':t'}
+let s:originBuffer = 0
" Setup the autocommands that handle the MRUList and other stuff. {{{1
autocmd VimEnter * call s:Setup()
@@ -205,6 +205,7 @@
return
endif
+ let s:originBuffer = bufnr("%")
silent let s:raw_buffer_listing = s:GetBufferInfo()
let copy = copy(s:raw_buffer_listing)
@@ -510,22 +511,35 @@
return s:Close()
endif
- " If the buf is active, then go to the tab where it is opened.
- if bufloaded(_bufNbr) && g:bufExplorerFindActive
- call s:Close()
- let bufname = expand("#"._bufNbr.":p")
-" exec "drop" substitute(bufname, "\\s", "\\\\ ", "g")
- exec bufname ? "drop ".substitute(bufname, "\\s", "\\\\ ", "g") : "buffer "._bufNbr
- elseif (a:0)
- call s:Close()
- tabnew
+ if (a:0 == 1) && (a:1 == "tab")
+ " Restore [BufExplorer] buffer.
+ exec "keepjumps silent buffer!".s:originBuffer
+
+ let tabNbr = s:GetTabNbr(_bufNbr)
+
+ if tabNbr == 0
+ " _bufNbr is not opened in any tabs
+ exec "999tab split +buffer" . _bufNbr
+ else
+ " _bufNbr is already opened in tab(s)
+ exec tabNbr . "tabnext"
+ " Focus window.
+ exec s:GetWinNbr(tabNbr, _bufNbr) . "wincmd w"
+ endif
+ else
+ " If the buf is active, then go to the tab where it is opened.
+ if bufloaded(_bufNbr) && g:bufExplorerFindActive
+ call s:Close()
+ let bufname = expand("#"._bufNbr.":p")
+ exec bufname ? "drop ".escape(bufname, " ") : "buffer "._bufNbr
+ endif
+
+ " Switch to the buffer.
+ exec "keepalt keepjumps silent b!" _bufNbr
endif
" Make the buffer 'listed' again.
call setbufvar(_bufNbr, "&buflisted", "1")
-
- " Switch to the buffer.
- exec "keepalt keepjumps silent b!" _bufNbr
else
call s:Error("Sorry, that buffer no longer exists, please select another")
call s:DeleteBuffer(_bufNbr, "wipe")
@@ -738,6 +752,24 @@
echohl WarningMsg | echo a:msg | echohl none
endfunction
+" GetTabNbr {{{1
+function s:GetTabNbr(bufNbr)
+ " Searching buffer bufno, in tabs.
+ for i in range(tabpagenr("$"))
+ if index(tabpagebuflist(i + 1), a:bufNbr) != -1
+ return i + 1
+ endif
+ endfor
+
+ return 0
+endfunction
+
+" GetWinNbr" {{{1
+function s:GetWinNbr(tabNbr, bufNbr)
+ " window number in tabpage.
+ return index(tabpagebuflist(a:tabNbr), a:bufNbr) + 1
+endfunction
+
" Winmanager Integration {{{1
let g:BufExplorer_title = "\[Buf\ List\]"
call s:Set("g:bufExplorerResize", 1)
@@ -788,6 +820,6 @@
call setpos(".", pres)
endfunction
-"1}}}
+"}}}1
" vim:ft=vim foldmethod=marker sw=2
Modified: trunk/packages/vim-scripts/plugin/cecutil.vim
URL: http://svn.debian.org/wsvn/pkg-vim/trunk/packages/vim-scripts/plugin/cecutil.vim?rev=1174&op=diff
==============================================================================
--- trunk/packages/vim-scripts/plugin/cecutil.vim (original)
+++ trunk/packages/vim-scripts/plugin/cecutil.vim Fri Jan 25 05:40:28 2008
@@ -2,8 +2,8 @@
" save/restore mark position
" save/restore selected user maps
" Author: Charles E. Campbell, Jr.
-" Version: 17a ASTRO-ONLY
-" Date: Aug 18, 2007
+" Version: 17
+" Date: Sep 04, 2007
"
" Saving Restoring Destroying Marks: {{{1
" call SaveMark(markname) let savemark= SaveMark(markname)
@@ -32,7 +32,7 @@
if &cp || exists("g:loaded_cecutil")
finish
endif
-let g:loaded_cecutil = "v17a"
+let g:loaded_cecutil = "v17"
let s:keepcpo = &cpo
set cpo&vim
"DechoVarOn
Modified: trunk/packages/vim-scripts/plugin/cvsmenu.vim
URL: http://svn.debian.org/wsvn/pkg-vim/trunk/packages/vim-scripts/plugin/cvsmenu.vim?rev=1174&op=diff
==============================================================================
--- trunk/packages/vim-scripts/plugin/cvsmenu.vim (original)
+++ trunk/packages/vim-scripts/plugin/cvsmenu.vim Fri Jan 25 05:40:28 2008
@@ -1,8 +1,8 @@
" CVSmenu.vim : Vim menu for using CVS vim:tw=0:sw=2:ts=8
" Author : Thorsten Maerz <info at netztorte.de> vim600:fdm=marker
" Maintainer : Wu Yongwei <wuyongwei at gmail.com>
-" $Revision: 1.144 $
-" $Date: 2007/10/27 05:13:58 $
+" $Revision: 1.145 $
+" $Date: 2007/12/30 06:40:43 $
" License : LGPL
"
" Tested with Vim 6.0
@@ -352,7 +352,7 @@
new
let zbak=@z
let @z = ''
- \."\n\"CVSmenu $Revision: 1.144 $"
+ \."\n\"CVSmenu $Revision: 1.145 $"
\."\n\"Current directory : ".expand('%:p:h')
\."\n\"Current Root : ".root
\."\n\"Current Repository : ".repository
@@ -2371,7 +2371,7 @@
" query status if wanted, file and CVSdir exist
if (g:CVSautocheck > 0)
\ && (expand("%:p:t") != '')
- \ && filereadable(expand("%:p:t"))
+ \ && filereadable(expand("%:p"))
\ && filereadable(expand("%:p:h").s:sep.s:CVSentries)
call CVSLocalStatus()
endif
Modified: trunk/packages/vim-scripts/plugin/gnupg.vim
URL: http://svn.debian.org/wsvn/pkg-vim/trunk/packages/vim-scripts/plugin/gnupg.vim?rev=1174&op=diff
==============================================================================
--- trunk/packages/vim-scripts/plugin/gnupg.vim (original)
+++ trunk/packages/vim-scripts/plugin/gnupg.vim Fri Jan 25 05:40:28 2008
@@ -1,10 +1,10 @@
" Name: gnupg.vim
-" Version: $Id: gnupg.vim 1605 2007-03-01 09:58:04Z mbr $
-" Author: Markus Braun <markus.braun at krawel.de>
-" Summary: Vim plugin for transparent editing of gpg encrypted files.
-" Licence: This program is free software; you can redistribute it and/or
-" modify it under the terms of the GNU General Public License.
-" See http://www.gnu.org/copyleft/gpl.txt
+" Version: $Id: gnupg.vim 1933 2008-01-23 09:49:33Z mbr $
+" Author: Markus Braun <markus.braun at krawel.de>
+" Summary: Vim plugin for transparent editing of gpg encrypted files.
+" Licence: This program is free software; you can redistribute it and/or
+" modify it under the terms of the GNU General Public License.
+" See http://www.gnu.org/copyleft/gpl.txt
" Section: Documentation {{{1
" Description:
"
@@ -56,56 +56,52 @@
" Richard Bronosky for patch to enable ".pgp" suffix.
" Erik Remmelzwaal for patch to enable windows support and patient beta
" testing.
+" Lars Becker for patch to make gpg2 working.
"
" Section: Plugin header {{{1
-if (exists("loaded_gnupg") || &cp || exists("#BufReadPre#*.\(gpg\|asc\|pgp\)"))
+if (exists("g:loaded_gnupg") || &cp || exists("#BufReadPre#*.\(gpg\|asc\|pgp\)"))
finish
endi
-let loaded_gnupg = 1
+let g:loaded_gnupg = "$Revision: 1933 $"
" Section: Autocmd setup {{{1
augroup GnuPG
-au!
-
-" First make sure nothing is written to ~/.viminfo while editing
-" an encrypted file.
-autocmd BufNewFile,BufReadPre,FileReadPre *.\(gpg\|asc\|pgp\) set viminfo=
-" We don't want a swap file, as it writes unencrypted data to disk
-autocmd BufNewFile,BufReadPre,FileReadPre *.\(gpg\|asc\|pgp\) set noswapfile
-" Initialize the internal variables
+autocmd!
+
+" initialize the internal variables
autocmd BufNewFile,BufReadPre,FileReadPre *.\(gpg\|asc\|pgp\) call s:GPGInit()
-" Force the user to edit the recipient list if he opens a new file and public
+" force the user to edit the recipient list if he opens a new file and public
" keys are preferred
autocmd BufNewFile *.\(gpg\|asc\|pgp\) if (exists("g:GPGPreferSymmetric") && g:GPGPreferSymmetric == 0) | call s:GPGEditRecipients() | endi
-" Switch to binary mode to read the encrypted file
-autocmd BufReadPre,FileReadPre *.\(gpg\|asc\|pgp\) set bin
+" do the decryption
autocmd BufReadPost,FileReadPost *.\(gpg\|asc\|pgp\) call s:GPGDecrypt()
-" Switch to normal mode for editing
-autocmd BufReadPost,FileReadPost *.\(gpg\|asc\|pgp\) set nobin
-" Call the autocommand for the file minus .gpg$
-autocmd BufReadPost,FileReadPost *.\(gpg\|asc\|pgp\) execute ":doautocmd BufReadPost " . escape(expand("%:r"), ' *?\"'."'")
-autocmd BufReadPost,FileReadPost *.\(gpg\|asc\|pgp\) execute ":redraw!"
-
-" Switch to binary mode before encrypt the file
-autocmd BufWritePre,FileWritePre *.\(gpg\|asc\|pgp\) set bin
-" Convert all text to encrypted text before writing
+
+" convert all text to encrypted text before writing
autocmd BufWritePre,FileWritePre *.\(gpg\|asc\|pgp\) call s:GPGEncrypt()
-" Undo the encryption so we are back in the normal text, directly
+" undo the encryption so we are back in the normal text, directly
" after the file has been written.
-autocmd BufWritePost,FileWritePost *.\(gpg\|asc\|pgp\) if (exists("b:GPGEncrypted") && b:GPGEncrypted == 1) | silent u | endi
-" Switch back to normal mode for editing
-autocmd BufWritePost,FileWritePost *.\(gpg\|asc\|pgp\) set nobin
+autocmd BufWritePost,FileWritePost *.\(gpg\|asc\|pgp\) call s:GPGEncryptPost()
+
augroup END
+
" Section: Highlight setup {{{1
highlight default link GPGWarning WarningMsg
highlight default link GPGError ErrorMsg
highlight default link GPGHighlightUnknownRecipient ErrorMsg
+
" Section: Functions {{{1
" Function: s:GPGInit() {{{2
"
" initialize the plugin
"
fun s:GPGInit()
+ " first make sure nothing is written to ~/.viminfo while editing
+ " an encrypted file.
+ set viminfo=
+
+ " we don't want a swap file, as it writes unencrypted data to disk
+ set noswapfile
+
" check if gpg-agent is allowed
if (!exists("g:GPGUseAgent"))
let g:GPGUseAgent = 1
@@ -120,6 +116,14 @@
if (!exists("g:GPGPreferArmor"))
let g:GPGPreferArmor = 0
endif
+
+ " check if debugging is turned on
+ if (!exists("g:GPGDebugLevel"))
+ let g:GPGDebugLevel = 0
+ endif
+
+ " print version
+ call s:GPGDebug(1, "gnupg.vim ". g:loaded_gnupg)
" determine if gnupg can use the gpg-agent
if (exists("$GPG_AGENT_INFO") && g:GPGUseAgent == 1)
@@ -175,6 +179,9 @@
" decrypt the buffer and find all recipients of the encrypted file
"
fun s:GPGDecrypt()
+ " switch to binary mode to read the encrypted file
+ set bin
+
" get the filename of the current buffer
let filename=escape(expand("%:p"), '\"')
@@ -187,58 +194,68 @@
" find the recipients of the file
let &shellredir=s:shellredir
let &shell=s:shell
- let output=system(s:GPGCommand . " --decrypt --dry-run --batch --no-use-agent --logger-fd 1 \"" . filename . "\"")
+ let output=system(s:GPGCommand . " --verbose --decrypt --list-only --dry-run --batch --no-use-agent --logger-fd 1 \"" . filename . "\"")
let &shellredir=s:shellredirsave
let &shell=s:shellsave
+ call s:GPGDebug(1, "output of command '" . s:GPGCommand . " --verbose --decrypt --list-only --dry-run --batch --no-use-agent --logger-fd 1 \"" . filename . "\"' is:")
+ call s:GPGDebug(1, ">>>>> " . output . " <<<<<")
" check if the file is symmetric/asymmetric encrypted
- if (match(output, "gpg: [^ ]\\+ encrypted data") >= 0)
+ if (match(output, "gpg: encrypted with [[:digit:]]\\+ passphrase") >= 0)
" file is symmetric encrypted
let b:GPGEncrypted=1
+ call s:GPGDebug(1, "this file is symmetric encrypted")
let b:GPGOptions=b:GPGOptions . "symmetric:"
let cipher=substitute(output, ".*gpg: \\([^ ]\\+\\) encrypted data.*", "\\1", "")
if (match(s:GPGCipher, "\\<" . cipher . "\\>") >= 0)
let b:GPGOptions=b:GPGOptions . "cipher-algo " . cipher . ":"
+ call s:GPGDebug(1, "cipher-algo is " . cipher)
else
echohl GPGWarning
echo "The cipher " . cipher . " is not known by the local gpg command. Using default!"
echo
echohl None
endi
- elseif (match(output, "gpg: public key decryption") >= 0)
+ elseif (match(output, "gpg: public key is [[:xdigit:]]\\{8}") >= 0)
" file is asymmetric encrypted
let b:GPGEncrypted=1
+ call s:GPGDebug(1, "this file is asymmetric encrypted")
let b:GPGOptions=b:GPGOptions . "encrypt:"
- let start=match(output, "ID [[:xdigit:]]\\{8}")
+ let start=match(output, "gpg: public key is [[:xdigit:]]\\{8}")
while (start >= 0)
- let start=start+3
+ let start=start + strlen("gpg: public key is ")
let recipient=strpart(output, start, 8)
+ call s:GPGDebug(1, "recipient is " . recipient)
let name=s:GPGNameToID(recipient)
if (strlen(name) > 0)
let b:GPGRecipients=b:GPGRecipients . name . ":"
+ call s:GPGDebug(1, "name of recipient is " . name)
else
let b:GPGUnknownRecipients=b:GPGUnknownRecipients . recipient . ":"
echohl GPGWarning
echo "The recipient " . recipient . " is not in your public keyring!"
echohl None
end
- let start=match(output, "ID [[:xdigit:]]\\{8}", start)
+ let start=match(output, "gpg: public key is [[:xdigit:]]\\{8}", start)
endw
- elseif (match(output, "gpg: no valid OpenPGP data found") >= 0)
+ else
" file is not encrypted
let b:GPGEncrypted=0
+ call s:GPGDebug(1, "this file is not encrypted")
echohl GPGWarning
echo "File is not encrypted, all GPG functions disabled!"
echohl None
+ set nobin
return
endi
" check if the message is armored
- if (stridx(getline(1), "-----BEGIN PGP MESSAGE-----") >= 0)
+ if (match(output, "gpg: armor header") >= 0)
+ call s:GPGDebug(1, "this file is armored")
let b:GPGOptions=b:GPGOptions . "armor:"
endi
@@ -256,8 +273,19 @@
let asd=input("Message could not be decrypted! (Press ENTER)")
echohl None
bwipeout
- return
- endi
+ set nobin
+ return
+ endi
+
+ " turn off binary mode
+ set nobin
+
+ " call the autocommand for the file minus .gpg$
+ execute ":doautocmd BufReadPost " . escape(expand("%:r"), ' *?\"'."'")
+ call s:GPGDebug(2, "called autocommand for " . escape(expand("%:r"), ' *?\"'."'"))
+
+ " refresh screen
+ redraw!
endf
" Function: s:GPGEncrypt() {{{2
@@ -265,6 +293,23 @@
" encrypts the buffer to all previous recipients
"
fun s:GPGEncrypt()
+ " save window view
+ let s:GPGWindowView = winsaveview()
+ call s:GPGDebug(2, "saved window view " . string(s:GPGWindowView))
+
+ " store encoding and switch to a safe one
+ if &fileencoding != &encoding
+ let s:GPGEncoding = &encoding
+ let &encoding = &fileencoding
+ call s:GPGDebug(2, "encoding was \"" . s:GPGEncoding . "\", switched to \"" . &encoding . "\"")
+ else
+ let s:GPGEncoding = ""
+ call s:GPGDebug(2, "encoding and fileencoding are the same (\"" . &encoding . "\"), not switching")
+ endi
+
+ " switch buffer to binary mode
+ set bin
+
" guard for unencrypted files
if (exists("b:GPGEncrypted") && b:GPGEncrypted == 0)
echohl GPGWarning
@@ -287,6 +332,7 @@
if (exists("g:GPGPreferArmor") && g:GPGPreferArmor == 1)
let b:GPGOptions=b:GPGOptions . "armor:"
endi
+ call s:GPGDebug(1, "no options set, so using default options: " . b:GPGOptions)
endi
let field=0
let option=s:GetField(b:GPGOptions, ":", field)
@@ -303,10 +349,12 @@
echo "Please use GPGEditRecipients to correct!!"
echo
echohl None
+ call s:GPGDebug(1, "unknown recipients are: " . b:GPGUnknownRecipients)
endi
" built list of recipients
if (exists("b:GPGRecipients") && strlen(b:GPGRecipients) > 0)
+ call s:GPGDebug(1, "recipients are: " . b:GPGRecipients)
let field=0
let gpgid=s:GetField(b:GPGRecipients, ":", field)
while (strlen(gpgid))
@@ -330,6 +378,7 @@
silent exec "'[,']!" . s:GPGCommand . " --quiet --no-encrypt-to " . options . recipients . " " . s:stderrredirnull
let &shellredir=s:shellredirsave
let &shell=s:shellsave
+ call s:GPGDebug(1, "called gpg command is: " . "'[,']!" . s:GPGCommand . " --quiet --no-encrypt-to " . options . recipients . " " . s:stderrredirnull)
if (v:shell_error) " message could not be encrypted
silent u
echohl GPGError
@@ -339,7 +388,36 @@
return
endi
- "redraw!
+endf
+
+" Function: s:GPGEncryptPost() {{{2
+"
+" undo changes don by encrypt, after writing
+"
+fun s:GPGEncryptPost()
+
+ if (exists("b:GPGEncrypted") && b:GPGEncrypted == 0)
+ return
+ endi
+
+ " undo encryption of buffer content
+ silent u
+
+ " switch back from binary mode
+ set nobin
+
+ " restore encoding
+ if s:GPGEncoding != ""
+ let &encoding = s:GPGEncoding
+ call s:GPGDebug(2, "restored encoding \"" . &encoding . "\"")
+ endi
+
+ " restore window view
+ call winrestview(s:GPGWindowView)
+ call s:GPGDebug(2, "restored window view" . string(s:GPGWindowView))
+
+ " refresh screen
+ redraw!
endf
" Function: s:GPGViewRecipients() {{{2
@@ -870,10 +948,20 @@
return ""
endi
endf
+
+" Function: s:GPGDebug(level, text) {{{2
+"
+" output debug message, if this message has high enough importance
+fun s:GPGDebug(level, text)
+ if (g:GPGDebugLevel >= a:level)
+ echom a:text
+ endi
+endf
+
" Section: Command definitions {{{1
com! GPGViewRecipients call s:GPGViewRecipients()
com! GPGEditRecipients call s:GPGEditRecipients()
com! GPGViewOptions call s:GPGViewOptions()
com! GPGEditOptions call s:GPGEditOptions()
-" vim600: set foldmethod=marker:
+" vim600: foldmethod=marker:foldlevel=0
Modified: trunk/packages/vim-scripts/plugin/supertab.vim
URL: http://svn.debian.org/wsvn/pkg-vim/trunk/packages/vim-scripts/plugin/supertab.vim?rev=1174&op=diff
==============================================================================
--- trunk/packages/vim-scripts/plugin/supertab.vim (original)
+++ trunk/packages/vim-scripts/plugin/supertab.vim Fri Jan 25 05:40:28 2008
@@ -2,7 +2,7 @@
" Original: Gergely Kontra <kgergely at mcl.hu>
" Current: Eric Van Dewoestine <ervandew at yahoo.com> (as of version 0.4)
" Please direct all correspondence to Eric.
-" Version: 0.44
+" Version: 0.45
"
" Description: {{{
" Use your tab key to do all your completion in insert mode!
@@ -215,6 +215,8 @@
autocmd!
autocmd BufEnter * call <SID>InitBuffer()
augroup END
+ " ensure InitBuffer gets called for the first buffer.
+ call s:InitBuffer()
" Setup mechanism to restore orignial completion type upon leaving insert
" mode if g:SuperTabRetainCompletionType == 2
More information about the pkg-vim-maintainers
mailing list