klen/python-mode — Issue #33: Running vim/gvim with python-mode 0.5 takes 5 seconds (Ubuntu)
Author: ianozsvald
Created: 2011-12-27 19:16:37+00:00
State: open

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.