I'm using Mac OSX Lion 10.7.2, Terminal.app supports 256 (output of :echo &t_Co). In my vimrc I have (PATH/TO/vim/vimrc)
syntax on
filetype plugin indent on
set nobackup
When I "vim blah.py" and :colorscheme torte
, syntax colors are not loading. For example python keyword doesn't have a proper colors (They have regular text color). That works for .c files but not python.
I updated my syntax/python.vim but still no luck.
Can someone tell me why?
markfw
Your answer is very good but let me just add one thing to it. In your .vimrc
instead of adding just
let python_highlight_all=1
you should add it this way
autocmd BufRead,BufNewFile *.py let python_highlight_all=1
This way it only applies to Python file(s).
Hope this help.
if it works in c but not on py, the filetype file and/or syntax file is not at the right location for python.
vim manual should help you, but I also would try :scr
command. This lists all the vim script loaded. So you start vim in two different way
vim your.c
vim your.py
and then in each vim session, type :scr. see how the syntax file for C is loaded (it is like chain reaction), and why it doesnt work that way for python may give you clue.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With