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 definitely don't want to go to my mouse.
Is there a quick and easy way to solve this for my workflow?
I just have this feature partially implemented with the help of a plugin named run_multiple_commands.py (see below)
(only tested on ST3, but the plugin is earlier than the first version of ST3 and should work on ST2 too).
Shortcut configuration is as below:
One shortcut (
shift+space
) for four conditions:cursor is just after quotes or closing parentheses/bracket:
move one character forward
cursor is just before quotes or closing parentheses/bracket:
move one character forward
cursor is just before opening parentheses/bracket:
move to closing parentheses/bracket
!
1
&& !2
&& !3
:move to closing parentheses/bracket
and move one more character forward
To use this configuration in your ST, you should first add a file named
run_multiple_commands.py
to your.../Package/User/
directory, and the content of which is the second code piece of This ArticleThis solution is just fine for everyday use but is not perfect because:
This can go to the end of brackets
on a Dell XPS, Ctrl Enter does the trick for me
I found another way which lies within sublime keybindings itself. Basically, I just modify the keybindings for auto closing parens, that is, I replace
"contents": "($0)"
with"contents": "($1)$0"
. Then just hitTab
to get out of the parenthesis. So I add in my keybindings the following:And similar for square brackets, curly brackets, and single and double quotes.
Best solution for this is recording a macro on Sublime Text and then assigning it to a keyboard shortcut. Follow these steps:
Create a shortcut by adding this between the square brackets in your in your Preferences > Key Bindings - User file:
Happy coding!
Perhaps the home and the end key are near to your fingers.