Bart
Bart

Reputation: 41

Sublime Text Moving cursor up and down directly in between the tags

I'm on OS X. How can I move my cursor around the code in Sublime Text (using keyboard only, obviously) in the way that it goes straight in between opening and closing tags?

For example I have ul list like this one below created with Emmet like ul>li*3. After hitting Tab button I end up in between first li tags. However when I type anything and hit arrow down my cursor goes at the end of next line. Moving around using Option+left/right is not convenient because cursor ends up just before / in </li> so I need to press left arrow twice to get where I want.

<ul>
  <li>hello 1</li>
  <li></li>
  <li></li>
</ul>

Is it possible to move straight in between the tags? Will it work also in CSS and/or JS?

Upvotes: 2

Views: 322

Answers (2)

aaronk6
aaronk6

Reputation: 2811

For matching HTML tags, you might want to install the Emmet plugin.

When it’s installed, matching the tags is possible with Shift + Control + T

Matching curly brackets in CSS and JavaScript (and also other languages), is built-in and can be done with Control + M.

Upvotes: 0

Bradia
Bradia

Reputation: 857

Install Emmet plugin "emmet-sublume" for sublime text:

https://github.com/sergeche/emmet-sublime

then use the following keyboard sequence: ⇧⌃T / Ctrl+Alt+J

More emmet shortcut keys can be find here

Emmet website: http://emmet.io/

Upvotes: 1

Related Questions