11

在 Eclipse 中,我想更改一些 .htm 文件的默认编辑器。

如果我尝试转到 FIle Association 并关联默认编辑器,则文件会在该新编辑器中打开,但我没有突出显示语法。

解决方案是文件关联被某些插件编辑器锁定

Preferences -- Context type----text ----Your editor -- reomve the extension

但我得到了 .htm(locked) 所以我不能删除它。

http://help.eclipse.org/juno/index.jsp?topic=%2Forg.eclipse.platform.doc.user%2Freference%2Fref-content-type.htm

注意:某些项目将被标记为“锁定”。如果项目是声明内容类型的插件提供的关联之一,则该项目被锁定。换句话说,您只能删除用户贡献的关联。

有什么办法可以去掉那些锁,即使它可能是骇人听闻的方式,但我想这样做

4

3 回答 3

7

您无需“解锁”现有关联即可添加新关联并将其设为默认关联。

  1. 通过“添加”按钮添加新关联
  2. 选择新条目
  3. 点击“默认”按钮,使您的新条目成为默认编辑器

在此处输入图像描述

于 2015-04-22T18:00:13.387 回答
2

Could it be, that you want to change the "File Association"? This can be done in General / Editors / File Associations. BUT Eclipse uses at least one default-editor and this is the reason for the "locked"-message in the "Content Types". You could set the "Text Editor" to all unwanted types. Looks like a workaround, but makes sense, because it is the same as the file associations of your operating system, that asks you for the program to display the file.

Another question is, why do you want to unlock or remove the "Content Type"? Does it change anything in the Eclipse logic?

于 2013-07-03T08:56:53.960 回答
1

从“Greg Desmarais”中查看这个答案(将所需的编辑器分配给“默认”)

https://stackoverflow.com/a/15642583/162094

于 2013-09-16T20:51:48.010 回答