Monday, January 30, 2012

Re: Set 'filetype' by filename extensions

On Tue, January 31, 2012 8:05 am, Clark J. Wang wrote:
> I have some files named in the *.kshlib format which are ksh scripts but
> vim always recongnized them as "ft=conf". So how can I force vim to
> consider those files as "ft=sh"?
>
> I tried following in vimrc but it did not work:
>
> autocmd BufReadPost *
> \ if bufname('%') =~ '^.*\.kshlib$' |
> \ exe 'normal set ft=sh' |
> \ endif
>

:h new-filetype

regards,
Christian

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments:

Post a Comment