summaryrefslogtreecommitdiffstats
path: root/bitbake/contrib/vim/plugin/newbb.vim
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/contrib/vim/plugin/newbb.vim')
-rw-r--r--[-rwxr-xr-x]bitbake/contrib/vim/plugin/newbb.vim14
1 files changed, 9 insertions, 5 deletions
diff --git a/bitbake/contrib/vim/plugin/newbb.vim b/bitbake/contrib/vim/plugin/newbb.vim
index 874e338059..3a42027361 100755..100644
--- a/bitbake/contrib/vim/plugin/newbb.vim
+++ b/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