From 5f468b232b6b3cd5fccb7c8c4a58598ff00760aa Mon Sep 17 00:00:00 2001 From: Sheldon Lee Date: Tue, 21 Nov 2023 17:32:46 +0800 Subject: [PATCH] Update formatting/highlighting settings for treesitter/nvim --- .config/nvim/after/plugin/treesitter.lua | 2 +- .config/nvim/lua/sheldonmlee/set.lua | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.config/nvim/after/plugin/treesitter.lua b/.config/nvim/after/plugin/treesitter.lua index f98af3a..4e8325f 100644 --- a/.config/nvim/after/plugin/treesitter.lua +++ b/.config/nvim/after/plugin/treesitter.lua @@ -22,6 +22,6 @@ require'nvim-treesitter.configs'.setup { -- Set this to `true` if you depend on 'syntax' being enabled (like for indentation). -- Using this option may slow down your editor, and you may see some duplicate highlights. -- Instead of true it can also be a list of languages - additional_vim_regex_highlighting = false, + additional_vim_regex_highlighting = true, }, } diff --git a/.config/nvim/lua/sheldonmlee/set.lua b/.config/nvim/lua/sheldonmlee/set.lua index 3ea23dd..ea7989c 100644 --- a/.config/nvim/lua/sheldonmlee/set.lua +++ b/.config/nvim/lua/sheldonmlee/set.lua @@ -1,11 +1,15 @@ vim.opt.number = true vim.opt.relativenumber = true +vim.cmd.syntax("enable") + vim.opt.smartindent = true vim.opt.tabstop = 4 vim.opt.softtabstop = 4 vim.opt.shiftwidth = 4 +vim.opt.linebreak = true + vim.opt.incsearch = true vim.opt.ignorecase = true vim.opt.smartcase = true @@ -17,3 +21,9 @@ vim.opt.scrolloff = 8 -- 'auto:1 sets signcolumn to hide if there is no warning/error etc. -- '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', {}), +})