Some little changes.

This commit is contained in:
Israel Chauca Fuentes
2009-08-20 21:33:17 -05:00
parent 286d6eae72
commit 00b9182b57
4 changed files with 18 additions and 27 deletions
-11
View File
@@ -1,11 +0,0 @@
[_] 33% Automatic set-up by file type
[X] 100% Customizable expansions
[_] 0% Create list of settings per file type
[_] 0% Use :normal instead for expansions?
[X] 100% Use escape()
[_] % Add command-line auto-pairing
: Would this have to be constant? consider only vim language? I think so...
vim:tw:78
+12 -12
View File
@@ -54,21 +54,21 @@ Unless |delimitMate_matchpairs| is set, this script uses the values in
The following table shows the behaviour, this applies to quotes too (the final The following table shows the behaviour, this applies to quotes too (the final
position of the cursor is represented by a "|"): position of the cursor is represented by a "|"):
With auto-close: With auto-close: >
Type | You get Type | You get
==================== ====================
( | (|) ( | (|)
–––––––––|–––––––––– –––––––––|––––––––––
() | ()| () | ()|
<
Without auto-close: Without auto-close: >
Type | You get Type | You get
==================== ====================
() | (|) () | (|)
–––––––––|–––––––––– –––––––––|––––––––––
()) | ()| ()) | ()|
<
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
2.2 EXPANSION OF SPACE AND CAR RETURN *delimitMateExpansion* 2.2 EXPANSION OF SPACE AND CAR RETURN *delimitMateExpansion*
@@ -76,32 +76,32 @@ When the cursor is inside an empty pair of delimiters, space and car return
can be expanded to follow your coding style using |'delimitMate_expand_space'| can be expanded to follow your coding style using |'delimitMate_expand_space'|
and |'delimitMate_expand_return'|. e.g. (cursor represented by a "|"): and |'delimitMate_expand_return'|. e.g. (cursor represented by a "|"):
Expand <Space> to: Expand <Space> to: >
<Space><Space><Left> | You get <Space><Space><Left> | You get
==================================== ====================================
(|) | ( | ) (|) | ( | )
<
Expand <CR> to: Expand <CR> to: >
<CR><CR><Up> | You get <CR><CR><Up> | You get
============================ ============================
(|) | ( (|) | (
| | | |
| ) | )
<
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
2.3 DELETION OF EMPTY PAIR *delimitMateBackspace* 2.3 DELETION OF EMPTY PAIR *delimitMateBackspace*
If you press backspace inside an empty pair, both delimiters are deleted. If you press backspace inside an empty pair, both delimiters are deleted.
e.g.: e.g.: >
Before | After Before | After
==================================== ====================================
call expand(|) | call expand| call expand(|) | call expand|
<
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
2.4 WRAPPING OF VISUAL SELECTION *delimitMateVisualWrapping* 2.4 WRAPPING OF VISUAL SELECTION *delimitMateVisualWrapping*
@@ -111,12 +111,12 @@ with delimiters. But, since brackets have special meaning in visual mode, a
leader ("q" by default) should precede the delimiter. This feature doesn't leader ("q" by default) should precede the delimiter. This feature doesn't
currently work on blockwise visual mode, any sugestions are welcome. currently work on blockwise visual mode, any sugestions are welcome.
e.g. (selection represented between square brackets): e.g. (selection represented between square brackets): >
Selected text | After q" Selected text | After q"
============================================= =============================================
An [absurd] example! | An "absurd" example! An [absurd] example! | An "absurd" example!
<
============================================================================== ==============================================================================
3. CUSTOMIZATION *delimitMateOptions* 3. CUSTOMIZATION *delimitMateOptions*
+5 -4
View File
@@ -1,4 +1,4 @@
" =========================================================================== " ============================================================================
" File: delimitMate.vim " File: delimitMate.vim
" 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.
@@ -22,6 +22,7 @@ if exists("g:loaded_delimitMate") "{{{1
call s:DelimitMateDo() call s:DelimitMateDo()
finish finish
endif endif
if v:version < 700 if v:version < 700
echoerr "delimitMate: this plugin requires vim >= 7!" echoerr "delimitMate: this plugin requires vim >= 7!"
finish finish
@@ -41,7 +42,7 @@ function! s:Init() "{{{1
if s:ValidMatchpairs(&matchpairs) == 1 if s:ValidMatchpairs(&matchpairs) == 1
let s:matchpairs_temp = &matchpairs let s:matchpairs_temp = &matchpairs
else else
echoerr "There seems to be a problem with 'matchpairs', read ':help matchpairs' and fix it or notify the maintainer of this script if it's a bug." echoerr "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 finish
endif endif
else else
@@ -53,7 +54,7 @@ function! s:Init() "{{{1
if s:ValidMatchpairs(&matchpairs) == 1 if s:ValidMatchpairs(&matchpairs) == 1
let s:matchpairs_temp = &matchpairs let s:matchpairs_temp = &matchpairs
else else
echoerr "There seems tobe a problem with 'matchpairs', read ':help matchpairs' and fix it or notify the maintainer of this script if it's a bug." echoerr "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 = "" let s:matchpairs_temp = ""
endif endif
@@ -96,7 +97,7 @@ function! s:Init() "{{{1
let s:matchpairs = split(s:matchpairs_temp, ',') let s:matchpairs = split(s:matchpairs_temp, ',')
let s:left_delims = split(s:matchpairs_temp, ':.,\=') let s:left_delims = split(s:matchpairs_temp, ':.,\=')
let s:right_delims = split(s:matchpairs_temp, ',\=.:') let s:right_delims = split(s:matchpairs_temp, ',\=.:')
let s:VMapMsg = "delimitMate is disabled on blockwise visual mode." let s:VMapMsg = "delimitMate: delimitMate is disabled on blockwise visual mode."
endfunction endfunction
+1
View File
@@ -0,0 +1 @@
To install this script just copy delimitMate.vim to your Vim's plugin folder (e.g.: $HOME/.vim/plugin) and delimitMate.txt to the respective 'doc' folder, then run 'helptags /path/to/.vim/doc'. After that you can read ':help delimitMate' for more info.