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 :)
This commit is contained in:
ahhshm 2022-07-26 11:10:27 +04:30 committed by Sidhanth Rathod
parent be5fe4ea62
commit a522cebca8
1 changed files with 7 additions and 3 deletions

View File

@ -1,15 +1,19 @@
local opt = vim.opt local opt = vim.opt
local g = vim.g local g = vim.g
local config = require("core.utils").load_config() local config = require("core.utils").load_config()
local vim_version = vim.version()
g.nvchad_theme = config.ui.theme g.nvchad_theme = config.ui.theme
g.toggle_theme_icon = "" g.toggle_theme_icon = ""
g.transparency = config.ui.transparency g.transparency = config.ui.transparency
g.theme_switcher_loaded = false g.theme_switcher_loaded = false
-- use filetype.lua instead of filetype.vim -- 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.did_load_filetypes = 0
g.do_filetype_lua = 1 g.do_filetype_lua = 1
end
opt.laststatus = 3 -- global statusline opt.laststatus = 3 -- global statusline
opt.showmode = false opt.showmode = false