Skip to main content
Add tag
Link
Hotschke
  • 4.9k
  • 26
  • 38
edited tags
Link
Martin Tournoij
  • 63.3k
  • 26
  • 199
  • 274
Source Link
Doorknob
  • 15.7k
  • 3
  • 49
  • 70

How can I treat LaTeX quotes as a text object?

Quotation marks in LaTeX are different than in normal text, in that they're formatted ``like this'' (or `like this' for single quotes). This makes it difficult to navigate through them in Vim.

I usually use something like T`ct' (backwards until `, change until '). However, this is clunky and unnatural. I would prefer to be able to use something along the lines of ciq ("change in quotes"), just like I can do ciw, ca), ci", ca', etc.

Is there any way to tell Vim to treat ``LaTeX'' `quotes' as text objects? (As a plus, is there any way to only trigger this while editing a .tex file?)