1475cb72dSAndrew Geissler" Vim plugin file
2475cb72dSAndrew Geissler" Purpose:	Create a template for new bbappend file
3475cb72dSAndrew Geissler" Author:	Joshua Watt <JPEWhacker@gmail.com>
4475cb72dSAndrew Geissler" Copyright:	Copyright (C) 2017 Joshua Watt <JPEWhacker@gmail.com>
5475cb72dSAndrew Geissler"
6475cb72dSAndrew Geissler" This file is licensed under the MIT license, see COPYING.MIT in
7475cb72dSAndrew Geissler" this source distribution for the terms.
8475cb72dSAndrew Geissler"
9475cb72dSAndrew Geissler
10475cb72dSAndrew Geisslerif &compatible || v:version < 600 || exists("b:loaded_bitbake_plugin")
11475cb72dSAndrew Geissler    finish
12475cb72dSAndrew Geisslerendif
13475cb72dSAndrew Geissler
14475cb72dSAndrew Geisslerfun! NewBBAppendTemplate()
15475cb72dSAndrew Geissler    if line2byte(line('$') + 1) != -1
16475cb72dSAndrew Geissler        return
17475cb72dSAndrew Geissler    endif
18475cb72dSAndrew Geissler
19475cb72dSAndrew Geissler    let l:paste = &paste
20475cb72dSAndrew Geissler    set nopaste
21475cb72dSAndrew Geissler
22475cb72dSAndrew Geissler    " New bbappend template
23*213cb269SPatrick Williams    0 put ='FILESEXTRAPATHS:prepend := \"${THISDIR}/${PN}:\"'
24475cb72dSAndrew Geissler    2
25475cb72dSAndrew Geissler
26475cb72dSAndrew Geissler    if paste == 1
27475cb72dSAndrew Geissler        set paste
28475cb72dSAndrew Geissler    endif
29475cb72dSAndrew Geisslerendfun
30475cb72dSAndrew Geissler
31475cb72dSAndrew Geisslerif !exists("g:bb_create_on_empty")
32475cb72dSAndrew Geissler    let g:bb_create_on_empty = 1
33475cb72dSAndrew Geisslerendif
34475cb72dSAndrew Geissler
35475cb72dSAndrew Geissler" disable in case of vimdiff
36475cb72dSAndrew Geisslerif v:progname =~ "vimdiff"
37475cb72dSAndrew Geissler    let g:bb_create_on_empty = 0
38475cb72dSAndrew Geisslerendif
39475cb72dSAndrew Geissler
40475cb72dSAndrew Geissleraugroup NewBBAppend
41475cb72dSAndrew Geissler    au BufNewFile,BufReadPost *.bbappend
42475cb72dSAndrew Geissler                \ if g:bb_create_on_empty |
43475cb72dSAndrew Geissler                \    call NewBBAppendTemplate() |
44475cb72dSAndrew Geissler                \ endif
45475cb72dSAndrew Geissleraugroup END
46475cb72dSAndrew Geissler
47