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

Add a feature to map left Option key to Meta #1321

Open
huyz opened this issue Oct 21, 2022 · 2 comments
Open

Add a feature to map left Option key to Meta #1321

huyz opened this issue Oct 21, 2022 · 2 comments
Labels
Input Issues related to keyboard or other types of input

Comments

@huyz
Copy link

huyz commented Oct 21, 2022

Is your feature request about something that is currently impossible or hard to do? Please describe the problem.

I don't really use accented characters using the macOS compose key. So I like to treat the left Option key as an additional modifier for more key mapping space. Creating these mappings for the text version of vim running inside of iTerm works great because I have the setting "Left Option key: Esc+".

The problem is that in MacVim, the Left Option key continues to act like the macOS Compose key. That means that I have to add to my .vimrc a bunch of mappings like:

nmap ß <M-s>
imap ß <M-s>

Describe the solution you'd like
Like VimR, let me map the left Option key as Meta:
screenshot 2022-10-21T045627Z

Describe alternatives you've considered
Add a bunch of alias mappings like:

nmap ß <M-s>
imap ß <M-s>
@ychin ychin added this to the Release 176 milestone Oct 22, 2022
@ychin
Copy link
Member

ychin commented Oct 22, 2022

Summary: For now, you can add :set macmeta to vimrc, which will do the same thing. For historical reasons, it's a Vim configuration (meaning you need to call it in Vim or set it in vimrc) instead of a GUI option like VimR. However, doing so will convert both left and right Option keys as Meta, but if you don't care about accent keys, you can just set that.


More details:

That said, I do intend to tackle input handling in a future release, probably the next one (after the current one I'm working on): https://github.com/macvim-dev/macvim/milestone/22. It's a lot easier to do everything in one go as I go around tackling different parts of the problem. For one, MacVim needs to implement "modifyOtherKeys", or in plain terms "Being able to handle Ctrl-I and Tab differently". The other aspect is that you would not need to think about "Meta" keys at all. After all, "meta" keys are a complete implementation detail, and you shouldn't need to think about it and should be able to to map something like <M-i> as is without configuration, while still preserving the ability to do accent keys. There are still some details that I'm ironing out, but just a heads up for that. If you use the binary release, you would see from the release notes when I make that change and can switch to using the new settings as I deprecate set macmeta. For now you can just use that option (when I say "deprecate" I don't mean it will stop working, just that it would no longer be the preferred way of doing things)

@huyz
Copy link
Author

huyz commented Oct 22, 2022

Thanks @ychin, I appreciate the tip, your future plans, and your explanation

@ychin ychin added the Input Issues related to keyboard or other types of input label Nov 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Input Issues related to keyboard or other types of input
Projects
None yet
Development

No branches or pull requests

2 participants