Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Tree: 0c630e1ecb
Fetching contributors…

Cannot retrieve contributors at this time

18 lines (15 sloc) 0.654 kB
" Defines `;` to select the object currently below the cursor.
" Intended for use when positioned above an opening or closing quote/bracket.
"
" Examples:
"
" Move to a string, change inside it: f" ci;
" Search for a bracket, delete whole object: /{ da;
onoremap a; :<c-u>call <SID>TextObjectCursorCharacter('a')<cr>
xnoremap a; :<c-u>call <SID>TextObjectCursorCharacter('a')<cr>
onoremap i; :<c-u>call <SID>TextObjectCursorCharacter('i')<cr>
xnoremap i; :<c-u>call <SID>TextObjectCursorCharacter('i')<cr>
function! s:TextObjectCursorCharacter(motion)
let char = getline('.')[col('.')-1]
exec 'normal! v' . a:motion . char
endfunction
Jump to Line
Something went wrong with that request. Please try again.