90854Re: syntax auto detect
- May 23 3:11 PMOn 2008-05-23, zhengquan <zhang.zhengquan@...> wrote:
> On May 1, 1:45 am, Gary Johnson <garyj...@...> wrote:How much more automatic can you get? As for smarter, the only
> > On 2008-04-25,zhengquan<zhang.zhengq...@...> wrote:
> > > Hello,
> > > I wonder if vim can auto detect filetypes.
> > > I want to edit some .cmd files which are actually scheme scripts.
> > > I can not add mode lines to the files because they will cause trouble
> > > when read by other programs. I also do not want to use autocmd to
> > > autodetect .cmd extensions. I would like to know if there are some
> > > smarter mechanisms for auto detecting filetypes.
> > :help new-filetype-scripts
> > You might also open $VIMRUNTIME/filetype.vim and search for "\.cmd"
> > to see how vim distinguishes rexx files from dosbatch files that
> > share the .cmd suffix. You could create your own
> > ~/.vim/filetype.vim and add similar logic to detect scheme files.
> > See
> > :help new-filetype
> I saw the detection method in filetype.vim
> It peeks the first line to see what it is, I wonder if there are
> smarter and more automatic ways to detect the syntax and tell what the
> filetype is.
information there is is the file's name and its contents. Vim will
sometimes examine more than the first line of a file to try to
determine its contents, especially if the file name has no suffix at
all. See $VIMRUNTIME/scripts.vim.
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
- << Previous post in topic Next post in topic >>