이 문서는 VIM, Yaml 문법 적용에 관한 것이다.
YAML 은 각종 설정파일에서 자주 쓰인다. Kubernetes 에서는 manifest 파일로 쓰이고 있는데, VIM 을 이용해 Yaml 을 편집할때에 간단하게 사용할 수 있는 방법을 소개한다.
간단하게 .vimrc 파일에 다음과 같이 입력해주면 된다.
syntax on
set nocompatible
set hls
set scs
set visualbell
set ignorecase
set showmatch
set fileencodings=utf-8
set termencoding=utf-8
set encoding=utf-8
" add yaml stuffs
" au! BufNewFile,BufReadPost *.{yaml,yml} set filetype=yaml foldmethod=indent
au! BufNewFile,BufReadPost *.{yaml,yml} set filetype=yaml
autocmd FileType yaml setlocal ts=2 sts=2 sw=2 expandtab autoindent
내용을 보면 금방 이해가 될 것이다.