0

I'm using neovim to edit code and am needing to create a mapping in which I press the left command key, and neovim (or at least my alacritty terminal) thinks that I am pressing the left control key.

I of course would love for neovim to be able to recognize the command key on mac but I can't seem to find any way to do this.

I have tried writing a karabiner-elements rule that applies only when editing in neovim without any success.

Would someone be able to show me the correct way to write an application-specific keybinding in karabiner elements that only functions in neovim? Or if there is any way in which I may use the command key natively in neovim?

  • macOS: Catalina 10.15.7

  • Terminal: Alacritty@latest

  • neovim: v0.4.4

  • karabiner-elements-@latest

7
  • Did you see this reddit comment reddit.com/r/neovim/comments/2tbn15/cmd_key_binding/…
    – minseong
    Commented Mar 19, 2021 at 14:33
  • or this github issue github.com/neovim/neovim/issues/7721#issue-281255962
    – minseong
    Commented Mar 19, 2021 at 14:33
  • @theonlygusti Yes, I tried the first thing google shows me when I search for this problem.
    – Bdyce
    Commented Mar 19, 2021 at 14:45
  • @theonlygusti neither of those threads provide any insight into the issue. Just that they have the same issue.
    – Bdyce
    Commented Mar 19, 2021 at 14:47
  • if map <D-x> doesn't map cmd-x in neovim for you, it means your terminal is capturing the command key and not letting neovim hear it
    – minseong
    Commented Mar 19, 2021 at 14:51

1 Answer 1

1

Unfortunately you didn't post WHAT exactly you wrote in your Karabiner-elements rule. Here is what normally works for specific apps:

There comes an app EventViewer with Karabiner-Elements that in its tab "Frontmost application" shows information on any active applications.
E.g., it might return "com.apple.TextEdit" and you would write in Karabiner:

{   "conditions": [
   {
      "bundle_identifiers": [
          "^com.apple.TextEdit" ],
      "type": "frontmost_application_if"
   }             ]

(Notice the ^ -character.) If you haven't tried it this way it might help.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .