vim.g.netrw_banner = 0 vim.opt.nu = true vim.opt.relativenumber = true vim.opt.cursorline = true vim.opt.cursorlineopt = "both" vim.opt.autoread = true vim.opt.tabstop = 4 vim.opt.softtabstop = 4 vim.opt.shiftwidth = 4 vim.opt.expandtab = true vim.opt.smartindent = true vim.opt.inccommand = "split" vim.opt.splitbelow = true vim.opt.splitright = true vim.opt.ignorecase = true vim.opt.smartcase = true vim.opt.laststatus = 3 vim.opt.swapfile = false vim.opt.backup = false vim.opt.undodir = vim.fn.stdpath("data") .. "/undodir" vim.opt.undofile = true vim.opt.completeopt = "menuone,noselect,fuzzy,nosort" vim.opt.shortmess:append("c") vim.opt.clipboard:append("unnamedplus") vim.opt.isfname:append("@-@") vim.opt.guicursor = "" vim.opt.scrolloff = 8 vim.opt.colorcolumn = "0" vim.opt.signcolumn = "yes" vim.opt.termguicolors = true vim.api.nvim_create_autocmd("TextYankPost", { desc = "Highlight when yanking (copying) text", callback = function() vim.hl.on_yank() end, }) vim.opt.foldlevel = 99 -- 打开文件时默认展开所有折叠