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?
Asked
Active
Viewed 9,418 times
10
-
What exactly do you mean? In your editor? What editor? – Lukas Graf Sep 23 '14 at 18:25
-
Sry. I want this behavior in vim – KKa Sep 23 '14 at 18:27
-
3That can be done with `:syntax on` in `vim`. [Add it to your `.vimrc`](http://stackoverflow.com/questions/11272501/vim-default-syntax-highlighting) to make it persistent. – Lukas Graf Sep 23 '14 at 18:28
2 Answers
16
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.

Ewan
- 14,592
- 6
- 48
- 62
0
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

Community
- 1
- 1

Mike Driscoll
- 32,629
- 8
- 45
- 88