Take the 2-minute tour ×

I would like to modify vim's updatetime for files with a specific extension. I've tried accomplishing this by adding the following line to my ~/.vimrc:

autocmd BufRead,BufNewFile *.t set updatetime=60000

This doesn't seem to work. When I open up a file with a .t extension and type :set ut? I see the default updatetime=4000.

share|improve this question

1 Answer 1

The 'updatetime' setting is a global setting, it is not meant to have different values for different buffers. Why do you want a different value?

You can work around this with autocmds, as you've attempted. However, the BufRead,BufNewFile events will only fire when a buffer is loaded; it won't update the setting as you switch buffers. The correct way is to define two autocmds on BufEnter; a general one to reset the setting, and (following that, so that it is executed after the first!) one that matches your file patterns and manipulates the setting:

autocmd BufEnter * set updatetime=4000
autocmd BufEnter *.t set updatetime=60000
share|improve this answer

Your Answer


