Sublime Forum

Want Redefine The "Shift + Enter"

#1

I want the “Shift + Enter” act as “end” + “enter” when coding…
but I don’t know how to set it. T_T

{ “keys”: “enter”], “command”: “insert”, “args”: {“characters”: “\n”} },
{ “keys”: “shift+enter”], “command”: “insert”, “args”: {“characters”: “\n”} },
{ “keys”: “end”], “command”: “move_to”, “args”: {“to”: “eol”, “extend”: false} },

0 Likes

#2

You want to create a macro. Hit “ctrl+q” to begin recording the macro. Then hit the key combination you want to record. In your case, “end” -> “enter”. Then press “ctrl"q” again. Now go to “Tools -> Save Macro”. Save this in your user directory (it should default there I believe). Finally create a user keybinding with the following entry.

{ "keys": "shift+enter"], "command": "run_macro_file", "args": {"file": "Packages/User/MyMacro.sublime-macro"} }

The above is kind of a general flow for defining/using a custom macro (series of commands). For your specific use case, I think the built in “Add Line” macro should do what you want. Just try adding the following as a user keybinding.

{ "keys": "shift+enter"], "command": "run_macro_file", "args": {"file": "Packages/Default/Add Line.sublime-macro"} }
0 Likes

#3
0 Likes