A language server for configuration files. The goal is to make editing config files modern and easy.
diagnostics | completion |
hover |
code-action |
definition |
rename |
signature-help |
|
---|---|---|---|---|---|---|---|
aliases | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
fstab | ✅ | ✅ | ✅ | ❓ | ❓ | ❓ | 🟡 |
hosts | ✅ | ✅ | ✅ | ✅ | ❓ | ❓ | ✅ |
ssh_config | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
sshd_config | ✅ | ✅ | ✅ | ❓ | ✅ | ❓ | ✅ |
wireguard | ✅ | ✅ | ✅ | ✅ | ❓ | ❓ | 🟡 |
bitcoin_conf | ✅ | ✅ | ✅ | ✅ | ❓ | ❓ | 🟡 |
✅ = Supported
🟡 = Will be supported, but not yet implemented
❓ = No idea what to implement here, please let me know if you have any ideas
Generate rpcauth
- config-lsp reads therpcuser
andrpcpassword
from the config file and generates a newrpcauth
line for you, which includes a properly salted and hashed password (this requires Python to be installed)Fix typo
- fix a typo
Send test mail
- send a test mail to the current email address in thealias
file (this requiressendmail
/postfix
to be installed)
Inline aliases
- inline duplicated aliases into one line
Generate SSH Key
- generate a new SSH key and add it to the config file (this requiresssh-keygen
to be installed)Add option to unknown
- add an option toIgnoreUnknown
. This is mostly used forUseKeychain
Fix typo
- fix a typo
Generate new peer based on this one
- generate a new peer config section that's similar the the current one. Useful for quickly adding new peers to a Wireguard config fileGenerate PostDown
- generate an adjacentPostDown
command based on the currentPreUp
command. Only supports iptables currentlyAdd PersistentKeepalive
- add aPersistentKeepalive
option to the current peer config sectionGenerate PrivateKey
/Generate PresharedKey
- generate a new private key or preshared key and insert it automaticallyFix typo
- fix a typo
Install the extension from the marketplace
Alternatively, you can also manually install the extension:
- Download the latest extension version from the release page - You can find the extension under the "assets" section. The filename ends with
.vsix
- Open VS Code
- Open the extensions sidebar
- In the top bar, click on the three dots and select "Install from VSIX..."
- Select the just downloaded
.vsix
file - You may need to restart VS Code
- Enjoy!
You can use the official config-lsp.nvim plugin to easily install and manage config-lsp in Neovim.
To use config-lsp
in any other editor, you'll need to install it manually.
Don't worry, it's easy!
Download the latest binary from the releases page and put it in your PATH.
brew install myzel394/formulae/config-lsp
nix build # Build the binary; Available in ./result/bin/config-lsp
nix build .#vs-code-extension # Build the VS Code extension; Available in ./result/config-lps-<version>.vsix
You can either compile the binary using go:
go build -o config-lsp
or build it using Nix:
nix flake build
Using nvim-lspconfig you can add config-lsp
by adding the following to your lsp.lua
(filename might differ):
if not configs.config_lsp then
configs.config_lsp = {
default_config = {
cmd = { 'config-lsp' },
filetypes = {
"sshconfig",
"sshdconfig",
"fstab",
"aliases",
-- Matches wireguard configs and /etc/hosts
"conf",
},
root_dir = vim.loop.cwd,
},
}
end
lspconfig.config_lsp.setup {}
As config-lsp is a hobby project and I'm working completely alone on it, I will first focus on widely used and well known config files.
You are welcome to request any config file, as far as it's fairly well known.
config-lsp supports the following CLI options:
Option | Description | Default value |
---|---|---|
--no-undetectable-errors |
If config-lsp is unable to detect the language, do not return any errors. | Disabled by default; Enabled in the VS Code extension |
--no-typo-suggestions |
Do not suggest typo fixes | Disabled by default |
--usage-reports-errors-only |
Only report errors. | By default all usage telemetry is enabled |
--usage-reports-disable |
Disable all telemetry | By default all usage telemetry is enabled |
Starting with version 0.3.0
, config-lsp collects usage telemetry to improve the project by default. The VS Code extension also collects telemetry by default, unless the built-in telemetry setting is changed to either errors-only or disabled.
Data is sent to my self-hosted Sentry instance. 30 days retention, no personal data, not shared with third parties.
We do not collect any personal data. We also do not collect the contents of your config files. We may collect the following data (but not limited to):
- Version of config-lsp
- The operating system
- CLI arguments used to start config-lsp
- Detected language of the config file
- The path to the file
- Logs generated by config-lsp
- Errorrs produced by config-lsp
- Used editor (if available)
We would be really happy if you would not disable telemetry, as this helps me improve the project, add new features, and fix bugs faster. No data is shared with third parties, and I do not use the data to track you personally. The data is only used to improve config-lsp.
You can either contribute to the project, see CONTRIBUTING.md, or you can sponsor me via GitHub Sponsors or via crypto currencies.
Oh and spreading the word about config-lsp is also a great way to support the project :)