Skip to content

Commit 879e81a

Browse files
committed
Add a set of g:pymode_lint_*_symbol options.
[Inspired by Syntastic](https://github.com/scrooloose/syntastic/blob/master/plugin/syntastic/signs.vim#L10-L24), this feature allows users to set, in their `~/.vimrc` file, a custom set of error symbols.
1 parent a9afe07 commit 879e81a

File tree

6 files changed

+94
-6
lines changed

6 files changed

+94
-6
lines changed

AUTHORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,4 @@ Contributors:
3030
* Lowe Thiderman (thiderman);
3131
* Naoya Inada (naoina);
3232
* Anler Hp (ikame);
33+
* Kevin Deldycke (kdeldycke);

Changelog.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ Changelog
77
* Support 'pudb' in breakpoints;
88
* Pyrun can now operate on a range of lines, and does not need to save (c) lawrenceakka
99
* Update pylama to version 1.5.0
10+
* Add a set of `g:pymode_lint_*_symbol` options;
1011

1112
## 2013-05-15 0.6.18
1213
--------------------

README.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,13 @@ Default values: ::
193193
" Maximal height of pylint error window
194194
let g:pymode_lint_maxheight = 6
195195

196+
" Symbol definition
197+
let g:pymode_lint_todo_symbol = 'WW'
198+
let g:pymode_lint_comment_symbol = 'CC'
199+
let g:pymode_lint_visual_symbol = 'RR'
200+
let g:pymode_lint_error_symbol = 'EE'
201+
let g:pymode_lint_info_symbol = 'II'
202+
let g:pymode_lint_pyflakes_symbol = 'FF'
196203

197204
.. note::
198205
Pylint options (ex. disable messages) may be defined in ``$HOME/pylint.rc``

autoload/pymode/troubleshooting.vim

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,12 @@ fun! pymode#troubleshooting#Test() "{{{
6060
call append('$', 'let pymode_lint_cwindow = ' . string(g:pymode_lint_cwindow))
6161
call append('$', 'let pymode_lint_message = ' . string(g:pymode_lint_message))
6262
call append('$', 'let pymode_lint_signs = ' . string(g:pymode_lint_signs))
63+
call append('$', 'let pymode_lint_todo_symbol = ' . string(g:pymode_lint_todo_symbol))
64+
call append('$', 'let pymode_lint_comment_symbol = ' . string(g:pymode_lint_comment_symbol))
65+
call append('$', 'let pymode_lint_visual_symbol = ' . string(g:pymode_lint_visual_symbol))
66+
call append('$', 'let pymode_lint_error_symbol = ' . string(g:pymode_lint_error_symbol))
67+
call append('$', 'let pymode_lint_info_symbol = ' . string(g:pymode_lint_info_symbol))
68+
call append('$', 'let pymode_lint_pyflakes_symbol = ' . string(g:pymode_lint_pyflakes_symbol))
6369
call append('$', 'let pymode_lint_jump = ' . string(g:pymode_lint_jump))
6470
call append('$', 'let pymode_lint_hold = ' . string(g:pymode_lint_hold))
6571
call append('$', 'let pymode_lint_minheight = ' . string(g:pymode_lint_minheight))

doc/pymode.txt

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,18 @@ PythonMode. These options should be set in your vimrc.
7676

7777
|'pymode_lint_signs'| Place signs
7878

79+
|'pymode_lint_todo_symbol'| Todo symbol
80+
81+
|'pymode_lint_comment_symbol'| Comment symbol
82+
83+
|'pymode_lint_visual_symbol'| Visual symbol
84+
85+
|'pymode_lint_error_symbol'| Error symbol
86+
87+
|'pymode_lint_info_symbol'| Info symbol
88+
89+
|'pymode_lint_pyflakes_symbol'| PyFlakes' info symbol
90+
7991
|'pymode_lint_jump'| Auto jump to first error
8092

8193
|'pymode_lint_hold'| Hold cursor in current window
@@ -296,6 +308,49 @@ Default: 1.
296308

297309
If this option is set to 0 then pylint will not place error signs.
298310

311+
------------------------------------------------------------------------------
312+
*'pymode_lint_todo_symbol'*
313+
Values: Symbol for todo signs.
314+
Default: "WW".
315+
316+
This option sets the symbol to use in the gutter to display todo signs.
317+
318+
------------------------------------------------------------------------------
319+
*'pymode_lint_comment_symbol'*
320+
Values: Symbol for comment signs.
321+
Default: "CC".
322+
323+
This option sets the symbol to use in the gutter to display comment signs.
324+
325+
------------------------------------------------------------------------------
326+
*'pymode_lint_visual_symbol'*
327+
Values: Symbol for visual signs.
328+
Default: "RR".
329+
330+
This option sets the symbol to use in the gutter to display visual signs.
331+
332+
------------------------------------------------------------------------------
333+
*'pymode_lint_error_symbol'*
334+
Values: Symbol for error signs.
335+
Default: "EE".
336+
337+
This option sets the symbol to use in the gutter to display error signs.
338+
339+
------------------------------------------------------------------------------
340+
*'pymode_lint_info_symbol'*
341+
Values: Symbol for info signs.
342+
Default: "II".
343+
344+
This option sets the symbol to use in the gutter to display info signs.
345+
346+
------------------------------------------------------------------------------
347+
*'pymode_lint_pyflakes_symbol'*
348+
Values: Symbol for PyFlakes' info signs.
349+
Default: "FF".
350+
351+
This option sets the symbol to use in the gutter to display PyFlakes' info
352+
signs.
353+
299354
------------------------------------------------------------------------------
300355
*'pymode_lint_jump'*
301356
Values: 0 or 1.

ftplugin/python/init-pymode.vim

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -108,16 +108,34 @@ if !pymode#Default("g:pymode_lint", 1) || g:pymode_lint
108108
" errors ruller, even if there's no errors.
109109
call pymode#Default("g:pymode_lint_signs_always_visible", 0)
110110

111+
" OPTION: g:pymode_lint_todo_symbol -- string. Todo symbol.
112+
call pymode#Default("g:pymode_lint_todo_symbol", "WW")
113+
114+
" OPTION: g:pymode_lint_comment_symbol -- string. Comment symbol.
115+
call pymode#Default("g:pymode_lint_comment_symbol", "CC")
116+
117+
" OPTION: g:pymode_lint_visual_symbol -- string. Visual symbol.
118+
call pymode#Default("g:pymode_lint_visual_symbol", "RR")
119+
120+
" OPTION: g:pymode_lint_error_symbol -- string. Error symbol.
121+
call pymode#Default("g:pymode_lint_error_symbol", "EE")
122+
123+
" OPTION: g:pymode_lint_info_symbol -- string. Info symbol.
124+
call pymode#Default("g:pymode_lint_info_symbol", "II")
125+
126+
" OPTION: g:pymode_lint_pyflakes_symbol -- string. PyFlakes' info symbol.
127+
call pymode#Default("g:pymode_lint_pyflakes_symbol", "FF")
128+
111129
" OPTION: g:pymode_lint_signs -- bool. Place error signs
112130
if (!pymode#Default("g:pymode_lint_signs", 1) || g:pymode_lint_signs) && has('signs')
113131

114132
" DESC: Signs definition
115-
sign define PymodeW text=WW texthl=Todo
116-
sign define PymodeC text=CC texthl=Comment
117-
sign define PymodeR text=RR texthl=Visual
118-
sign define PymodeE text=EE texthl=Error
119-
sign define PymodeI text=II texthl=Info
120-
sign define PymodeF text=FF texthl=Info
133+
execute 'sign define PymodeW text=' . g:pymode_lint_todo_symbol . " texthl=Todo"
134+
execute 'sign define PymodeC text=' . g:pymode_lint_comment_symbol . " texthl=Comment"
135+
execute 'sign define PymodeR text=' . g:pymode_lint_visual_symbol . " texthl=Visual"
136+
execute 'sign define PymodeE text=' . g:pymode_lint_error_symbol . " texthl=Error"
137+
execute 'sign define PymodeI text=' . g:pymode_lint_info_symbol . " texthl=Info"
138+
execute 'sign define PymodeF text=' . g:pymode_lint_pyflakes_symbol . " texthl=Info"
121139

122140
if !pymode#Default("g:pymode_lint_signs_always_visible", 0) || g:pymode_lint_signs_always_visible
123141
" Show the sign's ruller if asked for, even it there's no error to show

0 commit comments

Comments
 (0)