jmancherje
jmancherje

Reputation: 6633

SublimeText2+HTML: Cursor positioning when creating new elements using "tab" shortcut

I could not think of an efficient title for my question so I apologize for any confusion there.

This question is specific to sublime text 2 (because that is the only editor I have used).

When I create a new element (div for example) I will type div.class-name + "tab" and it will generate the following (with the "*" represents cursor location):

    <div class="class-name">*</div>

As shown, the cursor will be conveniently located in-between the opening and closing braces of the div.

I then hit return twice to bring to open some space to put text or more elements inside of the div so it looks like this (again "*" represents cursor location):

    <div class="class-name">

    *</div>

I then hit "up" on my keyboard to bring my cursor up as shown here:

    <div class="class-name">
*
    </div>

Then I hit "tab" to bring my cursor forward but it jumps down to the end of the /div:

    <div class="class-name">

    </div>*

I then have to hit "up" again, then "tab" and then it jumps to the position I want it to go.

    <div class="class-name">
          *
    </div>

Is there a more efficient way to create an element, open it up over a line or 2 and get my cursor inside of the element to add more code?

Upvotes: 0

Views: 23

Answers (1)

filype
filype

Reputation: 8380

I am using sublime text 3 and the behaviour is as expected. See below. It may be worth upgrading to Sublime Text 3.

enter image description here

Upvotes: 1

Related Questions