nvim: 判斷當前終端機是否在圖形環境裡

This commit is contained in:
2025-05-06 20:37:27 +08:00
parent 5869fb71b8
commit d220d0ffa2
3 changed files with 26 additions and 3 deletions

View File

@@ -63,6 +63,7 @@ return {
{
"eero-lehtinen/oklch-color-picker.nvim",
enabled = require("tools.gui").is_graphical(),
event = "VeryLazy",
version = "*",
keys = {

View File

@@ -2,11 +2,13 @@ return {
-- 測試狀況Linux Fcitx5 Wayland 可用 / macOS 15 不可用
-- {
-- "Freed-Wu/ime.nvim",
-- enabled = require("tools.gui").is_graphical(),
-- },
-- 測試狀況Linux Fcitx5 Wayland 可用 / macOS 15 可用
{
"keaising/im-select.nvim",
enabled = require("tools.gui").is_graphical(),
config = function()
require("im_select").setup({})
end,
@@ -15,17 +17,18 @@ return {
-- 測試狀況Linux Fcitx5 Wayland 可用
-- {
-- "pysan3/fcitx5.nvim",
-- enabled = require("tools.gui").is_graphical(),
-- cond = function()
-- return vim.fn.executable("fcitx5-remote") == 1
-- end,
-- event = { "ModeChanged" }, -- 在模式改變時載入插件
-- config = function()
-- require("fcitx5").setup() -- 初始化插件
--
-- -- 以下是手動指定規則
-- -- local en = "keyboard-us"
-- -- local tw = "chewing"
--
-- -- require("fcitx5").setup({
-- -- imname = {
-- -- norm = en,
@@ -34,7 +37,7 @@ return {
-- -- },
-- -- remember_prior = false,
-- -- })
--
-- -- -- If you are using `jk` to escape, map 全角のjk.
-- -- vim.cmd([[
-- -- inoremap <silent> <Esc>