learning

Change the current directory on Vim

눈침침 2011. 6. 20. 16:15

빔(VIM)에서 현재 폴더의 위치를 변경하고 싶을 때!

Vim 에서 현재 디렉토리를 변경할 때는 :cd 라고 입력한 뒤, 가고 싶은 폴더 경로를 입력하면 된다. 이렇게 쉬운 명령어였을 줄이야.
만약 {홈디렉토리}/workspace로 이동하고 싶을 땐, 아래와 같이 입력하면 된다.

:cd ~/workspace

Change the current directory to {path}.
If {path} is relative, it is searched for in the directories listed in 'cdpath'.
Does not change the meaning of an already opened file, because its full path name is remembered. Files from the |arglist| may change though! On MS-DOS this also changes the active drive.
To change to the directory of the current file:

:cd %:h
VIM Doc