When I open a YAML file in Rails repository, this plugin automatically sets the filetype of it as eruby.yaml instead of yaml, even if the file has nothing to do with Rails. For example:
These files' filetype are set to eruby.yaml. And the problem is that the default commentstring is different between eruby.yaml and yaml file type:
eruby.yaml - <%#%s%>
yaml - # %s
Since the comment format of eruby is invalid in YAML, we cannot comment out code easily in a normal YAML file with eruby.yaml type by vim-commentary which depends on the commentstring option.
Suggestion
How about setting the filetype of YAML files in the general Rails directories only?
Such as app, lib, config, test, and spec.
Hi, thank you for the awesome plugin!
Problem
When I open a YAML file in Rails repository, this plugin automatically sets the
filetype
of it aseruby.yaml
instead ofyaml
, even if the file has nothing to do with Rails. For example:These files'
filetype
are set toeruby.yaml
. And the problem is that the defaultcommentstring
is different betweeneruby.yaml
andyaml
file type:eruby.yaml
-<%#%s%>
yaml
-# %s
Since the comment format of
eruby
is invalid in YAML, we cannot comment out code easily in a normal YAML file witheruby.yaml
type byvim-commentary
which depends on thecommentstring
option.Suggestion
How about setting the
filetype
of YAML files in the general Rails directories only? Such asapp
,lib
,config
,test
, andspec
.(code link):
https://github.com/tpope/vim-rails/blob/8407484a329b6722ee088a096a8d879a5c32ac67/plugin/rails.vim#L100-L103