summaryrefslogtreecommitdiff
path: root/poky/bitbake/contrib/vim/plugin/newbb.vim
diff options
context:
space:
mode:
authorJason M. Bills <jason.m.bills@linux.intel.com>2020-12-08 00:38:17 +0300
committerJason M. Bills <jason.m.bills@linux.intel.com>2020-12-08 00:38:17 +0300
commit8d6ae7f2a817751fad151168fa10ce28ee0869d8 (patch)
tree281032f7ec07c41589aa094bd165cc2a98f2d3a7 /poky/bitbake/contrib/vim/plugin/newbb.vim
parentc16fb8893b19075db4bcf3b5bf33c1db8c3ca2bd (diff)
parent5da3c2284560a7e08ffafd03c5b5ba44a3242228 (diff)
downloadopenbmc-8d6ae7f2a817751fad151168fa10ce28ee0869d8.tar.xz
Merge tag '0.26' of ssh://git-amr-1.devtools.intel.com:29418/openbmc-openbmc into update
Diffstat (limited to 'poky/bitbake/contrib/vim/plugin/newbb.vim')
-rw-r--r--[-rwxr-xr-x]poky/bitbake/contrib/vim/plugin/newbb.vim14
1 files changed, 9 insertions, 5 deletions
diff --git a/poky/bitbake/contrib/vim/plugin/newbb.vim b/poky/bitbake/contrib/vim/plugin/newbb.vim
index 874e33805..3a4202736 100755..100644
--- a/poky/bitbake/contrib/vim/plugin/newbb.vim
+++ b/poky/bitbake/contrib/vim/plugin/newbb.vim
@@ -10,7 +10,7 @@
"
" 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
endif
@@ -25,7 +25,7 @@ endfun
fun! <SID>GetUserEmail()
let l:user_email = system("git config --get user.email")
if v:shell_error
- return "unknow@user.org"
+ return "unknown@user.org"
else
return substitute(l:user_email, "\n", "", "")
endfun
@@ -41,6 +41,10 @@ fun! BBHeader()
endfun
fun! NewBBTemplate()
+ if line2byte(line('$') + 1) != -1
+ return
+ endif
+
let l:paste = &paste
set nopaste
@@ -48,7 +52,7 @@ fun! NewBBTemplate()
call BBHeader()
" New the bb template
- put ='DESCRIPTION = \"\"'
+ put ='SUMMARY = \"\"'
put ='HOMEPAGE = \"\"'
put ='LICENSE = \"\"'
put ='SECTION = \"\"'
@@ -58,7 +62,7 @@ fun! NewBBTemplate()
" Go to the first place to edit
0
- /^DESCRIPTION =/
+ /^SUMMARY =/
exec "normal 2f\""
if paste == 1
@@ -76,7 +80,7 @@ if v:progname =~ "vimdiff"
endif
augroup NewBB
- au BufNewFile *.bb
+ au BufNewFile,BufReadPost *.bb
\ if g:bb_create_on_empty |
\ call NewBBTemplate() |
\ endif