install: conform.nvim
This commit is contained in:
parent
e3dc3f07d6
commit
a6a7676c4e
|
@ -25,6 +25,7 @@
|
||||||
./plugins/ui/lualine.nix
|
./plugins/ui/lualine.nix
|
||||||
|
|
||||||
# LSP and formatting
|
# LSP and formatting
|
||||||
|
./plugins/lsp/conform.nix
|
||||||
./plugins/lsp/lsp.nix
|
./plugins/lsp/lsp.nix
|
||||||
|
|
||||||
# Git
|
# Git
|
||||||
|
|
26
config/plugins/lsp/conform.nix
Normal file
26
config/plugins/lsp/conform.nix
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
{pkgs, ...}:
|
||||||
|
|
||||||
|
{
|
||||||
|
plugins.conform-nvim = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
# Run the formatter on file save.
|
||||||
|
formatOnSave = {
|
||||||
|
lspFallback = true;
|
||||||
|
timeoutMs = 500;
|
||||||
|
};
|
||||||
|
# Receive notificaton when a formatter errors.
|
||||||
|
notifyOnError = true;
|
||||||
|
|
||||||
|
# Map of filetype to formatters.
|
||||||
|
formattersByFt = {
|
||||||
|
c = ["clang-format"];
|
||||||
|
nix = ["alejandra"];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
# Install our formatters.
|
||||||
|
extraPackages = with pkgs; [
|
||||||
|
alejandra
|
||||||
|
];
|
||||||
|
}
|
Loading…
Reference in a new issue