![고정 너비 텍스트를 생성하기 위해 vim을 사용하십니까?](https://rvso.com/image/1395407/%EA%B3%A0%EC%A0%95%20%EB%84%88%EB%B9%84%20%ED%85%8D%EC%8A%A4%ED%8A%B8%EB%A5%BC%20%EC%83%9D%EC%84%B1%ED%95%98%EA%B8%B0%20%EC%9C%84%ED%95%B4%20vim%EC%9D%84%20%EC%82%AC%EC%9A%A9%ED%95%98%EC%8B%AD%EB%8B%88%EA%B9%8C%3F.png)
양식에 텍스트가 있습니다.
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
<