Update formatting/highlighting settings for treesitter/nvim

This commit is contained in:
Sheldon Lee 2023-11-21 17:32:46 +08:00
parent 48b8e7f35b
commit 5f468b232b
2 changed files with 11 additions and 1 deletions

View File

@ -22,6 +22,6 @@ require'nvim-treesitter.configs'.setup {
-- Set this to `true` if you depend on 'syntax' being enabled (like for indentation). -- 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. -- 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 -- Instead of true it can also be a list of languages
additional_vim_regex_highlighting = false, additional_vim_regex_highlighting = true,
}, },
} }

View File

@ -1,11 +1,15 @@
vim.opt.number = true vim.opt.number = true
vim.opt.relativenumber = true vim.opt.relativenumber = true
vim.cmd.syntax("enable")
vim.opt.smartindent = true vim.opt.smartindent = true
vim.opt.tabstop = 4 vim.opt.tabstop = 4
vim.opt.softtabstop = 4 vim.opt.softtabstop = 4
vim.opt.shiftwidth = 4 vim.opt.shiftwidth = 4
vim.opt.linebreak = true
vim.opt.incsearch = true vim.opt.incsearch = true
vim.opt.ignorecase = true vim.opt.ignorecase = true
vim.opt.smartcase = 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. -- 'auto:1 sets signcolumn to hide if there is no warning/error etc.
-- 'no' disables signcolumn -- 'no' disables signcolumn
vim.opt.signcolumn = 'no' 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', {}),
})