I'm editing a table in extended-markdown, and I'm wondering how to easily edit cells without moving the dividing lines.
Tables are formatted like this:
| HEADING1 | HEADING2 | etc...
| ---------------- | -------------- | etc...
| row 1 | column2 | etc...
| etc...
Suppose I want to change an entry but leave the next |
in its place. Ideally, I'd go to the first word in the cell and use c<something>
, type the new entry, and, upon leaving insert
mode, a sufficient number of spaces would be inserted or deleted after the new text to ensure that the |
character is restored to its original location, if possible. (Obviously if too much text is entered, this won't be possible; one solution for this would be to somehow restrict the insert operation to the maximum number of characters to permit retaining the cell-shape, though I don't know if Vim permits this.)
This seems like it should be possible to implement by creating a new text-object or something, though I realize there would be a fair amount of "magic" involved since leaving insert mode would trigger a second edit operation.