Skip to content

Commit

Permalink
Don't clobber user text objects
Browse files Browse the repository at this point in the history
References vim-ruby#46.
  • Loading branch information
tpope committed Aug 26, 2011
1 parent 8aa9cee commit 3720d28
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions ftplugin/ruby.vim
Expand Up @@ -125,16 +125,25 @@ if !exists("g:no_plugin_maps") && !exists("g:no_ruby_maps")
xnoremap <silent> <buffer> [] :<C-U>call <SID>searchsyn('\<end\>','rubyModule\<Bar>rubyClass','b','v')<CR>
xnoremap <silent> <buffer> ][ :<C-U>call <SID>searchsyn('\<end\>','rubyModule\<Bar>rubyClass','','v')<CR>
onoremap <silent> <buffer> im :<C-U>call <SID>wrap_i('[m',']M')<CR>
onoremap <silent> <buffer> am :<C-U>call <SID>wrap_a('[m',']M')<CR>
onoremap <silent> <buffer> ic :<C-U>call <SID>wrap_i('[[','][')<CR>
onoremap <silent> <buffer> ac :<C-U>call <SID>wrap_a('[[','][')<CR>
let b:undo_ftplugin = b:undo_ftplugin
\."| sil! exe 'unmap <buffer> [[' | sil! exe 'unmap <buffer> ]]' | sil! exe 'unmap <buffer> []' | sil! exe 'unmap <buffer> ]['"
\."| sil! exe 'unmap <buffer> [m' | sil! exe 'unmap <buffer> ]m' | sil! exe 'unmap <buffer> [M' | sil! exe 'unmap <buffer> ]M'"
\."! sil! exe 'ounmap <buffer> im'| sil! exe 'ounmap <buffer> am'| sil! exe 'ounmap <buffer> ic'| sil! exe 'ounmap <buffer> ac'"

if maparg('im','n') == ''
onoremap <silent> <buffer> im :<C-U>call <SID>wrap_i('[m',']M')<CR>
onoremap <silent> <buffer> am :<C-U>call <SID>wrap_a('[m',']M')<CR>
let b:undo_ftplugin = b:undo_ftplugin
\."! sil! exe 'ounmap <buffer> im' | sil! exe 'ounmap <buffer> am'"
endif

if maparg('ic','n') == ''
onoremap <silent> <buffer> ic :<C-U>call <SID>wrap_i('[[','][')<CR>
onoremap <silent> <buffer> ac :<C-U>call <SID>wrap_a('[[','][')<CR>
let b:undo_ftplugin = b:undo_ftplugin
\."| sil! exe 'ounmap <buffer> ic' | sil! exe 'ounmap <buffer> ac'"
endif

if maparg("\<C-]>",'n') == ''
nnoremap <silent> <buffer> <C-]> :<C-U>exe v:count1."tag <C-R>=RubyCursorIdentifier()<CR>"<CR>
nnoremap <silent> <buffer> g<C-]> :<C-U>exe "tjump <C-R>=RubyCursorIdentifier()<CR>"<CR>
Expand Down

0 comments on commit 3720d28

Please sign in to comment.