4

I've configured python-mode to check manually. So I type :PyLint and it checks my code, showing the "QuickFix" window and some marks at the side. I can subsequently close the QuickFix window by typing :onlyin the other window or so, but how can I clear the side marks?

5
  • Correcting all the errors, then re-running :PyLint will do the trick, but I'm not sure how well this solves your problem.
    – David Cain
    Aug 1, 2013 at 14:54
  • No, or course not. The problem is that I can't correct all the errors in a huge and messy file. I rewrite parts of it and I use PyLint to check that these parts are OK. But then when I do other work elsewhere in the file, I need to turn these off; they are too distracting. Aug 1, 2013 at 14:59
  • Does a :sign unplace * do what you want?
    – FDinoff
    Aug 1, 2013 at 15:05
  • @FDinoff: Yes, that was what I wanted (maybe you want to create an answer with that). Aug 1, 2013 at 15:25
  • 1
    @AntonisChristofides Just take Ingo's Answer.
    – FDinoff
    Aug 1, 2013 at 15:40

2 Answers 2

5

The plugin uses signs to show the lint errors. If you never want to see them

let g:pymode_lint_signs = 0

disables them.

If you want to clear them, AFAICT there's no interface in the plugin for just that. (You could file an enhancement request.) But what should work is clearing all signs of the current buffer:

:sign unplace * buffer=<C-r>=bufnr('')<CR>

or

:execute 'sign unplace * buffer=' . bufnr('')
4
  • I can't take this answer as it is now because it's too complicated, vim complains that the commands are wrong, and :sign unplace * is what I want. Aug 1, 2013 at 16:06
  • 1
    If this is too complex to type, you have several options: custom command, cabbrev, mapping, ... A simple :sign unplace * does more than what you want; it affects all signs in all buffers. But go ahead and use just that if you can live with the consequences. Aug 1, 2013 at 16:25
  • (I meant it's too complicated given that :sign unplace * does the job, but you made it clear that it has a problem.) Vim still complains these commands are wrong. While :sign unplace 1 buffer=1 works, :sign unplace * buffer=1 says "E474: Invalid argument". Aug 1, 2013 at 20:28
  • Oh, you need at least Vim 7.3.596 for that to work. Update your Vim, or use the worse alternative. Aug 2, 2013 at 6:14
2

PyLint marks are made with signs. (:h :sign)

You can use

:sign unplace *

to remove all the signs in all buffers. This will only be a problem if you want some buffers to keep signs.

If you only want to remove signs in only the current buffer you can use a mapping of Ingo Karkat's answer.

nnoremap <leader>s :execute 'sign unplace * buffer=' . bufnr('')<CR>

Take a look at :h :sign-unplace for other options.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.