Patchwork [bitbake-devel,v2] bitbake.vim: detect *.bbappend files in ftdetect automatically

login
register
mail settings
Submitter Eren Türkay
Date Dec. 12, 2012, 8:35 p.m.
Message ID <20121212203550.GD743@gmail.com>
Download mbox | patch
Permalink /patch/40853/
State Accepted
Commit 0668a0ea968baf930f05806a5452c8dbe4ec35ce
Headers show

Comments

Eren Türkay - Dec. 12, 2012, 8:35 p.m.
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 |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
Martin Jansa - Dec. 12, 2012, 8:47 p.m.
On Wed, Dec 12, 2012 at 9:35 PM, Eren Türkay <eren@hambedded.org> wrote:
> 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 |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/contrib/vim/ftdetect/bitbake.vim b/contrib/vim/ftdetect/bitbake.vim
> index 179e4d9..b9529e6 100644
> --- a/contrib/vim/ftdetect/bitbake.vim
> +++ b/contrib/vim/ftdetect/bitbake.vim
> @@ -10,8 +10,8 @@ if &compatible || version < 600
>      finish
>  endif
>
> -" .bb and .bbclass
> -au BufNewFile,BufRead *.b{b,bclass}    set filetype=bitbake
> +" .bb, .bbappend and .bbclass
> +au BufNewFile,BufRead *.{bb,bbappend,bbclass}  set filetype=bitbake

fwiw: you can probably add .inc too, but some people will probably
find it conflicting with some other ftdetect.. :/
Eren Türkay - Dec. 12, 2012, 8:58 p.m.
On Wed, Dec 12, 2012 at 09:47:26PM +0100, Martin Jansa wrote:
> fwiw: you can probably add .inc too, but some people will probably
> find it conflicting with some other ftdetect.. :/

*.inc and *.conf are already defined in the lines 16 and 19. I haven't
had any problems with them as I don't have conflicting files.

I wonder why *.bbinc isn't used instead of such a generic name *.inc :)
With a lot of recipes referencing *.inc, changing the suffix just for
vim plugin wouldn't be suitable. However, for the sake of consistency
with bb{class,append}, changing the practice of using *.inc to *.bbinc
could be good in some time.

Regards,
Eren

Patch

diff --git a/contrib/vim/ftdetect/bitbake.vim b/contrib/vim/ftdetect/bitbake.vim
index 179e4d9..b9529e6 100644
--- a/contrib/vim/ftdetect/bitbake.vim
+++ b/contrib/vim/ftdetect/bitbake.vim
@@ -10,8 +10,8 @@  if &compatible || version < 600
     finish
 endif
 
-" .bb and .bbclass
-au BufNewFile,BufRead *.b{b,bclass}	set filetype=bitbake
+" .bb, .bbappend and .bbclass
+au BufNewFile,BufRead *.{bb,bbappend,bbclass}	set filetype=bitbake
 
 " .inc
 au BufNewFile,BufRead *.inc 		set filetype=bitbake