autocmds.lua 807 B

12345678910111213141516171819202122232425
  1. -- Autocmds are automatically loaded on the VeryLazy event
  2. -- Default autocmds that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/autocmds.lua
  3. --
  4. -- Add any additional autocmds here
  5. -- with `vim.api.nvim_create_autocmd`
  6. --
  7. -- Or remove existing autocmds by their group name (which is prefixed with `lazyvim_` for the defaults)
  8. -- e.g. vim.api.nvim_del_augroup_by_name("lazyvim_wrap_spell")
  9. -- 自动打开Neotree(使用标准LazyVim方式)
  10. vim.api.nvim_create_autocmd("VimEnter", {
  11. callback = function()
  12. -- 延迟执行,确保插件加载完成
  13. vim.defer_fn(function()
  14. vim.cmd("Neotree show")
  15. end, 50)
  16. end,
  17. })
  18. -- 确保bufferline始终显示
  19. vim.api.nvim_create_autocmd("VimEnter", {
  20. callback = function()
  21. vim.o.showtabline = 2
  22. end,
  23. })