mirror of
https://github.com/Raimondi/delimitMate.git
synced 2025-12-10 22:51:53 +08:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3ce7f7ffcf |
@@ -174,8 +174,8 @@ e.g.: >
|
|||||||
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
|
||||||
*'delimitMate_autoclose'*
|
*'delimitMate_autoclose'*
|
||||||
*'b:delimitMate_autoclose'*
|
*'b:delimitMate_autoclose'*
|
||||||
Values: 0 or 1.
|
Values: 0 or 1. ~
|
||||||
Default: 1
|
Default: 1 ~
|
||||||
|
|
||||||
If this option is set to 0, delimitMate will not add a closing delimiter
|
If this option is set to 0, delimitMate will not add a closing delimiter
|
||||||
automagically. See |delimitMateAutoClose| for details.
|
automagically. See |delimitMateAutoClose| for details.
|
||||||
@@ -186,8 +186,8 @@ e.g.: >
|
|||||||
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
|
||||||
*'delimitMate_matchpairs'*
|
*'delimitMate_matchpairs'*
|
||||||
*'b:delimitMate_matchpairs'*
|
*'b:delimitMate_matchpairs'*
|
||||||
Values: A string with |matchpairs| syntax.
|
Values: A string with |matchpairs| syntax. ~
|
||||||
Default: &matchpairs
|
Default: &matchpairs ~
|
||||||
|
|
||||||
Use this option to tell delimitMate which characters should be considered
|
Use this option to tell delimitMate which characters should be considered
|
||||||
matching pairs. Read |delimitMateAutoClose| for details.
|
matching pairs. Read |delimitMateAutoClose| for details.
|
||||||
@@ -198,8 +198,8 @@ e.g: >
|
|||||||
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
|
||||||
*'delimitMate_quotes'*
|
*'delimitMate_quotes'*
|
||||||
*'b:delimitMate_quotes'*
|
*'b:delimitMate_quotes'*
|
||||||
Values: A string of characters separated by spaces.
|
Values: A string of characters separated by spaces. ~
|
||||||
Default: "\" ' `"
|
Default: "\" ' `" ~
|
||||||
|
|
||||||
Use this option to tell delimitMate which characters should be considered as
|
Use this option to tell delimitMate which characters should be considered as
|
||||||
quotes. Read |delimitMateAutoClose| for details.
|
quotes. Read |delimitMateAutoClose| for details.
|
||||||
@@ -210,8 +210,8 @@ e.g.: >
|
|||||||
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
|
||||||
*'delimitMate_visual_leader'*
|
*'delimitMate_visual_leader'*
|
||||||
*'b:delimitMate_visual_leader'*
|
*'b:delimitMate_visual_leader'*
|
||||||
Values: Any character.
|
Values: Any character. ~
|
||||||
Default: q
|
Default: q ~
|
||||||
|
|
||||||
The value of this option will be used to wrap the selection in visual mode
|
The value of this option will be used to wrap the selection in visual mode
|
||||||
when followed by a delimiter. Read |delimitMateVisualWrap| for details.
|
when followed by a delimiter. Read |delimitMateVisualWrap| for details.
|
||||||
@@ -222,8 +222,8 @@ e.g: >
|
|||||||
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
|
||||||
*'delimitMate_expand_cr'*
|
*'delimitMate_expand_cr'*
|
||||||
*'b:delimitMate_expand_cr'*
|
*'b:delimitMate_expand_cr'*
|
||||||
Values: A key mapping.
|
Values: A key mapping. ~
|
||||||
Default: "\<CR>"
|
Default: "\<CR>" ~
|
||||||
|
|
||||||
The value of this option will be used to expand the car return character when
|
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.
|
typed inside an empty delimiter pair. Read |delimitMateExpansion| for details.
|
||||||
@@ -234,8 +234,8 @@ e.g.: >
|
|||||||
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
|
||||||
*'delimitMate_expand_space'*
|
*'delimitMate_expand_space'*
|
||||||
*'b:delimitMate_expand_space'*
|
*'b:delimitMate_expand_space'*
|
||||||
Values: A key mapping.
|
Values: A key mapping. ~
|
||||||
Default: "\<Space>"
|
Default: "\<Space>" ~
|
||||||
|
|
||||||
The value of this option will be used to expand the space character when typed
|
The value of this option will be used to expand the space character when typed
|
||||||
inside an empty delimiter pair. Read |delimitMateExpansion| for details.
|
inside an empty delimiter pair. Read |delimitMateExpansion| for details.
|
||||||
@@ -245,8 +245,8 @@ e.g.: >
|
|||||||
<
|
<
|
||||||
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
|
||||||
*'delimitMate_excluded_ft'*
|
*'delimitMate_excluded_ft'*
|
||||||
Values: A string of file type names separated by single commas.
|
Values: A string of file type names separated by single commas. ~
|
||||||
Defaul: Empty.
|
Defaul: Empty. ~
|
||||||
|
|
||||||
This options turns delimitMate off for the listed file types, use this option
|
This options turns delimitMate off for the listed file types, use this option
|
||||||
only if don't want any of the features it provides.
|
only if don't want any of the features it provides.
|
||||||
@@ -371,7 +371,11 @@ This script was inspired by the auto-completion of delimiters of TextMate.
|
|||||||
==============================================================================
|
==============================================================================
|
||||||
8. HISTORY *delimitMateHistory*
|
8. HISTORY *delimitMateHistory*
|
||||||
|
|
||||||
Version Date Release notes
|
Version Date Release notes ~
|
||||||
|
|---------|------------|-----------------------------------------------------|
|
||||||
|
1.4 2009-09-27 Fix: delimitMate is now enabled on new buffers even
|
||||||
|
if they don't have set the file type option or were
|
||||||
|
opened directly from the terminal.
|
||||||
|---------|------------|-----------------------------------------------------|
|
|---------|------------|-----------------------------------------------------|
|
||||||
1.3 2009-09-24 Now local options can be used along with autocmd
|
1.3 2009-09-24 Now local options can be used along with autocmd
|
||||||
for specific file type configurations.
|
for specific file type configurations.
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
" ============================================================================
|
" ============================================================================
|
||||||
" File: delimitMate.vim
|
" File: delimitMate.vim
|
||||||
" Version: 1.3
|
" Version: 1.4
|
||||||
" Description: This plugin tries to emulate the auto-completion of delimiters
|
" Description: This plugin tries to emulate the auto-completion of delimiters
|
||||||
" that TextMate provides.
|
" that TextMate provides.
|
||||||
" Maintainer: Israel Chauca F. <israelchauca@gmail.com>
|
" Maintainer: Israel Chauca F. <israelchauca@gmail.com>
|
||||||
@@ -108,7 +108,7 @@ function! s:Init() "{{{1
|
|||||||
elseif exists("b:delimitMate_visual_leader")
|
elseif exists("b:delimitMate_visual_leader")
|
||||||
let s:visual_leader = b:delimitMate_visual_leader
|
let s:visual_leader = b:delimitMate_visual_leader
|
||||||
else
|
else
|
||||||
let s:visual_leader = g:delimitMate_visual_leader
|
let s:visual_leader = g:delimitMate_visual_leader
|
||||||
endif " }}}
|
endif " }}}
|
||||||
|
|
||||||
if !exists("b:delimitMate_expand_space") && !exists("g:delimitMate_expand_space") " {{{
|
if !exists("b:delimitMate_expand_space") && !exists("g:delimitMate_expand_space") " {{{
|
||||||
@@ -392,7 +392,7 @@ function! s:TestMappings() "{{{1
|
|||||||
exec "normal A\<CR>Car return: " . s:quotes[i] . s:quotes[i] . "\<CR>|\<Esc>GGA\<CR>\<CR>"
|
exec "normal A\<CR>Car return: " . s:quotes[i] . s:quotes[i] . "\<CR>|\<Esc>GGA\<CR>\<CR>"
|
||||||
endfor
|
endfor
|
||||||
endif
|
endif
|
||||||
exec "normal \<Esc>"
|
exec "normal \<Esc>i"
|
||||||
endfunction "}}}1
|
endfunction "}}}1
|
||||||
|
|
||||||
function! s:SwitchAutoclose() "{{{1
|
function! s:SwitchAutoclose() "{{{1
|
||||||
@@ -406,6 +406,42 @@ function! s:SwitchAutoclose() "{{{1
|
|||||||
DelimitMateReload
|
DelimitMateReload
|
||||||
endfunction "}}}1
|
endfunction "}}}1
|
||||||
|
|
||||||
|
function! s:UnMap() " {{{
|
||||||
|
|
||||||
|
for char in s:right_delims + s:quotes
|
||||||
|
if maparg(char,"i") =~ 'SkipDelim'
|
||||||
|
exec 'iunmap <buffer> ' . char
|
||||||
|
"echomsg 'iunmap <buffer> ' . char
|
||||||
|
endif
|
||||||
|
endfor
|
||||||
|
for char in s:right_delims + s:left_delims + s:quotes
|
||||||
|
if maparg(s:visual_leader . char,"v") =~ 'IsBlock'
|
||||||
|
exec 'vunmap <buffer> ' . s:visual_leader . char
|
||||||
|
"echomsg 'vunmap <buffer> ' . s:visual_leader . char
|
||||||
|
endif
|
||||||
|
endfor
|
||||||
|
let s:i = 0
|
||||||
|
while s:i < len(s:matchpairs)
|
||||||
|
if maparg(char,"i") =~ s:left_delims[s:i] . s:right_delims[s:i] . '<Left>'
|
||||||
|
exec 'iunmap <buffer> ' . char
|
||||||
|
"echomsg 'iunmap <buffer> ' . char
|
||||||
|
endif
|
||||||
|
let s:i += 1
|
||||||
|
endwhile
|
||||||
|
for char in s:quotes
|
||||||
|
if maparg(char, "i") =~ 'QuoteDelim'
|
||||||
|
exec 'iunmap <buffer> ' . char
|
||||||
|
"echomsg 'iunmap <buffer> ' . char
|
||||||
|
endif
|
||||||
|
endfor
|
||||||
|
for char in s:right_delims
|
||||||
|
if maparg(char, "i")
|
||||||
|
exec 'iunmap <buffer> ' . char
|
||||||
|
"echomsg 'iunmap <buffer> ' . char
|
||||||
|
endif
|
||||||
|
endfor
|
||||||
|
endfunction " }}}
|
||||||
|
|
||||||
function! s:TestMappingsDo() "{{{1
|
function! s:TestMappingsDo() "{{{1
|
||||||
if !exists("g:delimitMate_testing")
|
if !exists("g:delimitMate_testing")
|
||||||
call s:DelimitMateDo()
|
call s:DelimitMateDo()
|
||||||
@@ -423,7 +459,7 @@ function! s:DelimitMateDo() "{{{1
|
|||||||
if exists("g:delimitMate_excluded_ft")
|
if exists("g:delimitMate_excluded_ft")
|
||||||
for ft in split(g:delimitMate_excluded_ft,',')
|
for ft in split(g:delimitMate_excluded_ft,',')
|
||||||
if ft ==? &filetype
|
if ft ==? &filetype
|
||||||
echomsg "Excluded"
|
call s:UnMap()
|
||||||
return 1
|
return 1
|
||||||
endif
|
endif
|
||||||
endfor
|
endfor
|
||||||
@@ -439,7 +475,7 @@ function! s:DelimitMateDo() "{{{1
|
|||||||
endfunction "}}}1
|
endfunction "}}}1
|
||||||
|
|
||||||
" Do the real work: {{{1
|
" Do the real work: {{{1
|
||||||
"call s:DelimitMateDo()
|
call s:DelimitMateDo()
|
||||||
|
|
||||||
" Let me refresh without re-loading the buffer:
|
" Let me refresh without re-loading the buffer:
|
||||||
command! DelimitMateReload call s:DelimitMateDo()
|
command! DelimitMateReload call s:DelimitMateDo()
|
||||||
@@ -447,8 +483,11 @@ command! DelimitMateReload call s:DelimitMateDo()
|
|||||||
" Quick test:
|
" Quick test:
|
||||||
command! DelimitMateTest call s:TestMappingsDo()
|
command! DelimitMateTest call s:TestMappingsDo()
|
||||||
|
|
||||||
"autocmd BufNewFile,BufRead,BufEnter * if !exists("b:loaded_delimitMate") || &filetype !=? "mailapp" | call <SID>DelimitMateDo() | endif
|
" Run on file type events.
|
||||||
autocmd VimEnter * autocmd FileType * if !exists("b:loaded_delimitMate") | call <SID>DelimitMateDo() | endif
|
autocmd VimEnter * autocmd FileType * call <SID>DelimitMateDo()
|
||||||
|
|
||||||
|
" Run on new buffers.
|
||||||
|
autocmd BufNewFile,BufRead,BufEnter * if !exists("b:loaded_delimitMate") | call <SID>DelimitMateDo() | endif
|
||||||
|
|
||||||
" GetLatestVimScripts: 2754 1 :AutoInstall: delimitMate.vim
|
" GetLatestVimScripts: 2754 1 :AutoInstall: delimitMate.vim
|
||||||
" vim:foldmethod=marker:foldcolumn=2
|
" vim:foldmethod=marker:foldcolumn=2
|
||||||
|
|||||||
Reference in New Issue
Block a user