I have word lists where the word or expression in Spanish is separated by its translation with a colon (":"). I want to make two columns, one for spanish, the other for english. I tried with
:%s/:/^I^I^I/g
But it does not give the desired output. The different columns are not aligned. However, when deleting the colon by hand and inserting the number of tabs with the same amount of tab strokes, it always ends up aligned...
Any idea how to solve this, preferably in vim?
On a Linux/*nix system I use column(1)
:%!column -s':' -t
followed by
:%retab!
I'd probable do a
:s/:/^I/g
followed by a
:set ts=25
Where 25 is the length of the longest word expected + 2. So, if you expect the longest word of your input (on the left side of the colon) to be 12 characters, I'd choose something around 14 instead.
If 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