.vimrc

changeset 105
f3d684572a8f
parent 87
4a38df9bd773
child 107
db3183c639f9
equal deleted inserted replaced
101:ed9cc9675e93 105:f3d684572a8f
137 set autoindent 137 set autoindent
138 set expandtab 138 set expandtab
139 set shiftwidth=2 139 set shiftwidth=2
140 set softtabstop=2 140 set softtabstop=2
141 141
142 " apparently you have to go out of your way to make this stick
143 autocmd BufNewFile,BufRead * setlocal formatoptions-=ro
144
145 set backspace=indent,eol,start 142 set backspace=indent,eol,start
146 143
147 "set nu 144 "set nu
148 set scrolloff=2 145 set scrolloff=2
149 set ruler 146 set ruler
224 set undodir=$MYVIM/var/undo//,. 221 set undodir=$MYVIM/var/undo//,.
225 end 222 end
226 " }}} 223 " }}}
227 224
228 225
229 " File type-specific settings {{{ 226 " Autocmds {{{
230 autocmd FileType text setlocal textwidth=78 227 augroup vimrc
228 autocmd!
229
230 " you have to go out of your way to make this stick
231 autocmd BufNewFile,BufRead * setlocal formatoptions-=ro
232
233 autocmd FileType text setlocal textwidth=78
234 autocmd FileType perl call PerlSettings()
235
236 " preload templates into new buffers by file extension
237 "autocmd BufNewFile * silent! 0r $MYVIM/templates/%:e.template
238
239 " simple strip trailing whitespace on save
240 "autocmd BufWritePre *.pl,*.rb,*.js,*.css,*.md :%s/\s+$//e
241
242 augroup END
243 "}}}
244
245
246 " Perl type-specific settings {{{
231 247
232 function! PerlSettings () 248 function! PerlSettings ()
233 setlocal keywordprg=perldoc\ -f 249 compiler perl
250 " even with g:perl_compiler_force_warnings = 0, perl -w is used and
251 " that's just noisy with intentional no-warnings blocks out there
252
234 setlocal makeprg=perl\ -c\ %\ $* 253 setlocal makeprg=perl\ -c\ %\ $*
235 setlocal errorformat=%m\ at\ %f\ line\ %l
236 endfunction 254 endfunction
237
238 autocmd FileType perl call PerlSettings()
239
240 " preload templates into new buffers by file extension
241 "autocmd BuffNewFile * silent! 0r $MYVIM/templates/%:e.template
242
243 " strip trailing whitespace on save
244 "autocmd BufWritePre * :%s/\s+$//e
245 255
246 " perl fold scanning is slow 256 " perl fold scanning is slow
247 "let perl_fold = 1 257 "let perl_fold = 1
248 let perl_include_pod = 1 258 let perl_include_pod = 1
259
249 " }}} 260 " }}}
250 261
251 262
252 " Plugin settings {{{ 263 " Plugin settings {{{
253 " > Gundo 264 " > Gundo

mercurial