Added outer ruby block functionality
This commit is contained in:
@@ -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
|
#### 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`
|
* `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.
|
* `: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
|
* `,ig` - toggle visual indentation guides
|
||||||
|
|||||||
13
vim/plugin/settings/outerblock.vim
Normal file
13
vim/plugin/settings/outerblock.vim
Normal 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>
|
||||||
Reference in New Issue
Block a user