20 Commits
2.2.0 ... 2.2.1

Author SHA1 Message Date
Martin Grenfell
ee14557c87 switch to 2.2.1 2008-11-13 23:25:03 +13:00
Martin Grenfell
8098fea8d9 add support for objj 2008-11-13 23:23:48 +13:00
Martin Grenfell
7e3f47ed8d add support for sieve 2008-11-13 23:16:21 +13:00
Martin Grenfell
06683e3311 add support for SVNannotate 2008-11-13 22:57:08 +13:00
Martin Grenfell
dda8510e0c add support for conkyrc 2008-11-13 22:54:59 +13:00
Martin Grenfell
a0003bc926 add support for clojure 2008-11-13 22:40:00 +13:00
Martin Grenfell
ca94c70dba add support for genshi and mako 2008-11-13 22:37:02 +13:00
Martin Grenfell
44b4c26b86 add support for asciidoc, git, gitrebase and fix gitcommit 2008-11-13 22:31:37 +13:00
Martin Grenfell
5d8bb28113 add support for CVScommit 2008-11-06 20:45:46 +13:00
Martin Grenfell
f65d86fea3 add support for hostsaccess 2008-10-29 20:31:13 +13:00
Martin Grenfell
1d92203107 add support for ps1 2008-10-25 11:49:36 +13:00
Martin Grenfell
fe73c80dc8 update credits 2008-10-25 11:37:04 +13:00
Martin Grenfell
cc9f986514 add support for processing 2008-10-25 11:36:01 +13:00
Martin Grenfell
03d9562db8 add support for actionscript 2008-10-25 11:35:34 +13:00
Martin Grenfell
1301323179 make haml comments own more 2008-10-25 11:32:40 +13:00
Martin Grenfell
842055ae43 fix a bug in the doc 2008-10-12 22:14:01 +13:00
Martin Grenfell
68bf65fcd2 fix automake comments 2008-10-12 22:14:01 +13:00
Martin Grenfell
aaf2471da7 add support for newlisp 2008-10-12 22:14:01 +13:00
Martin Grenfell
e14bdb0735 fix to the credits 2008-10-07 09:08:39 +13:00
Martin Grenfell
8dda3f17e0 always use :normal! instead of :normal 2008-10-04 12:13:10 +13:00
2 changed files with 81 additions and 20 deletions

View File

@@ -729,7 +729,7 @@ See |NERDComAltDelim| for switching commenting styles at runtime.
4. Key mapping customisation *NERDComMappings* 4. Key mapping customisation *NERDComMappings*
To change a mapping just map another key combo to the internal <plug> mapping. To change a mapping just map another key combo to the internal <plug> mapping.
For example, to remap the *NERDComComment* mapping to ",omg" you would put For example, to remap the |NERDComComment| mapping to ",omg" you would put
this line in your vimrc: > this line in your vimrc: >
map ,omg <plug>NERDCommenterComment map ,omg <plug>NERDCommenterComment
< <
@@ -798,6 +798,23 @@ if your face looked like a toaster and a t-rex put together? :(
============================================================================== ==============================================================================
8. Changelog *NERDComChangelog* 8. Changelog *NERDComChangelog*
2.2.1
- add support for newlisp and clojure, thanks to Matthew Lee Hinman.
- fix automake comments, thanks to Elias Pipping
- make haml comments default to -# with / as the alternative delimiter,
thanks to tpope
- add support for actionscript and processing thanks to Edwin Benavides
- add support for ps1 (powershell), thanks to Jason Mills
- add support for hostsaccess, thanks to Thomas Rowe
- add support for CVScommit
- add support for asciidoc, git and gitrebase. Thanks to Simon Ruderich.
- use # for gitcommit comments, thanks to Simon Ruderich.
- add support for mako and genshi, thanks to Keitheis.
- add support for conkyrc, thanks to David
- add support for SVNannotate, thanks to Miguel Jaque Barbero.
- add support for sieve, thanks to Stefan Walk
- add support for objj, thanks to Adam Thorsen.
2.2.0 2.2.0
- rewrote the mappings system to be more "standard". - rewrote the mappings system to be more "standard".
- removed all the mapping options. Now, mappings to <plug> mappings are - removed all the mapping options. Now, mappings to <plug> mappings are
@@ -955,6 +972,8 @@ Thanks to Elias Pipping for sending me a bug report about haskell commenting.
Thanks to mntnoe for pointing out incorrect delimiters for haskell. Thanks to mntnoe for pointing out incorrect delimiters for haskell.
Thanks to Mark S. for pointing out a bug in the doc.
Not to forget! Thanks to the following people for sending me new filetypes to Not to forget! Thanks to the following people for sending me new filetypes to
support :D support :D
@@ -981,7 +1000,7 @@ Stefano Zacchiroli debcontrol, debchangelog, mkd
Alex Tarkovsky ebuild and eclass Alex Tarkovsky ebuild and eclass
Jorge Rodrigues gams Jorge Rodrigues gams
Rainer Müller Objective C Rainer Müller Objective C
Jason Mills Groovy Jason Mills Groovy, ps1
Normandie Azucena vera Normandie Azucena vera
Florian Apolloner ldif Florian Apolloner ldif
David Fishburn lookupfile David Fishburn lookupfile
@@ -996,7 +1015,7 @@ Greg Weber D, haml
Bruce Sherrod velocity Bruce Sherrod velocity
timberke cobol, calibre timberke cobol, calibre
Aaron Schaefer factor Aaron Schaefer factor
Laurent ARNOUD asterisk, mplayerconf Mr X asterisk, mplayerconf
Kuchma Michael plsql Kuchma Michael plsql
Brett Warneke spectre Brett Warneke spectre
Pipp lhaskell Pipp lhaskell
@@ -1026,6 +1045,16 @@ Bernhard Grotz potwiki
sgronblo man sgronblo man
François txt2tags François txt2tags
Giacomo Mariani SVNinfo Giacomo Mariani SVNinfo
Matthew Lee Hinman newlisp, clojure
Elias Pipping automake
Edwin Benavides actionscript, processing
Thomas Rowe hostsaccess
Simon Ruderich asciidoc, git, gitcommit, gitrebase
Keitheis mako, genshi
David conkyrc
Miguel Jaque Barbero SVNannotate
Stefan Walk sieve
Adam Thorsen objj
============================================================================== ==============================================================================
9. License *NERDComLicense* 9. License *NERDComLicense*

View File

@@ -2,8 +2,8 @@
" File: NERD_commenter.vim " File: NERD_commenter.vim
" Description: vim global plugin that provides easy code commenting " Description: vim global plugin that provides easy code commenting
" Maintainer: Martin Grenfell <martin_grenfell at msn dot com> " Maintainer: Martin Grenfell <martin_grenfell at msn dot com>
" Version: 2.2.0 " Version: 2.2.1
" Last Change: 4th October, 2008 " Last Change: 13th November, 2008
" License: This program is free software. It comes without any warranty, " License: This program is free software. It comes without any warranty,
" to the extent permitted by applicable law. You can redistribute " to the extent permitted by applicable law. You can redistribute
" it and/or modify it under the terms of the Do What The Fuck You " it and/or modify it under the terms of the Do What The Fuck You
@@ -125,6 +125,8 @@ function s:SetUpForNewFiletype(filetype, forceReset)
call s:MapDelimiters('%', '') call s:MapDelimiters('%', '')
elseif a:filetype == "acedb" elseif a:filetype == "acedb"
call s:MapDelimitersWithAlternative('//','', '/*','*/') call s:MapDelimitersWithAlternative('//','', '/*','*/')
elseif a:filetype == "actionscript"
call s:MapDelimitersWithAlternative('//','', '/*','*/')
elseif a:filetype == "ada" elseif a:filetype == "ada"
call s:MapDelimitersWithAlternative('--','', '-- ', '') call s:MapDelimitersWithAlternative('--','', '-- ', '')
elseif a:filetype == "ahdl" elseif a:filetype == "ahdl"
@@ -143,6 +145,8 @@ function s:SetUpForNewFiletype(filetype, forceReset)
call s:MapDelimiters('#', '') call s:MapDelimiters('#', '')
elseif a:filetype == "apachestyle" elseif a:filetype == "apachestyle"
call s:MapDelimiters('#', '') call s:MapDelimiters('#', '')
elseif a:filetype == "asciidoc"
call s:MapDelimiters('//', '')
elseif a:filetype == "applescript" elseif a:filetype == "applescript"
call s:MapDelimitersWithAlternative('--', '', '(*', '*)') call s:MapDelimitersWithAlternative('--', '', '(*', '*)')
elseif a:filetype == "asm68k" elseif a:filetype == "asm68k"
@@ -164,7 +168,7 @@ function s:SetUpForNewFiletype(filetype, forceReset)
elseif a:filetype == "autoit" elseif a:filetype == "autoit"
call s:MapDelimiters(';','') call s:MapDelimiters(';','')
elseif a:filetype == "automake" elseif a:filetype == "automake"
call s:MapDelimitersWithAlternative('#','', 'dnl ', '') call s:MapDelimiters('##','')
elseif a:filetype == "ave" elseif a:filetype == "ave"
call s:MapDelimiters("'",'') call s:MapDelimiters("'",'')
elseif a:filetype == "awk" elseif a:filetype == "awk"
@@ -211,6 +215,8 @@ function s:SetUpForNewFiletype(filetype, forceReset)
call s:MapDelimitersWithAlternative('//','', '/*','*/') call s:MapDelimitersWithAlternative('//','', '/*','*/')
elseif a:filetype == "clipper" elseif a:filetype == "clipper"
call s:MapDelimitersWithAlternative('//','', '/*','*/') call s:MapDelimitersWithAlternative('//','', '/*','*/')
elseif a:filetype == "clojure"
call s:MapDelimiters(';', '')
elseif a:filetype == "cmake" elseif a:filetype == "cmake"
call s:MapDelimiters('#','') call s:MapDelimiters('#','')
elseif a:filetype == "cobol" elseif a:filetype == "cobol"
@@ -219,6 +225,8 @@ function s:SetUpForNewFiletype(filetype, forceReset)
call s:MapDelimiters('#', '') call s:MapDelimiters('#', '')
elseif a:filetype == "config" elseif a:filetype == "config"
call s:MapDelimiters('dnl ', '') call s:MapDelimiters('dnl ', '')
elseif a:filetype == "conkyrc"
call s:MapDelimiters('#', '')
elseif a:filetype == "context" elseif a:filetype == "context"
call s:MapDelimiters('%','') call s:MapDelimiters('%','')
elseif a:filetype == "cpp" elseif a:filetype == "cpp"
@@ -243,6 +251,8 @@ function s:SetUpForNewFiletype(filetype, forceReset)
call s:MapDelimiters('CVS:','') call s:MapDelimiters('CVS:','')
elseif a:filetype == "CVSAnnotate" elseif a:filetype == "CVSAnnotate"
call s:MapDelimiters('','') call s:MapDelimiters('','')
elseif a:filetype == "CVScommit"
call s:MapDelimiters('','')
elseif a:filetype == "d" elseif a:filetype == "d"
call s:MapDelimitersWithAlternative('//','', '/*','*/') call s:MapDelimitersWithAlternative('//','', '/*','*/')
elseif a:filetype == "dcl" elseif a:filetype == "dcl"
@@ -335,6 +345,8 @@ function s:SetUpForNewFiletype(filetype, forceReset)
call s:MapDelimiters('--', '') call s:MapDelimiters('--', '')
elseif a:filetype == "geek" elseif a:filetype == "geek"
call s:MapDelimiters('GEEK_COMMENT:', '') call s:MapDelimiters('GEEK_COMMENT:', '')
elseif a:filetype == "genshi"
call s:MapDelimitersWithAlternative('<!--','-->', '{#', '#}')
elseif a:filetype == "gentoo-conf-d" elseif a:filetype == "gentoo-conf-d"
call s:MapDelimiters('#', '') call s:MapDelimiters('#', '')
elseif a:filetype == "gentoo-env-d" elseif a:filetype == "gentoo-env-d"
@@ -349,14 +361,18 @@ function s:SetUpForNewFiletype(filetype, forceReset)
call s:MapDelimiters('#', '') call s:MapDelimiters('#', '')
elseif a:filetype == 'gentoo-package-use' elseif a:filetype == 'gentoo-package-use'
call s:MapDelimiters('#', '') call s:MapDelimiters('#', '')
elseif a:filetype == 'git'
call s:MapDelimiters('', '')
elseif a:filetype == 'gitAnnotate' elseif a:filetype == 'gitAnnotate'
call s:MapDelimiters('', '') call s:MapDelimiters('', '')
elseif a:filetype == 'gitcommit' elseif a:filetype == 'gitcommit'
call s:MapDelimiters('', '') call s:MapDelimiters('#', '')
elseif a:filetype == 'gitconfig' elseif a:filetype == 'gitconfig'
call s:MapDelimiters(';', '') call s:MapDelimiters(';', '')
elseif a:filetype == 'gitdiff' elseif a:filetype == 'gitdiff'
call s:MapDelimiters('', '') call s:MapDelimiters('', '')
elseif a:filetype == 'gitrebase'
call s:MapDelimiters('#', '')
elseif a:filetype == "gnuplot" elseif a:filetype == "gnuplot"
call s:MapDelimiters('#','') call s:MapDelimiters('#','')
elseif a:filetype == "groovy" elseif a:filetype == "groovy"
@@ -374,13 +390,15 @@ function s:SetUpForNewFiletype(filetype, forceReset)
elseif a:filetype == "h" elseif a:filetype == "h"
call s:MapDelimitersWithAlternative('//','', '/*','*/') call s:MapDelimitersWithAlternative('//','', '/*','*/')
elseif a:filetype == "haml" elseif a:filetype == "haml"
call s:MapDelimiters('/', '') call s:MapDelimitersWithAlternative('-#', '', '/', '')
elseif a:filetype == "help" elseif a:filetype == "help"
call s:MapDelimiters('"','') call s:MapDelimiters('"','')
elseif a:filetype == "hercules" elseif a:filetype == "hercules"
call s:MapDelimitersWithAlternative('//','', '/*','*/') call s:MapDelimitersWithAlternative('//','', '/*','*/')
elseif a:filetype == "hog" elseif a:filetype == "hog"
call s:MapDelimiters('#', '') call s:MapDelimiters('#', '')
elseif a:filetype == "hostsaccess"
call s:MapDelimiters('#', '')
elseif a:filetype == "html" elseif a:filetype == "html"
call s:MapDelimitersWithAlternative('<!--','-->', '//', '') call s:MapDelimitersWithAlternative('<!--','-->', '//', '')
elseif a:filetype == "htmldjango" elseif a:filetype == "htmldjango"
@@ -477,6 +495,8 @@ function s:SetUpForNewFiletype(filetype, forceReset)
call s:MapDelimiters('#','') call s:MapDelimiters('#','')
elseif a:filetype == "make" elseif a:filetype == "make"
call s:MapDelimiters('#','') call s:MapDelimiters('#','')
elseif a:filetype == "mako"
call s:MapDelimiters('##', '')
elseif a:filetype == "man" elseif a:filetype == "man"
call s:MapDelimiters('."', '') call s:MapDelimiters('."', '')
elseif a:filetype == "map" elseif a:filetype == "map"
@@ -539,6 +559,8 @@ function s:SetUpForNewFiletype(filetype, forceReset)
call s:MapDelimiters('', '') call s:MapDelimiters('', '')
elseif a:filetype == "netrw" elseif a:filetype == "netrw"
call s:MapDelimiters('', '') call s:MapDelimiters('', '')
elseif a:filetype == "newlisp"
call s:MapDelimiters(';','')
elseif a:filetype == "nqc" elseif a:filetype == "nqc"
call s:MapDelimiters('/*','*/') call s:MapDelimiters('/*','*/')
elseif a:filetype == "nroff" elseif a:filetype == "nroff"
@@ -549,6 +571,8 @@ function s:SetUpForNewFiletype(filetype, forceReset)
call s:MapDelimitersWithAlternative('//','', '/*','*/') call s:MapDelimitersWithAlternative('//','', '/*','*/')
elseif a:filetype == "objcpp" elseif a:filetype == "objcpp"
call s:MapDelimitersWithAlternative('//','', '/*','*/') call s:MapDelimitersWithAlternative('//','', '/*','*/')
elseif a:filetype == "objj"
call s:MapDelimitersWithAlternative('//','', '/*','*/')
elseif a:filetype == "ocaml" elseif a:filetype == "ocaml"
call s:MapDelimiters('(*','*)') call s:MapDelimiters('(*','*)')
elseif a:filetype == "occam" elseif a:filetype == "occam"
@@ -615,12 +639,16 @@ function s:SetUpForNewFiletype(filetype, forceReset)
call s:MapDelimiters('%', '') call s:MapDelimiters('%', '')
elseif a:filetype == "ppwiz" elseif a:filetype == "ppwiz"
call s:MapDelimiters(';;', '') call s:MapDelimiters(';;', '')
elseif a:filetype == "processing"
call s:MapDelimitersWithAlternative('//','', '/*','*/')
elseif a:filetype == "procmail" elseif a:filetype == "procmail"
call s:MapDelimiters('#', '') call s:MapDelimiters('#', '')
elseif a:filetype == "progress" elseif a:filetype == "progress"
call s:MapDelimiters('/*','*/') call s:MapDelimiters('/*','*/')
elseif a:filetype == "prolog" elseif a:filetype == "prolog"
call s:MapDelimitersWithAlternative('%','','/*','*/') call s:MapDelimitersWithAlternative('%','','/*','*/')
elseif a:filetype == "ps1"
call s:MapDelimiters('#', '')
elseif a:filetype == "psf" elseif a:filetype == "psf"
call s:MapDelimiters('#', '') call s:MapDelimiters('#', '')
elseif a:filetype == "ptcap" elseif a:filetype == "ptcap"
@@ -699,6 +727,8 @@ function s:SetUpForNewFiletype(filetype, forceReset)
call s:MapDelimiters('<!--','-->') call s:MapDelimiters('<!--','-->')
elseif a:filetype == "sicad" elseif a:filetype == "sicad"
call s:MapDelimiters('*', '') call s:MapDelimiters('*', '')
elseif a:filetype == "sieve"
call s:MapDelimiters('#', '')
elseif a:filetype == "simula" elseif a:filetype == "simula"
call s:MapDelimitersWithAlternative('%', '', '--', '') call s:MapDelimitersWithAlternative('%', '', '--', '')
elseif a:filetype == "sinda" elseif a:filetype == "sinda"
@@ -763,6 +793,8 @@ function s:SetUpForNewFiletype(filetype, forceReset)
call s:MapDelimiters('','') call s:MapDelimiters('','')
elseif a:filetype == "svn" elseif a:filetype == "svn"
call s:MapDelimiters('','') call s:MapDelimiters('','')
elseif a:filetype == "SVNannotate"
call s:MapDelimiters('','')
elseif a:filetype == "SVNAnnotate" elseif a:filetype == "SVNAnnotate"
call s:MapDelimiters('','') call s:MapDelimiters('','')
elseif a:filetype == "SVNcommit" elseif a:filetype == "SVNcommit"
@@ -1004,13 +1036,13 @@ function s:AppendCommentToLine()
"stick the delimiters down at the end of the line. We have to format the "stick the delimiters down at the end of the line. We have to format the
"comment with spaces as appropriate "comment with spaces as appropriate
execute ":normal " . insOrApp . (isLineEmpty ? '' : ' ') . left . right . " " execute ":normal! " . insOrApp . (isLineEmpty ? '' : ' ') . left . right . " "
" if there is a right delimiter then we gotta move the cursor left " if there is a right delimiter then we gotta move the cursor left
" by the len of the right delimiter so we insert between the delimiters " by the len of the right delimiter so we insert between the delimiters
if lenRight > 0 if lenRight > 0
let leftMoveAmount = lenRight let leftMoveAmount = lenRight
execute ":normal " . leftMoveAmount . "h" execute ":normal! " . leftMoveAmount . "h"
endif endif
startinsert startinsert
endfunction endfunction
@@ -1589,11 +1621,11 @@ function! NERDComment(isVisual, type) range
elseif a:type == 'yank' elseif a:type == 'yank'
if a:isVisual if a:isVisual
normal gvy normal! gvy
elseif countWasGiven elseif countWasGiven
execute firstLine .','. lastLine .'yank' execute firstLine .','. lastLine .'yank'
else else
normal Y normal! yy
endif endif
execute firstLine .','. lastLine .'call NERDComment('. a:isVisual .', "norm")' execute firstLine .','. lastLine .'call NERDComment('. a:isVisual .', "norm")'
endif endif
@@ -1630,19 +1662,19 @@ function s:PlaceDelimitersAndInsBetween()
" place the delimiters down. We do it differently depending on whether " place the delimiters down. We do it differently depending on whether
" there is a left AND right delimiter " there is a left AND right delimiter
if lenRight > 0 if lenRight > 0
execute ":normal " . insOrApp . left . right execute ":normal! " . insOrApp . left . right
execute ":normal " . lenRight . "h" execute ":normal! " . lenRight . "h"
else else
execute ":normal " . insOrApp . left execute ":normal! " . insOrApp . left
" if we are tacking the delim on the EOL then we gotta add a space " if we are tacking the delim on the EOL then we gotta add a space
" after it cos when we go out of insert mode the cursor will move back " after it cos when we go out of insert mode the cursor will move back
" one and the user wont be in position to type the comment. " one and the user wont be in position to type the comment.
if isDelimOnEOL if isDelimOnEOL
execute 'normal a ' execute 'normal! a '
endif endif
endif endif
normal l normal! l
"if needed convert spaces back to tabs and adjust the cursors col "if needed convert spaces back to tabs and adjust the cursors col
"accordingly "accordingly
@@ -1811,7 +1843,7 @@ function s:UncommentLinesSexy(topline, bottomline)
" if the first line contains only the left delim then just delete it " if the first line contains only the left delim then just delete it
if theLine =~ '^[ \t]*' . left . '[ \t]*$' && !g:NERDCompactSexyComs if theLine =~ '^[ \t]*' . left . '[ \t]*$' && !g:NERDCompactSexyComs
call cursor(a:topline, 1) call cursor(a:topline, 1)
normal dd normal! dd
let bottomline = bottomline - 1 let bottomline = bottomline - 1
" topline contains more than just the left delim " topline contains more than just the left delim
@@ -1835,7 +1867,7 @@ function s:UncommentLinesSexy(topline, bottomline)
" if the bottomline contains only the right delim then just delete it " if the bottomline contains only the right delim then just delete it
if theLine =~ '^[ \t]*' . right . '[ \t]*$' if theLine =~ '^[ \t]*' . right . '[ \t]*$'
call cursor(bottomline, 1) call cursor(bottomline, 1)
normal dd normal! dd
" the last line contains more than the right delim " the last line contains more than the right delim
else else
@@ -3048,7 +3080,7 @@ function s:RestoreScreenState()
endif endif
call cursor(t:NERDComOldTopLine, 0) call cursor(t:NERDComOldTopLine, 0)
normal zt normal! zt
call setpos(".", t:NERDComOldPos) call setpos(".", t:NERDComOldPos)
endfunction endfunction