neovim: add clang_format and enable auto format
This commit is contained in:
parent
79d396ddfd
commit
9ad02124d7
|
@ -22,14 +22,17 @@ return {
|
||||||
enabled = true, -- enable or disable format on save globally
|
enabled = true, -- enable or disable format on save globally
|
||||||
allow_filetypes = { -- enable format on save for specified filetypes only
|
allow_filetypes = { -- enable format on save for specified filetypes only
|
||||||
-- "go",
|
-- "go",
|
||||||
|
"c",
|
||||||
|
"cpp",
|
||||||
|
"h",
|
||||||
"javascript",
|
"javascript",
|
||||||
"jsx",
|
"jsx",
|
||||||
"lua",
|
"lua",
|
||||||
"nix",
|
"nix",
|
||||||
"rust",
|
"rust",
|
||||||
|
"svelte",
|
||||||
"tsx",
|
"tsx",
|
||||||
"typescript",
|
"typescript",
|
||||||
"svelte",
|
|
||||||
},
|
},
|
||||||
ignore_filetypes = { -- disable format on save for specified filetypes
|
ignore_filetypes = { -- disable format on save for specified filetypes
|
||||||
-- "python",
|
-- "python",
|
||||||
|
|
|
@ -12,6 +12,7 @@ return {
|
||||||
-- https://github.com/nvimtools/none-ls.nvim/tree/main/lua/null-ls/builtins/diagnostics
|
-- https://github.com/nvimtools/none-ls.nvim/tree/main/lua/null-ls/builtins/diagnostics
|
||||||
config.sources = {
|
config.sources = {
|
||||||
-- Set a formatter
|
-- Set a formatter
|
||||||
|
null_ls.builtins.formatting.clang_format,
|
||||||
null_ls.builtins.formatting.nixfmt,
|
null_ls.builtins.formatting.nixfmt,
|
||||||
null_ls.builtins.formatting.prettier,
|
null_ls.builtins.formatting.prettier,
|
||||||
null_ls.builtins.formatting.stylua,
|
null_ls.builtins.formatting.stylua,
|
||||||
|
|
Loading…
Reference in a new issue