diff options
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/autoload/dist/ft.vim | 6 | ||||
-rw-r--r-- | runtime/filetype.vim | 3 | ||||
-rw-r--r-- | runtime/lua/vim/filetype.lua | 6 | ||||
-rw-r--r-- | runtime/lua/vim/filetype/detect.lua | 4 |
4 files changed, 16 insertions, 3 deletions
diff --git a/runtime/autoload/dist/ft.vim b/runtime/autoload/dist/ft.vim index a3a67cacb9..9e30ae1f51 100644 --- a/runtime/autoload/dist/ft.vim +++ b/runtime/autoload/dist/ft.vim @@ -519,12 +519,14 @@ func dist#ft#FTinc() " headers so assume POV-Ray elseif lines =~ '^\s*\%({\|(\*\)' || lines =~? s:ft_pascal_keywords setf pascal + elseif lines =~# '\<\%(require\|inherit\)\>' || lines =~# '\w\+ = ' + setf bitbake else call dist#ft#FTasmsyntax() if exists("b:asmsyntax") - exe "setf " . fnameescape(b:asmsyntax) + exe "setf " . fnameescape(b:asmsyntax) else - setf pov + setf pov endif endif endif diff --git a/runtime/filetype.vim b/runtime/filetype.vim index 5a643803d3..f28118e272 100644 --- a/runtime/filetype.vim +++ b/runtime/filetype.vim @@ -253,6 +253,9 @@ au BufNewFile,BufRead *.db call dist#ft#BindzoneCheck('') " Blank au BufNewFile,BufRead *.bl setf blank +" Bitbake +au BufNewFile,BufRead *.bb,*.bbappend,*.bbclass,*/build/conf/*.conf,*/meta{-*,}/conf/*.conf setf bitbake + " Blkid cache file au BufNewFile,BufRead */etc/blkid.tab,*/etc/blkid.tab.old setf xml diff --git a/runtime/lua/vim/filetype.lua b/runtime/lua/vim/filetype.lua index 9ba036ca92..70c8cd15eb 100644 --- a/runtime/lua/vim/filetype.lua +++ b/runtime/lua/vim/filetype.lua @@ -172,6 +172,9 @@ local extension = { return require('vim.filetype.detect').bindzone(bufnr, '') end, bicep = 'bicep', + bb = 'bitbake', + bbappend = 'bitbake', + bbclass = 'bitbake', bl = 'blank', bsdl = 'bsdl', bst = 'bst', @@ -1662,6 +1665,9 @@ local pattern = { ['[mM]akefile%.am'] = 'automake', ['.*/bind/db%..*'] = starsetf('bindzone'), ['.*/named/db%..*'] = starsetf('bindzone'), + ['.*/build/conf/.*%.conf'] = 'bitbake', + ['.*/meta/conf/.*%.conf'] = 'bitbake', + ['.*/meta%-.*/conf/.*%.conf'] = 'bitbake', ['.*bsd'] = 'bsdl', ['bzr_log%..*'] = 'bzr', ['.*enlightenment/.*%.cfg'] = 'c', diff --git a/runtime/lua/vim/filetype/detect.lua b/runtime/lua/vim/filetype/detect.lua index 8331920406..8c10517687 100644 --- a/runtime/lua/vim/filetype/detect.lua +++ b/runtime/lua/vim/filetype/detect.lua @@ -62,7 +62,7 @@ end -- Checks the first 5 lines for a asmsyntax=foo override. -- Only whitespace characters can be present immediately before or after this statement. function M.asm_syntax(bufnr) - local lines = table.concat(getlines(bufnr, 1, 5), ' '):lower() + local lines = ' ' .. table.concat(getlines(bufnr, 1, 5), ' '):lower() .. ' ' local match = lines:match('%sasmsyntax=([a-zA-Z0-9]+)%s') if match then return match @@ -554,6 +554,8 @@ function M.inc(bufnr) -- headers so assume POV-Ray elseif findany(lines, { '^%s{', '^%s%(%*' }) or matchregex(lines, pascal_keywords) then return 'pascal' + elseif findany(lines, { '^%s*inherit ', '^%s*require ', '^%s*%w+%s+= ' }) then + return 'bitbake' else local syntax = M.asm_syntax(bufnr) if not syntax or syntax == '' then |