Compare commits

..

2 Commits

Author SHA1 Message Date
d220d0ffa2 nvim: 判斷當前終端機是否在圖形環境裡 2025-05-06 20:37:27 +08:00
5869fb71b8 fix packages 2025-05-06 20:37:06 +08:00
4 changed files with 38 additions and 3 deletions

View File

@ -45,6 +45,8 @@ apt = [
'eza',
'neovim',
'ueberzug',
'ripgrep',
'tree-sitter-cli',
]
# Debian -----------------------------------------------------------------------
@ -65,6 +67,8 @@ apt = [
'vim',
'git',
'gcc',
'ripgrep',
'tree-sitter-cli',
]
apt_13 = [
@ -92,12 +96,15 @@ pacman = [
'cmake',
'zsh',
'lsix',
'imagemagick',
'ueberzugpp',
'eza',
'grc',
'zellij',
'ranger',
'neovim',
'ripgrep',
'tree-sitter',
]
pacman_nogui = [
'vim',
@ -135,6 +142,7 @@ pacman = [
'cmake',
'zsh',
'lsix',
'imagemagick',
'ueberzugpp',
'eza',
'grc',
@ -146,6 +154,10 @@ pacman = [
'nodejs',
'npm',
'jdk-openjdk',
'ripgrep',
'tree-sitter',
'tree-sitter-bash',
'tree-sitter-cli',
]
pacman_nogui = [
'vim',

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>

View File

@ -0,0 +1,19 @@
local M = {}
--- 當前終端機環境是否在圖形環境裡面Linux / macOS
--- @return boolean is_gui
function M.is_graphical()
local env = vim.env
local term_program = env.TERM_PROGRAM -- macOS GUI 終端機常見
local display = env.DISPLAY -- Linux X11
local wayland = env.WAYLAND_DISPLAY -- Linux Wayland
local ssh = env.SSH_CONNECTION or env.SSH_CLIENT
if ssh then
return false
end
return term_program or display or wayland and true or false
end
return M