Code Monkey home page Code Monkey logo

flake8-vim's Introduction

Flake8-vim: frosted, pep8 and mcabe checker for Vim

Flake8-vim is a Vim plugin that checks python sources for errors. It's based on pylint-mode plugin by Kirill Klenov.

Installation

Manual installation

Clone plugin repository using Git:

git clone --recursive https://github.com/andviro/flake8-vim.git

Copy ftplugin folder into your Vim home directory.

Using plugin manager (recommended)

Install Vundle, then run bundle install command:

BundleInstall andviro/flake8-vim

Alternatively install Neobundle and load plugin using command:

NeoBundleInstall andviro/flake8-vim

Configuration

By default python source code is checked with frosted, pep8 and mccabe code complexity utility. The following options can be configured through global variables in .vimrc:

Auto-check file for errors on write:

let g:PyFlakeOnWrite = 1

List of checkers used:

let g:PyFlakeCheckers = 'pep8,mccabe,frosted'

Default maximum complexity for mccabe:

let g:PyFlakeDefaultComplexity=10

List of disabled pep8 warnings and errors:

let g:PyFlakeDisabledMessages = 'E501'

Default aggressiveness for autopep8:

let g:PyFlakeAggressive = 0

Default height of quickfix window:

let g:PyFlakeCWindow = 6 

Whether to place signs or not:

let g:PyFlakeSigns = 1 

When usign signs, this is the first id that will be used to identify the signs. Tweak this if you are using other plugins that also use the sign gutter

let g:PyFlakeSignStart = 1

Maximum line length for PyFlakeAuto command

let g:PyFlakeMaxLineLength = 100

Visual-mode key command for PyFlakeAuto

let g:PyFlakeRangeCommand = 'Q'

Force python 3 interface:

let g:PyFlakeForcePyVersion = 3

Commands

Disable/enable automatic checking of current file

:PyFlakeToggle

Run checks for current file

:PyFlake

Auto-fix pep8 errors for current file

:PyFlakeAuto

PyFlakeAuto command by default works with the whole file, but also accepts line ranges. Select some lines in Python code, then use :'<,'>PyFlakeAuto to re-format and fix pep8 errors for them. For every Python buffer Visual-mode shortcut is added to quickly fix selection ('Q' by default). Set global variable g:PyFlakeRangeCommand in .vimrc to change the key sequence. To disable visual mode mapping, set this variable to empty string.

Author

Andrew Rodionoff (@andviro)

Contributors

  • OGURA_Daiki (@hachibeeDI)
  • Pål (@maedox)
  • Charles (@char101)
  • Ronaldo Maia (@romaia)
  • @sgur

flake8-vim's People

Contributors

andviro avatar char101 avatar hachibeedi avatar sgur avatar romaia avatar

Watchers

Daniel Manary avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.