mkdir -pv ~/.vim/ftdetect
mkdir -pv ~/.vim/indent
mkdir -pv ~/.vim/syntax
mkdir -pv ~/.vim/indent
mkdir -pv ~/.vim/syntax
그리고 각 폴더에 아래와 같이 wget을 이용해서 scala.vim파일을 각각 생성합니다.
$ wget --no-check-certificate https://lampsvn.epfl.ch/trac/scala/export/18260/scala-tool-support/trunk/src/vim/ftdetect/scala.vim -O ~/.vim/ftdetect/scala.vim
$ wget --no-check-certificate https://lampsvn.epfl.ch/trac/scala/export/18260/scala-tool-support/trunk/src/vim/indent/scala.vim -O ~/.vim/indent/scala.vim
$ wget --no-check-certificate https://lampsvn.epfl.ch/trac/scala/export/18260/scala-tool-support/trunk/src/vim/syntax/scala.vim -O ~/.vim/syntax/scala.vim
$ wget --no-check-certificate https://lampsvn.epfl.ch/trac/scala/export/18260/scala-tool-support/trunk/src/vim/indent/scala.vim -O ~/.vim/indent/scala.vim
$ wget --no-check-certificate https://lampsvn.epfl.ch/trac/scala/export/18260/scala-tool-support/trunk/src/vim/syntax/scala.vim -O ~/.vim/syntax/scala.vim
wget은 우분투에서 사용하고 OS X에는 wget이 들어있지 않기 때문에 curl을 이용해서 아래처럼 파일을 다운로드합니다.
$ curl -L https://lampsvn.epfl.ch/trac/scala/export/18260/scala-tool-support/trunk/src/vim/ftdetect/scala.vim > ~/.vim/ftdetect/scala.vim
$ curl -L https://lampsvn.epfl.ch/trac/scala/export/18260/scala-tool-support/trunk/src/vim/indent/scala.vim > ~/.vim/indent/scala.vim
$ curl -L https://lampsvn.epfl.ch/trac/scala/export/18260/scala-tool-support/trunk/src/vim/syntax/scala.vim > ~/.vim/syntax/scala.vim
$ curl -L https://lampsvn.epfl.ch/trac/scala/export/18260/scala-tool-support/trunk/src/vim/indent/scala.vim > ~/.vim/indent/scala.vim
$ curl -L https://lampsvn.epfl.ch/trac/scala/export/18260/scala-tool-support/trunk/src/vim/syntax/scala.vim > ~/.vim/syntax/scala.vim
그리고 .vimrc에 아래의 설정을 추가합니다.
set nocompatible
set nu
syntax on
filetype indent on
set autoindent
set ic
set hls
set lbr
colorscheme desert
set nu
syntax on
filetype indent on
set autoindent
set ic
set hls
set lbr
colorscheme desert
이제 vim에서 scala파일을 열면 Syntax Highlight가 동작합니다.
Comments