Git Product home page Git Product logo

python-mode's Introduction

Testing python-mode

Python-mode, a Python IDE for Vim


This project needs contributors.

Documentation:


Important notes:

  • From 2017-11-19 onwards python-mode uses submodules instead of hard 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 you still need to use it with python2 you should look for the last-py2-support branch and/or tag.

If you are a new user please clone the repos using the recursive flag:

git clone --recurse-submodules https://github.com/python-mode/python-mode


Python-mode is a Vim plugin that magically converts Vim into a Python IDE.

Why Python-mode?

  1. Be more productive: Pymode saves time by bringing all the tools necessary for professional developers so that you can focus on bigger things. It has been finely tuned based on decades of experience working with Vim and is constantly kept up to date.
  2. Get smart assistance: Pymode knows all about your code. We use the best-in-class intellisense code completion, on-the-fly error checking and quick-fixes; easy project navigation and much more.
  3. Use the full power and capabilities of Vim: Unlike traditional IDEs which can only provide a small subset of Vim functionalities, you can do everything and anything that you can in Vim.
  4. Modular structure: We attempt to create Python-mode with the same principles of python: i.e. have a modular structure, so that as and when better libraries evolve, we can provide you the best experience, while abstracting the details so that you can get back to what you do best.
  5. 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 and 3.6+
  • 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.

Requirements

Vim >= 7.3 (most features needed +python3 support) (also --with-features=big if you want g:pymode_lint_signs).

How to install

Manually (according to vim's package structure)

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/start
git clone --recurse-submodules https://github.com/python-mode/python-mode.git
cd python-mode

Note. Windows OS users need to add -c core.symlinks=true. See below.

pathogen

cd ~/.vim
mkdir -p bundle && cd bundle
git clone --recurse-submodules https://github.com/python-mode/python-mode.git

Enable pathogen in your ~/.vimrc:

" Pathogen load
filetype off

call pathogen#infect()
call pathogen#helptags()

filetype plugin indent on
syntax on

vim-plug

Include the following in the vim-plug section of your ~/.vimrc:

Plug 'python-mode/python-mode', { 'for': 'python', 'branch': 'develop' }

NeoBundle

Add the following:

" python-mode: PyLint, Rope, Pydoc, breakpoints from box.
" https://github.com/python-mode/python-mode
NeoBundleLazy 'python-mode/python-mode', { 'on_ft': 'python' }

Manually

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

Then rebuild helptags in vim:

:helptags ~/.vim/doc/

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

Troubleshooting/Debugging

First read our short FAQ or 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 your python-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 its location 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 the plugin 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 your python-mode directory)
  • tree <python-mode-directory> or something similar (such as ls -lR)

Frequent problems

Read this section before opening an issue on the tracker.

Python 2/3 vim support

Vim has issues to work with both python2 and python3 at the same time, so if your VIM is compiled with support to both version you may find problems. The best way to handle it is to build your vim again with only python3 support. Here is a good reference on how to build vim from source.

Python 3 syntax

python-mode supports only python3, so, if you are using python2 we cannot help you that much. Look for our branch with python2-support (old version, not maintained anymore) (last-py2-support).

Symlinks on Windows

Users on Windows OS might need to add -c core.symlinks=true switch to correctly clone / pull repository. Example: git clone --recurse-submodules https://github.com/python-mode/python-mode -c core.symlinks=true

Error updating the plugin

If you are trying to update the plugin (using a plugin manager or manually) and you 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 a git push --force in its git history. So the best way for you to handle it is to run, inside the python-mode directory:

  • git submodule update --recursive --init --force
  • git submodule sync --recursive

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/python-mode/python-mode/issues

Contributing

The contributing guidelines for this plugin are outlined at :help pymode-development.

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.

Python libraries

Vendored Python modules are located mostly in pymode/libs/.

Copyright

Copyright © 2013-2015 Kirill Klenov (https://github.com/klen).

License

Licensed under a GNU lesser general public license.

If you like this plugin, I would very appreciated if you kindly send me a postcard :) My address is here: "Russia, 143500, MO, Istra, pos. Severny 8-3" to "Kirill Klenov". Thanks for support!

python-mode's People

Contributors

alvinfrancis avatar andriykohut avatar avacariu avatar bkbncn avatar blueyed avatar brycepg avatar codito avatar diraol avatar fmv1992 avatar fpob avatar kamranmaharov avatar klen avatar lawrenceakka avatar lieryan avatar lodagro avatar marsoft avatar mattdodge avatar mjperrone avatar nixon avatar nvie avatar pidelport avatar ram-z avatar s0undt3ch avatar sjl avatar westurner avatar wilywampa avatar wjstarrsiii avatar wlonk avatar zcodes avatar zhimsel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

python-mode's Issues

Don't understand how to configure pylint

Hi, I like your plugin and I learned about pylint and other tools from it.
I have a " $HOME/.pylintrc in my folder with the contents
[FORMAT]
indent-string=' '

when I run the default pylint it does not warn me about these errors but when I run :PyLint in vim I always get the warnings
|10 warning| Bad indentation. Found 2 spaces, expected 4

Any clue to what I am doing wrong?

Thanks!

Requirements issue

On my Debian Squeeze, I don't have vim compiled with python support, so I need to compile it from source.
Today I tried python-mode and get E319 error - sign command is not available (this commands defined in after/plugin/pymode_lint.vim, lines 32-35.
Here I read that to support sign command, Vim must be compiled with --with-features=big flag, which normal by default.
So, I think, this must be written in requirements part of documentation

ImportError: cannot import name MANAGER

Hi,

I'm trying to install the plugin in macvim, I'm using vundle (https://github.com/gmarik/vundle), so what i've done it's copy the plugin into the bundle folder and run :BundleInstall.

After that when I run macvim, this is what i get:

Error detected while processing /Users/flopez/.vim/bundle/python-mode/after/plugin/pymode_lint.vim:
line 60:
Traceback (most recent call last):
File "", line 4, in
ImportError: cannot import name MANAGER

Best regards

Documentation/README errors

Hi, I've added all default settings to my vimrc to see what I can modify.

Firstly I get following errors:

E492: Not an editor command: leg g:pymode_syntax_print_as_function = 0
E492: Not an editor command: leg g:pymode_syntax_indent_errors = g:pymode_syntax_all
E492: Not an editor command: leg g:pymode_syntax_space_errors = g:pymode_syntax_all
E492: Not an editor command: leg g:pymode_syntax_string_formatting = g:pymode_syntax_all
E492: Not an editor command: leg g:pymode_syntax_string_format = g:pymode_syntax_all

Also there was one more due to

let g:pymode_rope_autoimport_modules = ["os","shutil","datetime"])

My vimrc is available here http://hg.jackleo.info/vim-configs/src/tip/vimrc
List of plugins used - http://hg.jackleo.info/vim-configs/src/tip/bundle

VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Sep 21 2011 09:34:32)
Included patches: 1-315
Modified by [email protected]
Compiled by [email protected]
Huge version without GUI.

error in .vim/plugin/pymode.vim

line 154 :
Traceback (most recent call last):
File "", line 6, in
ImportError: No module named logilab.astng.builder
line 267 行
Traceback (most recent call last):
File "", line 1, in
File "/home/asuka/.vim/pylibs/ropevim.py", line 6, in
import ropemode.decorators
ImportError: No module named ropemode.decorators

omni complete is very slow and use high CPU

I have many vim scripts for python in vimrc.
Here is two screenshot :
the first one is searching something. use a long time.
http://ompldr.org/vYjZtaQ
second is the completion for python.
http://ompldr.org/vYjZtaw
Is there a way to speed up this completion ? or maybe somewhere is wrong ?
Maybe I should debug this, but I do not know how to see the process of completion.

Here is other vim scripts in vimrc:
AutoComplPop
SuperTab
pythoncomplete
indentpython.vim--nianyang
SimpylFold
vim-pep8

Check on save not working with Turkish locale

I'm using tr_TR.UTF-8 as my system locale.
in pylibs/logilab/astng/rebuilder.py line 142:
visit_name = 'visit_' + REDIRECT.get(cls_name, cls_name).lower()

locale dependent string method lower() is called and that doesn't work sometimes because upper I letter is not converted to lower i in Turkish locale.
possible fix is to set CTYPE locale to C before using locale dependent string functions. I could fix this issue by adding those two lines above line 142:

import locale
locale.setlocale(locale.LC_CTYPE, "C")

inline pylint override appears to break python mode

I have the following method in a new script.

#def create_app(database_uri='sqlite://'):
#    """ Construct the flask application """
#    app = Flask(__name__)
#    app.config.from_object(settings)
#
#    DB.create_all(app=app)
#
#    @app.route('/')
#    def index():  # pylint: disable=C0111,W0612
#        return "we're live"
#    return app

Whether it is commented in or out, that pylint directive does its work and suppresses the docstring (and one other error) but it does something bad to the Quickfix List.

[Quickfix List]
Quickfix: 16
Error detected while processing function pymode#lint#Check..pymode#PlaceSigns:
line    3:
E155: Unknown sign: I
E155: Unknown sign: I
Press ENTER or type command to continue

pylint related error on linux mint 12

Hi, just done fresh install of gvim, pathogen, python-mode (by following readme).
No other plugins installed.

After trying to save some file, for example:
x,y = (10,20)

It shows the following error.

[Quickfix List]
Quickfix: 1
Error detected while processing function pymode#lint#Check:
line 23:
E121: Undefined variable: b:qf_list
E15: Invalid expression: b:qf_list

Sorry for inconvenience)
Boris.

Docs window opens on auto completion

Since a few weeks, whenever I start writing a word and press Ctrl+Space to start the auto completion, I do get the small popup giving me the possible options as usual but at the same time a new buffer opens on top of the screen showing the docstring of the item that was first in the list of the options.

This did not happen when I started using python-mode a while ago. Is there any new setting to disable this behavior?

And by the way: Is it possible to remap the cursor keys to Ctrl+hjkl while navigating in the auto completion popup box? Usually I use autocompletion quite a lot but having to select the correct item with the cursor keys somehow defeats the whole purpose of using vim with its hjkl approach to navigation :)

confusing pylint configuration

I see a pylint.ini in the Python-mode-klen dir, but it does not appear to be used. I put a .pylintrc in my ~ and it seems to be a complete replacement of the default, not additional settings.

Can you clarify the locations and configuration of pylint?

auto popup feature

Did you know that vim plugin "AutoComplPop" ? I hope "python-mode" can add auto-popup feature too. Pressing too many times is not a good idea.
Because "AutoComplPop" can not display preview info of completion, like "time fun", here fun will awesome.

python-mode strange omnicomplete behavior

Setup:

import itertools
itertools.ch|

where | is the cursor.

Before installing python-mode, the word omnicompletes to itertools.chain. After, it completes to itertools.chchain.

Plugin Doesn't Work After Installation

I am slightly mixed up with the installation process; which folders do I move to the ~/.vim directory? I tried moving the individual folders to the ~/.vim directory, but nothing seems to be working --not even ":help PythonMode" or ":help PythonModeOptions". Could you kindly assist with steps I should follow to enable the plugin?

Buffer read only after save

VIM 7.3, Windows (tested on Windows XP, Vista and 7)

Using default configuration, PyLint is run after writing the buffer.

Then any following buffer write fails with E505: "filename" is read-only message.

I'd like the buffer to remain writable after PyLint runs (so disabling PyLint is a dirty workaround)

Feature request: show error message in status line when cursor is placed at the error line

I like the ability of pyflakes-vim and vim-pep8 plugins to show error message in statusline if cursor is placed at the error line. The example screen shows a message from vim-pep8 (cursor is at the line 0):

   EE  1 import os                                                                      
       0 class A():                                                                                                                        
-      1     pass                                                                       
       2                                                                                
  /tmp/test.py [python] [tw: 0]                                                                                         2,10           Весь
 E302 expected 2 blank lines, found 0

I set g:pymode_lint_cwindow = 0 to get rid of annoying jumps of quickfix window so I have no way to see the error.

let g:ropevim_goto_def_newwin = 1 does not work

I have this in my .vimrc : let g:ropevim_goto_def_newwin = 1 and it used to work.
However today I realized that it does not work any more.

I checked the rope repository and at least according to their docs, that setting should still exist.

Does python-mode override this somehow?

function RopeShowDoc error

handing function RopeShowDoc error:
the 1st line:
E116: Invalid arguments for function helpers#ShowPreview
Traceback (most recent call last):
File "", line 1, in
File "/home/asuka/.vim/pylibs/ropemode/decorators.py", line 55, in newfunc
return func(_args, *_kwds)
File "/home/asuka/.vim/pylibs/ropemode/interface.py", line 184, in show_doc
self._base_show_doc(prefix, codeassist.get_doc)
File "/home/asuka/.vim/pylibs/ropemode/interface.py", line 200, in base_show
doc
self.env.show_doc(docs, prefix)
File "/home/asuka/.vim/pylibs/ropevim.py", line 252, in show_doc
vim.command("call helpers#ShowPreview('%s')" % docs)
vim.error
this happened when I went to the definition on 're' in 'import re'.
So is with 'go do doc'

No config file found, using default configuration (pylint)

Superb plugin, so far!

Whenever I open a .py file, I get an error message:

Error detected while processing /home/martin/mbrochh-dotfiles/.vim/bundle/python-mode/ftplugin/python/lint.vim:
line 62:
No config file found, using default configuration

After that, the actual file is opened. It's a bit annoying... what config file is missing and where do I have to put it?

Thanks a lot!
Martin

still function RopeGotoDefinition

this can be reproduced only left file unsaved.
Traceback (most recent call last):
File "", line 1, in
File "/home/asuka/.vim/pylibs/ropemode/decorators.py", line 55, in newfunc
return func(_args, *_kwds)
File "/home/asuka/.vim/pylibs/ropemode/interface.py", line 153, in goto_defini
tion
self._goto_location(definition[0], definition[1])
File "/home/asuka/.vim/pylibs/ropemode/interface.py", line 434, in _goto_locat
ion
other=self.env.get('goto_def_newwin'))
File "/home/asuka/.vim/pylibs/ropevim.py", line 206, in find_file
vim.command('e %s' % filename)
vim.error

dulplicate completion

I have an object a and it has a method abc.
Then I type
a.ab
here I press Ctrl x and Ctrl o. And there shows 'a.ababc'
I'm sure it has nothing to do with my .vimrc and I only have a NerdTree plugin

Not an editor command: PyLint

I wouldn't be surprised if this is a configuration issue on my part, but I thought I'd check. The documentation aspect of the plugin is working great, as well as ropevim, but I can't get any of the PyLint portion to work. I can do :help PyLint and get the documentation from the plugin, but trying :PyLint tells me that the editor command doesn't exist. Also, saving isn't firing PyLint off, and there aren't even any errors in that respect.

My install of vim does have Python support. I'm using vim 7.3 on Mac OSX. I've left all the python-mode defaults alone, and even tried explicitly enabling pylint in my vimrc. Hasn't seem to make much of a difference though. Any idea what might be going on? Thanks for any help, and for the great plugin :)

socket.py ImportError DLL load failed R6034

on window7,use portable python2.6.1 ,in vim add this plugin,after run show error info:
...
socket.py ImportError DLL load failed R6034
..
from _socket import *
..
but in python shell, from _socket import * is ok.

function RopeGotoDefinition error

Traceback (most recent call last):
File "", line 1, in
File "/home/asuka/.vim/pylibs/ropemode/decorators.py", line 55, in newfunc
return func(_args, *_kwds)
File "/home/asuka/.vim/pylibs/ropemode/interface.py", line 153, in goto_definition
self._goto_location(definition[0], definition[1])
File "/home/asuka/.vim/pylibs/ropemode/interface.py", line 434, in _goto_location
other=self.env.get('goto_def_newwin'))
File "/home/asuka/.vim/pylibs/ropevim.py", line 206, in find_file
vim.command('e %s' % filename)
vim.error

Toggle pylint cwindow function

Hi,

There are times when pylint hotfix buffer (cwindow) is annoying. I've created a function in my config to toggle g:pymode_linkt_cwindow, but the perfect solution would be a python-mode function that not only sets the g:pymode_lint_window variable, but also shows/hides current cwindow accordingly :) a PyLintCwindowToggle :)

File is set as readonly when using PyLint

When I have PyLint checker as PyLint, after I save a file once, my settings are switched to confirm (was noconfirm) and the python file is set to read only. Even after changing both of those settings, I still am told that the file is read only, no matter how many times I set noreadonly. The error I get is E505. Running pyflakes as the lint checker works fine.

Error detected while processing function pymode#CheckProgram

Hello,
I have problem with python-mode on Vim 7.3 64bit on Windows 7.

Error detected while processing function pymode#CheckProgram:

line 6:

Can't find 'pydoc'. Please set g:pydoc, or extend $PATH, or disable
pymode_doc.

Can't find 'python'. Please set g:python, or extend $PATH, or disable
pymode_run.

standart :py in vim works, but plugin cannot find python I do not understand why.
Thanks,
Tom

Pylint regex fix for windows

Currently the pylint regex is:

pylint_re = re.compile('^[^:]+:(\d+): \[([EWRCI]+)[^\]]*\] (.*)$')

This fails on windows because the filename returned from pylint uses windows drivepaths, which use a : after the first letter. This regex works with either windows or linux:

pylint_re = re.compile('^(.:)?[^:]+:(\d+): \[([EWRCI]+)[^\]]*\] (.*)$')

Error when loading Vim on Windows after install

I use Vim on Windows.
I installed the plugin using Vundle.
After opening a new Vim process I get the following error:

Error detected while processing C:\Users\Owner\.vim\bundle\python-mod
e\plugin\pymode.vim:

line  205:

Error in sys.excepthook:

Traceback (most recent call last):

  File "C:\Python27\lib\site-packages\sitecustomize.py", line 5, in info

    if hasattr(sys, 'ps1') or not sys.stderr.isatty():

AttributeError: isatty

Original exception was:

Traceback (most recent call last):

  File "<string>", line 2, in <module>

  File "build\bdist.win32\egg\ipdb\__init__.py", line 1, in <module>

    # -*- coding: utf-8 -*-

  File "build\bdist.win32\egg\ipdb\__main__.py", line 11, in <module>

  File "C:\Python27\lib\site-packages\ipython-0.11-py2.7.egg\IPython\__init
__.py", line 43, in <module>

    from .config.loader import Config

  File "C:\Python27\lib\site-packages\ipython-0.11-py2.7.egg\IPython\confi
g\loader.py", line 26, in <module>

    from IPython.utils.path import filefind, get_ipython_dir

  File "C:\Python27\lib\site-packages\ipython-0.11-py2.7.egg\IPython\utils\
path.py", line 22, in <module>

    from IPython.utils import warn

  File "C:\Python27\lib\site-packages\ipython-0.11-py2.7.egg\IPython\utils\
warn.py", line 19, in <module>

    from IPython.utils import io

  File "C:\Python27\lib\site-packages\ipython-0.11-py2.7.egg\IPython\utils\
io.py", line 91, in <module>

    stdout = IOStream(sys.stdout)

  File "C:\Python27\lib\site-packages\ipython-0.11-py2.7.egg\IPython\utils\
io.py", line 32, in __init__

    raise ValueError("fallback required, but not specified")

ValueError: fallback required, but not specified

Running vim/gvim with python-mode 0.5 takes 5 seconds (Ubuntu)

First - thanks for python-mode - I've been waiting ages for a better Vim environment for my Python coding, thank you!

I was using python-mode on a work machine with Windows, it ran fine and didn't slow down the start of GVim (Windows 7, Python 2.7). I didn't use a package manager.

Now I'm using python-mode 0.5 on my laptop under Ubuntu 11.04 with Pathogen (fresh install) and Python 2.7 - with python-mode in my bundle directory like:
$ ls ~/.vim/bundle/

nerdtree python-mode
it takes 4 to 5 seconds to start. If I move python-mode out of the bundle directory then it takes 2 seconds to start.

This installation is actually running in a VirtualBox (running on an 8 core laptop with Linux Mint 12 [based on Ubuntu 11.10], 8GB RAM, SSD drive), I accept a slight overhead for disk access but going from 2 seconds to 5 seconds is too slow.

The slow start happens if I'm editing an existing file or with no file e.g.:
gvim # takes 5 seconds
gvim somefile.py # takes 5 seconds

I have pylint installed in my virtualenv, it runs correctly inside gvim and it runs correctly from the command line. The only other plugin I have is nerdtree.

This is my .vimrc - perhaps I need to change the order of things?
ian@ian-strongsteam-VirtualBox:~/.vim/bundle$ more ~/.vimrc
filetype on
filetype plugin on
filetype indent on
let Tlist_Ctags_Cmd='/usr/local/bin/ctags'
autocmd FileType python set omnifunc=pythoncomplete#Complete
" config for pathogen https://github.com/tpope/vim-pathogen
call pathogen#infect()
set nocompatible " use Vim rather than vi defaults
" http://superuser.com/questions/10588/how-to-make-cut-copy-paste-in-gvim-on-ubuntu-work-with-ctrlx-ctrlc-ctrlv
source $VIMRUNTIME/mswin.vim
behave mswin
" setup NERDTree on Ctrl N
nmap :NERDTreeToggle
set expandtab
set tabstop=8
set softtabstop=4
set shiftwidth=4
set autoindent
:syntax on
set lines=40 columns=120
" Pathogen load via https://github.com/klen/python-mode
call pathogen#helptags()
syntax on " turns syntax colouring on

I saw the FAQ entries
https://github.com/klen/python-mode#id18
and removed a .ropeproject directory from further up the tree - that didn't change the 5 second loading speed.

I'm very happy to make changes - can someone suggest some things I should try?

Many thanks, Ian.

"Making rename changes..." runs too slow

Renaming itself is very fast (especially second and later runs),
but after renaming vim indicates in status bar "Making rename changes..."
about 20 seconds and maximum loads CPU

Playing with lint checker variables in vimrc have no effect at all:
let g:pymode_lint_checker = "pyflakes"
let g:pymode_lint = 0

May be I forgot something obvious?
I use:

  • windows xp
  • latest python-mode from git (installed not from pathogen)
  • python 2.6.5
  • vim 7.3

Incompatibility with Pyflakes

Hi,

Python-mode is incompatible with Pyflakes. Mainly because of the python function name collision (check()), and both uses the same quick fix window and left side bar markers.

PyLint in Python-mode is also slow, so preferably I would keep Pyflakes quick on-the-fly checks if possible.

Focus jumps to quickfix window after pylint

I have g:pymode_lint_onfly set to 1. This works, but the focus jumps from an editor into a first line in quickfix window. I want focus to stay in current buffer. Is there a setting to do so?

Thanks!

Ctrl-space choose the first one just like the LuckyAssist.

for example: type
import math
math.
here I press ctrl space and then comes the 'acos'
Otherwise my IM binds the ctrl space and I change it to ctrl shift space. I don't know if it matters.What I wish is to set it to Alt - / or Ctrl - / or Ctrl - .
I try the way given in docs but didn't work

2 problems

1.Status bar doesn't show the keys pressed any more.
2.Go to definition never finds.

Pylint and Pyrun doesn't work on Ubuntu 10.04 GVIM 7.3

On my Ubuntu 11.04 64bit with VIM 7.3, the version 0.5.8 doesn't work well, as PyLint always gives 0 quickfix and Pyrun outputs mixes up with "Error while processing function".
Here is a patch that works for me.

diff --git a/autoload/pymode/run.vim b/autoload/pymode/run.vim
index 23fc6a9..083fdbf 100644
--- a/autoload/pymode/run.vim
+++ b/autoload/pymode/run.vim
@@ -2,9 +2,10 @@
fun! pymode#run#Run(line1, line2) "{{{
if &modifiable && &modified | write | endif
redi @">

  • sil!py execfile(vim.eval('expand("%s:p")'))
  • !python %
    redi END
    call pymode#TempBuffer()
  • normal Pdd
  • normal P3dd
  • %s/
    //g
    wincmd p
    endfunction "}}}
    diff --git a/plugin/pymode.vim b/plugin/pymode.vim
    index 611c72f..1dd2941 100644
    --- a/plugin/pymode.vim
    +++ b/plugin/pymode.vim
    @@ -108,7 +108,7 @@ from pyflakes import checker

Pylint setup

linter = lint.PyLinter()
-pylint_re = re.compile('^(?:.:)?[^:]+:(\d+): [([EWRCI]+)[^]]] (.)$')
+pylint_re = re.compile('^(?P[RCWEF]):\s_(?P\d+),(?P\d+):(?P:)?(?P._)$')

checkers.initialize(linter)
linter.load_file_configuration(vim.eval("g:pymode_lint_config"))
@@ -126,12 +126,13 @@ def pylint():
qf = []
for w in linter.reporter.out.getvalue().split('\n'):
test = pylint_re.match(w)

  •    test and qf.append(dict(
    
  •    if test:
    
  •        qf.append(dict(
             filename = filename,
             bufnr = vim.current.buffer.number,
    
  •            lnum = test.group(1),
    
  •            type = test.group(2),
    
  •            text = test.group(3).replace("'", "\""),
    
  •            lnum = test.group('lineno'),
    
  •            type = test.group('type'),
    
  •            text = test.group('message').replace("'", "\""),
         ))
    
    vim.command('let b:qf_list = %s' % repr(qf))

Error Loading vim -- undefined variable g:mode_syntax

On starting vim, I get the following error. How can I fix it?

Error detected while processing /home/ryan/.vim/bundle/python-mode/syntax/python.vim:
line 4:
E121: Undefined variable: g:pymode_syntax
E15: Invalid expression: pymode#Default('b:current_syntax', 'python') || !g:pymode_syntax

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.