Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork772
Vim python-mode. PyLint, Rope, Pydoc, breakpoints from box.
License
python-mode/python-mode
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
This project needs contributors.
Documentation:
:help pymode
- https://github.com/python-mode/python-mode/wiki
Important notes:
From 2017-11-19 onwards python-mode uses submodules instead ofhard coding 3rd party libraries into its codebase. Please issue the command:
git submodule update --init --recursive
inside your python-mode folder.From 2019-12-14 onwards
python-mode
dropped python2 support. If youstill need to use it with python2 you should look for thelast-py2-support
branch and/or tag.
If you are a new user please clone the repos using the recursive flag:
git clone --recurse-submoduleshttps://github.com/python-mode/python-mode
Python-mode is a Vim plugin that magically converts Vim into a Python IDE.
Why Python-mode?
- Be more productive: Pymode saves time by bringing all the toolsnecessary for professional developers so that you can focus on biggerthings. It has been finely tuned based on decades of experience workingwith Vim and is constantly kept up to date.
- Get smart assistance: Pymode knows all about your code. We use thebest-in-class intellisense code completion, on-the-fly error checking andquick-fixes; easy project navigation and much more.
- Use the full power and capabilities of Vim: Unlike traditional IDEswhich can only provide a small subset of Vim functionalities, you can doeverything and anything that you can in Vim.
- Modular structure: We attempt to create Python-mode with the sameprinciples of python: i.e. have a modular structure, so that as and whenbetter libraries evolve, we can provide you the best experience, whileabstracting the details so that you can get back to what you do best.
- Written mostly in Python: 96.1% written in Python. Well, we love Python:)
The plugin contains all you need to develop python applications in Vim.
- Support Python 3.10.13, 3.11.9, 3.12.4, 3.13.0
- Syntax highlighting
- Virtualenv support
- Run python code (
<leader>r
) - Add/remove breakpoints (
<leader>b
) - Improved Python indentation
- Python motions and operators (
]]
,3[[
,]]M
,vaC
,viM
,daC
,ciM
, ...) - Improved Python folding
- Run multiple code checkers simultaneously (
:PymodeLint
) - Autofix PEP8 errors (
:PymodeLintAuto
) - Search in python documentation (
<leader>K
) - Code refactoring
- Intellisense code-completion
- Go to definition (
<C-c>g
) - And more, more ...
See a screencast here:http://www.youtube.com/watch?v=67OZNp9Z0CQ.
Another old presentation here:http://www.youtube.com/watch?v=YhqsjUUHj6g.
To read python-mode documentation in Vim, use:help pymode
.
Vim >= 7.3 (most features needed +python3 support) (also--with-features=big
if you wantg:pymode_lint_signs
).
As of vim8 there is an officially supported way of adding plugins. See:tab help packages
in vim for details.
cd ~/.vim/pack/python-mode/startgit clone --recurse-submodules https://github.com/python-mode/python-mode.gitcd python-mode
Note. Windows OS users need to add-c core.symlinks=true
. See below.
cd ~/.vimmkdir -p bundle && cd bundlegit clone --recurse-submodules https://github.com/python-mode/python-mode.git
Enablepathogen in your~/.vimrc
:
" Pathogen loadfiletype offcall pathogen#infect()call pathogen#helptags()filetype plugin indent onsyntax on
Include the following in thevim-plugsection of your~/.vimrc
:
Plug 'python-mode/python-mode', { 'for': 'python', 'branch': 'develop' }
Add the following:
" python-mode: PyLint, Rope, Pydoc, breakpoints from box." https://github.com/python-mode/python-modeNeoBundleLazy 'python-mode/python-mode', { 'on_ft': 'python' }
% git clone --recurse-submodules https://github.com/python-mode/python-mode.git% cd python-mode% cp -R * ~/.vim
Then rebuildhelptags in vim:
:helptags ~/.vim/doc/
filetype-plugin (:help filetype-plugin-on
) andfiletype-indent(:help filetype-indent-on
) must be enabled to use python-mode.
For consistent testing across different Python versions, python-mode provides aDocker-based testing environment. This is especially useful for contributorsand developers who want to test the plugin with different Python versions.
# Run tests with default Python version (3.13.0)./scripts/run-tests-docker.sh# Run tests with specific Python version./scripts/run-tests-docker.sh 3.11# Run tests with all supported Python versions./scripts/test-all-python-versions.sh
The Docker environment supports the following Python versions:
- 3.10.13
- 3.11.9
- 3.12.4
- 3.13.0 (default)
For detailed information about the Docker testing environment, seeREADME-Docker.md.
- Docker
- Docker Compose
First read our shortFAQor using:help pymode-faq
.If your question is not described there then you already know what to do(because you read the first item of our FAQ :) ).
Nevertheless just a refresher on how to submit bugs:
(From the FAQ)
Clear all python cache/compiled files (*.pyc
files and__pycache__
directory and everything under it) from yourpython-mode install directory.
In Linux/Unix/MacOS you can run:
find <path_to_pymode> -type f -iname '*.pyc' -o -iname '*.pyo' -delete && find . -type d -name '__pycache__' -delete
Then start python mode with:
vim -i NONE -u <path_to_pymode>/debugvimrc.vim
Reproduce the error and submit your python mode debug file. You can check itslocation with:messages
for something like:
pymode debug msg 1: Starting debug on: 2017-11-18 16:44:13 with file /tmp/pymode_debug_file.txt
Please submit the entire content of the file along with a reasoning of why theplugin seems broken.
Do check for sensitive information in the file before submitting.
Please, also provide more contextual information such as:
- your Operational System (Linux, WIndows, Mac) and which version
- the
vim --version
output - which is your default python (
python --version
) - the python version that vim has loaded in your tests:
:PymodePython import sys; print(sys.version_info)
output.
- and if you are using virtualenvs and/or conda, also state that, please.
- It would be good also to provide the output of the two following commands:
git status
(under yourpython-mode directory)tree <python-mode-directory>
or something similar (such asls -lR
)
If you're using the Docker testing environment, also provide:
- The output of
docker --version
anddocker compose version
- The Python version used in Docker (if testing with a specific version)
- Any Docker-related error messages
- The output of
./scripts/run-tests-docker.sh --help
(if available)
Read this section before opening an issue on the tracker.
Vimhas issues to work with bothpython2 and python3 at the same time, so if your VIM is compiled with supportto both version you may find problems. The best way to handle it is to buildyour vim again with only python3 support.Hereis a good reference on how to build vim from source.
python-mode
supports only python3, so, if you are using python2 we cannothelp you that much. Look for our branch with python2-support (old version,not maintained anymore) (last-py2-support
).
python-mode
supports only Python 3. The project has completely removed Python 2support since version 0.11.0. Currently supported Python versions are:3.10.13, 3.11.9, 3.12.4, and 3.13.0.
If you need Python 2 support, you can use the legacylast-py2-support
branch,but it is no longer maintained.
Vimhas issues when compiled withboth Python 2 and Python 3 support. For best compatibility with python-mode,build Vim with only Python 3 support. Seethis guidefor building Vim from source.
Users on Windows OS might need to add-c core.symlinks=true
switch tocorrectly clone / pull repository. Example:git clone --recurse-submodules https://github.com/python-mode/python-mode -c core.symlinks=true
If you encounter issues with the Docker testing environment:
Build Failures: Ensure Docker and Docker Compose are properly installedand up to date. The Dockerfile requires Ubuntu 24.04 packages.
Python Version Issues: Verify that the requested Python version issupported (3.10.13, 3.11.9, 3.12.4, 3.13.0). Use the major.minor format(e.g.,
3.11
) when specifying versions.Vim Build Issues: The Docker environment builds Vim from source withPython support for each version. Ensure sufficient disk space and memoryfor the build process.
Test Failures: If tests fail in Docker but pass locally, check thatall git submodules are properly initialized and the correct Python versionis active.
For detailed troubleshooting, seeREADME-Docker.md.
If you are trying to update the plugin (using a plugin manager or manually) andyou are seeing an error such as:
Server does not allow request for unadvertised object
Then we probably changed some repo reference or some of our dependencies had agit push --force
in its git history. So the best way for you to handle it isto run, inside thepython-mode
directory:
git submodule update --recursive --init --force
git submodule sync --recursive
Documentation is available in your vim:help pymode
.
If you have any suggestions, bug reports or annoyances please report them tothe issue tracker at:https://github.com/python-mode/python-mode/issues
The contributing guidelines for this plugin are outlined at:help pymode-development
.
Before contributing, please:
Test with Docker: Use the Docker testing environment to ensure yourchanges work across all supported Python versions (3.10.13, 3.11.9, 3.12.4, 3.13.0)
Run Full Test Suite: Use
./scripts/test-all-python-versions.sh
to testwith all supported Python versionsCheck CI: Ensure the GitHub Actions CI passes for your changes
Follow Development Guidelines: See
:help pymode-development
for detaileddevelopment guidelines
- Author: Kirill Klenov (https://github.com/klen)
- Maintainers:
- Felipe Vieira (https://github.com/fmv1992)
- Diego Rabatone Oliveira (https://github.com/diraol)
Also see the AUTHORS file.
Development of python-mode happens at github:https://github.com/python-mode/python-mode
Please make a pull request to development branch and add yourself to AUTHORS.
Vendored Python modules are located mostly inpymode/libs/.
Copyright © 2013-2015 Kirill Klenov (https://github.com/klen).
Licensed under aGNU lesser general public license.
If you like this plugin, I would very appreciated if you kindly send mea postcard :) My address is here: "Russia, 143500, MO, Istra, pos. Severny 8-3"to "Kirill Klenov".Thanks for support!
About
Vim python-mode. PyLint, Rope, Pydoc, breakpoints from box.
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Sponsor this project
Uh oh!
There was an error while loading.Please reload this page.
Packages0
Uh oh!
There was an error while loading.Please reload this page.