IntelliJ IDEA允许在“设置>文件类型”中手动添加语法突出显示设置,即使在社区版中也是如此,但它会在重新启动后忽略这些设置。
这些设置存储在用户的主目录中,例如 ~/。IdeaIC2016.1/config/filetypes/*.xml.不幸的是,重新启动IDE后,这些设置不会被读取,因此配置任何设置似乎都没有用:-(
<filetype binary="false" description="JSP files (syntax highlighting only)" name="JSP">
<highlighting>
<options>
<option name="LINE_COMMENT" value="" />
<option name="COMMENT_START" value="<%--" />
<option name="COMMENT_END" value="--%>" />
<option name="HEX_PREFIX" value="#" />
<option name="NUM_POSTFIXES" value="" />
<option name="HAS_BRACES" value="true" />
<option name="HAS_BRACKETS" value="true" />
<option name="HAS_PARENS" value="true" />
<option name="HAS_STRING_ESCAPES" value="true" />
</options>
<keywords keywords="%>;<%!;<%@;include;page;taglib" ignore_case="false" />
<keywords2 keywords="c:choose;c:if;c:otherwise;c:set;c:url;c:when;fmt:message;fmt:setBundle;fmt:setLocale;s:eval;s:message;sec:authorize" />
<keywords3 keywords="html;head;title;meta;header;nav;section;footer;body;a;br;hr;div;form;input;button;submit;textarea;p;script;noscript;span;style;table;td;th;tr;ol;ul;li;label;i;h1;h2;h3;h4;h5;img" />
<keywords4 keywords="if;else;function;for;do;let;this;while;with;thows;true;false;char;case;continue;alert;confirm;console;length;return;var;boolean;forms;" />
</highlighting>
</filetype>
(~/.IdeaIC2016.1/config/filetypes/JSP.xml )
IntelliJ Community Edition 还忽略了 CSS 文件的任何文件类型设置,这些设置可能如下所示:
<filetype binary="false" description="CSS files (syntax highlighting only)" name="CSS">
<highlighting>
<options>
<option name="LINE_COMMENT" value="" />
<option name="COMMENT_START" value="/*" />
<option name="COMMENT_END" value="*/" />
<option name="HEX_PREFIX" value="#" />
<option name="NUM_POSTFIXES" value="" />
<option name="HAS_BRACES" value="true" />
</options>
<keywords keywords="a;body;button;div;font;font-face;form;frame;h1;h2;h3;h4;iframe;img;import;input;li;link;media;nav;ol;option;p;select;span;table;td;th;title;tr;u;ul;video" ignore_case="false" />
<keywords2 keywords=" box-shadow;background;background-color;border;border-radius;bottom;box-shadow;color;content;cursor;display;float;font-family;font-size;font-weight;height;left;line-height;list-style-type;margin;margin-bottom;margin-left;margin-right;margin-top;outline;overflow;padding;padding-bottom;padding-left;padding-right;padding-top;position;right;text-align;text-decoration;text-transform;top;vertical-align;white-space;width;z-index;zoom" />
<keywords3 keywords="em;pt;px;rgb;rgba" />
<keywords4 keywords="!important;active;after;before;hover;none;visited" />
</highlighting>
</filetype>
(~/.IdeaIC2016.1/config/filetypes/CSS.xml)