![Usando o vim para criar texto de largura fixa?](https://rvso.com/image/1395407/Usando%20o%20vim%20para%20criar%20texto%20de%20largura%20fixa%3F.png)
Eu tenho texto no formulário
xxxx yyyyy
xx yyyy
xxxxxxxx yyyyy
x y
Eu gostaria que o segundo conjunto em cada linha começasse no mesmo ponto, ou seja
xxxx yyyyy
xx yyyy
xxxxxxxx yyyyy
x y
Não consigo pensar em uma solução elegante usando o vim e sempre me incomoda quando invisto mais tempo em uma solução do que seria necessário para fazer algo manualmente. Sempre posso armazená-lo para a próxima vez, se alguém tiver uma solução inteligente!
Responder1
Eu vi alguns truques inteligentes de localização/substituição que dariam conta do recado, mas não posso, de forma alguma, guardá-los na memória, então isso é uma coisa que eu uso(e recomendo)um plug-in.
UsandoAlinhar, isso passa a ser um mero
- VG (select all)
- <leader>tsp (align whitespace)
Da ajuda
--------------------------- *alignmap-Tsp*
Alignment Map Examples: \tsp *alignmap-tsp* {{{3
---------------------------
Normally Align can't use white spaces for field separators as such
characters are ignored surrounding field separators. The \tsp and
\Tsp maps get around this limitation.
Original: >
one two three four five
six seven eight nine ten
eleven twelve thirteen fourteen fifteen
<
Becomes: Select the lines, \tsp >
one two three four five
six seven eight nine ten
eleven twelve thirteen fourteen fifteen
<
Becomes: Select the lines, \Tsp >
one two three four five
six seven eight nine ten
eleven twelve thirteen fourteen fifteen
<