mirror of
https://github.com/Dichgrem/DCGOS.git
synced 2025-12-17 03:31:59 -05:00
feat:add_nixvim
This commit is contained in:
46
home/nixvim/plugins/lsp/conform.nix
Normal file
46
home/nixvim/plugins/lsp/conform.nix
Normal file
@@ -0,0 +1,46 @@
|
||||
{
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
plugins.conform-nvim = {
|
||||
enable = true;
|
||||
settings = {
|
||||
format_on_save = {
|
||||
lspFallback = true;
|
||||
timeoutMs = 500;
|
||||
};
|
||||
formatters_by_ft = {
|
||||
# Use the "_" filetype to run formatters on filetypes that don't have other formatters configured.
|
||||
"_" = [
|
||||
"squeeze_blanks"
|
||||
"trim_whitespace"
|
||||
"trim_newlines"
|
||||
];
|
||||
};
|
||||
formatters = {
|
||||
_ = {
|
||||
command = "${pkgs.gawk}/bin/gawk";
|
||||
};
|
||||
squeeze_blanks = {
|
||||
command = lib.getExe' pkgs.coreutils "cat";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
keymaps = [
|
||||
{
|
||||
mode = [
|
||||
"n"
|
||||
"v"
|
||||
];
|
||||
key = "<leader>cf";
|
||||
action = "<cmd>lua require('conform').format()<cr>";
|
||||
options = {
|
||||
silent = true;
|
||||
desc = "Format";
|
||||
};
|
||||
}
|
||||
];
|
||||
}
|
||||
Reference in New Issue
Block a user