C
C
creatoroftheworld2015-09-17 15:52:29
css
creatoroftheworld, 2015-09-17 15:52:29

How to remap the Enter key in Sublime (for important business)?

Ask why?
But there is a default macro in Sublime (Ctrl + Enter), which FIRST goes to the end of the current line, and from there it already goes to a new line. Roughly speaking, it jumps to a clean new line from any position.
So, IMHO, it would be more practical if this command was on Enter, and the default transition to a new line from the current position was on Ctrl + Enter. In places, in general, change teams.
Copy from default.sublime-keymap like this

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

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

and just swap ["enter"] with ["ctrl+enter"], and paste it into the custom hotkeys file.
And... it doesn't work. More precisely, Enter was overwritten, while Ctrl + Enter did not overwrite the old value. I'm far from an expert, but I suspect that Enter isn't just for line breaks, so there's some sort of conflict going on here.
I couldn’t figure it out myself, but I think someone smarter than me will like the idea and help me)

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question