简体   繁体   中英

After “a{display text}”, then pasting the url, how can I get the cursor to go after the close </a>? Like $0 in a Sublime autocomplete

I'm using Emmet in Sublime Text 3.

After executing a{display text} , you get

<a href="__CURSOR__">display text</a>

What I'm trying to do is get the cursor to jump to after the close </a> , after I've pasted in the url. I'm trying to simulate Sublime's autocomplete $0 behavior, like

<a href="$1">display text</a>$0

I am looking through snippets.json, but I'm not getting it. The only "a" entry is in the "abbreviations" object, and contains only the open tag:

"a": "<a href=\"\">",

I've not edited any Emmet tags before, and I thought this might be a good first one to try.

Any ideas on how this might be possible?

There's a built-in Emmet setting that does this for all tags:

This is in C:\\Users\\jeffy\\AppData\\Roaming\\Sublime Text 3\\Packages\\Emmet\\Emmet.sublime-settings

// If set to `true`, Emmet will automatically insert final tabstop
// at the end of expanded abbreviation
"insert_final_tabstop": false

I duplicated it to C:\\Users\\jeffy\\AppData\\Roaming\\Sublime Text 3\\Packages\\User\\Emmet.sublime-settings

and changed it to true . It does exactly as I want. Well, it still goes to the display text, even if there already is display text. Then it goes to the end. But close enough!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM