parent
2597126549
commit
17b3d146d4
|
|
@ -1,6 +1,16 @@
|
||||||
return {
|
return {
|
||||||
'stevearc/conform.nvim',
|
'stevearc/conform.nvim',
|
||||||
event = { 'BufReadPre', 'BufNewFile' },
|
event = { 'BufReadPre', 'BufNewFile' },
|
||||||
|
keys = {
|
||||||
|
{
|
||||||
|
'<leader>tf',
|
||||||
|
function()
|
||||||
|
vim.g.disable_autoformat = not vim.g.disable_autoformat
|
||||||
|
end,
|
||||||
|
mode = '',
|
||||||
|
desc = 'Toggle Format On Save',
|
||||||
|
},
|
||||||
|
},
|
||||||
config = function()
|
config = function()
|
||||||
local conform = require 'conform'
|
local conform = require 'conform'
|
||||||
|
|
||||||
|
|
@ -20,11 +30,12 @@ return {
|
||||||
liquid = { 'prettier' },
|
liquid = { 'prettier' },
|
||||||
lua = { 'stylua' },
|
lua = { 'stylua' },
|
||||||
},
|
},
|
||||||
format_on_save = {
|
format_on_save = function(bufnr)
|
||||||
lsp_fallback = true,
|
if vim.g.disable_autoformat or vim.b[bufnr].disable_autoformat then
|
||||||
async = false,
|
return
|
||||||
timeout_ms = 1000,
|
end
|
||||||
},
|
return { timeout_ms = 1000, lsp_format = 'fallback' }
|
||||||
|
end,
|
||||||
}
|
}
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,14 @@
|
||||||
|
return {
|
||||||
|
'pmizio/typescript-tools.nvim',
|
||||||
|
dependencies = { 'nvim-lua/plenary.nvim', 'neovim/nvim-lspconfig' },
|
||||||
|
config = function()
|
||||||
|
require('typescript-tools').setup {
|
||||||
|
settings = {
|
||||||
|
jsx_close_tag = {
|
||||||
|
enable = true,
|
||||||
|
filetypes = { 'javascriptreact', 'typescriptreact', 'javascript' },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
end,
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue