mirror of
https://github.com/nvim-lua/kickstart.nvim.git
synced 2025-12-07 09:35:37 -08:00
my config yay
This commit is contained in:
33
lua/custom/plugins/conform.lua
Normal file
33
lua/custom/plugins/conform.lua
Normal file
@@ -0,0 +1,33 @@
|
||||
return {
|
||||
{
|
||||
'stevearc/conform.nvim',
|
||||
event = { 'BufWritePre' },
|
||||
cmd = { 'ConformInfo' },
|
||||
keys = {
|
||||
{
|
||||
'<C>f',
|
||||
function()
|
||||
require('conform').format { async = true, lsp_fallback = true }
|
||||
end,
|
||||
mode = '',
|
||||
desc = 'Format buffer',
|
||||
},
|
||||
},
|
||||
opts = {
|
||||
notify_on_error = true,
|
||||
formatters_by_ft = {
|
||||
lua = { 'stylua' },
|
||||
javascript = { 'prettier' },
|
||||
typescript = { 'prettier' },
|
||||
},
|
||||
format_on_save = function(bufnr)
|
||||
local disable_filetypes = {--[[ c = true, cpp = true ]]
|
||||
}
|
||||
return {
|
||||
timeout_ms = 500,
|
||||
lsp_fallback = not disable_filetypes[vim.bo[bufnr].filetype],
|
||||
}
|
||||
end,
|
||||
},
|
||||
},
|
||||
}
|
||||
Reference in New Issue
Block a user