From 11b08278fac7b10d72ae5a8ee07602cc0429b587 Mon Sep 17 00:00:00 2001 From: Israel Chauca Fuentes Date: Thu, 24 Sep 2009 02:37:12 -0500 Subject: [PATCH] === 1.3 === Now local options can be used along with autocmd for specific file type configurations. Fixes: - Unnamed register content is not lost on visual mode. - Use noremap where appropiate. - Wrapping a single empty line works as expected. --- delimitMate.txt | 81 +++++++++++++-- delimitMate.vim | 269 ++++++++++++++++++++++++++++++------------------ 2 files changed, 239 insertions(+), 111 deletions(-) diff --git a/delimitMate.txt b/delimitMate.txt index e749410..2a85e9f 100644 --- a/delimitMate.txt +++ b/delimitMate.txt @@ -20,7 +20,7 @@ 5. TODO list_______________________________|delimitMateTodo| 6. Maintainer______________________________|delimitMateMaintainer| 7. Credits_________________________________|delimitMateCredits| - + 8. History_________________________________|delimitMateHistory| ============================================================================== 1.- INTRODUCTION *delimitMate* @@ -133,38 +133,47 @@ e.g. (selection represented between square brackets): > 3.1 OPTIONS SUMMARY *delimitMateOptionSummary* The behaviour of this script can be customized setting the following options -in your vimrc file. +in your vimrc file. You can use local options to set the configuration for +specific file types, see |delimitMateOptionDetails| for examples. |'loaded_delimitMate'| Turns off the script. |'delimitMate_autoclose'| Tells delimitMate whether to automagically insert the closing delimiter. -|'b:delimitMate_matchpairs'| Tells delimitMate which characters are +|'delimitMate_matchpairs'| Tells delimitMate which characters are matching pairs. -|'b:delimitMate_quotes'| Tells delimitMate which quotes should be +|'delimitMate_quotes'| Tells delimitMate which quotes should be used. |'delimitMate_visual_leader'| Sets the leader to be used in visual mode. -|'b:delimitMate_expand_cr'| Sets the expansion for inside an empty +|'delimitMate_expand_cr'| Sets the expansion for inside an empty pair of matching delimiters or quotes. -|'b:delimitMate_expand_space'| Sets the expansion for inside an +|'delimitMate_expand_space'| Sets the expansion for inside an empty pair of matching delimiters or quotes. +|'delimitMate_excluded_ft'| Turns off the script for the given file types. + ------------------------------------------------------------------------------ 3.2 OPTIONS DETAILS *delimitMateOptionDetails* Add the shown lines to your vimrc files in order to set the below options. +Local options take precedence over global ones and can be used along with +autocmd to modify delimitMate's behavior for specific file types. *'loaded_delimitMate'* -You can turn off this plugin using this line in your vimrc: > + *'b:loaded_delimitMate'* +This option prevents delimitMate from loading. +e.g.: > let loaded_delimitMate = 1 + au FileType mail let b:loaded_delimitMate = 1 < ------------------------------------------------------------------------------ *'delimitMate_autoclose'* + *'b:delimitMate_autoclose'* Values: 0 or 1. Default: 1 @@ -172,9 +181,11 @@ If this option is set to 0, delimitMate will not add a closing delimiter automagically. See |delimitMateAutoClose| for details. e.g.: > let delimitMate_autoclose = 0 + au FileType mail let b:delimitMate_autoclose = 0 < ------------------------------------------------------------------------------ - *'b:delimitMate_matchpairs'* + *'delimitMate_matchpairs'* + *'b:delimitMate_matchpairs'* Values: A string with |matchpairs| syntax. Default: &matchpairs @@ -182,8 +193,10 @@ Use this option to tell delimitMate which characters should be considered matching pairs. Read |delimitMateAutoClose| for details. e.g: > let delimitMate = "(:),[:],{:},<:>" + au FileType vim,html let b:delimitMate_matchpairs = "(:),[:],{:},<:>" < ------------------------------------------------------------------------------ + *'delimitMate_quotes'* *'b:delimitMate_quotes'* Values: A string of characters separated by spaces. Default: "\" ' `" @@ -192,9 +205,11 @@ Use this option to tell delimitMate which characters should be considered as quotes. Read |delimitMateAutoClose| for details. e.g.: > let b:delimitMate_quotes = "\" ' ` *" + au FileType html let b:delimitMate_quotes = "\" '" < ------------------------------------------------------------------------------ *'delimitMate_visual_leader'* + *'b:delimitMate_visual_leader'* Values: Any character. Default: q @@ -202,8 +217,10 @@ The value of this option will be used to wrap the selection in visual mode when followed by a delimiter. Read |delimitMateVisualWrap| for details. e.g: > let delimitMate_visual_leader = "f" + au FileType html let b:delimitMate_visual_leader = "f" < ------------------------------------------------------------------------------ + *'delimitMate_expand_cr'* *'b:delimitMate_expand_cr'* Values: A key mapping. Default: "\" @@ -212,8 +229,10 @@ The value of this option will be used to expand the car return character when typed inside an empty delimiter pair. Read |delimitMateExpansion| for details. e.g.: > let b:delimitMate_expand_cr = "\\\" + au FileType mail let b:delimitMate_expand_cr = "\ < ------------------------------------------------------------------------------ + *'delimitMate_expand_space'* *'b:delimitMate_expand_space'* Values: A key mapping. Default: "\" @@ -221,9 +240,19 @@ Default: "\" The value of this option will be used to expand the space character when typed inside an empty delimiter pair. Read |delimitMateExpansion| for details. e.g.: > - let b:delimitMate_expand_space = "\\\" + let delimitMate_expand_space = "\\\" + au filetype tcl let b:delimitMate_expand_space = "\" < +------------------------------------------------------------------------------ + *'delimitMate_excluded_ft'* +Values: A string of file type names separated by single commas. +Defaul: Empty. +This options turns delimitMate off for the listed file types, use this option +only if don't want any of the features it provides. +e.g.: > + let delimitMate_excluded_ft = "mail,txt" +< ============================================================================== 4. PUBLIC COMMANDS *delimitMatePublicCommands* @@ -231,7 +260,7 @@ e.g.: > :DelimitMateReload *:DelimitMateReload* Re-sets all the mappings used for this script, use it if any option has been -changed. +changed or if the filetype option hasn't been set yet. ------------------------------------------------------------------------------ :DelimitMateTest *:DelimitMateTest* @@ -310,7 +339,6 @@ represented by an "|": > - Automatic set-up by file type. - Make visual wrapping work on blockwise visual mode. - Limit behaviour by region. -- Fix some problems wrapping a single empty line in visual mode. ============================================================================== 6. MAINTAINER *delimitMateMaintainer* @@ -340,4 +368,35 @@ from the following sources: This script was inspired by the auto-completion of delimiters of TextMate. +============================================================================== + 8. HISTORY *delimitMateHistory* + + Version Date Release notes +|---------|------------|-----------------------------------------------------| + 1.3 2009-09-24 Now local options can be used along with autocmd + for specific file type configurations. + Fixes: + - Unnamed register content is not lost on visual + mode. + - Use noremap where appropiate. + - Wrapping a single empty line works as expected. + +|---------|------------|-----------------------------------------------------| + 1.2 2009-09-07 Fixes: + - When inside nested empty pairs, deleting the + innermost left delimiter would delete all right + contiguous delimiters. + - When inside an empty pair, inserting a left + delimiter wouldn't insert the right one, instead + the cursor would jump to the right. + - New buffer inside the current window wouldn't + have the mappings set. +|---------|------------|-----------------------------------------------------| + 1.1 2009-08-25 Fixed an error that ocurred when mapleader wasn't + set and added support for GetLatestScripts + auto-detection. +|---------|------------|-----------------------------------------------------| + 1.0 2009-08-23 Initial upload. +|---------|------------|-----------------------------------------------------| + vim:tw=78:ts=8:ft=help:norl: diff --git a/delimitMate.vim b/delimitMate.vim index aff266a..d0b9a23 100644 --- a/delimitMate.vim +++ b/delimitMate.vim @@ -1,6 +1,6 @@ " ============================================================================ " File: delimitMate.vim -" Version: 1.1 +" Version: 1.3 " Description: This plugin tries to emulate the auto-completion of delimiters " that TextMate provides. " Maintainer: Israel Chauca F. @@ -21,6 +21,7 @@ if exists("g:loaded_delimitMate") "{{{1 " User doesn't want this plugin, let's get out! finish endif +let g:loaded_delimitMate = 1 if exists("s:loaded_delimitMate") && !exists("g:delimitMate_testing") " Don't define the functions if they already exist: just do the work @@ -34,24 +35,26 @@ if v:version < 700 finish endif -let s:loaded_delimitMate = 1 +let s:loaded_delimitMate = 1 " }}}1 function! s:Init() "{{{1 - if !exists("g:delimitMate_autoclose") + if !exists("b:delimitMate_autoclose") && !exists("g:delimitMate_autoclose") " {{{ let s:autoclose = 1 + elseif exists("b:delimitMate_autoclose") + let s:autoclose = b:delimitMate_autoclose else let s:autoclose = g:delimitMate_autoclose - endif + endif " }}} - if !exists("b:delimitMate_matchpairs") + if !exists("b:delimitMate_matchpairs") && !exists("g:delimitMate_matchpairs") " {{{ if s:ValidMatchpairs(&matchpairs) == 1 let s:matchpairs_temp = &matchpairs else echoerr "delimitMate: There seems to be a problem with 'matchpairs', read ':help matchpairs' and fix it or notify the maintainer of this script if this is a bug." finish endif - else + elseif exists("b:delimitMate_matchpairs") if s:ValidMatchpairs(b:delimitMate_matchpairs) || b:delimitMate_matchpairs == "" let s:matchpairs_temp = b:delimitMate_matchpairs else @@ -63,51 +66,93 @@ function! s:Init() "{{{1 let s:matchpairs_temp = "" endif endif - endif + else + if s:ValidMatchpairs(g:delimitMate_matchpairs) || g:delimitMate_matchpairs == "" + let s:matchpairs_temp = g:delimitMate_matchpairs + else + echoerr "delimitMate: Invalid format in 'g:delimitMate_matchpairs', falling back to matchpairs. Fix the error and use the command :DelimitMateReload to try again." + if s:ValidMatchpairs(&matchpairs) == 1 + let s:matchpairs_temp = &matchpairs + else + echoerr "delimitMate: There seems to be a problem with 'matchpairs', read ':help matchpairs' and fix it or notify the maintainer of this script if this is a bug." + let s:matchpairs_temp = "" + endif + endif - if exists("b:delimitMate_quotes") + endif " }}} + + if exists("b:delimitMate_quotes") " {{{ if b:delimitMate_quotes =~ '^\(\S\)\(\s\S\)*$' || b:delimitMate_quotes == "" let s:quotes = split(b:delimitMate_quotes) else let s:quotes = split("\" ' `") echoerr "delimitMate: There is a problem with the format of 'b:delimitMate_quotes', it should be a string of single characters separated by spaces. Falling back to default values." endif + elseif exists("g:delimitMate_quotes") + if g:delimitMate_quotes =~ '^\(\S\)\(\s\S\)*$' || g:delimitMate_quotes == "" + let s:quotes = split(g:delimitMate_quotes) + else + let s:quotes = split("\" ' `") + echoerr "delimitMate: There is a problem with the format of 'g:delimitMate_quotes', it should be a string of single characters separated by spaces. Falling back to default values." + endif else let s:quotes = split("\" ' `") - endif + endif " }}} - if !exists("g:delimitMate_visual_leader") + if !exists("b:delimitMate_visual_leader") && !exists("g:delimitMate_visual_leader") " {{{ if !exists("g:mapleader") let s:visual_leader = "\\" else let s:visual_leader = g:mapleader endif + elseif exists("b:delimitMate_visual_leader") + let s:visual_leader = b:delimitMate_visual_leader else - let s:visual_leader = g:delimitMate_visual_leader - endif + let s:visual_leader = g:delimitMate_visual_leader + endif " }}} - if !exists("b:delimitMate_expand_space") + if !exists("b:delimitMate_expand_space") && !exists("g:delimitMate_expand_space") " {{{ let s:expand_space = "\" elseif b:delimitMate_expand_space == "" let s:expand_space = "\" - else + elseif exists("b:delimitMate_expand_space") let s:expand_space = b:delimitMate_expand_space - endif - - if !exists("b:delimitMate_expand_cr") - let s:expand_return = "\" - elseif b:delimitMate_expand_cr == "" - let s:expand_return = "\" else - let s:expand_return = b:delimitMate_expand_cr - endif + let s:expand_space = g:delimitMate_expand_space + endif " }}} + + if !exists("b:delimitMate_expand_cr") && !exists("g:delimitMate_expand_cr") " {{{ + let s:expand_return = "\" + elseif exists("b:delimitMate_expand_cr") + if b:delimitMate_expand_cr == "" + let s:expand_return = "\" + else + let s:expand_return = b:delimitMate_expand_cr + endif + else + if g:delimitMate_expand_cr == "" + let s:expand_return = "\" + else + let s:expand_return = g:delimitMate_expand_cr + endif + + endif " }}} let s:matchpairs = split(s:matchpairs_temp, ',') let s:left_delims = split(s:matchpairs_temp, ':.,\=') let s:right_delims = split(s:matchpairs_temp, ',\=.:') let s:VMapMsg = "delimitMate: delimitMate is disabled on blockwise visual mode." -endfunction + call s:ResetMappings() + if s:autoclose + call s:AutoClose() + else + call s:NoAutoClose() + endif + call s:ExtraMappings() + let b:loaded_delimitMate = 1 + +endfunction "}}}1 function! s:ValidMatchpairs(str) "{{{1 if a:str !~ '^\(.:.\)\+\(,.:.\)*$' @@ -119,7 +164,7 @@ function! s:ValidMatchpairs(str) "{{{1 endif endfor return 1 -endfunc +endfunction "}}}1 function! s:IsEmptyPair(str) "{{{1 for pair in s:matchpairs @@ -133,12 +178,12 @@ function! s:IsEmptyPair(str) "{{{1 endif endfor return 0 -endfunc +endfunction "}}}1 function! s:WithinEmptyPair() "{{{1 let cur = strpart( getline('.'), col('.')-2, 2 ) return s:IsEmptyPair( cur ) -endfunc +endfunction "}}}1 function! s:SkipDelim(char) "{{{1 let cur = strpart( getline('.'), col('.')-2, 3 ) @@ -154,7 +199,7 @@ function! s:SkipDelim(char) "{{{1 else return a:char endif -endfunc +endfunction "}}}1 function! s:QuoteDelim(char) "{{{1 let line = getline('.') @@ -169,7 +214,7 @@ function! s:QuoteDelim(char) "{{{1 "Starting a string return a:char.a:char."\" endif -endf +endfunction "}}}1 function! s:ClosePair(char) "{{{1 if getline('.')[col('.') - 1] == a:char @@ -177,7 +222,7 @@ function! s:ClosePair(char) "{{{1 else return a:char endif -endf +endfunction "}}}1 function! s:ResetMappings() "{{{1 for delim in s:right_delims + s:left_delims + s:quotes @@ -186,77 +231,99 @@ function! s:ResetMappings() "{{{1 endfor silent! iunmap silent! iunmap -endfunction +endfunction "}}}1 function! s:MapMsg(msg) "{{{1 redraw echomsg a:msg return "" -endfunction +endfunction "}}}1 function! s:NoAutoClose() "{{{1 - " imap ) =SkipDelim('\)') + " inoremap ) =SkipDelim('\)') for delim in s:right_delims + s:quotes - exec 'imap ' . delim . ' =SkipDelim("' . escape(delim,'"') . '")' - endfor - - " Wrap the selection with delimiters, but do nothing if blockwise visual mode is active: - for i in range(len(s:matchpairs)) - " Map left delimiter: - " vmap q( visualmode() == "" ? MapMsg(VMapMsg) : "s(\\")\" - exec 'vmap ' . s:visual_leader . s:left_delims[i] . ' visualmode() == "" ? MapMsg("' . s:VMapMsg . '") : "s' . s:left_delims[i] . '\\"' . s:right_delims[i] . '\"' - - " Map right delimiter: - " vmap q) visualmode() == "" ? MapMsg(VMapMsg) : "s(\\")\" - exec 'vmap ' . s:visual_leader . s:right_delims[i] . ' visualmode() == "" ? MapMsg("' . s:VMapMsg . '") : "s' . s:left_delims[i] . '\\"' . s:right_delims[i] . '"' - endfor - - for quote in s:quotes - " vmap q" visualmode() == "" ? MapMsg(VMapMsg) : "s'\\"'\" - exec 'vmap ' . s:visual_leader . quote . ' visualmode() == "" ? MapMsg("' . s:VMapMsg . '") : "s' . escape(quote,'"') . '\\"' . escape(quote,'"') . '\"' - endfor -endfunction - -function! s:AutoClose() "{{{1 - " Add matching pair and jump to the midle: - " imap ( () - let s:i = 0 - while s:i < len(s:matchpairs) - exec 'imap ' . s:left_delims[s:i] . ' ' . s:left_delims[s:i] . '_' . s:right_delims[s:i] . '' - let s:i += 1 - endwhile - - " Add matching quote and jump to the midle, or exit if inside a pair of matching quotes: - " imap " =QuoteDelim("\"") - for delim in s:quotes - exec 'imap ' . delim . ' =QuoteDelim("\' . delim . '")' - endfor - - " Exit from inside the matching pair: - " imap ) =ClosePair(')') - for delim in s:right_delims - exec 'imap ' . delim . ' =ClosePair("\' . delim . '")' + exec 'inoremap ' . delim . ' =SkipDelim("' . escape(delim,'"') . '")' endfor " Wrap the selection with matching pairs, but do nothing if blockwise visual mode is active: let s:i = 0 while s:i < len(s:matchpairs) " Map left delimiter: - " vmap q( visualmode() == "" ? MapMsg("Message") : "s(\\"\" - exec 'vmap ' . s:visual_leader . s:left_delims[s:i] . ' visualmode() == "" ? MapMsg("' . s:VMapMsg . '") : "s' . s:left_delims[s:i] . '\\"\"' + " vnoremap q( visualmode() == "" ? MapMsg("Message") : "s(\\"\" + exec 'vnoremap ' . s:visual_leader . s:left_delims[s:i] . ' IsBlockVisual() ? MapMsg("' . s:VMapMsg . '") : "s' . s:left_delims[s:i] . '\\"' . s:right_delims[s:i] . '\:call RestoreRegister()"' " Map right delimiter: - " vmap q) visualmode() == "" ? MapMsg("Message") : "s(\\""\" - exec 'vmap ' . s:visual_leader . s:right_delims[s:i] . ' visualmode() == "" ? MapMsg("' . s:VMapMsg . '") : "s' . s:left_delims[s:i] . '\\""' + " vnoremap q) visualmode() == "" ? MapMsg("Message") : "s(\\""\" + exec 'vnoremap ' . s:visual_leader . s:right_delims[s:i] . ' IsBlockVisual() ? MapMsg("' . s:VMapMsg . '") : "s' . s:left_delims[s:i] . '\\"' . s:right_delims[s:i] . '\:call RestoreRegister()"' let s:i += 1 endwhile " Wrap the selection with matching quotes, but do nothing if blockwise visual mode is active: for quote in s:quotes - " vmap q' visualmode() == "" ? MapMsg("Message") : "s'\\"'\" - exec 'vmap ' . s:visual_leader . quote . ' visualmode() == "" ? MapMsg("' . s:VMapMsg . '") : "s' . escape(quote,'"') .'\\"' . escape(quote,'"') . '\"' + " vnoremap q' visualmode() == "" ? MapMsg("Message") : "s'\\"'\" + exec 'vnoremap ' . s:visual_leader . quote . ' IsBlockVisual() ? MapMsg("' . s:VMapMsg . '") : "s' . escape(quote,'"') .'\\"' . escape(quote,'"') . '\:call RestoreRegister()"' endfor -endfunction +endfunction "}}}1 + +function! s:AutoClose() "{{{1 + " Add matching pair and jump to the midle: + " inoremap ( () + let s:i = 0 + while s:i < len(s:matchpairs) + exec 'inoremap ' . s:left_delims[s:i] . ' ' . s:left_delims[s:i] . s:right_delims[s:i] . '' + let s:i += 1 + endwhile + + " Add matching quote and jump to the midle, or exit if inside a pair of matching quotes: + " inoremap " =QuoteDelim("\"") + for delim in s:quotes + exec 'inoremap ' . delim . ' =QuoteDelim("\' . delim . '")' + endfor + + " Exit from inside the matching pair: + " inoremap ) =ClosePair(')') + for delim in s:right_delims + exec 'inoremap ' . delim . ' =ClosePair("\' . delim . '")' + endfor + + " Wrap the selection with matching pairs, but do nothing if blockwise visual mode is active: + let s:i = 0 + while s:i < len(s:matchpairs) + " Map left delimiter: + " vnoremap q( visualmode() == "" ? MapMsg("Message") : "s(\\"\" + exec 'vnoremap ' . s:visual_leader . s:left_delims[s:i] . ' IsBlockVisual() ? MapMsg("' . s:VMapMsg . '") : "s' . s:left_delims[s:i] . '\\"' . s:right_delims[s:i] . '\:call RestoreRegister()"' + + " Map right delimiter: + " vnoremap q) visualmode() == "" ? MapMsg("Message") : "s(\\""\" + exec 'vnoremap ' . s:visual_leader . s:right_delims[s:i] . ' IsBlockVisual() ? MapMsg("' . s:VMapMsg . '") : "s' . s:left_delims[s:i] . '\\"' . s:right_delims[s:i] . '\:call RestoreRegister()"' + let s:i += 1 + endwhile + + " Wrap the selection with matching quotes, but do nothing if blockwise visual mode is active: + for quote in s:quotes + " vnoremap q' visualmode() == "" ? MapMsg("Message") : "s'\\"'\" + exec 'vnoremap ' . s:visual_leader . quote . ' IsBlockVisual() ? MapMsg("' . s:VMapMsg . '") : "s' . escape(quote,'"') .'\\"' . escape(quote,'"') . '\:call RestoreRegister()"' + endfor +endfunction "}}}1 + +function! s:IsBlockVisual() " {{{1 + if visualmode() == "" + return 1 + endif + let s:save_reg = getreg('"') + echomsg s:save_reg + let s:save_reg_mode = getregtype('"') + echomsg s:save_reg_mode + if len(getline('.')) == 0 + let @" = "\n" + endif + return 0 +endfunction " }}}1 + +function! s:RestoreRegister() " {{{1 + call setreg('"', s:save_reg, s:save_reg_mode) + echo "" +endfunction " }}}1 function! s:ExpandReturn() "{{{1 if s:WithinEmptyPair() @@ -264,7 +331,7 @@ function! s:ExpandReturn() "{{{1 else return "\" endif -endfunction +endfunction "}}}1 function! s:ExpandSpace() "{{{1 if s:WithinEmptyPair() @@ -272,18 +339,18 @@ function! s:ExpandSpace() "{{{1 else return "\" endif -endfunction +endfunction "}}}1 function! s:ExtraMappings() "{{{1 " If pair is empty, delete both delimiters: - imap WithinEmptyPair() ? "\\\" : "\" + inoremap WithinEmptyPair() ? "" : "\" " Expand return if inside an empty pair: - imap =ExpandReturn() + inoremap =ExpandReturn() " Expand space if inside an empty pair: - imap =ExpandSpace() -endfunction + inoremap =ExpandSpace() +endfunction "}}}1 function! s:TestMappings() "{{{1 if s:autoclose @@ -326,7 +393,7 @@ function! s:TestMappings() "{{{1 endfor endif exec "normal \" -endfunction +endfunction "}}}1 function! s:SwitchAutoclose() "{{{1 if !exists("g:delimitMate_autoclose") @@ -337,7 +404,7 @@ function! s:SwitchAutoclose() "{{{1 let g:delimitMate_autoclose = 1 endif DelimitMateReload -endfunction +endfunction "}}}1 function! s:TestMappingsDo() "{{{1 if !exists("g:delimitMate_testing") @@ -350,28 +417,29 @@ function! s:TestMappingsDo() "{{{1 call s:SwitchAutoclose() call s:TestMappings() endif -endfunction +endfunction "}}}1 function! s:DelimitMateDo() "{{{1 + if exists("g:delimitMate_excluded_ft") + for ft in split(g:delimitMate_excluded_ft,',') + if ft ==? &filetype + echomsg "Excluded" + return 1 + endif + endfor + endif try - let s:save_cpo = &cpo + let save_cpo = &cpo set cpo&vim call s:Init() - call s:ResetMappings() - if s:autoclose - call s:AutoClose() - else - call s:NoAutoClose() - endif - call s:ExtraMappings() - let b:loaded_delimitMate = 1 finally - let &cpo = s:save_cpo + let &cpo = save_cpo endtry -endfunction + let &cpo = save_cpo +endfunction "}}}1 " Do the real work: {{{1 -call s:DelimitMateDo() +"call s:DelimitMateDo() " Let me refresh without re-loading the buffer: command! DelimitMateReload call s:DelimitMateDo() @@ -379,7 +447,8 @@ command! DelimitMateReload call s:DelimitMateDo() " Quick test: command! DelimitMateTest call s:TestMappingsDo() -autocmd BufNewFile,BufRead,BufEnter * if !exists("b:loaded_delimitMate") | call DelimitMateDo() | endif +"autocmd BufNewFile,BufRead,BufEnter * if !exists("b:loaded_delimitMate") || &filetype !=? "mailapp" | call DelimitMateDo() | endif +autocmd VimEnter * autocmd FileType * if !exists("b:loaded_delimitMate") | call DelimitMateDo() | endif " GetLatestVimScripts: 2754 1 :AutoInstall: delimitMate.vim " vim:foldmethod=marker:foldcolumn=2