Smarten up filetype handling

4 Points

Martin Kopischke Martin Kopischke

4 years ago

Make sure Vim adjusts the file type when you change a file’s extension.

if has('autocmd')
  " assuming filetype plugin indent on
  augroup filetype_detect_on_rename
    autocmd!
    autocmd BufFilePost * filetype detect
  augroup END
endif