How to jump to a CSS-class from the HTML-file

81 views
Skip to first unread message

Vlad Ghitulescu

unread,
Mar 5, 2020, 7:06:20 AM3/5/20
to BBEdit Talk

Hey!

Is there a way in BBEdit to jump right to the definition of the CSS-class from within a HTML-file where this class is used?

Like in this HTML-file (row 3607):

I would like to jump right to the definition of the class "treppen_thumbnails"

I normally use for this Multi-File search within the BBEdit-project and then find it (here in the „_modals-01-eingestemmteT.less-file“)

Is there a shorter way or perhaps even a keyboard shortcut to jump directly to the definition within the project after selecting the class within the HTML-file?

Thanks!

Regards,
Vlad

Bildschirmfoto 2020-03-05 um 12.47.05.png
Bildschirmfoto 2020-03-05 um 12.47.24.png
Bildschirmfoto 2020-03-05 um 12.48.14.png

Rick Yentzer

unread,
Mar 10, 2020, 11:54:59 PM3/10/20
to BBEdit Talk
I don't know of a way, but that's not to say it doesn't exist. There are much smarter people here than I. Hopefully someone can chime in with a workflow for this very thing. This can be done in JetBrains' editors, but I still most of my time in BBEdit.

Perhaps an applescript could get us close?

Any takers? :)

Thanks,
Rick Yentzer

GP

unread,
Mar 11, 2020, 9:30:14 AM3/11/20
to BBEdit Talk
Have you looked into using BBEdit's ctags support?

Although I've never tried it, the documentation for Universal ctags claims improved support for generating tag files for html, JS, and CSS files. Per the BBEdit User Manual section "Ctags for Enhanced Language Support", BBEdit can use tag file information "for navigating source code files" to support  finding a definition and opening it.

Vlad Ghitulescu

unread,
Mar 11, 2020, 9:30:14 AM3/11/20
to BBEdit Talk

Hi, Rick!


Thanks for giving me hope! :-)

Yes, this is possible with other editors - I'm using Eclipse and Sublime Text on my PC at work and both can do this - but I'm all BBEdit at home, that's why I'm asking.


Regards,
Vlad

--
This is the BBEdit Talk public discussion group. If you have a feature request or need technical support, please email "sup...@barebones.com" rather than posting here. Follow @bbedit on Twitter: <https://twitter.com/bbedit>
---
You received this message because you are subscribed to the Google Groups "BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bbedit+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bbedit/11819583-d27e-4ded-94bd-6dca09512d91%40googlegroups.com.

Sam Hathaway

unread,
Mar 11, 2020, 9:47:30 AM3/11/20
to BBEdit Talk

Vlad,

Look at “Ctags for Enhanced Language Support” in Chapter 14 of the BBEdit User Manual.

I haven’t tried it, but the version of ctags bundled with BBEdit should understand HTML, JS, and CSS files. I don’t know if it can understand inline JS and CSS. If it can’t, you can look into using Universal Ctags instead.

When running a version of ctags that’s not bundled with BBEdit, you might have to use these switches to generate a tags file that’s compatible with BBEdit:

-n --tag-relative=no --fields=+a+m+n+S

(N.B., I’ve been carrying these switches around for years now, and they might not actually be necessary or advisable.)

Hope this helps!
-sam

--

This is the BBEdit Talk public discussion group. If you have a feature request or need technical support, please email "sup...@barebones.com" rather than posting here. Follow @bbedit on Twitter: https://twitter.com/bbedit
--- You received this message because you are subscribed to the Google Groups "BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bbedit+un...@googlegroups.com.

Vlad Ghitulescu

unread,
Mar 12, 2020, 9:07:55 AM3/12/20
to BBEdit Talk

Hi, Sam!

I haven't got the time to try it, but Rick did and it didn't work.

Regards,
Vlad

Vlad Ghitulescu

unread,
Mar 12, 2020, 9:07:55 AM3/12/20
to BBEdit Talk
--
This is the BBEdit Talk public discussion group. If you have a feature request or need technical support, please email "sup...@barebones.com" rather than posting here. Follow @bbedit on Twitter: <https://twitter.com/bbedit>
---
You received this message because you are subscribed to the Google Groups "BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bbedit+un...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages