parent
2597126549
commit
17b3d146d4
|
|
@ -1,6 +1,16 @@
|
|||
return {
|
||||
'stevearc/conform.nvim',
|
||||
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()
|
||||
local conform = require 'conform'
|
||||
|
||||
|
|
@ -20,11 +30,12 @@ return {
|
|||
liquid = { 'prettier' },
|
||||
lua = { 'stylua' },
|
||||
},
|
||||
format_on_save = {
|
||||
lsp_fallback = true,
|
||||
async = false,
|
||||
timeout_ms = 1000,
|
||||
},
|
||||
format_on_save = function(bufnr)
|
||||
if vim.g.disable_autoformat or vim.b[bufnr].disable_autoformat then
|
||||
return
|
||||
end
|
||||
return { timeout_ms = 1000, lsp_format = 'fallback' }
|
||||
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