From a522cebca81ee8f472701de3fd24296ede8377bd Mon Sep 17 00:00:00 2001 From: ahhshm <87268103+ahhshm@users.noreply.github.com> Date: Tue, 26 Jul 2022 11:10:27 +0430 Subject: [PATCH] fix(options): don't set `did_load_filetypes` in neovim nightly Lua filetype detection is enabled by default in neovim nightly so we don't need those two options. The reason we can't simply override them in `custom/init.lua` is that setting `did_load_filetypes` to any value, completely disables filetype detection (and therefore syntax highlighting) and this may confuse people that use neovim nightly. I know NvChad doesn't officially support neovim nightly but people may want to try it to see the new features and this PR makes their life easier. Also, you do a similar check in `plugins/configs/lspconfig.lua` so I thought it's ok :) --- lua/core/options.lua | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lua/core/options.lua b/lua/core/options.lua index b2dbdbf..d8f7fe7 100644 --- a/lua/core/options.lua +++ b/lua/core/options.lua @@ -1,15 +1,19 @@ local opt = vim.opt local g = vim.g local config = require("core.utils").load_config() +local vim_version = vim.version() g.nvchad_theme = config.ui.theme g.toggle_theme_icon = "  " g.transparency = config.ui.transparency g.theme_switcher_loaded = false --- use filetype.lua instead of filetype.vim -g.did_load_filetypes = 0 -g.do_filetype_lua = 1 +-- use filetype.lua instead of filetype.vim. it's enabled by default in neovim 0.8 (nightly) +if vim_version.minor < 8 then + g.did_load_filetypes = 0 + g.do_filetype_lua = 1 +end + opt.laststatus = 3 -- global statusline opt.showmode = false