You can define your own text objects by combining visual mode display and standby mapping.
This snippet will create the text object i/ :
xnoremap i/ :<Cu>normal! T/vt/<CR> onoremap i/ :normal vi/<CR>
which you can use as built-in: ci/ , vi/ , di/ , yi/ .
And this will create a text object a/ :
xnoremap a/ :<Cu>normal! F/vf/<CR> onoremap a/ :normal va/<CR>
which you can use as built-in: ca/ , va/ , da/ , ya/ .
BONUS: This is an easily extensible snippet from my vimrc that creates at least 26 new text objects, including the ones you want:
for char in [ '_', '.', ':', ',', ';', '<bar>', '/', '<bslash>', '*', '+', '%', '-', '#' ] execute 'xnoremap i' . char . ' :<Cu>normal! T' . char . 'vt' . char . '<CR>' execute 'onoremap i' . char . ' :normal vi' . char . '<CR>' execute 'xnoremap a' . char . ' :<Cu>normal! F' . char . 'vf' . char . '<CR>' execute 'onoremap a' . char . ' :normal va' . char . '<CR>' endfor
source share