{"id":24515553,"url":"https://github.com/mkdir700/im-select-remote.nvim","last_synced_at":"2026-05-08T15:20:18.852Z","repository":{"id":172161443,"uuid":"648926695","full_name":"mkdir700/im-select-remote.nvim","owner":"mkdir700","description":"A VIM input method switching plugin implemented based on SSH forwarding and Socket communication. 一个基于 SSH 转发和 Socket 通信实现的 VIM 输入法切换插件","archived":false,"fork":false,"pushed_at":"2024-03-15T01:26:40.000Z","size":40,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-11T20:42:52.429Z","etag":null,"topics":["im-select","neovim","plugin","vim"],"latest_commit_sha":null,"homepage":"","language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mkdir700.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-06-03T08:16:56.000Z","updated_at":"2024-03-19T04:19:28.000Z","dependencies_parsed_at":null,"dependency_job_id":"b0406f16-0fe2-44ab-98bd-27d20f7f8495","html_url":"https://github.com/mkdir700/im-select-remote.nvim","commit_stats":null,"previous_names":["mkdir700/im-select-osc.nvim"],"tags_count":3,"template":false,"template_full_name":"ellisonleao/nvim-plugin-template","purl":"pkg:github/mkdir700/im-select-remote.nvim","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkdir700%2Fim-select-remote.nvim","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkdir700%2Fim-select-remote.nvim/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkdir700%2Fim-select-remote.nvim/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkdir700%2Fim-select-remote.nvim/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mkdir700","download_url":"https://codeload.github.com/mkdir700/im-select-remote.nvim/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkdir700%2Fim-select-remote.nvim/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32785679,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-08T08:22:46.396Z","status":"ssl_error","status_checked_at":"2026-05-08T08:22:45.650Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["im-select","neovim","plugin","vim"],"created_at":"2025-01-22T01:18:17.979Z","updated_at":"2026-05-08T15:20:18.832Z","avatar_url":"https://github.com/mkdir700.png","language":"Lua","funding_links":[],"categories":[],"sub_categories":[],"readme":"# IM-Select-Remote\n\n![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/mkdir700/im-select-remote/default.yml?branch=main\u0026style=for-the-badge)\n![Lua](https://img.shields.io/badge/Made%20with%20Lua-blueviolet.svg?style=for-the-badge\u0026logo=lua)\n\n基于 SSH 转发和 Socket 通信的 VIM 输入法切换插件。\n\n## 介绍\n\n切换输入法您需要安装第三方工具，我这里推荐使用 [im-select](https://github.com/daipeihust/im-select)，当我执行如下命令即可切换至 ABC 输入法：\n\n```\nim-select com.apple.keylayout.ABC\n```\n\n所以，逻辑非常简单，就是让远程服务器调用本机用于切换输入法的命令即可。\n\n## 安装\n\n- packer\n\n```lua\nuse { 'mkdir700/im-select-remote' }\n```\n\n- lazyvim\n\n```lua\n{\n  \"mkdir700/im-select-remote\",\n  config = function()\n    require('im-select-remote').setup()\n  end\n}\n```\n\n## 配置\n\n### 插件配置\n\n默认配置如下：\n\n```lua\nM.config = {\n  osc = {\n    secret = \"\",\n  },\n  socket = {\n    port = 23333,\n    max_retry_count = 3,\n    command = \"im-select com.apple.keylayout.ABC\",\n  },\n}\n```\n\n### SSH + Socket (推荐)\n\n#### 配置 SSH\n\n配置文件路径：`~/.ssh/config`\n\n- 本机\n\n```\nHost \u003cyour server name\u003e\n  HostName \u003cyour hostname\u003e\n  User \u003cusername\u003e\n  Port 22\n  RemoteForward 127.0.0.1:23333 127.0.0.1:23333  -- 用于端口转发\n  ServerAliveInterval 240\nHost *\n  ForwardAgent yes\n```\n\n\u003e 注意：`RemoteForward` 用于端口转发，`ServerAliveInterval` 用于保持连接。\n\u003e `RemoteForward` 的第一个参数是远程服务器的地址，第二个参数是本地机器的地址。\n\n- 远程服务器\n\n```\nHost local\n  HostName localhost\n  Port 23333\n  User \u003cusername\u003e\n```\n\n#### 启动 Socket 服务\n\nIM-Select-Remote 可以连接 Socket 服务以通知本地机器切换输入法，所以本地机器需要开启一个 Socket 服务。\n\n```bash\ngit clone https://github.com/mkdir700/im-select-remote.git\nchmod +x ./im-select-remote/server/im_server.sh\n./im-select-remote/server/im-server.sh\n```\n\n##### 自启动\n\nMac OS:\n\n```bash\nlaunchctl load ./launch/localhost.im-server.plist\nlaunchctl start localhost.im-select.plist\nlaunchctl status localhost.im-select.plist\n```\n\nLinux:\n\n```bash\nTODO\n```\n\nWindows:\n\n\n```bash\nTODO\n```\n\n注意：\n\n打开 NVIM 后，IM-Select-Remote 会去判断是否已配置 SSH，这将作为是否自动连接的前提条件。如果检查通过将连接 Socket 服务，否则最多重试三次后就放弃连接。\n\n此外，您也可以执行 `IMSelectSocketEnable` 进行手动连接。\n\n### OSC (等待测试)\n\nTODO\n\n## 使用\n\n自动切换输入法的触发时机：\n\n- 进入缓冲区时\n- 从输入模式回到正常模式时\n\n## 感谢\n\n- https://github.com/daipeihust/im-select\n- https://github.com/ojroques/nvim-osc52\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmkdir700%2Fim-select-remote.nvim","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmkdir700%2Fim-select-remote.nvim","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmkdir700%2Fim-select-remote.nvim/lists"}