On 22-Jun-2010 04:22, Adrien "Pied" PiƩrard wrote: > As I happen to write a lot of math in latex, I have many $ > signs everywhere that I would like to treat as quotations so that I > can do da$ or yi$. > I guess this could be implemented with vimscript, though this does not > explain why the aforementioned motions are hard-coded.
I've written a set of generic Vimscript functions for defining such mappings, which I've been using for text objects of email fortunes, diff hunks and Vim help sections. Prompted by your question, I've polished, documented and published this as the CountJump plugin. It's not just for text objects, but can cover motions (e.g. ]$, [$) as well. http://www.vim.org/scripts/script.php?script_id=3130 Your "$"-delimited latex text object would be defined via call CountJump#TextObject#MakeWithCountSearch('<buffer>', '$', 'ai', 'v', '\$', '\$') This snippet could be put into .vim/ftplugin/tex_textobject.vim and you would be done. I hope this is useful; feedback is welcome. -- regards, ingo -- -- Ingo Karkat -- /^-- /^-- /^-- /^-- /^-- /^-- http://ingo-karkat.de/ -- -- http://vim.sourceforge.net/account/profile.php?user_id=9713 -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php