GithubHelp home page GithubHelp logo

fudong1127 / python-mode Goto Github PK

View Code? Open in Web Editor NEW

This project forked from python-mode/python-mode

0.0 1.0 0.0 10.98 MB

Vim python-mode. PyLint, Rope, Pydoc, breakpoints from box.

License: GNU Lesser General Public License v3.0

python-mode's Introduction

logo Python-mode, Python in VIM

https://travis-ci.org/klen/python-mode.png?branch=develop Donate

Python-mode is a vim plugin that helps you to create python code very quickly by utilizing libraries including pylint, rope, pydoc, pyflakes, pep8, and mccabe for features like static analysis, refactoring, folding, completion, documentation, and more.

The plugin contains all you need to develop python applications in Vim.

There is no need to install pylint, rope or any other Python libraries on your system.

  • Support Python version 2.6+ and 3.2+
  • Syntax highlighting
  • Virtualenv support
  • Run python code (<leader>r)
  • Add/remove breakpoints (<leader>b)
  • Improved Python indentation
  • Python folding
  • Python motions and operators (]], 3[[, ]]M, vaC, viM, daC, ciM, ...)
  • Code checking (pylint, pyflakes, pylama, ...) that can be run simultaneously (:PymodeLint)
  • Autofix PEP8 errors (:PymodeLintAuto)
  • Search in python documentation (K)
  • Code refactoring <rope refactoring library> (rope)
  • Strong code completion (rope)
  • Go to definition (<C-c>g for :RopeGotoDefinition)
  • And more, more ...

See (very old) screencast here: http://www.youtube.com/watch?v=67OZNp9Z0CQ (sorry for quality, this is my first screencast) Another old presentation here: http://www.youtube.com/watch?v=YhqsjUUHj6g

To read python-mode documentation in Vim, see :help pymode.txt

Requirements

  • VIM >= 7.3 (mostly features needed +python or +python3 support) (also --with-features=big if you want g:pymode_lint_signs)

How to install

Using pathogen (recomended)

% cd ~/.vim
% mkdir -p bundle && cd bundle
% git clone git://github.com/klen/python-mode.git
  • Enable pathogen in your ~/.vimrc:

    " Pathogen load
    filetype off
    
    call pathogen#infect()
    call pathogen#helptags()
    
    filetype plugin indent on
    syntax on
    

Manually

% git clone git://github.com/klen/python-mode.git
% cd python-mode
% cp -R * ~/.vim

Then rebuild helptags in vim:

:helptags ~/.vim/doc/

Note

filetype-plugin (:help filetype-plugin-on) and filetype-indent (:help filetype-indent-on) must be enabled to use python-mode.

Debian packages

Repository URL: http://klen.github.io/python-mode/deb/ Install with commands:

add-apt-repository http://klen.github.io/python-mode/deb main
apt-get update
apt-get install vim-python-mode

If you are getting the message: "The following signatures couldn't be verified because the public key is not available":

apt-key adv --keyserver keyserver.ubuntu.com --recv-keys B5DF65307000E266

vim-python-mode using vim-addons, so after installation just enable python-mode with command:

vim-addons install python-mode

Troubleshooting

If your python-mode doesn't work:

  1. Load Vim with only python-mode enabled (use debug.vim from pymode):

    vim -u <path_to_pymode>/debug.vim
    

And try to repeat your case. If no error occurs, seems like problem isn't in the plugin.

  1. Type :PymodeTroubleshooting

And fix any warnings or copy the output and send it to me. (For example, by creating a new github issue if one does not already exist for the problem).

Customization

You can override the default key bindings by redefining them in your .vimrc, for example:

" Override go-to.definition key shortcut to Ctrl-]
let g:pymode_rope_goto_definition_bind = "<C-]>"

" Override run current python file key shortcut to Ctrl-Shift-e
let g:pymode_run_bind = "<C-S-e>"

" Override view python doc key shortcut to Ctrl-Shift-d
let g:pymode_doc_bind = "<C-S-d>"

Documentation

Documentation is available in your vim :help pymode

Bugtracker

If you have any suggestions, bug reports or annoyances please report them to the issue tracker at https://github.com/klen/python-mode/issues

Contributing

See the AUTHORS file.

Development of python-mode happens at github: https://github.com/klen/python-mode

Please make a pull request to development branch and add yourself to AUTHORS.

Copyright

Copyright © 2013 Kirill Klenov (klen)

License

Licensed under a GNU lesser general public license.

If you like this plugin, you can send me postcard :) My address is here: "Russia, 143401, Krasnogorsk, Shkolnaya 1-19" to "Kirill Klenov". Thanks for support!

python-mode's People

Contributors

alienth avatar alvinfrancis avatar bendavis78 avatar blueyed avatar bmease avatar bruston avatar codito avatar cu3po42 avatar dirkwallenstein avatar dkasak avatar eshilts avatar ethanvandenberg22 avatar fhenrysson avatar fisadev avatar florentx avatar igorgue avatar jawrainey avatar jgosmann avatar jonnymcc avatar kdeldycke avatar klen avatar krader1961 avatar lawrenceakka avatar lodagro avatar mjperrone avatar nixon avatar s0undt3ch avatar sjl avatar tramchamploo avatar winged avatar

Watchers

 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.