Yes this is possible and useful and even considered best practice. They are called filetype plugins in Vim speech. And Vim even comes with many filetype plugins (as well as indent and syntax files) for several languages.
You need to enable this in your
.vimrc like this:
filetype plugin on
then put your specific filetype settings into a file (creating non-existing directories) called
~/.vim/ftplugin/python.vim for python settings. This is also covered in the FAQ.
There is also another possibility (if you don't want to use filetype specific options):
If you want to group some options to a specific file, you can make use of the
runtime command. For example my
.vimrc contains this line:
" This script contains plugin specific settings
" This script contains mappings
" additional helper functions:
" For abbreviations read in the following file: