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 (e.g., KillMode=, Type=, Restart=)
- Unit names in dependencies (e.g., WantedBy=, Requires)
- Inspections
- Invalid value for argument.
- Shell syntax detected in Exec___= call.
- Unknown option in section (ignoring those starting with X-)
- Missing required key
- Annotations
- When the section name is invalid or used in the wrong file type
- 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)
- Templates for several unit types
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 Libera.Chat.
- Everything but the logo is GPLv2.
- Logo is CC-BY-SA, as it is a derivative work from the brand repository.
This has adopted Conventional Commits format for commit messages, in theory anyway. The main effect is that certain tags will be excluded from the automatic changelog.
Java 17
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.