nvim formatting
This commit is contained in:
@@ -619,12 +619,7 @@ require('lazy').setup({
|
|||||||
vue = { hybridMode = true },
|
vue = { hybridMode = true },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
eslint = {
|
eslint = {},
|
||||||
init_options = {
|
|
||||||
filetypes = { 'javascript', 'javascriptreact', 'typescript', 'typescriptreact', 'vue' },
|
|
||||||
format = { enable = true },
|
|
||||||
},
|
|
||||||
},
|
|
||||||
--prettierd = {},
|
--prettierd = {},
|
||||||
-- TODO: end
|
-- TODO: end
|
||||||
html = {},
|
html = {},
|
||||||
@@ -699,7 +694,8 @@ require('lazy').setup({
|
|||||||
desc = '[F]ormat buffer',
|
desc = '[F]ormat buffer',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
opts = {
|
config = function()
|
||||||
|
local conform = require('conform').setup {
|
||||||
notify_on_error = false,
|
notify_on_error = false,
|
||||||
format_on_save = function(bufnr)
|
format_on_save = function(bufnr)
|
||||||
-- Disable "format_on_save lsp_fallback" for languages that don't
|
-- Disable "format_on_save lsp_fallback" for languages that don't
|
||||||
@@ -721,9 +717,21 @@ require('lazy').setup({
|
|||||||
-- python = { "isort", "black" },
|
-- python = { "isort", "black" },
|
||||||
--
|
--
|
||||||
-- You can use 'stop_after_first' to run the first available formatter from the list
|
-- You can use 'stop_after_first' to run the first available formatter from the list
|
||||||
javascript = { 'prettierd' },
|
javascript = {},
|
||||||
},
|
typescript = {},
|
||||||
|
vue = {},
|
||||||
|
typescriptreact = {},
|
||||||
|
javascriptreact = {},
|
||||||
},
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
vim.api.nvim_create_autocmd('BufWritePre', {
|
||||||
|
pattern = '*',
|
||||||
|
callback = function(args)
|
||||||
|
require('conform').format { bufnr = args.buf, lsp_fallback = true }
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
end,
|
||||||
},
|
},
|
||||||
|
|
||||||
{ -- Autocompletion
|
{ -- Autocompletion
|
||||||
|
|||||||
Reference in New Issue
Block a user