sublimetext2 - Hotkey to end the line with a semicolon and jump to a new line in Sublime Text 2 -
i'm trying figure out hotkey @ work. got job , using mac more or less first time in life.
back home on laptop, when using eclipse, seem remember there being single hotkey both:
- add
;
end of current line (no matter caret within said line) - place cursor @ beginning of new line, same indentation level line had added semicolon to
does know if eclipse-specific hotkey, or know of way replicate said hotkey in sublime text 2?
best solution recording macro on sublime text , assigning keyboard shortcut. follow these steps:
- create line such alert('hello') , leave cursor right after letter 'o'.
- then go tools > record macro start recording.
- press command+→ go end of line.
- press ; , hit enter
- stop recording macro going tools > stop recording macro
- you can test macro tools > playback macro (optional)
- save macro going tools > save macro (ex: endofline.sublime-macro)
create shortcut adding between square brackets in in preferences > key bindings - user file:
{ "keys": ["super+;"], "command": "run_macro_file", "args": {"file": "packages/user/endofline.sublime-macro"} }
- now, every time hit command+;, magically place semicolon @ end of current line , move cursor next line.
happy coding!
Comments
Post a Comment