mirror of
https://github.com/zhenyan121/dotfiles.git
synced 2026-04-10 06:24:08 +08:00
feat: change nvim config to AstroNvim
This commit is contained in:
@@ -1,19 +1,15 @@
|
||||
if true then return {} end -- WARN: REMOVE THIS LINE TO ACTIVATE THIS FILE
|
||||
|
||||
-- Customize Treesitter
|
||||
|
||||
---@type LazySpec
|
||||
return {
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
version = false, -- 建议使用 master 分支
|
||||
build = ":TSUpdate",
|
||||
event = { "BufReadPost", "BufNewFile" }, -- 只有打开文件时才加载,防止启动报错
|
||||
config = function()
|
||||
-- 增加一个保护性检测
|
||||
local status_ok, configs = pcall(require, "nvim-treesitter.configs")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
configs.setup({
|
||||
ensure_installed = { "lua", "vim", "vimdoc", "query", "c", "cpp" }, -- 基础必装
|
||||
highlight = { enable = true },
|
||||
indent = { enable = true }, -- 建议开启,C++ 缩进会更准确
|
||||
})
|
||||
end,
|
||||
opts = {
|
||||
ensure_installed = {
|
||||
"lua",
|
||||
"vim",
|
||||
-- add more arguments for adding more treesitter parsers
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user