Is there a way to print something with the given keybinding in Sublime Text 4
?
E. g. for the sake of R
, I would like the alt+oem_minus
and alt+-
keybindings strokes to result in <-
.
I understand that for whatever I want to do, I can record a macro and this would work just fine but this action is so trivial that I wonder whether I can do without macro.
I understand that there are probably language plugins and IDEs that include this feature by default, but the most apparent one, the R-IDE
, doesn't seem to have it, and moreover, Sublime
is just an editor for quick scripts, not a comprehensive IDE, I have to intention to aggravate the app with scripts I do not need.
Thank you in advance for any response!
Open Sublime Text, go to Preferences
> Key Bindings
and add this:
[
{
"keys": ["alt+keypad_minus", "alt+-"],
"command": "insert_snippet",
"args": {"contents": "<-"}
}
]
If you want to position the cursor after <-
, you can do it via $0
like this:
"args": {"contents": "<- $0"}