my config yay
This commit is contained in:
parent
d605b840a2
commit
f4b595733a
32 changed files with 1108 additions and 715 deletions
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,
|
||||
},
|
||||
},
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue