root로 들어가서 vi를 하면 아무리 해도 Syntax High light가 작동하지를 않는다.
물론 whereis로 검색을 해봐도 vi는 하나뿐인데 왜그런가 해서 검색을 해봤더니
| Ok, I fixed it... all I had to do was to add an alias for vi pointing to /usr/bin/vim in my /root/.bashrc file. Root was using /bin/vi which is the Small version, while other accounts were aliasing vi as vim, which is why it was working... I was also able to get syntax to work as root by using just "vim filename" instead of vi... Silly me... Thanks for pointing me in the right direction Tony! :) [링크 : http://www.nabble.com/Unable-to-get-syntax-highlighting-to-work-for-root-account-td15767467.html] |
| $ alias alias l.='ls -d .* --color=tty' alias ll='ls -l --color=tty' alias ls='ls --color=tty' alias mc='. /usr/share/mc/bin/mc-wrapper.sh' alias vi='vim' alias which='alias | /usr/bin/which --tty-only --read-alias --show-dot --show-tilde' |
일반 유저에서 alias를 실행해보니, vi가 설정되어 있었다.
그런데 root는 이러한 부분이 없었다.
| # alias alias cp='cp -i' alias l.='ls -d .* --color=tty' alias ll='ls -l --color=tty' alias ls='ls --color=tty' alias mc='. /usr/share/mc/bin/mc-wrapper.sh' alias mv='mv -i' alias rm='rm -i' alias which='alias | /usr/bin/which --tty-only --read-alias --show-dot --show-tilde' |
root는 안전을 위해 rm이나 mv에 -i(interative) 옵션을 기본으로 붙이게 해놨다.
'프로그램 사용 > vi' 카테고리의 다른 글
| vi 에서 명령어 실행하기 (0) | 2010.01.28 |
|---|---|
| vi set commands (0) | 2010.01.27 |
| vimdiff (0) | 2009.10.29 |
| VI 자동 줄 정렬 (0) | 2009.10.06 |
| vi auto indent (0) | 2009.10.06 |
