Software/Dev Tools

VIM commands 명령어

neovaga 2021. 6. 6. 13:00
반응형

Vim은 Terminal 에서 코딩을 할때 정말 많이 쓰는 Tool인데 다양한 GUI tool을 사용하다 보면 가끔 빌드 할 때나 Git에 업데이트할 때 사용을 하고 있다. 알아두면 강력하고 편리한 Tool인 건 확실하다. 

 

https://www.vim.org //공식 사이트라서 다양한 정보가 많다. 당장 필요한 정보가 한눈에 안들어 옴 

-Vim 버전은 6이상은 쓰는 게 좋단다. Vim은 vi를 조금 더 개선한 편집 Tool이라고 보면 될 것 같다. UNIX system 에서 많이 쓰인다. 

-GPL-compatible license (General Public License):자유롭게 수정 배포 가능하지만 원 제작자에서 저작권이 있기에 재배포시 명시함

-6 kilobyte 프로그램

-다양한 확장프로그램을 가능

-https://vim.fandom.com/wiki/Searching //기본 사용법이 설명 되어 있다. 한눈에 쏙 안들어 옴

 

:set nu - enabling the line number display

:set nonu - disabling the line number display

 

u - Undo the last operation; u# allows you to undo multiple actions

Ctrl + r - Redo the last undo

 

/[keyword] - Searches for text in the document where keyword is whatever keyword, phrase or string of characters you're looking for

?[keyword] - Searches previous text for your keyword, phrase or character string

n - Searches your text again in whatever direction your last search was

Shift + * - Display current word on the curser

 

기본 이동 명령

h - Moves the cursor to the left

l - Moves the cursor to the right

j - Moves the cursor down one line

k - Moves the cursor up one line

H - Puts the cursor at the top of the screen

M - Puts the cursor in the middle of the screen

L - Puts the cursor at the bottom of the screen

w - Puts the cursor at the start of the next word

b - Puts the cursor at the start of the previous word

e - Puts the cursor at the end of a word

gg - Places the cursor at the start of the file

 

G - Places the cursor at the end of the file

 

기본 편집 명령

yy - Copies a line

yw - Copies a word

y$ - Copies from where your cursor is to the end of a line

v - Highlight one character at a time using arrow buttons or the h, k, j, l buttons

V - Highlights one line, and movement keys can allow you to highlight additional lines

p - Paste whatever has been copied to the unnamed register

d - Deletes highlighted text

dd - Deletes a line of text

dw - Deletes a word

 

화면 분할 해서 사용하는 명령어

Ctrl + ws - Split windows horizontally.  // :sp - 가로 분할

Ctrl + wv - Split windows vertically        //:vs - 세로 분할

Ctrl + ww - Switch between windows

Ctrl + wq - Quit a window                       //:close - 분할 창 닫기

Ctrl + wh - Moves your cursor to the window to the left

Ctrl + wl - Moves your cursor to the window to the right

Ctrl + wj - Moves your cursor to the window below the one you're in

Ctrl + wk - Moves your cursor to the window above the one you're in

 

현재 사용하고 있는 VIM 버전 이다. 

VIM - Vi IMproved 8.2 (2019 Dec 12, compiled May  8 2021 05:44:12)

vimrc 파일을 통해서 현재 vim의 설정을 저장해서 사용할 수 있다.

git clone git@github.com:neovaga/vimrc.git   

반응형