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
.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With