Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Just like "ci(" changes everything between parentheses, I want "ci$" to change everything between dollar signs (for editing LaTeX.) Is this possible?

share|improve this question
I didn't know about this command... do you know where I can read about it in the manual? I couldn't find it for some reason. – Robert S Ciaccio Dec 18 '10 at 20:41
@calavera: ":help c" and then ":help object-select" – Neil G Dec 19 '10 at 1:36
found it, thanks! – Robert S Ciaccio Dec 19 '10 at 1:49

The vim LaTeX box plugin adds this feature. If you didn't want to use the rest of the plugin, you could just look at the source and see how it is done.

I think some of the other LaTeX plugins for vim probably have that feature too. There are at least four major ones, the LaTeX box one is the one I'm most familiar with.

share|improve this answer

I don't think so; you'll have to have some way of telling vim whether you want to change between the dollar sign forward or back, and I don't think that it can be programatically determined.

You can, however, do a "cf$" to change everything from where you are on the line until the next dollar sign, or "cF$" if you want to go to the previous dollar sign.

share|improve this answer
That's possible. See the related vim tip for the implementation principles: vim.wikia.com/wiki/Indent_text_object – Luc Hermitte Dec 20 '10 at 23:03
ct$ or cT$ otherwise you also delete the dollar sign – Three Diag May 1 at 14:06


Or if you want to create a text object:

  onoremap i$ :normal! T$v,<cr>
  vnoremap i$ <esc>T$v,
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.