I have a markdown table like this. I want to swap head3 column with head2.
| head1 | head3 | head2 |
|-------|-------|-------|
| foo | baa | none |
| some | text | here |
I can easily cut the column using visual mode (Ctrl-V), but how can I paste the column 'column-wisely'?
Also, which operating is easiert:
Press Ctrl+v to enter visual block mode. The words VISUAL BLOCK will appear at the bottom of the screen. Use the Arrow keys to highlight the single character column. You can verify that each task is indented the same amount.
ctrl+shift+v is visual block. So just press ctrl+shift+v and then use cursor keys to select what you want.
To swap the current line with the next one, type ddp while in command mode.
When you've selected and cut something with Ctrl+V, Vim will paste it as a column too. You can Ctrl+V select the column you want to swap into and paste, and the column you just replaced will now be in your paste register. Go back to the column you cut first and paste one more time to move the replaced column.
In steps:
head3
columnhead2
columnhead3
used to beIf you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With