Re: [question] filetype name with dot (example included)
- On 08/10/13 15:37, Bruno Sutic wrote:
> Hello vimers!":set syntax=…" (which, if included, should be "setlocal syntax=…"
> I'm using vim-handlebars filetype plugin, link to source: https://github.com/nono/vim-handlebars
> I noticed the plugin is setting filetype with a dot in the name.
> Link to the relevant line in the source code:
> Vim seems to be fine with that (see :h 'ft'), but the line above does not seem "right". It is essentially loading 2 filetypes, but then running additional files with "runtime!", which seems redundant.
> I downloaded the project locally and experimented with removing the "runtime" from the line above.
> But it seems I can't 'nail' all the functionality: either handlebars syntax is missing, or 'matchit' plugin support for html or handlebars is not working.
> Basically, I don't know how to use this and the docs are terse.
instead) should not be necessary if your vimrc includes "syntax on" or
"syntax enable"; similarly, "runtime! ftplugin/…" should not be
necessary if it includes _either_ "filetype plugin on" or "syntax on"
>Assuming the filename is enough to detect the filetype:
> My question is: what is the idiomatic, proper way in vim to use filetype with dot (2 filetypes at once)?
:au BufRead,BufNewFile *.foobar setf foo.bar " set it only if not yet set
:au BufRead,BufNewFile *.foobar set filetype=foo.bar " set it even if
in a file named one of
- on Unix-like
- on Windows
- on either
Most of these directories and all of these files are absent by default
in a new Vim installation. Create them if necessary.
This will source the plugins in the order shown (first foo.vim, then
bar.vim). In case of conflicting settings, e.g. matchit's b:match_words,
then the last one wins. If the correct value for both HTML and
handlebars is set in the handlebars ftplugin, then the dotted filename
should be html.handlebars and not the opposite.
> Is there a (good) plugin that uses this trick in a different way, so I can learn from it? Do you know what might be the problem here?dunno
> Any help with this is appreciated!
In specifications, Murphy's Law supersedes Ohm's.
You received this message from the "vim_dev" 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
You received this message because you are subscribed to the Google Groups "vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
For more options, visit https://groups.google.com/groups/opt_out.