Home > free software, gentoo, maemo, mamona, vim > Editing OpenEmbedded and Bitbake files with syntax highlighting at Vim

Editing OpenEmbedded and Bitbake files with syntax highlighting at Vim

Now that I’m currently working with OpenEmbedded at Mamona, I often have to edit and create new ‘bb’ files (the definition and instructions to build packages or define configurations, like ebuilds for Gentoo).

After working with ebuilds to build a few packages, I was really comfortable with the syntax highlighting and new ebuild templates that I have with Vim, but didn’t found anything like that for Bitbake and OpenEmbedded.

First searching for syntax highlighting for Bitbake, I found that Chris Larson already created a Vim syntax file that covered almost everything I need, but was a little bit different from what we have with ebuilds, so I decided to create my own syntax (based on Chris’) and template plugin.

Here’s the code, I just released the version 0.1, it’s quite easy to install, just like any other vim syntax and plugins, just copy the directories at your ~/.vim (sorry emacs users, but this is only for Vim ;-)

I’m probably not covering everything from the OpenEmbedded/Bitbake syntax, but it’s quite good for now. If you see any red text around at your code just email me and I’ll try to fix it (patches are also welcome).

It was quite fun to develop for Vim, it’s not that different from any other language and it has many good help files where you can find every allowed syntax that you can use in your script.

Here are some screenshots from bb files and the template plugin:

* Syntax Highlighting:
vim syntax

* Template for new bb files (just open a new file that ends with ‘.bb’):
vim template
The template plugin will try to find your user name and email by your global git conf.

Thanks Chris for his syntax file and for the gentoo developers, who created the gentoo-syntax package.

About these ads
  1. May 5, 2009 at 2:00 pm | #1

    Why not add:
    set background=dark

    or type “:set background=dark”
    That way it stops trying to use dark purple as a “highlight” on the black background?

  2. May 5, 2009 at 2:00 pm | #2

    Why not add:
    set background=dark
    to your .vimrc
    or type “:set background=dark”
    That way it stops trying to use dark purple as a “highlight” on the black background?

  3. November 6, 2009 at 3:31 pm | #3

    great configuration! very useful!

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: