Sublime Forum

Custom Command to modify Text on Current Line

#1

Hello,

I did some poking around to try to find something similar to what I’m looking for, but didn’t have any luck. What I’m looking to do is add a keyboard shortcut to a custom command that takes the current line that you are on and does some sort of transformation to it.

More specifically, I am looking to be able to adjust the format of a one-line Java comment by simply pressing the keyboard shortcut while on that line. Here is the format change I would like to make

Before: “//This is a comment”
After: “[TAB]/* This is a comment */”

Thanks for pointing me in the right direction!
Micah

0 Likes

#2

Just stumbled across a solution! Using macros seems like an easy and elegant solution! This is a good tutorial: webdesign.tutsplus.com/articles/ … esign-6398

0 Likes