# HG changeset patch # User edogawaconan # Date 1424773046 -32400 # Node ID 75c30f2b4694978cfe32b4d90317d2f3d6e5c075 # Parent 8b884bbb1d05588d71bafe252a0bc038aa9a4fc8 Add special setting for ruby, global default to 4/noet (ruby is 2/et). diff -r 8b884bbb1d05 -r 75c30f2b4694 rc/vimrc --- a/rc/vimrc Sat Jan 17 20:10:45 2015 +0900 +++ b/rc/vimrc Tue Feb 24 19:17:26 2015 +0900 @@ -9,8 +9,11 @@ set backspace=2 " make backspace work like most other apps set esckeys set noerrorbells -set ts=4 -set sw=2 + +set tabstop=4 +set shiftwidth=4 +set softtabstop=4 + set copyindent set title set incsearch @@ -69,6 +72,14 @@ endif if has("autocmd") + function In2() + set softtabstop=2 tabstop=2 shiftwidth=2 expandtab + endfunction + + function In4() + set softtabstop=4 tabstop=4 shiftwidth=4 noexpandtab + endfunction + augroup json_autocmd autocmd! autocmd FileType json set autoindent @@ -82,6 +93,7 @@ " reference: https://github.com/elzr/vim-json/blob/master/ftplugin/json.vim let g:vim_json_syntax_conceal = 1 augroup END + autocmd BufNewFile,BufRead *.json set filetype=json autocmd BufNewFile,BufRead *.jsonp set filetype=json autocmd BufRead,BufNewFile *.blade.php set filetype=blade @@ -93,6 +105,9 @@ autocmd BufRead,BufNewFile Gemfile set filetype=ruby autocmd BufRead,BufNewFile config.ru set filetype=ruby autocmd BufRead,BufNewFile supervisord.conf set filetype=dosini + + autocmd FileType ruby call In2() + autocmd FileType coffee call In2() endif if has('autocmd')