I was wondering how can I get this colorful syntax highlighting in vim on my Mac. I didn't add any libraries on my ubuntu desktop to get the syntax as shown in the image. Is it possible to get this behavior on Mac as well?

I was wondering how can I get this colorful syntax highlighting in vim on my Mac. I didn't add any libraries on my ubuntu desktop to get the syntax as shown in the image. Is it possible to get this behavior on Mac as well?

In Mac OSX edit your .vimrc file:
vi ~/.vimrc
and add the following:
filetype plugin indent on
syntax on
Save and close (:x) and try opening your python file again.
It is not clear what you are referring to. If you are using a text editor in your terminal such as vim, then there is probably a plugin you can install to enable syntax highlighting. If you just want to style a Python file, then you might want to check out pygments
See also:
Alternatively, you might want to try out iPython