I realized I use 'ctrl+enter' a lot more than 'enter' in ST3. Would it be possible to switch these two commands?

I can easily switch 'ctrl+enter' to 'enter' with:

{ "keys": ["enter"], "command": "run_macro_file", "args": {"file": "res://Packages/Default/Add Line.sublime-macro"} }

But I'm not sure how to switch 'enter' to 'ctrl+enter'. It seems that only the "auto-completion" functionality of 'enter' is defined in the default keymap.

{ "keys": ["enter"], "command": "commit_completion", "context":
    [
        { "key": "auto_complete_visible" },
        { "key": "setting.auto_complete_commit_on_tab", "operand": false }
    ]
},

Any thoughts would be much appreciated!

PS. And if there was a way I could keep 'enter' to commit completion while also using it to skip to next line, that would be the icing on the cake.

有帮助吗?

解决方案

Nevermind, I found it:

  { "keys": ["ctrl+enter"], "command": "insert", "args": {"characters": "\n"} },

That just leaves the question of how to continue to use 'enter' for auto-completion. If anyone has any ideas, I'd be curious to hear them!

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top