Note that there are some explanatory texts on larger screens.

plurals
  1. PODescribe your customized Vim editor for Python/Django development?
    text
    copied!<p>I've recently switched entirely to Vim for all my Python/Django development. It took me a lot of time to customize it to the point it is today, and God knows how hard it was for me to find help regarding the best vim plugins out there suited for Python/Django development.</p> <p>I decided to ask this question so people like me could benefit directly from your experience: You've built the perfect Python/Djangoish Vim editor? Describe it for us (plugins, scripts, customized .vimrc, colorschemes ..etc).</p> <p>Thanks</p> <h2><strong>My Configuration</strong></h2> <p>Ok, this is my own configuration. actually I've chosen to create a simple Vim configuration so I can master the little number of plugins I've chosen to install instead of make a big stack of plugins that I'll never master nor use. This is the list of the plugins I use the most:</p> <ul> <li><strong><a href="http://www.vim.org/scripts/script.php?script_id=1658" rel="noreferrer">NERDTree</a></strong> for file management,</li> <li><strong><a href="http://www.vim.org/scripts/script.php?script_id=2540" rel="noreferrer">SnipMate</a></strong> which is an implementation of TextMate's snippets feature,</li> <li><strong>Code Completion</strong> is handled with Omnicompletion which come by default in Vim,</li> <li><strong><a href="http://www.vim.org/scripts/script.php?script_id=910" rel="noreferrer">Pydoc</a></strong> to integrate the Python Documentation into Vim,</li> <li><strong><a href="http://www.vim.org/scripts/script.php?script_id=273" rel="noreferrer">TagList</a></strong> for source code browsing, very useful in large files.</li> <li><a href="http://www.vim.org/scripts/script.php?script_id=2441" rel="noreferrer"><strong>Pyflakes</strong></a> script to highlight Python code on the fly with warnings</li> </ul> <p>Also I've created a python.vim file in $HOME/.vim/ftplugin/ containing this script so I can run python code from Vim just by running Shift+e:</p> <pre><code>" Execute file being edited with &lt;Shift&gt; + e: map &lt;buffer&gt; &lt;S-e&gt; :w&lt;CR&gt;:!/usr/bin/env python % &lt;CR&gt; </code></pre> <p>Also I've collected some useful .vimrc customizations:</p> <pre><code>set nocompatible " use vim defaults set number " show line numbers colorscheme desert set tags=tags;$HOME/.vim/tags/ "recursively searches directory for 'tags' file set expandtab " tabs are converted to spac set tabstop=4 " numbers of spaces of tab character set shiftwidth=4 " numbers of spaces to (auto)indent set showcmd " display incomplete commands set hlsearch " highlight searches set incsearch " do incremental searching set ruler " show the cursor position all the time set numberwidth=4 " line numbering takes up 5 spaces set ignorecase " ignore case when searching set nowrap " stop lines from wrapping filetype plugin indent on " turn on the indent plugins syntax on " syntax highlighing " TagList Plugin Configuration let Tlist_Ctags_Cmd='/usr/bin/ctags' " point taglist to ctags let Tlist_GainFocus_On_ToggleOpen = 1 " Focus on the taglist when its toggled let Tlist_Close_On_Select = 1 " Close when something's selected let Tlist_Use_Right_Window = 1 " Project uses the left window let Tlist_File_Fold_Auto_Close = 1 " Close folds for inactive files " Omnicompletion functions autocmd FileType python set omnifunc=pythoncomplete#Complete autocmd FileType javascript set omnifunc=javascriptcomplete#CompleteJS autocmd FileType html set omnifunc=htmlcomplete#CompleteTags autocmd FileType css set omnifunc=csscomplete#CompleteCSS au FileType py set expandtab au FileType py set foldmethod=indent map &lt;F2&gt; :previous&lt;CR&gt; " map F2 to open previous buffer map &lt;F3&gt; :next&lt;CR&gt; " map F3 to open next buffer map &lt;F4&gt; :NERDTreeToggle&lt;CR&gt; " map F4 to open NERDTree map &lt;F5&gt; :TlistToggle&lt;CR&gt; " map F5 to toggle the Tag Listing map &lt;silent&gt;&lt;C-Left&gt; &lt;C-T&gt; " taglist - map Ctrl-LeftArrow to jump to the method/property under your cursor map &lt;silent&gt;&lt;C-Right&gt; &lt;C-]&gt; " taglist - map Ctrl-RhitArrow to jump back to your source code map &lt;silent&gt;&lt;A-Right&gt; :tabnext&lt;CR&gt; " map Alt-RightArrow to jump to the next tab map &lt;silent&gt;&lt;A-Left&gt; :tabprevious&lt;CR&gt; " map Alt-LeftArrow to jump to the previous tab </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload