wlh320 / rime-ls

A language server for Rime input method engine 通过 LSP 代码补全使用 Rime 输入法
BSD 3-Clause "New" or "Revised" License
181 stars 11 forks source link

希望大佬能够进行lazy.nvim的适配安装。 #12

Open now-ing opened 12 months ago

rainzm commented 12 months ago

这个项目是一个语言服务器,和 lazy.nvim 没有直接的适配关系,他应该和 neovim/nvim-lspconfig 适配吧。 这个文档 nvim.md 写的蛮清楚的。 我用的 lazy.nvim 可以参考下我的配置:https://github.com/rainzm/rainvim/blob/main/lua/plugins/lsp/rime_ls.lua#L3

now-ing commented 12 months ago

好的,谢谢!! 为什么不使用lunarvim ne

rainzm commented 12 months ago

用啥都行,我最早用neovim的时候还没有 lunarvim 这个项目,配置也是一路迁移过来的。自己配的东西比较适合自己吧。

wlh320 commented 12 months ago

我也有在用 lazy.nvim,配置上你也可以参考我的 dotfiles 如果指的是与一些 neovim 现有插件比如 mason,nvim-lspconfig 的适配,等我过段时间有时间的话可能会去做

uuhan commented 8 months ago

贴下我的配置,工作挺好的。

    local configs = require "lspconfig.configs"
    if not configs.rimels then
      configs.rimels = {
        default_config = {
          cmd = { "rime_ls" },
          -- root_dir = require("lspconfig.util").root_pattern ".git",
          root_dir = function() return vim.fn.expand "~/.local/share/rime-data" end,
          filetypes = { "*" },
          init_options = {
            enabled = true,
            shared_data_dir = vim.fn.expand "~/Library/Rime",
            user_data_dir = vim.fn.expand "~/.local/share/rime-data",
            log_dir = vim.fn.expand "~/.local/share/rime-lsp",
            max_candidates = 10, -- [v0.2.0 后不再有用] 与 rime 的候选数量配置最好保持一致
            paging_characters = { "-", "=" }, -- [since v0.2.4] 这些字符会强制触发一次补全,可用于翻页 见 issue #13
            trigger_characters = {}, -- 为空表示全局开启
            schema_trigger_character = "&", -- [since v0.2.0] 当输入此字符串时请求补全会触发 “方案选单”
            always_incomplete = false, -- [since v0.2.3] true 强制补全永远刷新整个列表,而不是使用过滤
            max_tokens = 0, -- [since v0.2.3] 大于 0 表示会在删除到这个字符个数的时候,重建所有候选词,而不使用删除字符操作
            preselect_first = true, -- [since v0.2.3] 是否默认第一个候选项是选中状态,default false
          },
        },
      }
    end

    local rime_ls_enabled = true
    if vim.fn.executable "rime_ls" ~= 0 and rime_ls_enabled then
      -- 启用 rimels
      lspconfig.rimels.setup {}
    end
liubianshi commented 5 months ago

我把自己配置打成了一个插件,可以像普通插件那样用 lazy.nvim 安装