Sublime Text 2 move cursor out of parenthesis, quotes, or brackets

后端 未结 12 761
囚心锁ツ
囚心锁ツ 2020-12-22 20:10

I need a fast way to make the cursor jump outside the auto wrap qoutes or other syntax elements. I don\'t want to have to reach down to my arrow keys each time, and definit

12条回答
  •  时光取名叫无心
    2020-12-22 20:59

    Best solution for this is recording a macro on Sublime Text and then assigning it to a keyboard shortcut. Follow these steps:

    1. Create a line such as alert('hello') and leave the cursor right after letter 'o'.
    2. Then go to Tools > Record a Macro to start recording.
    3. Press Command+ to go to the end of line.
    4. Press ; and hit Enter
    5. Stop recording the macro by going to Tools > Stop Recording Macro
    6. You can now test your macro by Tools > Playback Macro (optional)
    7. Save your macro by going to Tools > Save Macro (ex: EndOfLine.sublime-macro)
    8. Create a shortcut by adding this between the square brackets in your in your Preferences > Key Bindings - User file:

      {
      "keys": ["super+;"], "command": "run_macro_file", "args": {"file": "Packages/User/EndOfLine.sublime-macro"}
      }
      
    9. Now, every time you hit Command+;, it will magically place the semicolon at the end of current line and move the cursor to the next line.

    Happy coding!

提交回复
热议问题