Commit message:
- Update `conform.nix` to configure notifyOnError and add keymaps for conform.nvim. - Remove deprecated format_on_save settings. - Add new key mappings for formatting with conform.nvim.
This commit is contained in:
parent
3d0b34c714
commit
ff3656deb7
1 changed files with 19 additions and 8 deletions
|
@ -7,14 +7,6 @@
|
|||
enable = true;
|
||||
|
||||
settings = {
|
||||
# Run the formatter on file save.
|
||||
format_on_save = {
|
||||
lspFallback = true;
|
||||
timeoutMs = 500;
|
||||
};
|
||||
# Receive notificaton when a formatter errors.
|
||||
notifyOnError = true;
|
||||
|
||||
# Map of filetype to formatters.
|
||||
formatters_by_ft = {
|
||||
c = ["clang-format"];
|
||||
|
@ -34,6 +26,25 @@
|
|||
command = lib.getExe pkgs.stylua;
|
||||
};
|
||||
};
|
||||
|
||||
# Receive notificaton when a formatter errors.
|
||||
notifyOnError = true;
|
||||
};
|
||||
};
|
||||
|
||||
# Keymaps for conform.nvim
|
||||
keymaps = [
|
||||
{
|
||||
mode = "";
|
||||
key = "<leader>f";
|
||||
action.__raw = ''
|
||||
function()
|
||||
require('conform').format { async = true, lsp_fallback = true }
|
||||
end
|
||||
'';
|
||||
options = {
|
||||
desc = "Format buffer";
|
||||
};
|
||||
}
|
||||
];
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue