I’m searching to empty out multiple columns in VIM
(not to delete but to put spaces inside).
This is my search command:
/\%2c\|\%4c\|\%>5c\%<9c
(column: 2,4,6-8)
How can I empty out these columns in vim?
:%s/\%2c\|\%4c\|\%>5c\%<9c/ /g doesn’t work
/\%cis a zero-width match.You’ll need to match something like:
Which will keep the values of columns 1, 3, and 5 in groups.
Then you can substitute:
…keeping columns 1, 3, and 5 but replacing the rest of the first eight columns with spaces.