Translate

[Linux] vim 에서 gradle 확장자의 syntax highlighting 되지 않는문제



OS: ubuntu 15.10 gnome
VIM ver: 7.4.712



증상

gradle 을 공부하면서 vi로 build.gradle 을 열어봤는데 groovy 형식의 syntax highlighting 이 되지 않았다.




해결 방법

아래와 같이 작업하면 groovy syntax highlighting 이 된다.
1004lucifer
1. vi로 gradle 파일을 오픈 후 :set filetype=groovy 라고 입력

 
2. 아래의 파일에 gradle 형식의 확장자를 지정해 준다. (권장)
/usr/share/vim/vim74/filetype.vim
(vim74 부분은 vim 버전에 따라 경로가 변경될 수 있다.)

" Vim support file to detect file types
"
" Maintainer:   Bram Moolenaar <Bram@vim.org>
" Last Change:  2015 Apr 06

" Listen very carefully, I will say this only once
if exists("did_load_filetypes")
  finish
endif
let did_load_filetypes = 1

" Line continuation is used here, remove 'C' from 'cpoptions'
let s:cpo_save = &cpo 
set cpo&vim

augroup filetypedetect

au BufNewFile,BufRead *.gradle setf groovy

" Ignored extensions






참조:
http://galsys.tumblr.com/post/51692458778/gradle-syntax-highlighting-in-vim
https://gist.github.com/uarun/1123563

댓글