Skip to content

Instantly share code, notes, and snippets.

@PeterRincker
Created February 3, 2022 16:17
Show Gist options
  • Save PeterRincker/7e1d6ff5cc6aef7fd8a42110e1768609 to your computer and use it in GitHub Desktop.
Save PeterRincker/7e1d6ff5cc6aef7fd8a42110e1768609 to your computer and use it in GitHub Desktop.
" Symbol text objects
for char in [ '_', '.', ':', ';', '<bar>', '/', '<bslash>', '*', '+', '%' ]
execute 'xnoremap i' . char . ' :<C-u>normal! T' . char . 'vt' . char . '<CR>'
execute 'onoremap i' . char . ' :normal vi' . char . '<CR>'
execute 'xnoremap a' . char . ' :<C-u>normal! F' . char . 'vf' . char . '<CR>'
execute 'onoremap a' . char . ' :normal va' . char . '<CR>'
endfor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment