How to add custom key binding for autocomplete confirm



I would like to add the following custom key bindings to my Atom Editor.

  • ctrl-j for insert newline
  • ctrl-j for confirm for autocomplete.

I managed to add insert newline key binding by adding the below code to my keymap.cson file:

  'ctrl-j': 'editor:newline'

I tried to add confirm for autocomplete as well, but couldn’t find the right one. The action I want to copy is done by enter. Attached a screenshot for autocomplete what I am talking about here. How can I add it? Thanks!

Adding a new keybinding

The command is autocomplete-plus:activate.


@DamnedScholar Thank you for your reply! Thanks to your advice, I managed to add ctrl-j key binding to both inserting newline and confirming autocomplete with the following.

  'ctrl-j': 'editor:newline'

  'ctrl-j': 'autocomplete-plus:confirm'

Thank you so much for your help!


No problem. :slight_smile: