This commit is contained in:
Young Xu 2023-02-22 19:25:24 +08:00
parent f090ecb4ec
commit 8dafdf51b7
Signed by: xuthus5
GPG Key ID: A23CF9620CBB55F9
3 changed files with 25 additions and 0 deletions

View File

@ -16,6 +16,7 @@ git clone --depth 1 https://github.com/wbthomason/packer.nvim\
```bash
sudo dnf install fd-find ripgrep -y
go install github.com/jesseduffield/lazygit@latest
sudo npm install -g @fsouza/prettierd
```
### 记忆项

View File

@ -1,9 +1,32 @@
local prettier = require("prettier")
prettier.setup({
bin = "prettier", -- or `'prettierd'` (v0.22+)
filetypes = {
"css",
"graphql",
"html",
"javascript",
"javascriptreact",
"json",
"less",
"markdown",
"scss",
"typescript",
"typescriptreact",
"yaml",
},
})
local augroup = vim.api.nvim_create_augroup("LspFormatting", {})
local null_ls = require("null-ls")
require("null-ls").setup({
sources = {
null_ls.builtins.formatting.gofmt,
null_ls.builtins.formatting.stylua,
null_ls.builtins.diagnostics.eslint_d.with({
diagnostics_format = "[eslint] #{m}\n(#{c})",
}),
},
-- you can reuse a shared lspconfig on_attach callback here
on_attach = function(client, bufnr)

View File

@ -78,6 +78,7 @@ return require("packer").startup(function(use)
})
-- 格式化
use({ "jose-elias-alvarez/null-ls.nvim" })
use({ "MunifTanjim/prettier.nvim" })
-- 项目管理
use({ "ahmedkhalf/project.nvim" })
-- 优化启动速度