]> Sergey Matveev's repositories - dotfiles.git/blobdiff - vim/.vim/ftplugin/python/pep8.vim
Vim scripts refactoring
[dotfiles.git] / vim / .vim / ftplugin / python / pep8.vim
index 7143e752f5d2c41090c9b3fce3a55f8a5d48f80f..8340721eebedd06510e43738c38fd6de04cc4ec2 100644 (file)
@@ -1,21 +1,3 @@
-" PEP8 caller
-" Maintainer: Sergey Matveev <stargrave@stargrave.org>
-" License: GNU General Public License version 3 of the License or later
-"
-" Call pycodestyle utility and fill quickfix window with its results.
-
+if exists("*python#pep8#do") | finish | endif
 sign define P8 text=P8 texthl=Error
-function! s:pep8()
-    set makeprg=PATH=$PATH\ pycodestyle\ --select=E,W\ %
-    silent make
-    sign unplace *
-    let l:id = 1
-    for item in getqflist()
-        execute(':sign place '.l:id.' name=P8 line='.l:item.lnum.' buffer='.l:item.bufnr)
-        let l:id = l:id + 2
-    endfor
-    redraw!
-    copen
-endfunction
-
-map <F5> :call <SID>pep8()<CR>
+map <buffer> <F5> :call python#pep8#do()<CR>