Here is an overview of the way that I configure Vim in order to develop Python programs. On Linux or Mac, your vimrc file if most likely located at
~/.vimrc but to find the exact location of the file type:
:version when in Vim. The following settings are meant to go in that file.
Some settings that I use for all code editing in Vim:
set textwidth=79 set nu syntax enable filetype indent plugin on
Many Python projects follow the PEP 8 guide so tabs are to be converted to four spaces:
set shiftwidth=4 set tabstop=4 set softtabstop=4 set expandtab set smartindent
In Python, I often want to be able to see whitespace characters. For this
listchars is used:
And then in the editor just type
:set list to toggle this view.
You can find my .vimrc file and .gitconfig file in my Dotfile repository.