
양식에 텍스트가 있습니다.
xxxx yyyyy
xx yyyy
xxxxxxxx yyyyy
x y
각 줄의 두 번째 세트가 같은 지점에서 시작되기를 바랍니다.
xxxx yyyyy
xx yyyy
xxxxxxxx yyyyy
x y
나는 vim을 사용하는 우아한 솔루션을 생각할 수 없으며 수동으로 무언가를 수행하는 데 걸리는 것보다 솔루션에 더 많은 시간을 투자하면 항상 나를 귀찮게 합니다. 누군가 영리한 솔루션을 가지고 있다면 다음 번에 항상 저축할 수 있습니다!
답변1
작업을 완료할 수 있는 몇 가지 영리한 찾기/대체 요령을 보았지만 평생 메모리에 저장할 수는 없으므로 이것이 제가 사용하는 것 중 하나입니다.(그리고 추천합니다)플러그인.
사용맞추다, 이것은 단순한 일이 됩니다
- VG (select all)
- <leader>tsp (align whitespace)
도움말에서
--------------------------- *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
<