Vim as an Integrated Development Environment (IDE) for Python3? - Part I of II
Yes, you read that correctly. Today we will look at the tools I chose to turn vim into an IDE, along with the bells and whistles that boost productivity.
If you don’t know what vim is, the manual page puts it best: “Vim is a text editor that is upwards compatible to Vi. It can be used to edit all kinds of plain text. It is especially useful for editing programs.” This article assumes you already know the basics of getting around the shell and vi.
Preparing an environment for Python 3 development is not hard. The complexity of the setup comes down to what you, the developer, are comfortable with in an IDE, and how few extra tools you want to depend on. Besides vim itself, we will touch on syntax highlighting, autocompletion, running code and ease of use.
Quick Notes - Will This Be Easy for Me?
Windows users can follow along with the Windows Subsystem for Linux (WSL) enabled. Linux users will have an easy time, since most of these tools are available through your package manager, with or without a graphical user interface (GUI). My fellow macOS users will have the easiest time of all, because this walkthrough was written on a Mac.
Vim - Enough Fluff, Let’s Do This!
First, check which version of vim you have and whether it supports Python 3. At the time of writing, the vim that ships with macOS was built without Python 3 support. From your terminal, run vim --version to see the version and features.
$ vim --version
Check the vim version and features.
Example of vim --version output. Note “-python3”.
Homebrew - Get the Vim You Need
Homebrew is a great resource for tools you might need in your macOS workflows. Need vim with Python 3? Homebrew has it. Follow the install instructions on Homebrew’s site to get started.
Once Homebrew is installed, run brew on its own to see a list of available commands.
$ brew
List brew commands.
brew command list.
If you already have vim installed, back up your files first. Assuming a default configuration, run this from your home directory:
$ cd ~
$ tar -cvf vimbkup.tar .vim*
Back up the current vim files.
You can inspect the contents of the backup with tar -tvf:
$ tar -tvf vimbkup.tar
List the backup’s contents.
We need Python! Install Python 3 with Homebrew:
$ brew install python
Install Python 3 with Homebrew.
Create an alias so that typing python runs Python 3:
$ alias python=python3
Make python call Python 3.
Install vim with brew install vim. Homebrew will install its dependencies too, so this may take a minute.
$ brew install vim
Install vim with Homebrew.
Brew output for the vim install.
Confirm that Homebrew’s vim includes Python 3. brew --prefix returns /opt/homebrew on Apple silicon Macs and /usr/local on Intel Macs, so this command works on either:
$ "$(brew --prefix)/bin/vim" --version | grep python3
Example of vim --version output. Note “+python3”.
Hang in There, We Are Almost Done
Typing vim may still launch the macOS version. Instead of removing the system copy, make sure Homebrew’s bin directory comes first in your PATH, so your shell finds Homebrew’s vim before the one in /usr/bin.
Since macOS Catalina, the default shell is Zsh. If you use a different shell, edit its startup file instead. Open .zshrc:
$ vim ~/.zshrc
Edit the Zsh startup file.
Add these lines, then save and reload the file with source ~/.zshrc. Pointing at Homebrew’s bin directory, rather than a version-numbered folder, means the path keeps working after vim updates.
# .zshrc
# Apple silicon: put Homebrew first in PATH.
# Intel Macs already have /usr/local/bin in PATH and can skip this line.
eval "$(/opt/homebrew/bin/brew shellenv)"
export EDITOR=vim
Zsh lines to add.
Run which vim to confirm that it points to Homebrew’s copy.
Closing Bytes and Bits
You are now ready to use the latest vim from Homebrew with Python 3 support. In Part II, we will configure vim for a full IDE experience with a .vimrc, vim-plug and VimAwesome.
If you are like me, research the plugins you’ll find useful for your new IDE.
Written with macOS Monterey 12, Homebrew and vim 8.2.
Edited in October 2026 for grammar and accuracy. The original zsh step put a wildcard in EDITOR, which zsh doesn’t expand there; it now uses Homebrew’s PATH setup, which also covers Apple silicon Macs.