Syntax highlighting in vim for python


Question

How do I do I set the syntax highlighting in Vim 7 for python?

I would like to set my own colorschemes, and syntax highlighting for a type of code file.

1
63
12/25/2013 7:56:15 PM

Accepted Answer

The command to enable syntax highlighting in vim is :syntax on, if you want it to be active everytime you launch vim, just add a line containing syntax on in your .vimrc file.

90
1/20/2011 11:37:03 AM

Syntax highlighting in vim for python (target is Ubuntu 12.10)

Here is a walkthrough on how to setup syntax highlighting in Python for Ubuntu 12.10. What you see is what you get:

enter image description here

https://github.com/sentientmachine/Pretty-Vim-Python/

Once you get the hang of how to inject a color scheme and syntax highlighting into your vi editor for a particular user, then you can customize it

There are hundreds of fashionable color schemes here: https://github.com/morhetz/gruvbox

Pick one that you like. Then download the python.vim and foobarcolorscheme9000.vim files and put them in the right spot as defined here: https://alvinalexander.com/linux/vi-vim-editor-color-scheme-colorscheme Set the appropriate commands in the ~/.vimrc and logout login.

Page listing most useful and fashionable python Color schemes:

https://stackoverflow.com/a/11060884/445131

Then you could try programming in VimL script language yourself.

Learn to edit the code that causes vim syntax highlighting to work. Make it better than it ever was.

http://en.wikibooks.org/wiki/Learning_the_vi_Editor/Vim/VimL_Script_language


Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow
Icon