ftplugin/python/flyquickfixmake.vim

Thu Aug 13 00:44:36 2009 +0900

author
hattori@www.hexacosa.net
date
Thu Aug 13 00:44:36 2009 +0900
changeset 14
a9ab5f3c6a3e
parent 13
2b0b8dadb0e1
child 17
bf5ed9b4dc87
permissions
-rw-r--r--

added file-header

     1 "" flyquickfixmake.vim (Modified to Python)
     2 "" [Install] copy to $HOME/.vim/ftplugin/python/
     3 "" [Require] pylint,pyflakes,pep8.py
     5 function! FlyquickfixPrgSet(mode)
     6     if a:mode == 0
     7         """ setting for pylint
     8         setlocal makeprg=/usr/bin/pylint\ --rcfile=$HOME/.pylint\ -e\ %
     9         setlocal errorformat=%t:%l:%m
    10         echo "flymake prg: pylint"
    11     elseif a:mode == 1
    12         """ setting for pyflakes
    13         setlocal makeprg=/usr/local/bin/pyflakes\ %
    14         setlocal errorformat=%f:%l:%m
    15         echo "flymake prg: pyflakes"
    16     else
    17         """ setting for pep8.py
    18         setlocal makeprg=/usr/local/bin/pep8.py\ %
    19         setlocal errorformat=%f:%l:%c:%m
    20         echo "flymake prg: pep8.py"
    21     endif
    22 endfunction
    24 function! FlyquickfixToggleSet()
    25     if g:python_flyquickfixmake == 1
    26         au! BufWritePost
    27         echo "not-used flymake"
    28         let g:python_flyquickfixmake = 0
    29     else
    30         echo "used flymake"
    31         let g:python_flyquickfixmake = 1
    32         au BufWritePost *.py make
    33     endif
    34 endfunction
    36 if !exists("g:python_flyquickfixmake")
    37     let g:python_flyquickfixmake = 1
    38     call FlyquickfixPrgSet(8)
    39     "au BufWritePost *.py silent make
    40     au BufWritePost *.py make
    41 endif
    43 map fs :call FlyquickfixToggleSet()<CR>
    44 map pl :call FlyquickfixPrgSet(0)<CR>
    45 map pf :call FlyquickfixPrgSet(1)<CR>
    46 map p8 :call FlyquickfixPrgSet(8)<CR>

mercurial