Vim, shorthand for Vi IMproved, is a text editor with numerous configuration options and wide-ranging extensions that can be used to write Python code.
Vim's philosophy is that developers are fastest when they never take their hands off the keys. Even using the mouse is a detriment to the rate at which your thoughts can flow into code.
Vim has a language behind its commands. When a beginner is learning the editor she may feel like it is impossible to understand all the key commands. However, the commands stack together in a logical way so that over time the editor becomes predictable.
The Vimrc file is used to configure the Vim editor. A Vimrc file can range from nothing in it to very complicated with hundreds or thousands of lines of configuration commands.
Here's a simple example .vimrc file I use for Python development to get a feel for some of the configuration statements:
# enable syntax highlighting syntax on # the next 4 lines set tabs to have 4 spaces, autoindent when already # working with indented lines, expand tabs key presses to spaces and # move lines 4 spaces each time the >> or << commands are used set ts=4 set autoindent set expandtab set shiftwidth=4 # enable all Python syntax highlighting features let python_highlight_all = 1
The Vimrc file lives under the home directory of the user account running
Vim. For example, when my user account is 'matt', on Mac OS X my Vimrc
file is found at /Users/matt/.vimrc. On Ubuntu Linux my Vimrc file
can be found within /home/matt/.vimrc.
If the Vimrc file does not already exist, just create it within the user's home directory and it will be picked up by Vim the next time you start the program.
Vim Adventures is a cute, fun browser-based game that helps you learn Vim commands by playing through the adventure.
Learn Vim Progressively is a wonderful tutorial that follows the path I took when learning Vim: learn just enough to survive with it as your day-to-day editor then begin adding more advanced commands on top.
A vim Tutorial and Primer is an incredibly deep study in how to go from beginner to knowledgeable in Vim.
Vim as Your IDE discusses how to set up Vim for greater productivity once you learn the initial Vim language for using the editor.
Setting up Vim for Python has a well written answer on Stack Overflow for getting started with Vim.
Vim as a Language explains the language syntax and how you can build up over time to master the editor.
In Vim: revisited the author explains his on-again off-again relationship with using Vim. He then shows how he configures and uses the editor so it sticks as his primary code editting tool.
A Good Vimrc is a fantastic, detailed overview and opinionated guide to configuring Vim. Highly recommended for new and experienced Vim users.
Vim and Python shows and explains many Python-specific .vimrc options.