-- DEBUG: set an sepearate environment while debugging functionset_rtpath() vim.opt.rtp:prepend("/Absolute/Path/To/Your/Dev/Dir") -- 這裡填寫你正在開發的這個工作目錄的絕對路徑 end -- DEBUG: end env settings
-- DEBUG: Move this when using it set_rtpath() -- DEBUG
-- Load user defined settings after Lazy initialization vim.api.nvim_create_autocmd('User', { pattern = 'LazyVimStarted', callback = function() vim.schedule(function() -- 這裡是在插件加載之後加載的全局配置, 會覆蓋插件的一些行為 require('default.config.keymaps').apply() require('default.config.options').apply() require('default.config.autocmd').apply() require('default.config.diagnostics').apply() end) end, })
-- set global leader vim.g.mapleader = ' ' vim.g.maplocalleader = ' '
-- set lazy path local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim' ifnot (vim.uv or vim.loop).fs_stat(lazypath) then local lazyrepo = 'https://github.com/folke/lazy.nvim.git' local out = vim.fn.system { 'git', 'clone', '--filter=blob:none', '--branch=stable', lazyrepo, lazypath } if vim.v.shell_error ~= 0then error('Error cloning lazy.nvim:\n' .. out) end end---@diagnostic disable-next-line: undefined-field vim.opt.rtp:prepend(lazypath)
-- import plugins require('lazy').setup { -- all the plugins' configure files should be put under `lua/plugins` spec = { { import = 'default.plugins' }, }, -- }, --[[@as LazySpec]] { -- Configure any other `lazy.nvim` configuration options here
install = { colorscheme = { 'catppuccin' }, }, ui = { backdrop = 100, border = 'rounded', }, performance = { rtp = { -- disable some rtp plugins, add more to your liking disabled_plugins = {}, }, }, config = function() -- apply options and keymaps -- must be put here as hook because plugin loading is async -- require('default.config.autocmd') end, } --[[@as LazyConfig]]