Vim Tips Wiki
Register
Advertisement

Use this page to discuss script 790 python: enhanced version of the Python syntax highlighting script

  • Add constructive comments, bug reports, or discuss improvements (see the guideline).
  • Do not document the script here (the author should do that on vim.org).
  • This page may be out of date: check the script's vim.org page above, and its release notes.

Installation[]

Do not install this script with the name python3.0.vim: it will not work. Rename and install as python.vim instead. --January 9, 2012

Comments[]

I'm a noob that wants to learn python and vim so I don't really know much about the linux command line. Could someone help me figure out how to add this to the correct directory? I've already done a find / vim to no avail. Thanks very much --Gideon.

Hi. You want to use the hidden directory, .vim , that should be in your home folder. the path should be something like:

/home/electricaltape/.vim/syntax/python.vim

where electricaltape is the user name. --electricaltape

Hi, I couldn't find a /.vim/syntax folder so I put the renamed python.vim file in /usr/share/vim. when I start vim and go ":python3" it says "error that command is not available in this version. I am using vim 7.3.43, am I doing it wrong?

Very. First, you should put it in $HOME/.vim/syntax (a.k.a. ~/.vim/syntax), creating the directories if they don't exist. This is where Vim looks for user-specific customizations to the Vim configuration. Second, after placing the file there, if you have syntax highlighting enabled already, you should not need to run any commands to use the plugin. The :python3 command you tried is for running python commands from within the editor using Vim's Python interface. Apparently your Vim does not have this interface compiled in. You may want to fix that for other reasons, but for the sake of this syntax script, it should be irrelevant. --Fritzophrenic 16:22, February 16, 2012 (UTC)

This syntax doesn't seem to highlight standard functions like int() or str(). Am I doing it wrong? 164.156.18.253 17:11, March 12, 2014 (UTC)

Advertisement