improving startup time by using lazy loading or filetype loading

This commit is contained in:
Jeremie Fraeys 2024-07-21 20:57:00 -04:00
parent bdb655c5a1
commit 7f1b34fd6f
62 changed files with 1285 additions and 561 deletions

View file

@ -1,44 +1,26 @@
-- NOTE: Must happen before plugins are required (otherwise wrong leader will be used)
vim.g.mapleader = ' '
vim.g.maplocalleader = ' '
-- Install package manager
-- https://github.com/folke/lazy.nvim
-- Check Lua documentation for more info
local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim'
local lazypath = vim.fn.stdpath('data') .. '/lazy/lazy.nvim'
if not vim.loop.fs_stat(lazypath) then
vim.fn.system {
vim.fn.system({
'git',
'clone',
'--filter=blob:none',
'https://github.com/folke/lazy.nvim.git',
'--branch=stable', -- latest stable release
lazypath,
}
})
end
vim.opt.rtp:prepend(lazypath)
vim.opt.rtp:prepend(vim.env.LAZY or lazypath)
local opts = {
git = { log = { '--since=3 days ago' } },
ui = { custom_keys = { false } },
checker = { enabled = false },
colorscheme = "monokai",
}
require('lazy').setup({
-- Git related plugins
'tpope/vim-fugitive',
'tpope/vim-rhubarb',
-- Detect tabstop and shiftwidth automatically
'tpope/vim-sleuth',
{
import = 'custom.plugins',
exclude = 'custom.plugins.mason',
},
}, opts)
vim.g.mapleader = ' '
vim.g.maplocalleader = ' '
require('config.lazy')
require('config.autocmds')
require('config.options')
require('config.mappings')
require('config.utils')
require('config.themes')
vim.cmd('filetype plugin on')