mirror of
https://github.com/Dichgrem/DCGOS.git
synced 2025-12-17 03:31:59 -05:00
45 lines
1.1 KiB
Nix
Executable File
45 lines
1.1 KiB
Nix
Executable File
{pkgs, ...}: {
|
|
programs.nixvim = {
|
|
extraPackages = with pkgs; [
|
|
stylua
|
|
];
|
|
|
|
plugins.conform-nvim = {
|
|
enable = true;
|
|
settings = {
|
|
notify_on_error = false;
|
|
format_on_save = ''
|
|
function(bufnr)
|
|
-- Disable "format_on_save lsp_fallback" for lanuages that don't
|
|
-- have a well standardized coding style. You can add additional
|
|
-- lanuages here or re-enable it for the disabled ones.
|
|
local disable_filetypes = { c = true, cpp = true }
|
|
return {
|
|
timeout_ms = 500,
|
|
lsp_fallback = not disable_filetypes[vim.bo[bufnr].filetype]
|
|
}
|
|
end
|
|
'';
|
|
formatters_by_ft = {
|
|
lua = ["stylua"];
|
|
};
|
|
};
|
|
};
|
|
|
|
keymaps = [
|
|
{
|
|
mode = "";
|
|
key = "<leader>f";
|
|
action.__raw = ''
|
|
function()
|
|
require('conform').format { async = true, lsp_fallback = true }
|
|
end
|
|
'';
|
|
options = {
|
|
desc = "[F]ormat buffer";
|
|
};
|
|
}
|
|
];
|
|
};
|
|
}
|