Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I know a little bit of autocmd and use it for few things. Currently, I have

au BufNewFile,BufRead *.inc set filetype=sql
au BufNewFile,BufRead *.tbl set filetype=sql

Reading the man page, the general syntax is

:autocmd [group] {events} {file_pattern} [nested] {command}

I would like to know, whether I can combine the above 2 statements in a single lin i.e. how can we specify more that one file extension in the file_pattern section? The man page doesn't say about this, but I believe it can be comma or space separated. Any hints?

share|improve this question

I believe it can be comma or space separated


au BufNewFile,BufRead *.tbl,*.inc setf sql
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.