User Tools

Site Tools


vim_notes

This is an old revision of the document!


How can I

vertical alignment of columns

:%!column -t

will convert

1.33570301776, 3.61194e-06, 7.24503e-06, -9.91572e-06, 1.25098e-05, 0.0102828
1.34538754675, 3.3689e-06, 9.86066e-06, -9.12075e-06, 1.18058e-05, 0.00334344
1.34808186291, -1.99011e-06, 6.53026e-06, -1.18909e-05, 9.52337e-06, 0.00158065

to

1.33570301776,  3.61194e-06,   7.24503e-06,  -9.91572e-06,  1.25098e-05,  0.0102828
1.34538754675,  3.3689e-06,    9.86066e-06,  -9.12075e-06,  1.18058e-05,  0.00334344
1.34808186291,  -1.99011e-06,  6.53026e-06,  -1.18909e-05,  9.52337e-06,  0.00158065

It also works on visual selection

:'<,'>!column -t

Ref:- https://stackoverflow.com/questions/1229900/reformat-in-vim-for-a-nice-column-layout

show line endings

change the encoding to utf-8

insert newline in search and replace

%s/29/\r29/gc

will insert a new line before each occurrence of 29.

join lines with a character

vim_notes.1625252242.txt.gz · Last modified: 2021/07/02 18:57 by admin