Fix prettier adding weird stuff to files

pull/104/head
Jules Sang 2024-12-02 11:32:54 +01:00
parent d21a8fdcfc
commit efbaa65a62
6 changed files with 64 additions and 76 deletions

View File

@ -1,6 +1,6 @@
{ {
"extras": [ "extras": [
"lazyvim.plugins.extras.coding.codeium"
], ],
"extras.bak": [ "extras.bak": [
"lazyvim.plugins.extras.editor.leap" "lazyvim.plugins.extras.editor.leap"

View File

@ -1,10 +1,12 @@
return { return {}
{ "Mofiqul/vscode.nvim", config = {} },
{ "catppuccin/nvim", name = "catppuccin" }, -- return {
{ -- { "Mofiqul/vscode.nvim", config = {} },
"jul-o/LazyVim", -- { "catppuccin/nvim", name = "catppuccin" },
opts = { -- {
colorscheme = "catppuccin-mocha", -- "jul-o/LazyVim",
}, -- opts = {
}, -- colorscheme = "catppuccin-mocha",
} -- },
-- },
-- }

View File

@ -1,26 +1,28 @@
local augroup = vim.api.nvim_create_augroup("LspFormatting", {}) return {}
return { -- local augroup = vim.api.nvim_create_augroup("LspFormatting", {})
"nvimtools/none-ls.nvim", --
opts = function(_, opts) -- return {
local nls = require("none-ls") -- "nvimtools/none-ls.nvim",
opts.sources = vim.list_extend(opts.sources or {}, { -- opts = function(_, opts)
nls.builtins.diagnostics.markdownlint, -- local nls = require("none-ls")
}) -- opts.sources = vim.list_extend(opts.sources or {}, {
-- table.insert(opts.sources, nls.builtins.formatting.prettierd) -- nls.builtins.diagnostics.markdownlint,
end, -- })
config = { -- -- table.insert(opts.sources, nls.builtins.formatting.prettierd)
on_attach = function(client, bufnr) -- end,
if client.supports_method("textDocument/formatting") then -- config = {
vim.api.nvim_clear_autocmds({ group = augroup, buffer = bufnr }) -- on_attach = function(client, bufnr)
vim.api.nvim_create_autocmd("BufWritePre", { -- if client.supports_method("textDocument/formatting") then
group = augroup, -- vim.api.nvim_clear_autocmds({ group = augroup, buffer = bufnr })
buffer = bufnr, -- vim.api.nvim_create_autocmd("BufWritePre", {
callback = function() -- group = augroup,
vim.lsp.buf.format() -- buffer = bufnr,
end, -- callback = function()
}) -- vim.lsp.buf.format()
end -- end,
end, -- })
}, -- end
} -- end,
-- },
-- }

View File

@ -1,6 +1,8 @@
return { return {}
"rcarriga/nvim-notify",
keys = { -- return {
{ "<esc>", require("notify").dismiss }, -- "rcarriga/nvim-notify",
}, -- keys = {
} -- { "<esc>", require("notify").dismiss },
-- },
-- }

View File

@ -1,14 +1,16 @@
return { return {}
"hrsh7th/nvim-cmp",
dependencies = { -- return {
{ "roobert/tailwindcss-colorizer-cmp.nvim", config = true }, -- "hrsh7th/nvim-cmp",
}, -- dependencies = {
opts = function(_, opts) -- { "roobert/tailwindcss-colorizer-cmp.nvim", config = true },
-- original LazyVim kind icon formatter -- },
local format_kinds = opts.formatting.format -- opts = function(_, opts)
opts.formatting.format = function(entry, item) -- -- original LazyVim kind icon formatter
format_kinds(entry, item) -- add icons -- local format_kinds = opts.formatting.format
return require("tailwindcss-colorizer-cmp").formatter(entry, item) -- opts.formatting.format = function(entry, item)
end -- format_kinds(entry, item) -- add icons
end, -- return require("tailwindcss-colorizer-cmp").formatter(entry, item)
} -- end
-- end,
-- }

View File

@ -1,20 +0,0 @@
return {
"MunifTanjim/prettier.nvim",
config = {
bin = "prettier", -- or `'prettierd'` (v0.23.3+)
filetypes = {
"css",
"graphql",
"html",
"javascript",
"javascriptreact",
"json",
"less",
"markdown",
"scss",
"typescript",
"typescriptreact",
"yaml",
},
},
}