Created
February 17, 2011 06:11
-
-
Save evanphx/831119 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/ftplugin/ruby.vim b/ftplugin/ruby.vim | |
index 07358b2..3b40da3 100644 | |
--- a/ftplugin/ruby.vim | |
+++ b/ftplugin/ruby.vim | |
@@ -29,8 +29,11 @@ endif | |
if exists("loaded_matchit") && !exists("b:match_words") | |
let b:match_ignorecase = 0 | |
+ " Go go gadget match! This ignores if, unless, while, and until if they come | |
+ " after non-spaces, meaning they're a post condition. | |
let b:match_words = | |
- \ '\<\%(if\|unless\|case\|while\|until\|for\|do\|class\|module\|def\|begin\)\>=\@!' . | |
+ \ '\%(\%(\%(\_^\s\+\)\|\%(\;\s*\)\)\@<=\<\%(if\|unless\|while\|until\)\)' . | |
+ \ '\|\%(\<\%(do\|case\|for\|class\|module\|def\|begin\)\)\>=\@!' . | |
\ ':' . | |
\ '\<\%(else\|elsif\|ensure\|when\|rescue\|break\|redo\|next\|retry\)\>' . | |
\ ':' . |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment