Added outer ruby block functionality

This commit is contained in:
Yan Pritzker
2012-10-01 17:16:15 -07:00
parent a6d6ab3da1
commit be12982398
2 changed files with 14 additions and 0 deletions

View File

@@ -318,6 +318,7 @@ If you omit the key combo, you'll get a list of all the maps. You can do the sam
#### Utility
* `,orb` - outer ruby block. takes you one level up from nested blocks (great for rspec)
* `crs`, `crc`, `cru` via abolish.vim, coerce to snake_case, camelCase, and UPPERCASE. There are more `:help abolish`
* `:NR` - NarrowRgn - use this on a bit of selected text to create a new split with just that text. Do some work on it, then :wq it to get the results back.
* `,ig` - toggle visual indentation guides

View File

@@ -0,0 +1,13 @@
" Navigate to the block surrounding this one
" For example if you're inside
" foo do
" bar do
" # you are here
" end
" end
"
" Then hitting ,orb ("outer ruby block") will take you to 'foo do'
"
" This is relying on the textobj-rubyblock which gives us 'ar' around ruby
" and matchit.vim which gives us jumping to the matching
nnoremap <silent> ,orb :normal varar%<esc><esc>