From 936f368036f56a84e66a5f1f55428c2ecc9211ea Mon Sep 17 00:00:00 2001 From: Akianonymus Date: Fri, 23 Jul 2021 20:19:33 +0530 Subject: [PATCH 1/3] Replace tweekmonster/startuptime.vim with dstein64/vim-startuptime because it's broken now --- lua/pluginList.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/pluginList.lua b/lua/pluginList.lua index 0829a565..88104178 100644 --- a/lua/pluginList.lua +++ b/lua/pluginList.lua @@ -198,7 +198,7 @@ return packer.startup( } use { - "tweekmonster/startuptime.vim", + "dstein64/vim-startuptime", cmd = "StartupTime" } From 6b4435caef3d2f5568896758f790890318500f08 Mon Sep 17 00:00:00 2001 From: Akianonymus Date: Fri, 23 Jul 2021 20:08:20 +0530 Subject: [PATCH 2/3] Don't use new_async It doesn't seem to be improving stuff as it is not supposed to Due to the half baked stats of the startuptime plugin, people were fooled no point in disabling filetype and whatenot See some discussion here: https://github.com/siduck76/NvChad/issues/175 --- init.lua | 19 ++++--------------- lua/options.lua | 7 ------- lua/theme.lua | 7 ------- 3 files changed, 4 insertions(+), 29 deletions(-) diff --git a/init.lua b/init.lua index 805fc326..0e533cca 100644 --- a/init.lua +++ b/init.lua @@ -1,21 +1,10 @@ -require "options" - local chad_modules = { + "options", "pluginList", "mappings", "utils" } -local async -async = - vim.loop.new_async( - vim.schedule_wrap( - function() - for i = 1, #chad_modules, 1 do - pcall(require, chad_modules[i]) - end - async:close() - end - ) -) -async:send() +for i = 1, #chad_modules, 1 do + pcall(require, chad_modules[i]) +end diff --git a/lua/options.lua b/lua/options.lua index cb62d38e..a8ad934a 100644 --- a/lua/options.lua +++ b/lua/options.lua @@ -1,13 +1,6 @@ local opt = vim.opt local g = vim.g --- Turn these off at startup, will be enabled later just before loading the theme -vim.cmd([[ - syntax off - filetype off - filetype plugin indent off -]]) - opt.ruler = false opt.hidden = true opt.ignorecase = true diff --git a/lua/theme.lua b/lua/theme.lua index 85bf8958..53567061 100644 --- a/lua/theme.lua +++ b/lua/theme.lua @@ -3,13 +3,6 @@ vim.g.nvchad_theme = "onedark" local present, base16 = pcall(require, "base16") if present then - -- enabled these options, was disabled in options.lua - vim.cmd([[ - syntax on - filetype on - filetype plugin indent on - ]]) - base16(base16.themes["onedark"], true) require "highlights" return true From 92eb5ca7404081e916b2f58ba15450a5a4870440 Mon Sep 17 00:00:00 2001 From: Akianonymus Date: Fri, 23 Jul 2021 20:41:09 +0530 Subject: [PATCH 3/3] Do not load packer on startup Actually saved some milliseconds, can be observed in benchmarks too from packer readme ``` To optimize startup time, packer.nvim compiles code to perform the lazy-loading operations you specify. This means that you do not need to load packer.nvim unless you want to perform some plugin management operations. ``` Add packer commands manually to mappings.lua, but with basic functionalty By this, we don't losr the packer commands and don't even load at startup After some command is actually executed, it will load the PackerCommands as they were --- init.lua | 1 - lua/mappings.lua | 7 +++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 0e533cca..49bc3ed4 100644 --- a/init.lua +++ b/init.lua @@ -1,6 +1,5 @@ local chad_modules = { "options", - "pluginList", "mappings", "utils" } diff --git a/lua/mappings.lua b/lua/mappings.lua index 0ff8a87d..c59592fb 100644 --- a/lua/mappings.lua +++ b/lua/mappings.lua @@ -146,3 +146,10 @@ map("n", "", ":noh", opt) -- get out of terminal with jk map("t", "jk", "", opt) + +-- Packer commands till because we are not loading it at startup +vim.cmd("silent! command PackerCompile lua require 'pluginList' require('packer').compile()") +vim.cmd("silent! command PackerInstall lua require 'pluginList' require('packer').install()") +vim.cmd("silent! command PackerStatus lua require 'pluginList' require('packer').status()") +vim.cmd("silent! command PackerSync lua require 'pluginList' require('packer').sync()") +vim.cmd("silent! command PackerUpdate lua require 'pluginList' require('packer').update()")