Syntax highlighting in vim for python

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

I would like to set my own color schemes and syntax highlighting for the code file type.

+57
python syntax vim vi vim-syntax-highlighting
Jan 20 '11 at 11:33
source share
4 answers

The command to enable syntax highlighting in vim :syntax on , if you want it to be active every time vim starts, just add the line containing syntax on to your .vimrc file.

+75
Jan 20 2018-11-11T00:
source share

Vim syntax highlighting for python (target - Ubuntu 12.10)

Here's a step-by-step guide on setting 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 learn how to embed the color scheme and syntax highlighting in the vi editor for a specific user, you can configure it.

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

Choose the one you like. Then download the python.vim and foobarcolorscheme9000.vim and put them in the right place as defined here: https://alvinalexander.com/linux/vi-vim-editor-color-scheme-colorscheme Set the appropriate commands to ~ /. vimrc and log out.

Page with a list of the most useful and trendy python color schemes:

stack overflow

Then you can try programming in the VimL scripting language yourself.

Learn how to edit code that makes vim syntax highlighting work. Do it better than ever.

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

+13
Dec 25 '13 at 19:56
source share

Put the syntax on line in .vimrc .

+10
Jan 20 '11 at 11:35
source share
  1. Make sure you have the latest vim installed, also do sudo apt-get install vim
  2. Modify the .vimrc file with echo "syntax on" >> ~/.vimrc
  3. Open the file with vi app.py You will see syntax highlighting.

enter image description here

0
Aug 15 '18 at 2:42
source share



All Articles