공부/JUN STUDY

Vim을 이용한 Line Breaks (자동 줄바꿈 하기) set tw 이용 gqap

JUNFUTURE 2024. 9. 3. 15:19

특정 보고서 포맷에 맞게끔
원하는 text width에 맞게 긴 문장의 글을
자동으로 줄바꿈하는것이 필요할때가 있다.

 

자동줄바꿈(Line Breaks) 전

The rapid advancement of technology in recent years has led to significant changes in various industries, including healthcare, finance, education, and communication, where innovations such as artificial intelligence, machine learning, blockchain, and the Internet of Things are reshaping the way we live, work, and interact with each other, making it crucial for individuals and organizations to stay updated with the latest trends and developments to remain competitive in the global market.

 


자동줄바꿈(Line Breaks) 후

The rapid advancement of technology in recent years has led to significant 
changes in various industries, including healthcare, finance, education, and
communication, where innovations such as artificial intelligence, machine
learning, blockchain, and the Internet of Things are reshaping the way we live,
work, and interact with each other, making it crucial for individuals and
organizations to stay updated with the latest trends and developments to remain
competitive in the global market.

 

이때 vim을 이용해 매우 간단하게 할 수 가 있어서 방법을 정리하려고한다.

 

 

1. vim 열어 긴 문장의 글 복사 붙여넣기

 

vim 을 연뒤
ctrl+shift+v로 붙여넣기를한다.

 

2. text width (tw) 정해주기

이후 esc -> :set tw=80(원하는 textwidth) 을 입력해 원하는 너비를 세팅해준다.

 

3. gqap

이후 해당 문장 앞에 커서를 두고
그냥 바로 (esc를 누르지않고) gqap를 입력해주면 자동으로 line break가 된다.