feat: change nvim config to AstroNvim

This commit is contained in:
2026-03-25 09:19:31 +08:00
parent d868f4ec4c
commit 3be61685ff
25 changed files with 580 additions and 354 deletions

View File

@@ -1,8 +1,27 @@
require("config.lazy")
-- 基础缩进设置
vim.opt.tabstop = 4 -- 1个Tab显示为4个空格
vim.opt.shiftwidth = 4 -- 自动缩进时缩进4个空格
vim.opt.expandtab = true -- 把Tab键变成空格现代编程通用习惯
vim.opt.softtabstop = 4 -- 编辑模式下按退格键退回4个空格
-- 显示行数
vim.opt.number = true
-- This file simply bootstraps the installation of Lazy.nvim and then calls other files for execution
-- This file doesn't necessarily need to be touched, BE CAUTIOUS editing this file and proceed at your own risk.
local lazypath = vim.env.LAZY or vim.fn.stdpath "data" .. "/lazy/lazy.nvim"
if not (vim.env.LAZY or (vim.uv or vim.loop).fs_stat(lazypath)) then
-- stylua: ignore
local result = vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", "--branch=stable", lazypath })
if vim.v.shell_error ~= 0 then
-- stylua: ignore
vim.api.nvim_echo({ { ("Error cloning lazy.nvim:\n%s\n"):format(result), "ErrorMsg" }, { "Press any key to exit...", "MoreMsg" } }, true, {})
vim.fn.getchar()
vim.cmd.quit()
end
end
vim.opt.rtp:prepend(lazypath)
-- validate that lazy is available
if not pcall(require, "lazy") then
-- stylua: ignore
vim.api.nvim_echo({ { ("Unable to load lazy from: %s\n"):format(lazypath), "ErrorMsg" }, { "Press any key to exit...", "MoreMsg" } }, true, {})
vim.fn.getchar()
vim.cmd.quit()
end
require "lazy_setup"
require "polish"