neovim: add clang_format and enable auto format

This commit is contained in:
Alexandre Cavalheiro 2024-09-01 17:36:15 -03:00
parent 79d396ddfd
commit 9ad02124d7
Signed by: wizardlink
GPG key ID: A5767B54367CFBDF
2 changed files with 5 additions and 1 deletions

View file

@ -22,14 +22,17 @@ return {
enabled = true, -- enable or disable format on save globally
allow_filetypes = { -- enable format on save for specified filetypes only
-- "go",
"c",
"cpp",
"h",
"javascript",
"jsx",
"lua",
"nix",
"rust",
"svelte",
"tsx",
"typescript",
"svelte",
},
ignore_filetypes = { -- disable format on save for specified filetypes
-- "python",

View file

@ -12,6 +12,7 @@ return {
-- https://github.com/nvimtools/none-ls.nvim/tree/main/lua/null-ls/builtins/diagnostics
config.sources = {
-- Set a formatter
null_ls.builtins.formatting.clang_format,
null_ls.builtins.formatting.nixfmt,
null_ls.builtins.formatting.prettier,
null_ls.builtins.formatting.stylua,