From 6b507c33682a935d6d92f4f0c15105fa7a67b69b Mon Sep 17 00:00:00 2001 From: Akianonymus Date: Mon, 19 Jul 2021 06:40:38 +0530 Subject: [PATCH] init: Asynchronously load filetype and syntax lots of improvement for startup time Co-authored-by: Vhyrro --- lua/options.lua | 7 +++++++ lua/theme.lua | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/lua/options.lua b/lua/options.lua index a12332e..2210681 100644 --- a/lua/options.lua +++ b/lua/options.lua @@ -1,6 +1,13 @@ 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 5356706..85bf895 100644 --- a/lua/theme.lua +++ b/lua/theme.lua @@ -3,6 +3,13 @@ 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