summaryrefslogtreecommitdiffstats
path: root/bitbake/contrib/vim/plugin/newbbappend.vim
diff options
context:
space:
mode:
authorChris Laplante <mostthingsweb@gmail.com>2020-07-05 15:04:26 -0400
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-07-08 12:12:45 +0100
commit92f256dc564434515ff3ede8ed5be29b04441a79 (patch)
tree1a3eaeac7142fe6fa5b19fd8c3795c1ec236de07 /bitbake/contrib/vim/plugin/newbbappend.vim
parentf3cb1662ca3623c1187d17c4ca2aa84d7b57748f (diff)
downloadpoky-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/newbbappend.vim')
-rw-r--r--bitbake/contrib/vim/plugin/newbbappend.vim46
1 files changed, 46 insertions, 0 deletions
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
10if &compatible || v:version < 600 || exists("b:loaded_bitbake_plugin")
11 finish
12endif
13
14fun! 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
29endfun
30
31if !exists("g:bb_create_on_empty")
32 let g:bb_create_on_empty = 1
33endif
34
35" disable in case of vimdiff
36if v:progname =~ "vimdiff"
37 let g:bb_create_on_empty = 0
38endif
39
40augroup NewBBAppend
41 au BufNewFile,BufReadPost *.bbappend
42 \ if g:bb_create_on_empty |
43 \ call NewBBAppendTemplate() |
44 \ endif
45augroup END
46