Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I would like to improve the behavior of vim mode in CJK languages. #16813

Open
1 task done
yasainet opened this issue Aug 24, 2024 · 10 comments
Open
1 task done

I would like to improve the behavior of vim mode in CJK languages. #16813

yasainet opened this issue Aug 24, 2024 · 10 comments
Labels
enhancement [core label] internationalization Feedback for human language support, translations, etc vim

Comments

@yasainet
Copy link

Check for existing issues

  • Completed

Describe the feature

I am Japanese and a zed enthusiast!
I love zed's UI, Design, UX, etc.

However, there are some problems with the CJK language support.

  1. terminal does not allow proper input of CJK languages (this is a separate issue, so I won't go into it here)
  2. vim mode does not support CJK languages well.

Here, we would like to express our hope for vim mode's support for CJK languages.

Switching mode

  • In normal vim, even if the IME is on in normal mode, typing commands such as i, a, and o will switch to insert mode.
  • However, in zed, if the IME is on in normal mode, typing commands such as i, a, and o will not switch to insert mode.

Behavior considering IME switching

Gaze shifting

  • Users of CJK languages (maybe!) expect often check the current IME state and the vim mode.
  • As you can see from the attached screenshot, the eye movement is very large.
  • I am sure that zed I know will solve this UI problem!

CleanShot 2024-08-25 at 08 35 44

If applicable, add mockups / screenshots to help present your vision of the feature

No response

@ConradIrwin
Copy link
Member

@yasainet @huacnlee and I were talking about this in #16278. Would the solution described there of a setting:

{"vim": {
  "normal_keyboard_layout": "com.apple.keylayout.US"
}}

work for you? That way whenever you are in normal mode, the keyboard is a QWERTY keyboard, but when you are in insert mode it restores your previous keyboard layout.

@huacnlee
Copy link
Contributor

I can do a test later. Do I just run that PR code with this setting?

@huacnlee
Copy link
Contributor

Actually in VIM and VS Code with Vim extension, the IME is not auto switch to English keyword when we at the Normal Mode.

Yes, They will go to Insert Mode, when I press i, but that not a good experience, the first i will break the next input, that IME not going to continue get other words.

CleanShot.2024-08-28.at.13.56.40.mp4

So, I usually switch the IME by myself.


@ConradIrwin I have tested that setting in Zed Preview 0.150.4, it is no effect. The IME is still in Chinese in Normal Mode.

@huacnlee
Copy link
Contributor

CleanShot.2024-08-28.at.14.03.39.mp4

@JosephTLyons JosephTLyons added vim internationalization Feedback for human language support, translations, etc and removed triage labels Aug 28, 2024
@yasainet
Copy link
Author

Is there a normal_keyboard_layout configuration item in Zed? I tried to find the source code but I could not find it.

I don't know the details, but on Mac there are US, ABC input sources by default, and I have ABC.
Both can be set from the English preferences.

@ConradIrwin
Copy link
Member

@yasainet this does not yet exist. It was an idea we were thinking about.

It looks like instead we might try to make this "just work" as described here: #17031.

@yasainet
Copy link
Author

@ConradIrwin
Thank you very much! I don't understand English so I read and write using translation software. Sorry for asking questions without understanding the fine nuances.

I will also check the page you presented!

@peng1999
Copy link

peng1999 commented Oct 18, 2024

Related: #7997

@huacnlee says:

Actually in VIM and VS Code with Vim extension, the IME is not auto switch to English keyword when we at the Normal Mode.

Not really. You can configure auto-switching IME in VsCodeVim settings. And we have many plugins (1, 2, 3, 4, etc) to do the same in Vim/Neovim.

@ConradIrwin says:

It looks like instead we might try to make this "just work" as described here: #17031.

I don't think the IME related things will ever be "just work" for Chinese users. We just need an auto-switch function like in VsCodeVim to reduce manual IME switching.

@ConradIrwin
Copy link
Member

We changed the way that Zed works with the IME to send keystrokes to Zed first in most cases. Does this give you what you want on macOS?

I still think we may need IME switching on other platforms.

@iwinux
Copy link

iwinux commented Feb 8, 2025

Related issue: #21042

It still happens with Zed 0.172.10.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement [core label] internationalization Feedback for human language support, translations, etc vim
Projects
None yet
Development

No branches or pull requests

6 participants