Steps:
- Place the cursor at the middle of a line of code. e.g. ("Hello") and put cursor in front of 'o'.
- Go to [Tools] > [Record a Macro]
- Press "End" key on keyboard, then type ";" and press Enter. 
 (If you want the cursor to stay at the end without breaking to new line then you don't have to press Enter)
- Go to [Tools] > [Stop Recording Macro]
- Test your macro by [Tools] > [Playback Macro]
- If it performs correctly, [Tools] > [Save Macro] (ex: endOfLine.sublime-macro)
- Create a shortcut by adding this between the square brackets in your in your [Preferences] > [Key Bindings] - User file:{ "keys": ["alt+enter"], "command": "run_macro_file", "args": {"file": "Packages/User/endOfLine.sublime-macro"} }
- Now, every time you hit Alt + Enter, it will place the semicolon at the end of current line and move the cursor to the next line.
Reference: drdiv
 
沒有留言:
張貼留言