Skip to contentSkip to conversation

bitbake.vim: detect *.bbappend files in ftdetect automatically

PATCH Superseded Eren Türkay 3 participants 7 messages Dec 12, 2012 – Dec 13, 2012

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bitbake.vim: detect *.bbappend files in ftdetect automatically

Currently, *.bb and *.bbclass files are automatically highlighted and detected as a bitbake file. Since *.bbappend files are also bitbake files, vim plugin should automatically detect and highlight it as well.

---
 contrib/vim/ftdetect/bitbake.vim |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
contrib/vim/ftdetect/bitbake.vim +1 -1
index 179e4d9..6822e24 100644
@@ -11,7 +11,7 @@ if &compatible || version < 600
 endif
 
 " .bb and .bbclass
-au BufNewFile,BufRead *.b{b,bclass}	set filetype=bitbake
+au BufNewFile,BufRead *.b{b,bappend,bclass}	set filetype=bitbake
 
 " .inc
 au BufNewFile,BufRead *.inc 		set filetype=bitbake
Signature · 1 line
1.7.7.5
#1 lore raw
Quoted 12 lines · Eren Türkay

Currently, *.bb and *.bbclass files are automatically highlighted and detected as a bitbake file. Since *.bbappend files are also bitbake files, vim plugin should automatically detect and highlight it as well.

---
 contrib/vim/ftdetect/bitbake.vim |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
contrib/vim/ftdetect/bitbake.vim +0 -0
index 179e4d9..6822e24 100644

contrib/vim/ftdetect/bitbake.vim if &compatible || version < 600 · line 14

Quoted 5 lines
contrib/vim/ftdetect/bitbake.vim +1 -1
@@ -11,7 +11,7 @@ if &compatible || version < 600
 endif
 
 " .bb and .bbclass
-au BufNewFile,BufRead *.b{b,bclass}	set filetype=bitbake
+au BufNewFile,BufRead *.b{b,bappend,bclass}	set filetype=bitbake

gack. there's no compelling reason to be that, um, pedantic with
the wildcard pattern. just use

*.{bb,bbappend,bbclass}

trying to save a couple characters while introducing that kind of visual ugliness just isn't worth it.

rday

Signature · 7 lines
========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                        http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================
#2 lore raw
Quoted 7 lines · Robert P. J. Day

gack. there's no compelling reason to be that, um, pedantic with
the wildcard pattern. just use

*.{bb,bbappend,bbclass}

trying to save a couple characters while introducing that kind of visual ugliness just isn't worth it.

It can be used but I was not the one who introduced "that kind of visual ugliness" :) I just sticked with the old one, adding bbappend.

Visual ugliness/goodness depends on person to person. To me, it doesn't look ugly at all. I've seen things uglier than just an innocent wildcard pattern.

Regards,
Eren

Signature · 2 lines
    . 73! DE TA1AET
      http://linkedin.com/in/erenturkay
#3 lore raw
Quoted 9 lines · Eren Türkay
Quoted 7 lines · Robert P. J. Day

gack. there's no compelling reason to be that, um, pedantic with
the wildcard pattern. just use

*.{bb,bbappend,bbclass}

trying to save a couple characters while introducing that kind of visual ugliness just isn't worth it.

Quoted 7 lines

It can be used but I was not the one who introduced "that kind of visual ugliness" :) I just sticked with the old one, adding bbappend.

Visual ugliness/goodness depends on person to person. To me, it doesn't look ugly at all. I've seen things uglier than just an innocent wildcard pattern.

sorry, i didn't mean to pick on you. :-) i would avoid that kind of
extreme optimization for a couple reasons.

first, it just *looks* like a typo at first glance. when i saw it,
my immediate reaction was, oops, spelling mistake and i had to look again to see it wasn't.

also, it's sort of just a fluke that you can do that kind of
optimization. the instant you add another suffix that starts with something other than a "b", it messes things up and you lose the advantage.

anyway, i will leave this in the hands of folks higher up the food
chain.

rday

Signature · 7 lines
========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                        http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================
#4 lore raw
Quoted 2 lines · Robert P. J. Day

sorry, i didn't mean to pick on you. :-) i would avoid that kind of
extreme optimization for a couple reasons.

No problem :)

Quoted 4 lines

also, it's sort of just a fluke that you can do that kind of
optimization. the instant you add another suffix that starts with something other than a "b", it messes things up and you lose the advantage.

Right, at first glance such a little code is not understood instantly. foo.{bbclass,bbappend,bb} is more natural for suffixes.

Quoted 2 lines

anyway, i will leave this in the hands of folks higher up the food
chain.

I'm sending V2 of the patch.

Signature · 2 lines
    . 73! DE TA1AET
      http://linkedin.com/in/erenturkay
#5 lore raw
In reply to Eren Türkay

contrib/vim/ftdetect/bitbake.vim if &compatible || version < 600 · line 14

Quoted 3 lines · Eren Türkay

" .bb and .bbclass

contrib/vim/ftdetect/bitbake.vim +1 -1
-au BufNewFile,BufRead *.b{b,bclass}    set filetype=bitbake
+au BufNewFile,BufRead *.b{b,bappend,bclass}    set filetype=bitbake

Don't forget to update the comment too :-)

#6 lore raw
Quoted 6 lines · Trevor Woerner

contrib/vim/ftdetect/bitbake.vim if &compatible || version < 600 · line 14

Quoted 3 lines · Eren Türkay

" .bb and .bbclass

contrib/vim/ftdetect/bitbake.vim +1 -1
-au BufNewFile,BufRead *.b{b,bclass}    set filetype=bitbake
+au BufNewFile,BufRead *.b{b,bappend,bclass}    set filetype=bitbake

Don't forget to update the comment too :-)

Thanks you for your feedback. V2 of the patch includes updated comment already. I fixed it while preparing v2.

Regards,
Eren

Signature · 2 lines
    . 73! DE TA1AET
      http://linkedin.com/in/erenturkay