Syntax Highlighting for Kirby Syntax in the Editor Brackets or BBEdit

Hi.
I’m completely new to Kirby : )

Congratulations on the release of Kirby 4!
You can tell how much care has gone into it just from the excellent documentation.
Great : )
I’m already looking forward to my first steps with Kirby.

Please allow me a question about syntax highlighting.

In text files there is a special syntax for fields:

There you can see the colored distinction.

Are there ready-made syntax highlighting configuration files for Kirby for the editor Brackets or BBEdit that I use on macOS?

Or would you strongly advise against using these two editors for certain reasons and use a different development environment/editor?

Thank you : )

Greetings, Andreas

Hello and welcome to the Kirby forum,

BBEdit automatically recognizes the format and selects the appropriate highlighting.
With .txt, however, there is no color highlighting.
You can change the assignment by manually assigning a different format to the file, e.g. YAML at the bottom o the editor-window:

If you always want .txt files to be highlighted as YAML, you can do this in the BBEdit preferences:

Thank you! Good to know. So this is usable as a temporary workaround : )

I don’t want to apply this syntax highlighting to just any TXT file.

So I have to find a way to “teach” BBEdit that a certain color scheme should only be applied in a certain context (local folder?).

How do you solve such tasks?
Does anyone use BBEdit or do you work with completely different development environments?

I have been using BBEdit for many years and it works very well with Kirby projects.
I am not aware of any function to define a folder (media) to display the contained .txt files separately. This is only possible in the preferences as a general setting for .txt files (see screenshot above).

If you work with different projects, additional folders will accumulate, which would then have to be defined. Visual Studio Code would be an alternative, but it is very powerful and suitable for advanced programmers.

2 Likes

Hello, Saerdna & welcome to the Kirby forum. :slight_smile:

Here’s a rather old thread - What’s your favorite editor? - illustrating the myriad editors used with Kirby.

I think it’s best to use the software (and hardware) you feel most comfortable and productive working with, which is why I’ve remained a faithful BBEdit user since 2003.

@aimedia
Thanks for the hint to the old thread. I will dive into it.

For me, not being a programmer, the huge number of functions in IDE is still confusing. I don’t yet know what is useful for my needs and what I won’t need.

I also can’t yet see where an IDE is really more useful than a pure editor. The boundaries are probably fluid between a powerful editor and an IDE.

What do I not have in BBEdit and Brackets so far, but would find appealing?

  1. versioning
  2. beautifier (automatically when saving & all files in a folder)
  3. search&replace in parts of code (interpreting html: parents/children, attributes, … like the editor adobe dreamweaver offers)

beautifier (automatically when saving & all files in a folder)

I am not aware of an automated Beautifier, but there is a menu command:
Markup → Utilities → Format

search&replace in parts of code (interpreting html: parents/children, attributes, … like the editor adobe dreamweaver offers)

The search function is very powerful, extensive and configurable.

I also use Prepos to compile and minimize my CSS and JS files.

There will never be an editor that is perfectly tailored to your needs. Others, on the other hand, are too complex and overloaded for me. I like the simplicity of BBEdit.

1 Like