mirror of
https://github.com/Raimondi/delimitMate.git
synced 2026-08-16 04:38:01 +08:00
Doc update, fix backspace & global functions.
Fixed a problem with MacVim and the Makefile.
This commit is contained in:
@@ -5,7 +5,7 @@ install:
|
|||||||
cp -f plugin/* ~/.vim/plugin/${PLUGIN}.vim
|
cp -f plugin/* ~/.vim/plugin/${PLUGIN}.vim
|
||||||
|
|
||||||
doc_update: install
|
doc_update: install
|
||||||
vim -u NONE -c 'helptags ~/.vim/doc' -c 'q'
|
/usr/bin/vim -u NONE -c ':helptags ~/.vim/doc' -c ':q'
|
||||||
|
|
||||||
zip:
|
zip:
|
||||||
zip -r ${PLUGIN}.zip doc plugin
|
zip -r ${PLUGIN}.zip doc plugin
|
||||||
@@ -14,7 +14,7 @@ zip:
|
|||||||
vimball: install
|
vimball: install
|
||||||
echo doc/${PLUGIN}.txt > vimball.txt
|
echo doc/${PLUGIN}.txt > vimball.txt
|
||||||
echo plugin/${PLUGIN}.vim >> vimball.txt
|
echo plugin/${PLUGIN}.vim >> vimball.txt
|
||||||
vim -c 'e vimball.txt' -c '%MkVimball! ${PLUGIN}' -c 'q'
|
/usr/bin/vim -c 'e vimball.txt' -c '%MkVimball! ${PLUGIN}' -c 'q'
|
||||||
|
|
||||||
gzip: vimball
|
gzip: vimball
|
||||||
gzip -f ${PLUGIN}.vba
|
gzip -f ${PLUGIN}.vba
|
||||||
|
|||||||
+83
-13
@@ -1,8 +1,18 @@
|
|||||||
*delimitMate.txt* Trying to keep those beasts at bay! v.2.0
|
*delimitMate* Trying to keep those beasts at bay! v.2.0 *delimitMate.txt*
|
||||||
|
|
||||||
|
========================================================================= ~
|
||||||
|
==== ========= ========================== ===== ===================== ~
|
||||||
|
==== ========= ========================== === ===================== ~
|
||||||
|
==== ========= ===================== === = = ========== ========= ~
|
||||||
|
==== === === == == = = === == == == == === === === == ~
|
||||||
|
== == = == ====== ======= === ===== == = === === = = ~
|
||||||
|
= = == == == == = = == === === ===== ===== === === = ~
|
||||||
|
= = == ===== == == = = == === === ===== === === === ==== ~
|
||||||
|
= = == = == == == = = == === === ===== == = === === = = ~
|
||||||
|
== === === == == = = == === == ===== === === === == ~
|
||||||
|
========================================================================= ~
|
||||||
|
|
||||||
REFERENCE MANUAL *delimitMate*
|
REFERENCE MANUAL *
|
||||||
|
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
0.- CONTENTS *delimitMate-contents*
|
0.- CONTENTS *delimitMate-contents*
|
||||||
@@ -18,10 +28,11 @@
|
|||||||
3.1 Option summary_____________________|delimitMateOptionSummary|
|
3.1 Option summary_____________________|delimitMateOptionSummary|
|
||||||
3.2 Options details____________________|delimitMateOptionDetails|
|
3.2 Options details____________________|delimitMateOptionDetails|
|
||||||
4. Commands________________________________|delimitMateCommands|
|
4. Commands________________________________|delimitMateCommands|
|
||||||
5. TODO list_______________________________|delimitMateTodo|
|
5. Functions_______________________________|delimitMateFunctions|
|
||||||
6. Maintainer______________________________|delimitMateMaintainer|
|
6. TODO list_______________________________|delimitMateTodo|
|
||||||
7. Credits_________________________________|delimitMateCredits|
|
7. Maintainer______________________________|delimitMateMaintainer|
|
||||||
8. History_________________________________|delimitMateHistory|
|
8. Credits_________________________________|delimitMateCredits|
|
||||||
|
9. History_________________________________|delimitMateHistory|
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
1.- INTRODUCTION *delimitMateIntro*
|
1.- INTRODUCTION *delimitMateIntro*
|
||||||
@@ -107,6 +118,10 @@ Expand <CR> to: >
|
|||||||
| )
|
| )
|
||||||
<
|
<
|
||||||
|
|
||||||
|
Since <Space> and <CR> are used everywhere, I have made the functions involved
|
||||||
|
in expansions global, so they can be used to make custom mappings. Read
|
||||||
|
|delimitMateFunctions| for more details.
|
||||||
|
|
||||||
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
|
||||||
2.3 BACKSPACE *delimitMateBackspace*
|
2.3 BACKSPACE *delimitMateBackspace*
|
||||||
|
|
||||||
@@ -158,6 +173,9 @@ e.g. typing at the "|": >
|
|||||||
==============================================================================
|
==============================================================================
|
||||||
3. CUSTOMIZATION *delimitMateOptions*
|
3. CUSTOMIZATION *delimitMateOptions*
|
||||||
|
|
||||||
|
You can create your own mappings for some features using the global functions.
|
||||||
|
Read |DelimitMateFunctions| for more info.
|
||||||
|
|
||||||
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
|
||||||
3.1 OPTIONS SUMMARY *delimitMateOptionSummary*
|
3.1 OPTIONS SUMMARY *delimitMateOptionSummary*
|
||||||
|
|
||||||
@@ -385,14 +403,59 @@ represented by an "|": >
|
|||||||
<
|
<
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
5. TODO LIST *delimitMateTodo*
|
5. FUNCTIONS *delimitMateFunctions*
|
||||||
|
|
||||||
|
------------------------------------------------------------------------------
|
||||||
|
delimitMate_WithinEmptyPair() *delimitMate_WithinEmptyPair*
|
||||||
|
|
||||||
|
Returns 1 if the cursor is inside an empty pair, 0 otherwise.
|
||||||
|
|
||||||
|
------------------------------------------------------------------------------
|
||||||
|
DelimitMate_ExpandReturn() *DelimitMate_ExpandReturn()*
|
||||||
|
|
||||||
|
Returns the expansion for <CR>.
|
||||||
|
|
||||||
|
e.g.: This mapping could be used to select an item on a pop-up menu or expand
|
||||||
|
<CR> inside an empty pair: >
|
||||||
|
|
||||||
|
inoremap <expr> <CR> pumvisible() ? "\<c-y>" :
|
||||||
|
\ DelimitMate_WithinEmptyPair ?
|
||||||
|
\ DelimitMate_ExpandReturn() : "\<CR>"
|
||||||
|
<
|
||||||
|
------------------------------------------------------------------------------
|
||||||
|
DelimitMate_ExpandSpace() *DelimitMate_ExpandSpace()*
|
||||||
|
|
||||||
|
Returns the expansion for <Space>.
|
||||||
|
e.g.: >
|
||||||
|
|
||||||
|
inoremap <expr> <Space> DelimitMate_WithinEmptyPair() ?
|
||||||
|
\ DelimitMate_ExpandSpace() : "\<Space>"
|
||||||
|
<
|
||||||
|
------------------------------------------------------------------------------
|
||||||
|
DelimitMate_ShouldJump() *DelimitMate_ShouldJump()*
|
||||||
|
|
||||||
|
Returns 1 if there is a closing delimiter or a quote to the right of the
|
||||||
|
cursor, 0 otherwise.
|
||||||
|
|
||||||
|
------------------------------------------------------------------------------
|
||||||
|
DelimitMate_JumpAny() *DelimitMate_JumpAny()*
|
||||||
|
|
||||||
|
This function returns a mapping that will make the cursor jump to the right.
|
||||||
|
e.g.: You can use this to create your own mapping to jump over any delimiter.
|
||||||
|
>
|
||||||
|
inoremap <expr> <C-Tab> DelimitMate_ShouldJump() ?
|
||||||
|
\ DelimitMate_JumpAny() : "\<C-Tab>"
|
||||||
|
<
|
||||||
|
|
||||||
|
==============================================================================
|
||||||
|
6. TODO LIST *delimitMateTodo*
|
||||||
|
|
||||||
- Automatic set-up by file type.
|
- Automatic set-up by file type.
|
||||||
- Make visual wrapping work on blockwise visual mode.
|
- Make visual wrapping work on blockwise visual mode.
|
||||||
- Limit behaviour by region.
|
- Limit behaviour by region.
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
6. MAINTAINER *delimitMateMaintainer*
|
7. MAINTAINER *delimitMateMaintainer*
|
||||||
|
|
||||||
Hi there! My name is Israel Chauca F. and I can be reached at:
|
Hi there! My name is Israel Chauca F. and I can be reached at:
|
||||||
mailto:israelchauca@gmail.com
|
mailto:israelchauca@gmail.com
|
||||||
@@ -401,7 +464,7 @@ Feel free to send me any suggestions and/or comments about this plugin, I'll
|
|||||||
be very pleased to read them.
|
be very pleased to read them.
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
7. CREDITS *delimitMateCredits*
|
8. CREDITS *delimitMateCredits*
|
||||||
|
|
||||||
Some of the code that make this script is modified or just shamelessly copied
|
Some of the code that make this script is modified or just shamelessly copied
|
||||||
from the following sources:
|
from the following sources:
|
||||||
@@ -420,11 +483,11 @@ from the following sources:
|
|||||||
This script was inspired by the auto-completion of delimiters of TextMate.
|
This script was inspired by the auto-completion of delimiters of TextMate.
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
8. HISTORY *delimitMateHistory*
|
9. HISTORY *delimitMateHistory*
|
||||||
|
|
||||||
Version Date Release notes ~
|
Version Date Release notes ~
|
||||||
|---------|------------|-----------------------------------------------------|
|
|---------|------------|-----------------------------------------------------|
|
||||||
2.0 2010-04-01 New:
|
2.0 2010-04-01 * New features:
|
||||||
- All features are redo/undo-wise safe.
|
- All features are redo/undo-wise safe.
|
||||||
- A single quote typed after an alphanumeric
|
- A single quote typed after an alphanumeric
|
||||||
character is considered an apostrophe and one
|
character is considered an apostrophe and one
|
||||||
@@ -438,7 +501,8 @@ This script was inspired by the auto-completion of delimiters of TextMate.
|
|||||||
active if you have any of the expansion options
|
active if you have any of the expansion options
|
||||||
set.
|
set.
|
||||||
- <S-Backspace> deletes the closing delimiter.
|
- <S-Backspace> deletes the closing delimiter.
|
||||||
Fixed:
|
|
||||||
|
* Fixed bug:
|
||||||
- s:vars were being used to store buffer options.
|
- s:vars were being used to store buffer options.
|
||||||
|
|
||||||
|---------|------------|-----------------------------------------------------|
|
|---------|------------|-----------------------------------------------------|
|
||||||
@@ -488,4 +552,10 @@ This script was inspired by the auto-completion of delimiters of TextMate.
|
|||||||
|
|
||||||
|---------|------------|-----------------------------------------------------|
|
|---------|------------|-----------------------------------------------------|
|
||||||
|
|
||||||
|
|
||||||
|
... |"| _ _ . . ___ ~
|
||||||
|
o,*,(o o) _|_|_ o' \,=./ `o . .:::. /_\ `* ~
|
||||||
|
8(o o)(_)Ooo (o o) (o o) :(o o): . (o o) ~
|
||||||
|
---ooO-(_)---Ooo----ooO--(_)--Ooo-ooO--(_)--Ooo-ooO--(_)--Ooo-ooO--(_)--Ooo- ~
|
||||||
|
|
||||||
vim:tw=78:ts=8:ft=help:norl:formatoptions+=tcroqn:autoindent:
|
vim:tw=78:ts=8:ft=help:norl:formatoptions+=tcroqn:autoindent:
|
||||||
|
|||||||
+14
-17
@@ -299,6 +299,11 @@ function! s:JumpOut(char) "{{{
|
|||||||
return a:char
|
return a:char
|
||||||
endfunction " }}}
|
endfunction " }}}
|
||||||
|
|
||||||
|
function! DelimitMate_JumpAny() " {{{
|
||||||
|
let nchar = getline('.')[col('.')-1]
|
||||||
|
return nchar . "\<Del>"
|
||||||
|
endfunction " DelimitMate_JumpAny() }}}
|
||||||
|
|
||||||
function! s:SkipDelim(char) "{{{
|
function! s:SkipDelim(char) "{{{
|
||||||
let cur = strpart( getline('.'), col('.')-2, 3 )
|
let cur = strpart( getline('.'), col('.')-2, 3 )
|
||||||
if cur[0] == "\\"
|
if cur[0] == "\\"
|
||||||
@@ -410,23 +415,13 @@ function! s:VisualMaps() " {{{
|
|||||||
endfunction "}}}
|
endfunction "}}}
|
||||||
|
|
||||||
function! DelimitMate_ExpandReturn() "{{{
|
function! DelimitMate_ExpandReturn() "{{{
|
||||||
if DelimitMate_WithinEmptyPair()
|
" Expand:
|
||||||
" Expand:
|
return "\<Esc>a\<CR>x\<CR>\<Esc>k$\"_xa"
|
||||||
return "\<esc>a\<CR>x\<CR>\<esc>k$\"_xa"
|
|
||||||
else
|
|
||||||
" Don't
|
|
||||||
return "\<CR>"
|
|
||||||
endif
|
|
||||||
endfunction "}}}
|
endfunction "}}}
|
||||||
|
|
||||||
function! DelimitMate_ExpandSpace() "{{{
|
function! DelimitMate_ExpandSpace() "{{{
|
||||||
if DelimitMate_WithinEmptyPair()
|
" Expand:
|
||||||
" Expand:
|
return s:WriteAfter(' ') . "\<Space>"
|
||||||
return s:WriteAfter(' ')."\<Space>"
|
|
||||||
else
|
|
||||||
" Don't
|
|
||||||
return "\<Space>"
|
|
||||||
endif
|
|
||||||
endfunction "}}}
|
endfunction "}}}
|
||||||
|
|
||||||
function! s:ExtraMappings() "{{{
|
function! s:ExtraMappings() "{{{
|
||||||
@@ -438,17 +433,19 @@ function! s:ExtraMappings() "{{{
|
|||||||
|
|
||||||
" Expand return if inside an empty pair:
|
" Expand return if inside an empty pair:
|
||||||
if b:delimitMate_expand_cr != 0
|
if b:delimitMate_expand_cr != 0
|
||||||
inoremap <buffer> <CR> <C-R>=DelimitMate_ExpandReturn()<CR>
|
inoremap <buffer> <expr> <CR> DelimitMate_WithinEmptyPair() ?
|
||||||
|
\ DelimitMate_ExpandReturn() : "\<CR>"
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" Expand space if inside an empty pair:
|
" Expand space if inside an empty pair:
|
||||||
if b:delimitMate_expand_space != 0
|
if b:delimitMate_expand_space != 0
|
||||||
inoremap <buffer> <Space> <C-R>=DelimitMate_ExpandSpace()<CR>
|
inoremap <buffer> <expr> <Space> DelimitMate_WithinEmptyPair() ?
|
||||||
|
\ DelimitMate_ExpandSpace() : "\<Space>"
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" Jump out ot any empty pair:
|
" Jump out ot any empty pair:
|
||||||
if b:delimitMate_tab2exit
|
if b:delimitMate_tab2exit
|
||||||
inoremap <buffer> <expr> <S-Tab> DelimitMate_ShouldJump() ? "\<Right>" : "\<S-Tab>"
|
inoremap <buffer> <expr> <S-Tab> DelimitMate_ShouldJump() ? DelimitMate_JumpAny() : "\<S-Tab>"
|
||||||
endif
|
endif
|
||||||
endfunction "}}}
|
endfunction "}}}
|
||||||
"}}}
|
"}}}
|
||||||
|
|||||||
Reference in New Issue
Block a user