3
3
Is it even possible?
What I mean is, many vim commands can take a movement to operate on, can I define a custom movement so that I can tailor my edits to an environment?
The specific command I'm interested in is gq
, to re-format. I can type gqip
to re-format a paragraph, ip
being the movement from the beginning to the end of the current paragraph excluding surrounding whitespace.
Is it possible to define a custom movement to replace ip
to allow me to, say, re-format comments without touching surrounding code? This would require a movement similar to ip
but with different conditions for where it starts or ends.
You should probably expand this answer to briefly cover what those links mention. In particular, that it's omap that does what I want. – SpoonMeiser – 2010-11-06T01:29:42.710
@SpoonMeiser: I would if I understood it better myself. As it is, I just knew where to find more information. – garyjohn – 2010-11-06T03:52:17.180