Compare commits

..

2 Commits

2 changed files with 37 additions and 30 deletions

View File

@ -1,31 +1,34 @@
return {
{
"pysan3/fcitx5.nvim",
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,
-- ins = tw,
-- cmd = en,
-- },
-- remember_prior = false,
-- })
-- -- If you are using `jk` to escape, map 全角のjk.
-- vim.cmd([[
-- inoremap <silent> <Esc>
-- tnoremap <silent> <Esc>
-- ]])
end,
"Freed-Wu/ime.nvim",
},
-- {
-- "pysan3/fcitx5.nvim",
-- 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,
-- -- ins = tw,
-- -- cmd = en,
-- -- },
-- -- remember_prior = false,
-- -- })
--
-- -- -- If you are using `jk` to escape, map 全角のjk.
-- -- vim.cmd([[
-- -- inoremap <silent> <Esc>
-- -- tnoremap <silent> <Esc>
-- -- ]])
-- end,
-- },
}

View File

@ -1,7 +1,9 @@
local servers = require("lsp.config.lsp_servers").lsp_servers
local lspconfig = require("lspconfig")
local capabilities = require("cmp_nvim_lsp").default_capabilities()
-- Neovim 版本要在 0.10 以上才啟用
local is_nvim_010 = vim.fn.has("nvim-0.10") == 1
local capabilities = is_nvim_010 and require("cmp_nvim_lsp").default_capabilities() or nil
local on_attach = function(_, bufnr)
local map = function(mode, lhs, rhs)
@ -18,7 +20,9 @@ end
for _, name in ipairs(servers) do
local ok, config = pcall(require, "lsp.servers." .. name)
if not ok then config = {} end
config.capabilities = capabilities
if capabilities then
config.capabilities = capabilities
end
config.on_attach = on_attach
lspconfig[name].setup(config)
end