-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy patherrormarker.txt
133 lines (110 loc) · 6.28 KB
/
errormarker.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
*errormarker* Plugin to highlight error positions v0.2
ERROR MARKER REFERENCE MANUAL ~
1. Usage |errormarker-usage|
2. Customization |errormarker-customization|
3. Credits |errormarker-credits|
4. Changelog |errormarker-changelog|
This plugin is only available if Vim was compiled with the |+signs| feature
and 'compatible' is not set.
==============================================================================
1. USAGE *errormarker-usage*
This plugin hooks the quickfix command |QuickFixCmdPost| and generates error
markers for every line that contains an error. Vim has to be compiled with
|+signs| for this to work.
Additionally, a tooltip with the error message is shown when you hover with
the mouse over a line with an error (only available when compiled with the
|+balloon_eval| feature), or when you press <Leader>cc in normal mode. This
functionality is also available with the |:ErrorAtCursor| command.
The functionality mentioned here is a plugin, see |add-plugin|. This plugin is
only available if 'compatible' is not set and Vim was compiled with |+signs|
and |+autocmd| support. You can avoid loading this plugin by setting the
"loaded_errormarker" variable in your |vimrc| file: >
:let loaded_errormarker = 1
==============================================================================
2. CUSTOMIZATION *errormarker-customization*
You can customize the signs that are used by Vim to mark warnings and errors
(see |:sign-define| for details).
*errormarker_erroricon* *errormarker_warningicon*
The icons that are used for the warnings and error signs in the GUI version of
Vim can be set by >
:let errormarker_erroricon = "/path/to/error/icon/name.png"
:let errormarker_warningicon = "/path/to/warning/icon/name.png"
If an icon is not found, text-only markers are displayed instead. The bitmap
should fit into the place of two characters.
You must use full paths for these variables, for icons in your home directory
expand the paths in your .vimrc with something like >
:let errormarker_erroricon = expand ("~/.vim/icons/error.png")
To get working icons on Microsoft Windows, place icons for errors and warnings
(you can use Google at http://images.google.com/images?q=error&imgsz=icon to
find some nice ones) as error.bmp and warning.bmp in your home directory at
C:\Documents and Settings\<user>\vimfiles\icons.
*errormarker_errortext* *errormarker_warningtext*
The text that is displayed without a GUI or if the icon files can not be found
can be set by >
:let errormarker_errortext = "EE"
:let errormarker_warningtext = "WW"
The maximum length is two characters.
*errormarker_errortextgroup* *errormarker_warningtextgroup*
The hightlighting groups that are used for the text signs without a GUI can be
set by >
:let errormarker_errortextgroup = "ErrorMsg"
:let errormarker_warningtextgroup = "Todo"
Use the "Normal" highlighting group to remove any highlighting.
*errormarker_errorgroup* *errormarker_warninggroup*
The hightlighting groups that are used to mark the lines that contain warnings
and errors in the text can be set by >
:let errormarker_errorgroup = "ErrorMsg"
:let errormarker_warninggroup = "Todo"
<
*errormarker_warningtypes*
If the compiler reports a severity for the error messages this can be used to
distinguish between warnings and errors. Vim uses a single character error
type that can be parsed with |errorformat| (%t). The error types that should
be treated as warnings can be set by >
let errormarker_warningtypes = "wWiI"
For example, the severity of error messages from gcc
averagergui.cpp|18 warning| unused parameter ‘file’ ~
averagergui.cpp|33 error| expected class-name before ‘I’ ~
can be parsed by adding the following lines to your .vimrc >
let &errorformat="%f:%l: %t%*[^:]:%m," . &errorformat
let &errorformat="%f:%l:%c: %t%*[^:]:%m," . &errorformat
let errormarker_warningtypes = "wW"
If you use a different locale than English, this may also be needed: >
set makeprg=LANGUAGE=C\ make
<
*errormarker_disablemappings* *\cc* *:ErrorAtCursor*
To show the error message at the cursor position (e.g. if you are working from
within a terminal, where tooltips are not available), the following command
and shortcut are defined: >
:ErrorAtCursor
:nmap <silent> <unique> <Leader>cc :ErrorAtCursor<CR>
The shortcut is only defined if no other mapping to ErrorAtCursor<CR> can be
found, and can be completely disabled by >
let errormarker_disablemappings = 1
<
==============================================================================
3. CREDITS *errormarker-credits*
Author: Michael Hofmann <mh21 at piware dot de>
==============================================================================
4. CHANGELOG *errormarker-changelog*
0.2 - redraw (thanks yoppi, kano4)
- ship icons, sign highlight (thanks andersonfreitas)
- ship docs separately, moved to github (thanks mbertheau)
0.1.13 - shortcut can be disabled (thanks Michael Jansen)
0.1.12 - shortcut (<Leader>cc) to show error at cursor (thanks Eric Rannaud)
0.1.11 - changelog fix
0.1.10 - removes accidental dependency on NerdEcho
0.1.9 - fixes Win32 icon display
0.1.8 - check for Vim version
0.1.7 - fixes gcc error message parsing example
0.1.6 - support for GetLatestVimScripts (vimscript#642)
0.1.5 - clarified documentation about paths
0.1.4 - fixes icon name and variable escaping
0.1.3 - customizable signs
- distinguishes between warnings and errors
0.1.2 - documentation
0.1.1 - handles nonexistent icons gracefully
- tooltips only used if Vim has balloon-eval support
0.1 - initial release
==============================================================================
vim:tw=78:ts=8:ft=help:norl: