diff options
-rw-r--r-- | bitbake/contrib/vim/ftdetect/bitbake.vim | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/bitbake/contrib/vim/ftdetect/bitbake.vim b/bitbake/contrib/vim/ftdetect/bitbake.vim index 09fc4dc74c..427ab5b987 100644 --- a/bitbake/contrib/vim/ftdetect/bitbake.vim +++ b/bitbake/contrib/vim/ftdetect/bitbake.vim | |||
@@ -11,10 +11,18 @@ if &compatible || version < 600 || exists("b:loaded_bitbake_plugin") | |||
11 | endif | 11 | endif |
12 | 12 | ||
13 | " .bb, .bbappend and .bbclass | 13 | " .bb, .bbappend and .bbclass |
14 | au BufNewFile,BufRead *.{bb,bbappend,bbclass} set filetype=bitbake | 14 | au BufNewFile,BufRead *.{bb,bbappend,bbclass} setfiletype bitbake |
15 | 15 | ||
16 | " .inc | 16 | " .inc -- meanwhile included upstream |
17 | au BufNewFile,BufRead *.inc set filetype=bitbake | 17 | if !has("patch-9.0.0055") |
18 | au BufNewFile,BufRead *.inc call s:BBIncDetect() | ||
19 | def s:BBIncDetect() | ||
20 | l:lines = getline(1) .. getline(2) .. getline(3) | ||
21 | if l:lines =~# '\<\%(require\|inherit\)\>' || lines =~# '[A-Z][A-Za-z0-9_:${}]*\s\+\%(??\|[?:+]\)\?= ' | ||
22 | set filetype bitbake | ||
23 | endif | ||
24 | enddef | ||
25 | endif | ||
18 | 26 | ||
19 | " .conf | 27 | " .conf |
20 | au BufNewFile,BufRead *.conf | 28 | au BufNewFile,BufRead *.conf |