Home > vim-textobj-quoted

vim-textobj-quoted

Vim-textobj-quoted is a project mainly written in Vim Script, it's free.

A text-object for quoted text

This is a mirror of http://www.vim.org/scripts/script.php?script_id=3581

A custom text object for selecting quoted text. It depends on awesome Kana's https://github.com/kana/vim-textobj-user.

vim-textobj-quoted gives you two new text-objects:

  • iq That stands for Inner Quoted
  • aq That stands for Around Quoted

So, the two text-objects defined will work with the following quoting chars:

  • { }
  • " "
  • ' '
  • ( )

Please note that the defined text-objects are single-line oriented. I find them very useful in situations like the following (* indicated cursor position):

  • "some awes*ome text"
  • (some awes*ome text)
  • {some awes*ome text}
  • 'some awes*ome text'

In each case you could use commands like viq or ciq and select/cancel all the quoted text. Obviously, you can achive the same results using commands like vi" or vi{. Indeed, the real benefit you'll get using this plugin is that you will have to remember only the q char.