diff options
| author | Chris Laplante <mostthingsweb@gmail.com> | 2020-07-05 15:04:26 -0400 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-07-08 12:12:45 +0100 |
| commit | 92f256dc564434515ff3ede8ed5be29b04441a79 (patch) | |
| tree | 1a3eaeac7142fe6fa5b19fd8c3795c1ec236de07 /bitbake/contrib/vim/plugin | |
| parent | f3cb1662ca3623c1187d17c4ca2aa84d7b57748f (diff) | |
| download | poky-92f256dc564434515ff3ede8ed5be29b04441a79.tar.gz | |
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>
Diffstat (limited to 'bitbake/contrib/vim/plugin')
| -rw-r--r--[-rwxr-xr-x] | bitbake/contrib/vim/plugin/newbb.vim | 14 | ||||
| -rw-r--r-- | bitbake/contrib/vim/plugin/newbbappend.vim | 46 |
2 files changed, 55 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 @@ | |||
| 10 | " | 10 | " |
| 11 | " Will try to use git to find the user name and email | 11 | " Will try to use git to find the user name and email |
| 12 | 12 | ||
| 13 | if &compatible || v:version < 600 | 13 | if &compatible || v:version < 600 || exists("b:loaded_bitbake_plugin") |
| 14 | finish | 14 | finish |
| 15 | endif | 15 | endif |
| 16 | 16 | ||
| @@ -25,7 +25,7 @@ endfun | |||
| 25 | fun! <SID>GetUserEmail() | 25 | fun! <SID>GetUserEmail() |
| 26 | let l:user_email = system("git config --get user.email") | 26 | let l:user_email = system("git config --get user.email") |
| 27 | if v:shell_error | 27 | if v:shell_error |
| 28 | return "unknow@user.org" | 28 | return "unknown@user.org" |
| 29 | else | 29 | else |
| 30 | return substitute(l:user_email, "\n", "", "") | 30 | return substitute(l:user_email, "\n", "", "") |
| 31 | endfun | 31 | endfun |
| @@ -41,6 +41,10 @@ fun! BBHeader() | |||
| 41 | endfun | 41 | endfun |
| 42 | 42 | ||
| 43 | fun! NewBBTemplate() | 43 | fun! NewBBTemplate() |
| 44 | if line2byte(line('$') + 1) != -1 | ||
| 45 | return | ||
| 46 | endif | ||
| 47 | |||
| 44 | let l:paste = &paste | 48 | let l:paste = &paste |
| 45 | set nopaste | 49 | set nopaste |
| 46 | 50 | ||
| @@ -48,7 +52,7 @@ fun! NewBBTemplate() | |||
| 48 | call BBHeader() | 52 | call BBHeader() |
| 49 | 53 | ||
| 50 | " New the bb template | 54 | " New the bb template |
| 51 | put ='DESCRIPTION = \"\"' | 55 | put ='SUMMARY = \"\"' |
| 52 | put ='HOMEPAGE = \"\"' | 56 | put ='HOMEPAGE = \"\"' |
| 53 | put ='LICENSE = \"\"' | 57 | put ='LICENSE = \"\"' |
| 54 | put ='SECTION = \"\"' | 58 | put ='SECTION = \"\"' |
| @@ -58,7 +62,7 @@ fun! NewBBTemplate() | |||
| 58 | 62 | ||
| 59 | " Go to the first place to edit | 63 | " Go to the first place to edit |
| 60 | 0 | 64 | 0 |
| 61 | /^DESCRIPTION =/ | 65 | /^SUMMARY =/ |
| 62 | exec "normal 2f\"" | 66 | exec "normal 2f\"" |
| 63 | 67 | ||
| 64 | if paste == 1 | 68 | if paste == 1 |
| @@ -76,7 +80,7 @@ if v:progname =~ "vimdiff" | |||
| 76 | endif | 80 | endif |
| 77 | 81 | ||
| 78 | augroup NewBB | 82 | augroup NewBB |
| 79 | au BufNewFile *.bb | 83 | au BufNewFile,BufReadPost *.bb |
| 80 | \ if g:bb_create_on_empty | | 84 | \ if g:bb_create_on_empty | |
| 81 | \ call NewBBTemplate() | | 85 | \ call NewBBTemplate() | |
| 82 | \ endif | 86 | \ endif |
diff --git a/bitbake/contrib/vim/plugin/newbbappend.vim b/bitbake/contrib/vim/plugin/newbbappend.vim new file mode 100644 index 0000000000..e04174cf62 --- /dev/null +++ b/bitbake/contrib/vim/plugin/newbbappend.vim | |||
| @@ -0,0 +1,46 @@ | |||
| 1 | " Vim plugin file | ||
| 2 | " Purpose: Create a template for new bbappend file | ||
| 3 | " Author: Joshua Watt <JPEWhacker@gmail.com> | ||
| 4 | " Copyright: Copyright (C) 2017 Joshua Watt <JPEWhacker@gmail.com> | ||
| 5 | " | ||
| 6 | " This file is licensed under the MIT license, see COPYING.MIT in | ||
| 7 | " this source distribution for the terms. | ||
| 8 | " | ||
| 9 | |||
| 10 | if &compatible || v:version < 600 || exists("b:loaded_bitbake_plugin") | ||
| 11 | finish | ||
| 12 | endif | ||
| 13 | |||
| 14 | fun! NewBBAppendTemplate() | ||
| 15 | if line2byte(line('$') + 1) != -1 | ||
| 16 | return | ||
| 17 | endif | ||
| 18 | |||
| 19 | let l:paste = &paste | ||
| 20 | set nopaste | ||
| 21 | |||
| 22 | " New bbappend template | ||
| 23 | 0 put ='FILESEXTRAPATHS_prepend := \"${THISDIR}/${PN}:\"' | ||
| 24 | 2 | ||
| 25 | |||
| 26 | if paste == 1 | ||
| 27 | set paste | ||
| 28 | endif | ||
| 29 | endfun | ||
| 30 | |||
| 31 | if !exists("g:bb_create_on_empty") | ||
| 32 | let g:bb_create_on_empty = 1 | ||
| 33 | endif | ||
| 34 | |||
| 35 | " disable in case of vimdiff | ||
| 36 | if v:progname =~ "vimdiff" | ||
| 37 | let g:bb_create_on_empty = 0 | ||
| 38 | endif | ||
| 39 | |||
| 40 | augroup NewBBAppend | ||
| 41 | au BufNewFile,BufReadPost *.bbappend | ||
| 42 | \ if g:bb_create_on_empty | | ||
| 43 | \ call NewBBAppendTemplate() | | ||
| 44 | \ endif | ||
| 45 | augroup END | ||
| 46 | |||
