Update ALL the plugins!
git-svn-id: http://photonzero.com/dotfiles/trunk@80 23f722f6-122a-0410-8cef-c75bd312dd78
This commit is contained in:
parent
0a85941bf4
commit
0ad6077023
42 changed files with 9620 additions and 1644 deletions
|
|
@ -404,6 +404,8 @@ then the script would do a sexy comment on the last visual selection.
|
|||
doing visual-block comments.
|
||||
|'NERDCommentWholeLinesInVMode'| Changes behaviour of visual comments.
|
||||
|'NERDCreateDefaultMappings'| Turn the default mappings on/off.
|
||||
|'NERDCustomDelimiters'| Add or override delimiters for any
|
||||
filetypes.
|
||||
|'NERDDefaultNesting'| Tells the script to use nested comments
|
||||
by default.
|
||||
|'NERDMenuMode'| Specifies how the NERD commenter menu
|
||||
|
|
@ -550,7 +552,7 @@ Note that this option does not affect the behaviour of commenting in
|
|||
|visual-block| mode.
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
*'NERDCreateDefaultMappings'*
|
||||
*'NERDCreateDefaultMappings'*
|
||||
Values: 0 or 1.
|
||||
Default: 1.
|
||||
|
||||
|
|
@ -559,6 +561,25 @@ If set to 0, none of the default mappings will be created.
|
|||
See also |NERDComMappings|.
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
*'NERDCustomDelimiters'*
|
||||
Values: A map (format specified below).
|
||||
Default: {}
|
||||
|
||||
Use this option if you have new filetypes you want the script to handle, or if
|
||||
you want to override the default delimiters of a filetype.
|
||||
|
||||
Example: >
|
||||
let g:NERDCustomDelimiters = {
|
||||
\ 'ruby': { 'left': '#', 'leftAlt': 'FOO', 'rightAlt': 'BAR' },
|
||||
\ 'grondle': { 'left': '{{', 'right': '}}' }
|
||||
\ }
|
||||
<
|
||||
|
||||
Here we override the delimiter settings for ruby and add FOO/BAR as alternative
|
||||
delimiters. We also add {{ and }} as delimiters for a new filetype called
|
||||
'grondle'.
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
*'NERDRemoveAltComs'*
|
||||
Values: 0 or 1.
|
||||
Default: 1.
|
||||
|
|
@ -576,7 +597,7 @@ It will not be uncommented if the NERDRemoveAltComs is set to 0.
|
|||
------------------------------------------------------------------------------
|
||||
*'NERDRemoveExtraSpaces'*
|
||||
Values: 0 or 1.
|
||||
Default: 1.
|
||||
Default: 0.
|
||||
|
||||
By default, the NERD commenter will remove spaces around comment delimiters if
|
||||
either:
|
||||
|
|
@ -599,8 +620,6 @@ Otherwise they would become: >
|
|||
int bar = 10;
|
||||
int baz = foo + bar
|
||||
<
|
||||
If you want the spaces to be removed only if |'NERDSpaceDelims'| is set then
|
||||
set NERDRemoveExtraSpaces to 0.
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
*'NERDLPlace'*
|
||||
|
|
@ -633,7 +652,7 @@ Default: 3
|
|||
This option can take 4 values:
|
||||
"0": Turns the menu off.
|
||||
"1": Turns the 'comment' menu on with no menu shortcut.
|
||||
"2": Turns the 'comment 'menu on with <alt>-c as the shortcut.
|
||||
"2": Turns the 'comment' menu on with <alt>-c as the shortcut.
|
||||
"3": Turns the 'Plugin -> comment' menu on with <alt>-c as the shortcut.
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
|
|
@ -781,6 +800,15 @@ The latest dev versions are on github
|
|||
==============================================================================
|
||||
8. Changelog *NERDComChangelog*
|
||||
|
||||
2.3.0
|
||||
- remove all filetypes which have a &commentstring in the standard vim
|
||||
runtime for vim > 7.0 unless the script stores an alternate set of
|
||||
delimiters
|
||||
- make the script complain if the user doesnt have filetype plugins enabled
|
||||
- use <leader> instead of comma to start the default mappings
|
||||
- fix a couple of bugs with sexy comments - thanks to Tim Smart
|
||||
- lots of refactoring
|
||||
|
||||
2.2.2
|
||||
- remove the NERDShutup option and the message is suppresses, this makes
|
||||
the plugin silently rely on &commentstring for unknown filetypes.
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
" ============================================================================
|
||||
" File: NERD_commenter.vim
|
||||
" Description: vim global plugin that provides easy code commenting
|
||||
" Maintainer: Martin Grenfell <martin_grenfell at msn dot com>
|
||||
" Version: 2.2.2
|
||||
" Last Change: 09th October, 2010
|
||||
" Maintainer: Martin Grenfell <martin.grenfell at gmail dot com>
|
||||
" Version: 2.3.0
|
||||
" Last Change: 08th December, 2010
|
||||
" License: This program is free software. It comes without any warranty,
|
||||
" 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
|
||||
|
|
@ -47,7 +47,7 @@ endfunction
|
|||
let s:spaceStr = ' '
|
||||
let s:lenSpaceStr = strlen(s:spaceStr)
|
||||
|
||||
" Section: variable init calls {{{2
|
||||
" Section: variable initialization {{{2
|
||||
call s:InitVariable("g:NERDAllowAnyVisualDelims", 1)
|
||||
call s:InitVariable("g:NERDBlockComIgnoreEmpty", 0)
|
||||
call s:InitVariable("g:NERDCommentWholeLinesInVMode", 0)
|
||||
|
|
@ -58,13 +58,15 @@ call s:InitVariable("g:NERDMenuMode", 3)
|
|||
call s:InitVariable("g:NERDLPlace", "[>")
|
||||
call s:InitVariable("g:NERDUsePlaceHolders", 1)
|
||||
call s:InitVariable("g:NERDRemoveAltComs", 1)
|
||||
call s:InitVariable("g:NERDRemoveExtraSpaces", 1)
|
||||
call s:InitVariable("g:NERDRemoveExtraSpaces", 0)
|
||||
call s:InitVariable("g:NERDRPlace", "<]")
|
||||
call s:InitVariable("g:NERDSpaceDelims", 0)
|
||||
call s:InitVariable("g:NERDDelimiterRequests", 1)
|
||||
|
||||
if !exists("g:NERDCustomDelimiters")
|
||||
let g:NERDCustomDelimiters = {}
|
||||
endif
|
||||
|
||||
let s:NERDFileNameEscape="[]#*$%'\" ?`!&();<>\\"
|
||||
"vf ;;dA:hcs"'A {j^f(lyi(k$p0f{a A }0f{a 'left':jdd^
|
||||
|
||||
let s:delimiterMap = {
|
||||
\ 'aap': { 'left': '#' },
|
||||
|
|
@ -144,7 +146,7 @@ let s:delimiterMap = {
|
|||
\ 'eiffel': { 'left': '--' },
|
||||
\ 'elf': { 'left': "'" },
|
||||
\ 'elmfilt': { 'left': '#' },
|
||||
\ 'erlang': { 'left': '%' },
|
||||
\ 'erlang': { 'left': '%', 'leftAlt': '%%' },
|
||||
\ 'eruby': { 'left': '<%#', 'right': '%>', 'leftAlt': '<!--', 'rightAlt': '-->' },
|
||||
\ 'expect': { 'left': '#' },
|
||||
\ 'exports': { 'left': '#' },
|
||||
|
|
@ -173,7 +175,7 @@ let s:delimiterMap = {
|
|||
\ 'gitrebase': { 'left': '#' },
|
||||
\ 'gnuplot': { 'left': '#' },
|
||||
\ 'groovy': { 'left': '//', 'leftAlt': '/*', 'rightAlt': '*/' },
|
||||
\ 'gsp': { 'left': '<%--', 'right': '--%>' },
|
||||
\ 'gsp': { 'left': '<%--', 'right': '--%>', 'leftAlt': '<!--','rightAlt': '-->'},
|
||||
\ 'gtkrc': { 'left': '#' },
|
||||
\ 'haskell': { 'left': '{-','right': '-}', 'leftAlt': '--' },
|
||||
\ 'hb': { 'left': '#' },
|
||||
|
|
@ -206,9 +208,10 @@ let s:delimiterMap = {
|
|||
\ 'kscript': { 'left': '//', 'leftAlt': '/*', 'rightAlt': '*/' },
|
||||
\ 'lace': { 'left': '--' },
|
||||
\ 'ldif': { 'left': '#' },
|
||||
\ 'less': { 'left': '/*','right': '*/' },
|
||||
\ 'lilo': { 'left': '#' },
|
||||
\ 'lilypond': { 'left': '%' },
|
||||
\ 'liquid': { 'left': '{%', 'right': '%}' },
|
||||
\ 'liquid': { 'left': '{% comment %}', 'right': '{% endcomment %}' },
|
||||
\ 'lisp': { 'left': ';', 'leftAlt': '#|', 'rightAlt': '|#' },
|
||||
\ 'llvm': { 'left': ';' },
|
||||
\ 'lotos': { 'left': '(*', 'right': '*)' },
|
||||
|
|
@ -255,6 +258,7 @@ let s:delimiterMap = {
|
|||
\ 'occam': { 'left': '--' },
|
||||
\ 'omlet': { 'left': '(*', 'right': '*)' },
|
||||
\ 'omnimark': { 'left': ';' },
|
||||
\ 'ooc': { 'left': '//', 'leftAlt': '/*', 'rightAlt': '*/' },
|
||||
\ 'openroad': { 'left': '//' },
|
||||
\ 'opl': { 'left': "REM" },
|
||||
\ 'ora': { 'left': '#' },
|
||||
|
|
@ -300,8 +304,10 @@ let s:delimiterMap = {
|
|||
\ 'sass': { 'left': '//', 'leftAlt': '/*' },
|
||||
\ 'sather': { 'left': '--' },
|
||||
\ 'scala': { 'left': '//', 'leftAlt': '/*', 'rightAlt': '*/' },
|
||||
\ 'scheme': { 'left': ';', 'leftAlt': '#|', 'rightAlt': '|#' },
|
||||
\ 'scilab': { 'left': '//' },
|
||||
\ 'scsh': { 'left': ';' },
|
||||
\ 'scss': { 'left': '/*','right': '*/' },
|
||||
\ 'sed': { 'left': '#' },
|
||||
\ 'sgmldecl': { 'left': '--', 'right': '--' },
|
||||
\ 'sgmllnx': { 'left': '<!--', 'right': '-->' },
|
||||
|
|
@ -376,12 +382,17 @@ let s:delimiterMap = {
|
|||
\ 'z8a': { 'left': ';' }
|
||||
\ }
|
||||
|
||||
"merge in the custom delimiters
|
||||
for ft in keys(g:NERDCustomDelimiters)
|
||||
let s:delimiterMap[ft] = g:NERDCustomDelimiters[ft]
|
||||
endfor
|
||||
|
||||
" Section: Comment mapping functions, autocommands and commands {{{1
|
||||
" ============================================================================
|
||||
" Section: Comment enabler autocommands {{{2
|
||||
" ============================================================================
|
||||
|
||||
augroup commentEnablers
|
||||
augroup NERDCommenter
|
||||
|
||||
"if the user enters a buffer or reads a buffer then we gotta set up
|
||||
"the comment delimiters for that new filetype
|
||||
|
|
@ -403,10 +414,24 @@ augroup END
|
|||
" set for this buffer.
|
||||
"
|
||||
function s:SetUpForNewFiletype(filetype, forceReset)
|
||||
let ft = a:filetype
|
||||
|
||||
"for compound filetypes, if we dont know how to handle the full filetype
|
||||
"then break it down and use the first part that we know how to handle
|
||||
if ft =~ '\.' && !has_key(s:delimiterMap, ft)
|
||||
let filetypes = split(a:filetype, '\.')
|
||||
for i in filetypes
|
||||
if has_key(s:delimiterMap, i)
|
||||
let ft = i
|
||||
break
|
||||
endif
|
||||
endfor
|
||||
endif
|
||||
|
||||
let b:NERDSexyComMarker = ''
|
||||
|
||||
if has_key(s:delimiterMap, a:filetype)
|
||||
let b:NERDCommenterDelims = s:delimiterMap[a:filetype]
|
||||
if has_key(s:delimiterMap, ft)
|
||||
let b:NERDCommenterDelims = s:delimiterMap[ft]
|
||||
for i in ['left', 'leftAlt', 'right', 'rightAlt']
|
||||
if !has_key(b:NERDCommenterDelims, i)
|
||||
let b:NERDCommenterDelims[i] = ''
|
||||
|
|
@ -1001,6 +1026,10 @@ function! NERDComment(isVisual, type) range
|
|||
let oldIgnoreCase = &ignorecase
|
||||
set noignorecase
|
||||
|
||||
if !exists("g:did_load_ftplugin") || g:did_load_ftplugin != 1
|
||||
call s:NerdEcho("filetype plugins should be enabled. See :help NERDComInstallation and :help :filetype-plugin-on", 0)
|
||||
endif
|
||||
|
||||
if a:isVisual
|
||||
let firstLine = line("'<")
|
||||
let lastLine = line("'>")
|
||||
|
|
@ -2400,10 +2429,10 @@ endfunction
|
|||
function s:NerdEcho(msg, typeOfMsg)
|
||||
if a:typeOfMsg == 0
|
||||
echohl WarningMsg
|
||||
echo 'NERDCommenter:' . a:msg
|
||||
echom 'NERDCommenter:' . a:msg
|
||||
echohl None
|
||||
elseif a:typeOfMsg == 1
|
||||
echo 'NERDCommenter:' . a:msg
|
||||
echom 'NERDCommenter:' . a:msg
|
||||
endif
|
||||
endfunction
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue