diff --git a/lua/core/options.lua b/lua/core/options.lua index d8f7fe7..6673303 100644 --- a/lua/core/options.lua +++ b/lua/core/options.lua @@ -1,15 +1,15 @@ local opt = vim.opt local g = vim.g local config = require("core.utils").load_config() -local vim_version = vim.version() +g.vim_version = vim.version().minor 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. it's enabled by default in neovim 0.8 (nightly) -if vim_version.minor < 8 then +if g.vim_version < 8 then g.did_load_filetypes = 0 g.do_filetype_lua = 1 end diff --git a/lua/plugins/configs/lspconfig.lua b/lua/plugins/configs/lspconfig.lua index f69c5c3..4b83eab 100644 --- a/lua/plugins/configs/lspconfig.lua +++ b/lua/plugins/configs/lspconfig.lua @@ -13,9 +13,7 @@ local utils = require "core.utils" -- export on_attach & capabilities for custom lspconfigs M.on_attach = function(client, bufnr) - local vim_version = vim.version() - - if vim_version.minor > 7 then + if vim.g.vim_version > 7 then -- nightly client.server_capabilities.documentFormattingProvider = false client.server_capabilities.documentRangeFormattingProvider = false