본문 바로가기

Mac

[vim] .vimrc 파일 없을때

맥으로 c 프로그래밍좀 공부할려고 했드만 vim에서 문법에 색을 안입혀주는게 아닌가..?!

그래서 찾아보니 .vimrc파일을 수정해주라네..

근데 찾아보니 없음. ㅡㅡ;

개발자 정신을 발휘한다면... 없으면 만들라?!

그래서 찾아보니 진짜 없으면 만들면 됨..ㅡㅡ;

순서는 이렇소.

$ cd ~
$ vi .vimrc

[.vimrc파일 내용]

" add for next lines
set tabstop=4
set ai " auto indenting
set history=100 " keep 100 lines of history
set ruler " show the cursor position
syntax on " syntax highlighting
set hlsearch " highlight the last searched term
filetype plugin on " use the file type plugins
" When editing a file, always jump to the last cursor position
autocmd BufReadPost *
\ if ! exists("g:leave_my_cursor_position_alone") |
\ if line("'\"") > 0 && line ("'\"") <= line("$") |
\ exe "normal g'\"" |
\ endif |
\ endif

 
:wq 로 저장하면

끝!

저기 .vimrc에서 문법에 색깔 입히는거는  
사실 요거 한줄

syntax on " syntax highlighting  

'Mac' 카테고리의 다른 글

homebrew 설치관련 링크  (0) 2011.11.17