From 041fd6bd70a0e45156d4e281fa5817dd2e7b025e Mon Sep 17 00:00:00 2001 From: Sheldon Lee Date: Thu, 11 Jan 2024 23:45:24 +0800 Subject: [PATCH] Add neoformat plugin and update configuration --- .config/nvim/after/plugin/lsp.lua | 2 +- .config/nvim/lua/sheldonmlee/packer.lua | 2 ++ .config/nvim/lua/sheldonmlee/set.lua | 8 +++++++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.config/nvim/after/plugin/lsp.lua b/.config/nvim/after/plugin/lsp.lua index 7cced73..6dbc831 100644 --- a/.config/nvim/after/plugin/lsp.lua +++ b/.config/nvim/after/plugin/lsp.lua @@ -29,7 +29,7 @@ end) -- (Optional) Configure lua language server for neovim require('lspconfig').lua_ls.setup(lsp.nvim_lua_ls()) -lsp.skip_server_setup({'ltex'}) +-- lsp.skip_server_setup({'ltex'}) lsp.setup() diff --git a/.config/nvim/lua/sheldonmlee/packer.lua b/.config/nvim/lua/sheldonmlee/packer.lua index 7533644..6bd05d1 100644 --- a/.config/nvim/lua/sheldonmlee/packer.lua +++ b/.config/nvim/lua/sheldonmlee/packer.lua @@ -44,6 +44,8 @@ return require('packer').startup(function(use) } } + use 'sbdchd/neoformat' + use 'lervag/vimtex' use 'nvim-lua/plenary.nvim' diff --git a/.config/nvim/lua/sheldonmlee/set.lua b/.config/nvim/lua/sheldonmlee/set.lua index ea7989c..e65fadd 100644 --- a/.config/nvim/lua/sheldonmlee/set.lua +++ b/.config/nvim/lua/sheldonmlee/set.lua @@ -22,8 +22,14 @@ vim.opt.scrolloff = 8 -- 'no' disables signcolumn vim.opt.signcolumn = 'no' +--vim.api.nvim_create_autocmd('BufWritePre', { +-- pattern = { '*.tsx', '*.ts', '*.jsx', '*.js' }, +-- command = 'silent! EslintFixAll', +-- group = vim.api.nvim_create_augroup('Eslint', {}), +--}) + vim.api.nvim_create_autocmd('BufWritePre', { pattern = { '*.tsx', '*.ts', '*.jsx', '*.js' }, - command = 'silent! EslintFixAll', + command = 'silent! Neoformat', group = vim.api.nvim_create_augroup('Eslint', {}), })