kamelot
kamelot

Reputation: 491

IntelliJ Idea 14 JSF XHTML code style

As I am the only member of our team who is not using Eclipse I have to setup the formatter according to the given code style (based on Eclipse formatter). For Java I have set everything without issues. But I need to set indentation using tabs instead of 4 spaces for XHTML JSF pages as well. I couldn't find XHTML option under Editor/Code Style.

I tried to set "use tab character" in default settings, HTML and XML as well, but nothing gave me the result I want. Now I am warned with the yellow stripe at the top of the editor that file is using tabs instead of 4 spaces.

I want to get rid of this completely and use tab indentation for this project.

Can someone give an advice? Thanks!

Upvotes: 1

Views: 1395

Answers (1)

Bohuslav Burghardt
Bohuslav Burghardt

Reputation: 34776

One option would be to use EditorConfig. It allows you to set indentation and other formatting settings for the project using configuration file named .editorconfig. You can check in this file to version control or you can just have it locally and put it to .gitignore for instance.

With the EditorConfig support enabled (check Settings/Editor/Code Style/Enable Editor Config Support, if not enabled by default), IntelliJ will use the settings from the configuration file and override the default IDE/project formatting settings accordingly.

Here is a sample configuration file, which should set the formatting you want:

# top-most EditorConfig file
root = true

[*]
end_of_line = lf
insert_final_newline = true
indent_style = tab
indent_size = 4

Upvotes: 1

Related Questions