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

macOS: Make cmd+q mappable #2558

Open
chrisgrieser opened this issue May 17, 2024 · 1 comment
Open

macOS: Make cmd+q mappable #2558

chrisgrieser opened this issue May 17, 2024 · 1 comment
Labels
enhancement New feature or request macos Specific to macOS and not investigable on other platforms

Comments

@chrisgrieser
Copy link

chrisgrieser commented May 17, 2024

Is your feature request related to a problem? Please describe.
cmd+q on macOS normally quits an app. However, in the case of Neovide, this leads to quitting the window, with an effect similar to :q!. However, it would be preferable to quit via :wqall to not lose any work.

Describe the solution you'd like
Make cmd+q mappable via vim.keymap.set("n", "<D-q>", …) (assuming vim.g.neovide_input_use_logo = true).

Describe alternatives you've considered
Use a keyboard remapping software, remap cmd+q to something like nvim --server "/tmp/nvim_server.pipe" --remote-send "<cmd>wqall<CR>". Additionally, Set up vim.fn.serverstart in your nvim config. Quite the workaround.

I also looked into using QuitPre autocommands in nvim, but could not get anything working there. I think it is because quitting via cmd+q does not trigger those events?

Additional context
Various apps seem to be able to make cmd+q mappable, so you can map it to something other than quitting the app. Two examples I am aware of are WezTerm and Obsidian.

@chrisgrieser chrisgrieser added the enhancement New feature or request label May 17, 2024
@fredizzimo fredizzimo added the macos Specific to macOS and not investigable on other platforms label May 18, 2024
@fredizzimo
Copy link
Member

@polachok, you created the menu implementation here

Do you think that's something possible to add? I'm not exactly sure how it would work, but maybe we should try to route it through the neovim keymap mapping system?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request macos Specific to macOS and not investigable on other platforms
Projects
None yet
Development

No branches or pull requests

2 participants