본문 바로가기
Research/Tools

VIM: How to comment/uncomment lines quickly

by sunnyan 2023. 9. 22.
728x90

1. 플러그인 종류

 

2. CTRL-V를 사용하는 방법

reference: https://stackoverflow.com/questions/1676632/whats-a-quick-way-to-comment-uncomment-lines-in-vim

  • Coment
1. ESC (normal mode)
2. Ctrl+v (Visual block mode)
3. Select lines you want
4. Shift + i (capital I)
5. Insert text you want(#, //, anyone)
6. Press ESC ESC (IMPORTANT: press twice!)

 

  • Comment out
1. ESC (normal mode)
2. Ctrl+v (Visual block mode)
3. Select lines you want
4. Press d or x
728x90