fix nvim: 判斷要在0.10以上版本,才要載入LSP功能

This commit is contained in:
Yuan Chiu 2025-05-06 17:06:18 +08:00
parent 80e6591ce1
commit 40e6a49141
2 changed files with 6 additions and 1 deletions

View File

@ -1,3 +1,6 @@
-- 如果nvim不在0.10以上,則不載入
if not vim.fn.has("nvim-0.10") == 1 then return {} end
-- 專責 LSP / 補全相關 plugin 定義
return {
-- 依照mason官方教學抄過來 https://github.com/williamboman/mason-lspconfig.nvim

View File

@ -4,5 +4,7 @@ require("config.keymaps_nvim")
require("config.keymaps")
require("config.gui")
require("config.lazy") -- 初始化 Lazy.nvim
if vim.fn.has("nvim-0.10") == 1 then
require("lsp") -- LSP 與 cmp 設定
end
require("config.terminal") -- 因為會被lazy.nvim override所以要放在最後