diff --git a/Makefile b/Makefile index 624c7f2..003ef0b 100644 --- a/Makefile +++ b/Makefile @@ -48,6 +48,7 @@ zip: rm -f *.zip zip -r $(PLUGIN).zip doc plugin autoload zip $(PLUGIN).zip -d \*.sw\? + zip $(PLUGIN).zip -d \*.orig zip $(PLUGIN).zip -d $(TESTS) ln -f $(PLUGIN).zip $(PLUGIN)-$(VERSION).zip diff --git a/autoload/delimitMate.vim b/autoload/delimitMate.vim index d60a3be..ac773de 100644 --- a/autoload/delimitMate.vim +++ b/autoload/delimitMate.vim @@ -8,6 +8,7 @@ " Utilities {{{ function! delimitMate#Init() "{{{ +" Initialize variables: " delimitMate_autoclose {{{ if !exists("b:delimitMate_autoclose") && !exists("g:delimitMate_autoclose") @@ -125,11 +126,10 @@ function! delimitMate#Init() "{{{ endfunction "}}} Init() function! delimitMate#ShouldJump() "{{{ + " Returns 1 if the next character is a closing delimiter. let col = col('.') let lcol = col('$') let char = getline('.')[col - 1] - let nchar = getline('.')[col] - let uchar = getline(line('.') + 1)[0] for cdel in b:delimitMate_right_delims + b:delimitMate_quotes_list if char == cdel @@ -138,6 +138,7 @@ function! delimitMate#ShouldJump() "{{{ endif endfor + let nchar = getline('.')[col] if b:delimitMate_expand_space && char == " " for cdel in b:delimitMate_right_delims + b:delimitMate_quotes_list if nchar == cdel @@ -147,6 +148,7 @@ function! delimitMate#ShouldJump() "{{{ endfor endif + let uchar = getline(line('.') + 1)[0] if b:delimitMate_expand_cr && char == "" for cdel in b:delimitMate_right_delims + b:delimitMate_quotes_list if uchar == cdel @@ -488,6 +490,8 @@ function! delimitMate#ExpandSpace() "{{{ return "\" endif if delimitMate#WithinEmptyPair() + " Expand: + call insert(b:delimitMate_buffer, 's') " Expand: call insert(b:delimitMate_buffer, 's') return delimitMate#WriteAfter(' ') . "\" @@ -708,8 +712,6 @@ function! delimitMate#TestMappings() "{{{ for i in range(len(b:delimitMate_quotes_list)) exec "normal GGAOpen & close: " . b:delimitMate_quotes_list[i] . "|" exec "normal A\Delete: " - exec "normal A". b:delimitMate_quotes_list[i] - exec "normal a\|" exec "normal A\Exit: " . b:delimitMate_quotes_list[i] . b:delimitMate_quotes_list[i] . "|" exec "normal A\Space: " . b:delimitMate_quotes_list[i] . " |" exec "normal A\Delete space: " . b:delimitMate_quotes_list[i] . " \|" diff --git a/doc/delimitMate.txt b/doc/delimitMate.txt index f800ec8..5607c73 100644 --- a/doc/delimitMate.txt +++ b/doc/delimitMate.txt @@ -1,5 +1,7 @@ *delimitMate* Trying to keep those beasts at bay! v2.3 *delimitMate.txt* + + MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM MMMM MMMMMMMMM MMMMMMMMMMMMMMMMMMMMMMMMMM MMMMM MMMMMMMMMMMMMMMMMMMMM ~ MMMM MMMMMMMMM MMMMMMMMMMMMMMMMMMMMMMMMMM MMM MMMMMMMMMMMMMMMMMMMMM @@ -12,7 +14,7 @@ MM MMM MMM MM MM M M MM MMM MM MMMMM MMM MMM MMM MM ~ MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM - REFERENCE MANUAL * + ============================================================================== 0.- CONTENTS *delimitMate-contents* @@ -40,7 +42,7 @@ 1.- INTRODUCTION *delimitMateIntro* This plug-in provides automatic closing of quotes, parenthesis, brackets, -etc., besides some other related features that should make your time in insert +etc.; besides some other related features that should make your time in insert mode a little bit easier. Most of the features can be modified or disabled permanently, using global @@ -148,7 +150,7 @@ When visual mode is active this script allows for the selection to be enclosed with delimiters. But, since brackets have special meaning in visual mode, a leader (the value of 'mapleader' by default) should precede the delimiter. NOTE that this feature brakes the redo command and doesn't currently work on -blockwise visual mode, any suggestions will be welcome. +blockwise visual mode, any suggestions to fix this will be very welcome. e.g. (selection represented between square brackets): > @@ -199,11 +201,13 @@ NOTE that you should use buffer variables (|b:var|) only to set options with The features of this plug-in might not be always helpful, comments and strings usualy don't need auto-completion. delimitMate monitors which region is being edited and if it detects that the cursor is in a comment it'll turn itself off -until the cursor leaves the comment. The excluded regions by can be set using -the option |'delimitMate_excluded_regions'|. Read |group-name| for a list of -regions or syntax group names. NOTE that this feature relies on a -proper syntax file for the current file type, if the syntax file doesn't -define a region, delimitMate won't know about it. +until the cursor leaves the comment. The excluded regions can be set using the +option |'delimitMate_excluded_regions'|. Read |group-name| for a list of +regions or syntax group names. + +NOTE that this feature relies on a proper syntax file for the current file +type, if the appropiate syntax file doesn't define a region, delimitMate won't +know about it. ============================================================================== 3. CUSTOMIZATION *delimitMateOptions* @@ -355,7 +359,7 @@ Values: A string of syntax group names names separated by single commas. ~ Default: Comment ~ This options turns delimitMate off for the listed regions, read |group-name| -for more info. +for more info about what is a region. e.g.: > let delimitMate_excluded_regions = "Comments,String" < @@ -513,7 +517,6 @@ e.g.: You can use this to create your own mapping to jump over any delimiter. - Automatic set-up by file type. - Make visual wrapping work on blockwise visual mode. -- Limit behaviour by region. ============================================================================== 7. MAINTAINER *delimitMateMaintainer* @@ -550,10 +553,12 @@ This script was inspired by the auto-completion of delimiters of TextMate. |---------|------------|-----------------------------------------------------| 2.3 2010-05-24 * Current release: - Syntax aware: Will turn off when editing comments - or other regions. + or other regions, customizable. - Changed format of most mappings. - Fix: expansion doesn't brake automatic indentation adjustments anymore. + - Fix: Arrow keys would insert A, B, C or D instead + of moving the cursor when using Vim on a terminal. |---------|------------|-----------------------------------------------------| 2.2 2010-05-16 * - Added command to switch the plug-in on and off. - Fix: some problems with , and .