PYENV prompt.
[profile.git] / .vim / ftplugin / gitv.vim
1 "AUTHOR:   Greg Sexton <gregsexton@gmail.com>
2 "WEBSITE:  http://www.gregsexton.org/portfolio/gitv/
3 "LICENSE:  Same terms as Vim itself (see :help license).
4 "NOTES:    Much of the credit for gitv goes to Tim Pope and the fugitive plugin
5 "          where this plugin either uses functionality directly or was inspired heavily.
6
7 "enabling these next lines breaks settings when reloading the buffer
8 "if exists("b:did_ftplugin") | finish | endif
9 "let b:did_ftplugin = 1
10
11 let s:cpo_save = &cpo
12 set cpo&vim
13
14 setlocal fdm=expr
15
16 fu! Foldlevelforbranch() "{{{
17     let line = getline(v:lnum)
18
19     if line == "-- Load More --"
20         return 0
21     endif
22     if line =~ "^-- \\[.*\\] --$"
23         return 0
24     endif
25
26     let line = substitute(line, "\\s", "", "g")
27     let level = match(line, "*") + 1
28     return level == 0 ? -1 : level
29 endfu "}}}
30 setlocal foldexpr=Foldlevelforbranch()
31
32 fu! BranchFoldText() "{{{
33     "get first non-blank line
34     let fs = v:foldstart
35     while getline(fs) =~ '^\s*$' | let fs = nextnonblank(fs + 1)
36     endwhile
37     if fs > v:foldend
38         let line = getline(v:foldstart)
39     else
40         let line = getline(fs)
41     endif
42     return line
43 endf "}}}
44 setlocal foldtext=BranchFoldText()
45 setlocal foldlevel=99
46
47 let &cpo = s:cpo_save
48 unlet s:cpo_save