[vim] g command (Toggle between uppercase and lowercase, movement in oneline...)

dev stefanCho·2021년 5월 16일
0

vim

목록 보기
3/5

g로 시작하는 command들 중에서는 유용한 것들이 몇가지 있다. 유튜브에서 우연히 봤는데, 간혹 필요할만한 것들이라서 기록한다.

key bindings

mapaction
gk, gjmulti lines로 보이는데, 실제로는 one line인 경우 보이는 위치에서 위,아래 이동
g0, g$multi lines로 보이는데, 실제로는 one line인 경우 보이는 위치에서 가장앞, 가장끝 이동
gq긴 one line을 multi lines로 바꿈
guu, gUUUncapitalize, capitalize words/lines
~, g~하나의 문자에 해서 대소문자 변경
gfhighlight된 텍스트를 파일로 열기
gvpreviouse selected text를 다시 select
gJspace 없이 lines conjoin하기, (J랑 비슷)
g&substitute(:/s) command를 모든 lines에 적용하는 것
:help gg command에 대한 help

응용

commandsaction
3~3개 letter를 Toggle(uppercase, lowercase 상태를 바꾼다는 의미)
g~3w3개 단어를 Toggle
g~iw(inner) word를 Toggle
g~$end of the line까지 Toggle
g~~, V~current line을 Toggle
gUiw(inner) word를 capitalize

Ref

Youtube
github

profile
Front-end Developer

0개의 댓글