mirror of
git://git.yoctoproject.org/poky.git
synced 2025-07-19 12:59:02 +02:00
bitbake: contrib/vim: synchronize from kergoth/vim-bitbake rev 4225ee8b4818d7e4696520567216a3a031c26f7d
(Bitbake rev: 24fb1f2fee449589b0c5468cbdebe9a6ffaac932) Signed-off-by: Chris Laplante <mostthingsweb@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
parent
f3cb1662ca
commit
92f256dc56
18
bitbake/contrib/vim/LICENSE.txt
Normal file
18
bitbake/contrib/vim/LICENSE.txt
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
The MIT License (MIT)
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
|
this software and associated documentation files (the "Software"), to deal in
|
||||||
|
the Software without restriction, including without limitation the rights to
|
||||||
|
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||||
|
the Software, and to permit persons to whom the Software is furnished to do so,
|
||||||
|
subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||||
|
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||||
|
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||||
|
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
|
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@ -6,12 +6,12 @@
|
||||||
"
|
"
|
||||||
" This sets up the syntax highlighting for BitBake files, like .bb, .bbclass and .inc
|
" This sets up the syntax highlighting for BitBake files, like .bb, .bbclass and .inc
|
||||||
|
|
||||||
if &compatible || version < 600
|
if &compatible || version < 600 || exists("b:loaded_bitbake_plugin")
|
||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" .bb, .bbappend and .bbclass
|
" .bb, .bbappend and .bbclass
|
||||||
au BufNewFile,BufRead *.{bb,bbappend,bbclass} set filetype=bitbake
|
au BufNewFile,BufRead *.{bb,bbappend,bbclass} set filetype=bitbake
|
||||||
|
|
||||||
" .inc
|
" .inc
|
||||||
au BufNewFile,BufRead *.inc set filetype=bitbake
|
au BufNewFile,BufRead *.inc set filetype=bitbake
|
||||||
|
|
|
@ -1,2 +1,13 @@
|
||||||
set sts=4 sw=4 et
|
" Only do this when not done yet for this buffer
|
||||||
set cms=#%s
|
if exists("b:did_ftplugin")
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Don't load another plugin for this buffer
|
||||||
|
let b:did_ftplugin = 1
|
||||||
|
|
||||||
|
let b:undo_ftplugin = "setl cms< sts< sw< et< sua<"
|
||||||
|
|
||||||
|
setlocal commentstring=#\ %s
|
||||||
|
setlocal softtabstop=4 shiftwidth=4 expandtab
|
||||||
|
setlocal suffixesadd+=.bb,.bbclass
|
||||||
|
|
14
bitbake/contrib/vim/plugin/newbb.vim
Executable file → Normal file
14
bitbake/contrib/vim/plugin/newbb.vim
Executable file → Normal file
|
@ -10,7 +10,7 @@
|
||||||
"
|
"
|
||||||
" Will try to use git to find the user name and email
|
" Will try to use git to find the user name and email
|
||||||
|
|
||||||
if &compatible || v:version < 600
|
if &compatible || v:version < 600 || exists("b:loaded_bitbake_plugin")
|
||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ endfun
|
||||||
fun! <SID>GetUserEmail()
|
fun! <SID>GetUserEmail()
|
||||||
let l:user_email = system("git config --get user.email")
|
let l:user_email = system("git config --get user.email")
|
||||||
if v:shell_error
|
if v:shell_error
|
||||||
return "unknow@user.org"
|
return "unknown@user.org"
|
||||||
else
|
else
|
||||||
return substitute(l:user_email, "\n", "", "")
|
return substitute(l:user_email, "\n", "", "")
|
||||||
endfun
|
endfun
|
||||||
|
@ -41,6 +41,10 @@ fun! BBHeader()
|
||||||
endfun
|
endfun
|
||||||
|
|
||||||
fun! NewBBTemplate()
|
fun! NewBBTemplate()
|
||||||
|
if line2byte(line('$') + 1) != -1
|
||||||
|
return
|
||||||
|
endif
|
||||||
|
|
||||||
let l:paste = &paste
|
let l:paste = &paste
|
||||||
set nopaste
|
set nopaste
|
||||||
|
|
||||||
|
@ -48,7 +52,7 @@ fun! NewBBTemplate()
|
||||||
call BBHeader()
|
call BBHeader()
|
||||||
|
|
||||||
" New the bb template
|
" New the bb template
|
||||||
put ='DESCRIPTION = \"\"'
|
put ='SUMMARY = \"\"'
|
||||||
put ='HOMEPAGE = \"\"'
|
put ='HOMEPAGE = \"\"'
|
||||||
put ='LICENSE = \"\"'
|
put ='LICENSE = \"\"'
|
||||||
put ='SECTION = \"\"'
|
put ='SECTION = \"\"'
|
||||||
|
@ -58,7 +62,7 @@ fun! NewBBTemplate()
|
||||||
|
|
||||||
" Go to the first place to edit
|
" Go to the first place to edit
|
||||||
0
|
0
|
||||||
/^DESCRIPTION =/
|
/^SUMMARY =/
|
||||||
exec "normal 2f\""
|
exec "normal 2f\""
|
||||||
|
|
||||||
if paste == 1
|
if paste == 1
|
||||||
|
@ -76,7 +80,7 @@ if v:progname =~ "vimdiff"
|
||||||
endif
|
endif
|
||||||
|
|
||||||
augroup NewBB
|
augroup NewBB
|
||||||
au BufNewFile *.bb
|
au BufNewFile,BufReadPost *.bb
|
||||||
\ if g:bb_create_on_empty |
|
\ if g:bb_create_on_empty |
|
||||||
\ call NewBBTemplate() |
|
\ call NewBBTemplate() |
|
||||||
\ endif
|
\ endif
|
||||||
|
|
46
bitbake/contrib/vim/plugin/newbbappend.vim
Normal file
46
bitbake/contrib/vim/plugin/newbbappend.vim
Normal file
|
@ -0,0 +1,46 @@
|
||||||
|
" Vim plugin file
|
||||||
|
" Purpose: Create a template for new bbappend file
|
||||||
|
" Author: Joshua Watt <JPEWhacker@gmail.com>
|
||||||
|
" Copyright: Copyright (C) 2017 Joshua Watt <JPEWhacker@gmail.com>
|
||||||
|
"
|
||||||
|
" This file is licensed under the MIT license, see COPYING.MIT in
|
||||||
|
" this source distribution for the terms.
|
||||||
|
"
|
||||||
|
|
||||||
|
if &compatible || v:version < 600 || exists("b:loaded_bitbake_plugin")
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
fun! NewBBAppendTemplate()
|
||||||
|
if line2byte(line('$') + 1) != -1
|
||||||
|
return
|
||||||
|
endif
|
||||||
|
|
||||||
|
let l:paste = &paste
|
||||||
|
set nopaste
|
||||||
|
|
||||||
|
" New bbappend template
|
||||||
|
0 put ='FILESEXTRAPATHS_prepend := \"${THISDIR}/${PN}:\"'
|
||||||
|
2
|
||||||
|
|
||||||
|
if paste == 1
|
||||||
|
set paste
|
||||||
|
endif
|
||||||
|
endfun
|
||||||
|
|
||||||
|
if !exists("g:bb_create_on_empty")
|
||||||
|
let g:bb_create_on_empty = 1
|
||||||
|
endif
|
||||||
|
|
||||||
|
" disable in case of vimdiff
|
||||||
|
if v:progname =~ "vimdiff"
|
||||||
|
let g:bb_create_on_empty = 0
|
||||||
|
endif
|
||||||
|
|
||||||
|
augroup NewBBAppend
|
||||||
|
au BufNewFile,BufReadPost *.bbappend
|
||||||
|
\ if g:bb_create_on_empty |
|
||||||
|
\ call NewBBAppendTemplate() |
|
||||||
|
\ endif
|
||||||
|
augroup END
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
"
|
"
|
||||||
" It's an entirely new type, just has specific syntax in shell and python code
|
" It's an entirely new type, just has specific syntax in shell and python code
|
||||||
|
|
||||||
if &compatible || v:version < 600
|
if &compatible || v:version < 600 || exists("b:loaded_bitbake_plugin")
|
||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
if exists("b:current_syntax")
|
if exists("b:current_syntax")
|
||||||
|
@ -58,8 +58,8 @@ syn match bbVarValue ".*$" contained contains=bbString,bbVarDeref,bbV
|
||||||
syn region bbVarPyValue start=+${@+ skip=+\\$+ end=+}+ contained contains=@python
|
syn region bbVarPyValue start=+${@+ skip=+\\$+ end=+}+ contained contains=@python
|
||||||
|
|
||||||
" Vars metadata flags
|
" Vars metadata flags
|
||||||
syn match bbVarFlagDef "^\([a-zA-Z0-9\-_\.]\+\)\(\[[a-zA-Z0-9\-_\.]\+\]\)\@=" contains=bbIdentifier nextgroup=bbVarFlagFlag
|
syn match bbVarFlagDef "^\([a-zA-Z0-9\-_\.]\+\)\(\[[a-zA-Z0-9\-_\.+]\+\]\)\@=" contains=bbIdentifier nextgroup=bbVarFlagFlag
|
||||||
syn region bbVarFlagFlag matchgroup=bbArrayBrackets start="\[" end="\]\s*\(=\|+=\|=+\|?=\)\@=" contained contains=bbIdentifier nextgroup=bbVarEq
|
syn region bbVarFlagFlag matchgroup=bbArrayBrackets start="\[" end="\]\s*\(:=\|=\|.=\|=.|+=\|=+\|?=\)\@=" contained contains=bbIdentifier nextgroup=bbVarEq
|
||||||
|
|
||||||
" Includes and requires
|
" Includes and requires
|
||||||
syn keyword bbInclude inherit include require contained
|
syn keyword bbInclude inherit include require contained
|
||||||
|
@ -67,15 +67,15 @@ syn match bbIncludeRest ".*$" contained contains=bbString,bbVarDeref
|
||||||
syn match bbIncludeLine "^\(inherit\|include\|require\)\s\+" contains=bbInclude nextgroup=bbIncludeRest
|
syn match bbIncludeLine "^\(inherit\|include\|require\)\s\+" contains=bbInclude nextgroup=bbIncludeRest
|
||||||
|
|
||||||
" Add taks and similar
|
" Add taks and similar
|
||||||
syn keyword bbStatement addtask addhandler after before EXPORT_FUNCTIONS contained
|
syn keyword bbStatement addtask deltask addhandler after before EXPORT_FUNCTIONS contained
|
||||||
syn match bbStatementRest ".*$" skipwhite contained contains=bbStatement
|
syn match bbStatementRest ".*$" skipwhite contained contains=bbStatement
|
||||||
syn match bbStatementLine "^\(addtask\|addhandler\|after\|before\|EXPORT_FUNCTIONS\)\s\+" contains=bbStatement nextgroup=bbStatementRest
|
syn match bbStatementLine "^\(addtask\|deltask\|addhandler\|after\|before\|EXPORT_FUNCTIONS\)\s\+" contains=bbStatement nextgroup=bbStatementRest
|
||||||
|
|
||||||
" OE Important Functions
|
" OE Important Functions
|
||||||
syn keyword bbOEFunctions do_fetch do_unpack do_patch do_configure do_compile do_stage do_install do_package contained
|
syn keyword bbOEFunctions do_fetch do_unpack do_patch do_configure do_compile do_stage do_install do_package contained
|
||||||
|
|
||||||
" Generic Functions
|
" Generic Functions
|
||||||
syn match bbFunction "\h[0-9A-Za-z_-]*" display contained contains=bbOEFunctions
|
syn match bbFunction "\h[0-9A-Za-z_\-\.]*" display contained contains=bbOEFunctions
|
||||||
|
|
||||||
" BitBake shell metadata
|
" BitBake shell metadata
|
||||||
syn include @shell syntax/sh.vim
|
syn include @shell syntax/sh.vim
|
||||||
|
@ -83,7 +83,7 @@ if exists("b:current_syntax")
|
||||||
unlet b:current_syntax
|
unlet b:current_syntax
|
||||||
endif
|
endif
|
||||||
syn keyword bbShFakeRootFlag fakeroot contained
|
syn keyword bbShFakeRootFlag fakeroot contained
|
||||||
syn match bbShFuncDef "^\(fakeroot\s*\)\?\([0-9A-Za-z_${}-]\+\)\(python\)\@<!\(\s*()\s*\)\({\)\@=" contains=bbShFakeRootFlag,bbFunction,bbVarDeref,bbDelimiter nextgroup=bbShFuncRegion skipwhite
|
syn match bbShFuncDef "^\(fakeroot\s*\)\?\([\.0-9A-Za-z_${}\-\.]\+\)\(python\)\@<!\(\s*()\s*\)\({\)\@=" contains=bbShFakeRootFlag,bbFunction,bbVarDeref,bbDelimiter nextgroup=bbShFuncRegion skipwhite
|
||||||
syn region bbShFuncRegion matchgroup=bbDelimiter start="{\s*$" end="^}\s*$" contained contains=@shell
|
syn region bbShFuncRegion matchgroup=bbDelimiter start="{\s*$" end="^}\s*$" contained contains=@shell
|
||||||
|
|
||||||
" Python value inside shell functions
|
" Python value inside shell functions
|
||||||
|
@ -91,7 +91,7 @@ syn region shDeref start=+${@+ skip=+\\$+ excludenl end=+}+ contained co
|
||||||
|
|
||||||
" BitBake python metadata
|
" BitBake python metadata
|
||||||
syn keyword bbPyFlag python contained
|
syn keyword bbPyFlag python contained
|
||||||
syn match bbPyFuncDef "^\(python\s\+\)\([0-9A-Za-z_${}-]\+\)\?\(\s*()\s*\)\({\)\@=" contains=bbPyFlag,bbFunction,bbVarDeref,bbDelimiter nextgroup=bbPyFuncRegion skipwhite
|
syn match bbPyFuncDef "^\(fakeroot\s*\)\?\(python\)\(\s\+[0-9A-Za-z_${}\-\.]\+\)\?\(\s*()\s*\)\({\)\@=" contains=bbShFakeRootFlag,bbPyFlag,bbFunction,bbVarDeref,bbDelimiter nextgroup=bbPyFuncRegion skipwhite
|
||||||
syn region bbPyFuncRegion matchgroup=bbDelimiter start="{\s*$" end="^}\s*$" contained contains=@python
|
syn region bbPyFuncRegion matchgroup=bbDelimiter start="{\s*$" end="^}\s*$" contained contains=@python
|
||||||
|
|
||||||
" BitBake 'def'd python functions
|
" BitBake 'def'd python functions
|
||||||
|
|
Loading…
Reference in New Issue
Block a user