automatic html closing tag?

3,421 views
Skip to first unread message

sparker

unread,
Jan 18, 2012, 5:45:30 PM1/18/12
to BBEdit Talk
I started using BBEdit (switched from Dreamweaver) and noticed that
there is no auto close tag feature. For example, if I type "<p>" I
would think it would automatically type the close tag with an
insertion point in the middle "<p>|</p>".
I see the "close current tag" in the side menu but that doesn't seem
very practical having to click on that just to close your html tag.
Does anyone know if there is something in the preferences where I can
use this feature? I find this feature very helpful. I would hate to
switch back to Dreamweaver just to use their text editor.
Thanks

Bucky Junior

unread,
Jan 29, 2012, 2:20:13 PM1/29/12
to bbe...@googlegroups.com
If you type "<p" and wait a few moments (see preferences for delay time), you will get a drop down. Press the ENTER key and you will get "<p><##></p>" with the <##> highlighted (the insertion point/area).

Bucky

Ken Lanxner

unread,
Jan 29, 2012, 2:54:18 PM1/29/12
to bbe...@googlegroups.com
Hi. Instead of typing paragraph tags, why not use the menu item
Markup -> Block Elements-> Paragraph? Assign a keyboard shortcut
to it. I use F1 because I do this so often.

Then one key will type the opening and closing <p> tags and
place the insertion point between them. Or if you have text
selected, it will wrap the text with paragraph tags. If you have
several blocks of text selected, it will wrap each block in its
own paragraph.

Ken

scot....@mrprint.com (sparker) wrote on 1/18/12 2:45 PM

--
Simple Lives Web Design
http://simplelives.com

Evan

unread,
Jan 30, 2012, 8:27:38 AM1/30/12
to BBEdit Talk
Assign a shortcut to "Close Current Tag" (I use ctrl+space) and hit
that when you're ready to close.

Alex Popescu

unread,
Jan 30, 2012, 2:27:24 PM1/30/12
to BBEdit Talk
Even if the two previous suggestions are good, but not optimized for
speed typing, the solution I'd suggest is to assign a shortcut to
Close current tag and one that is not very difficult to type
frequently.

Another possible solution is to assign a nice shortcut to Insert
clipping (e.g. Ctrl + Space) menu and have that insert the tags as it
automatically inserts the tags.

A://

——

unread,
Jan 30, 2012, 11:05:28 PM1/30/12
to BBEdit Talk
Actually, just typing a "p", and then waiting a beat, and then
pressing TAB to accept the first completion works here.

On Jan 29, 11:20 am, Bucky Junior <buckyjunior...@googlemail.com>
wrote:

——

unread,
Jan 30, 2012, 11:09:11 PM1/30/12
to BBEdit Talk
I'm a huge fan of ctrl-/, with the caps lock key bound to ctrl.

Incidentally, if I were a huge emacs fan, wouldn't I want that
keyboard shortcut to be Search -> Live Search?

BBunny

unread,
Nov 9, 2013, 3:51:05 AM11/9/13
to bbe...@googlegroups.com, buckyju...@googlemail.com
OMG, Bucky, thank you! I have been searching for a way to auto-complete tags in BBEdit for months. You just saved me so much time!

And, for anyone who finds the delay too long, you can change it with the command line. The default is half a second:
defaults write com.barebones.bbedit Editor_AutoCompleteDelay -float 0.5

I changed it to 0.1.

Reply all
Reply to author
Forward
0 new messages