This plugin adds support for systemd unit files to IntelliJ.
- Syntax highlighting for unit files
- Auto-completion for:
- Option names in a section
- Boolean options
- Octal options
- Some other common options (KillMode=, Type=, Restart=)
- Inspections
- Invalid values for boolean options
- Unknown option in section (ignoring those starting with X-)
- Annotations
- When the section name is invalid.
- Whitespace after a line continuation \ character.
- When a key has been deprecated.
- Built-in documentation for options or section name (available when hitting CTRL+Q or F1 on Mac)
To create a file simply right click on a folder and New > File, and enter a file name ending any of:
.automount
.device
.mount
.path
.service
.slice
.socket
.swap
.target
.timer
The file should then be associated with this plugin and the above features should work.
NOTE: .scope
units are not configured via unit configuration files and so we don't support them.
This plugin is avaliable to install at the JetBrains Plugin Repository.
- The documentation is extracted from the systemd source code.
- A number of users of the IntelliJ Plugin Developers Slack provided a lot of useful advice.
- As with every project I work on the help and patient tutelage of members of ##java on Freenode.
- Everything but the logo is GPLv2.
- Logo is CC-BY-SA, as it is a derivative work from the brand repository.
On top of Java 11, you will need the m4 macro processor installed on your system and available on the path.
Simply clone the repository, and run
./gradlew buildPlugin
Then in IntelliJ navigate to
Plugins > Install Plugins From Disk > build/distributions/systemdUnitFilePlugin-X.X-SNAPSHOT.zip
When starting the development IDE if the fonts are poor add the following ENVIRONMENT VARIABLE to the run configuration
_JAVA_OPTIONS=-Dawt.useSystemAAFontSettings\=lcd -Dsun.java2d.renderer\=sun.java2d.marlin.MarlinRenderingEngine
Note: If you are using the Gradle runIde task it must be passed as an environment variable and not a VM option, because it gets executed in a different VM.
If you see errors related to duplicate SLF4J class bindings available switch the JRE in use from the Default which references IntelliJ, to a native one.