feat(nvim): added trim_newlines extra formatter

This commit is contained in:
Sergio Laín 2024-01-07 14:52:02 +01:00
parent 4cab75b85b
commit d60d1d668a
No known key found for this signature in database
GPG key ID: 14C9B8080681777B
3 changed files with 10 additions and 1 deletions

View file

@ -88,7 +88,7 @@
"nvim-recorder": { "branch": "main", "commit": "daaae505862e816a7efe578e22d6f3d10cd7a2e6" },
"nvim-scissors": { "branch": "main", "commit": "7e3f33ad7495a0d8632a690d35c74e1b38d85ba1" },
"nvim-spectre": { "branch": "master", "commit": "d8906855f1949ac97b1e77aaf8d3fe12ed158ddc" },
"nvim-treesitter": { "branch": "master", "commit": "5032f9952ad2a3a7f7792ac438c4f9e2bd53e0b9" },
"nvim-treesitter": { "branch": "master", "commit": "8cd2b230174efbf7b5d9f49fe2f90bda6b5eb16e" },
"nvim-treesitter-context": { "branch": "master", "commit": "652ec514d6ba8bc4a3c2de76c855fe668e2c7196" },
"nvim-treesitter-endwise": { "branch": "master", "commit": "4c344ffc8d54d7e1ba2cefaaa2c10ea93aa1cc2d" },
"nvim-treesitter-textobjects": { "branch": "master", "commit": "85b9d0cbd4ff901abcda862b50dbb34e0901848b" },

View file

@ -47,6 +47,7 @@
"plugins.extras.formatting.isort",
"plugins.extras.formatting.prettier",
"plugins.extras.formatting.rustfmt",
"plugins.extras.formatting.trim_newlines",
"plugins.extras.formatting.trim_whitespace",
"plugins.extras.lang.ansible",
"plugins.extras.lang.bash",

View file

@ -0,0 +1,8 @@
return {
"stevearc/conform.nvim",
opts = function(_, opts)
opts.formatters_by_ft["_"] = opts.formatters_by_ft["_"] or {}
table.insert(opts.formatters_by_ft["_"], "trim_newlines")
return opts
end,
}