Skip to content

feat(Squirrel cli): add --ascii, --nascii and --getascii#1070

Merged
lotem merged 2 commits into
rime:masterfrom
Parsifa1:ascii-noascii
Jun 2, 2026
Merged

feat(Squirrel cli): add --ascii, --nascii and --getascii#1070
lotem merged 2 commits into
rime:masterfrom
Parsifa1:ascii-noascii

Conversation

@Parsifa1
Copy link
Copy Markdown
Contributor

ref #797 #123
close #774

add --ascii --nascii getascii

api 参考了 rime/weasel#1113

我不是特别了解swift

该pr在 ai 的辅助下完成 我在本地测试了这几个功能 如果有写的不符合普遍范式的情况可以直接修改或者review提出来(

@Parsifa1 Parsifa1 changed the title feat(Squirrel cli): add --ascii && --nascii --getascii feat(Squirrel cli): add --ascii, --nascii and --getascii Sep 21, 2025
@Parsifa1
Copy link
Copy Markdown
Contributor Author

cal be used in :

local current = vim.fn.system "/Library/Input\\ Methods/Squirrel.app/Contents/MacOS/Squirrel --getascii"

function Switch_to_English_input_method()
  current = vim.fn.system "/Library/Input\\ Methods/Squirrel.app/Contents/MacOS/Squirrel --getascii"
  if current ~= "ascii" then
    vim.fn.system "/Library/Input\\ Methods/Squirrel.app/Contents/MacOS/Squirrel --ascii"
  end
end

function Set_input_method()
  if current ~= "ascii" then
    vim.fn.system(
      "/Library/Input\\ Methods/Squirrel.app/Contents/MacOS/Squirrel --" .. string.gsub(current, "\n", "")
    )
  end
end

vim.cmd [[
augroup input_method
  autocmd!
  autocmd InsertEnter * :lua Set_input_method()
  autocmd InsertLeave * :lua Switch_to_English_input_method()
augroup END
]]

@wesleyel
Copy link
Copy Markdown

wesleyel commented Jun 2, 2026

Nice PR!

我编译了一份, 结合VSCode semantic token type 做了一个小扩展来切换中英模式.

性能和体验都很不错.

@lotem
Copy link
Copy Markdown
Member

lotem commented Jun 2, 2026

小狼毫那邊已經合併了

@lotem lotem merged commit 77098ab into rime:master Jun 2, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

能否提供一个命令行接口,来切换中英文状态?

3 participants