comparison rc/vimrc @ 544:75c30f2b4694

Add special setting for ruby, global default to 4/noet (ruby is 2/et).
author edogawaconan <me@myconan.net>
date Tue, 24 Feb 2015 19:17:26 +0900
parents fc429d39ce9e
children c9ea8dd9d382
comparison
equal deleted inserted replaced
543:8b884bbb1d05 544:75c30f2b4694
7 set vb t_vb= " disables visual bell 7 set vb t_vb= " disables visual bell
8 set ruler 8 set ruler
9 set backspace=2 " make backspace work like most other apps 9 set backspace=2 " make backspace work like most other apps
10 set esckeys 10 set esckeys
11 set noerrorbells 11 set noerrorbells
12 set ts=4 12
13 set sw=2 13 set tabstop=4
14 set shiftwidth=4
15 set softtabstop=4
16
14 set copyindent 17 set copyindent
15 set title 18 set title
16 set incsearch 19 set incsearch
17 set ignorecase 20 set ignorecase
18 set smartcase 21 set smartcase
67 set t_Co=256 70 set t_Co=256
68 colorscheme base16-default 71 colorscheme base16-default
69 endif 72 endif
70 73
71 if has("autocmd") 74 if has("autocmd")
75 function In2()
76 set softtabstop=2 tabstop=2 shiftwidth=2 expandtab
77 endfunction
78
79 function In4()
80 set softtabstop=4 tabstop=4 shiftwidth=4 noexpandtab
81 endfunction
82
72 augroup json_autocmd 83 augroup json_autocmd
73 autocmd! 84 autocmd!
74 autocmd FileType json set autoindent 85 autocmd FileType json set autoindent
75 autocmd FileType json set formatoptions=tcq2l 86 autocmd FileType json set formatoptions=tcq2l
76 autocmd FileType json set textwidth=78 shiftwidth=2 87 autocmd FileType json set textwidth=78 shiftwidth=2
80 91
81 " required by syntax file 92 " required by syntax file
82 " reference: https://github.com/elzr/vim-json/blob/master/ftplugin/json.vim 93 " reference: https://github.com/elzr/vim-json/blob/master/ftplugin/json.vim
83 let g:vim_json_syntax_conceal = 1 94 let g:vim_json_syntax_conceal = 1
84 augroup END 95 augroup END
96
85 autocmd BufNewFile,BufRead *.json set filetype=json 97 autocmd BufNewFile,BufRead *.json set filetype=json
86 autocmd BufNewFile,BufRead *.jsonp set filetype=json 98 autocmd BufNewFile,BufRead *.jsonp set filetype=json
87 autocmd BufRead,BufNewFile *.blade.php set filetype=blade 99 autocmd BufRead,BufNewFile *.blade.php set filetype=blade
88 autocmd BufRead,BufNewFile *.coffee set filetype=coffee 100 autocmd BufRead,BufNewFile *.coffee set filetype=coffee
89 autocmd BufRead,BufNewFile *.erb set filetype=eruby 101 autocmd BufRead,BufNewFile *.erb set filetype=eruby
91 autocmd BufRead,BufNewFile *.scss set filetype=scss 103 autocmd BufRead,BufNewFile *.scss set filetype=scss
92 autocmd BufRead,BufNewFile *.slim set filetype=slim 104 autocmd BufRead,BufNewFile *.slim set filetype=slim
93 autocmd BufRead,BufNewFile Gemfile set filetype=ruby 105 autocmd BufRead,BufNewFile Gemfile set filetype=ruby
94 autocmd BufRead,BufNewFile config.ru set filetype=ruby 106 autocmd BufRead,BufNewFile config.ru set filetype=ruby
95 autocmd BufRead,BufNewFile supervisord.conf set filetype=dosini 107 autocmd BufRead,BufNewFile supervisord.conf set filetype=dosini
108
109 autocmd FileType ruby call In2()
110 autocmd FileType coffee call In2()
96 endif 111 endif
97 112
98 if has('autocmd') 113 if has('autocmd')
99 "Restore cursor position 114 "Restore cursor position
100 set viminfo='10,\"100,:20,%,n~/.viminfo 115 set viminfo='10,\"100,:20,%,n~/.viminfo