1Devel::Cover::Report::VUisme(r3)Contributed Perl DocumenDteavteilo:n:Cover::Report::Vim(3)
2
3
4

NAME

6       Devel::Cover::Report::Vim - Backend for displaying coverage data in Vim
7

VERSION

9       version 1.36
10

SYNOPSIS

12        cover -report vim
13

DESCRIPTION

15       This module provides a reporting mechanism for displaying coverage data
16       in Vim.  It is designed to be called from the "cover" program.
17
18       By default, the output of this report is a file named "coverage.vim" in
19       the directory of the coverage database.  To use it, run
20
21        :so cover_db/coverage.vim
22
23       and you should see signs in the left column indicating the coverage
24       status of that line.
25
26       The signs are as follows:
27
28        P - Pod coverage
29        S - Statement coverage
30        R - Subroutine coverage
31        B - Branch coverage
32        C - Condition coverage
33
34       The last of the criteria, in the order given above, is the one which is
35       displayed.  Correctly covered criteria are shown in green.  Incorrectly
36       covered criteria are shown in red.  Any incorrectly covered criterion
37       will override a correctly covered criterion.
38
39       If the coverage for the file being displayed is out of date the a
40       function called CoverageOld() is called and passed the name of the
41       file.  Similarly, for current coverage data file CoverageValid is
42       called.
43
44       Signs may be overridden in a file named devel-cover.vim located
45       somewhere underneath the ~/.vim directory.
46
47       For example, I use the solarized theme and keep the following commands
48       in my local configuration file ~/.vim/local/devel-cover.vim:
49
50        let s:fg_cover = "#859900"
51        let s:fg_error = "#dc322f"
52        let s:bg_valid = "#073642"
53        let s:bg_old   = "#342a2a"
54
55        let s:types = [ "pod", "subroutine", "statement", "branch", "condition", ]
56
57        for s:type in s:types
58            exe "highlight cov_" . s:type .       " ctermbg=1 cterm=bold gui=NONE guifg=" . s:fg_cover
59            exe "highlight cov_" . s:type . "_error ctermbg=1 cterm=bold gui=NONE guifg=" . s:fg_error
60        endfor
61        exe "highlight SignColumn ctermbg=0 guibg=" . s:bg_valid
62
63        " highlight cov ctermbg=8 guibg=#002b36
64        " highlight err ctermbg=0 guibg=#073642
65
66        function! s:set_bg(bg)
67            for s:type in s:types
68                exe "highlight cov_" . s:type .       " guibg=" . a:bg
69                exe "highlight cov_" . s:type . "_error guibg=" . a:bg
70            endfor
71            exe "highlight SignColumn ctermbg=0 guibg=" . a:bg
72        endfunction
73
74        function! CoverageValid(filename)
75            call s:set_bg(s:bg_valid)
76        endfunction
77
78        function! CoverageOld(filename)
79            call s:set_bg(s:bg_old)
80        endfunction
81
82       This configuration sets the background colour of the signs to a dark
83       red when the coverage data is out of date.
84
85       coverage.vim adds two user commands: :Cov and :Uncov which can be used
86       to toggle the state of coverage signs.
87
88       The idea and the vim template is shamelessly stolen from Simplecov-Vim.
89       See https://github.com/nyarly/Simplecov-Vim
90

SEE ALSO

92        Devel::Cover
93        Simplecov-Vim (https://github.com/nyarly/Simplecov-Vim)
94

BUGS

96       Huh?
97

LICENCE

99       Copyright 2012-2019, Paul Johnson (paul@pjcj.net)
100
101       This software is free.  It is licensed under the same terms as Perl
102       itself.
103
104       The latest version of this software should be available from my
105       homepage: http://www.pjcj.net
106
107       The template is copied from Simplecov-Vim
108       (https://github.com/nyarly/Simplecov-Vim) and is under the MIT Licence.
109
110       The MIT License
111
112       Copyright (c) 2011 Judson Lester
113
114       Permission is hereby granted, free of charge, to any person obtaining a
115       copy of this software and associated documentation files (the
116       "Software"), to deal in the Software without restriction, including
117       without limitation the rights to use, copy, modify, merge, publish,
118       distribute, sublicense, and/or sell copies of the Software, and to
119       permit persons to whom the Software is furnished to do so, subject to
120       the following conditions:
121
122       The above copyright notice and this permission notice shall be included
123       in all copies or substantial portions of the Software.
124
125       THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
126       OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
127       MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
128       IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
129       CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
130       TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
131       SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
132
133
134
135perl v5.36.0                      2022-07-22      Devel::Cover::Report::Vim(3)
Impressum