0

I'm having trouble getting my VIM to correctly syntax highlight php short tags.

let php_sql_query=1
let php_htmlInStrings=1
let php_noShortTags=0
let php_folding=0
let php_baselib=1
let php_asp_tags=0
let php_parent_error_close=1
let php_parent_error_open=1
"let php_sync_method=10  " Sync only 10 lines backwards
let php_alt_comparisons=1
let php_alt_assignByReference=1

Is all all set in my vimrc file already. I can't find any help on noShortTags but changing from 0 to 1 has no effect.

Output from :scriptnames

 1: /usr/share/vim/vimrc
 2: /usr/share/vim/vim72/debian.vim
 3: /usr/share/vim/vim72/syntax/syntax.vim
 4: /usr/share/vim/vim72/syntax/synload.vim
 5: /usr/share/vim/vim72/syntax/syncolor.vim
 6: /usr/share/vim/vim72/filetype.vim
 7: /usr/share/vim/vim72/ftplugin.vim
 8: /usr/share/vim/vim72/colors/elflord.vim
 9: /etc/vim/toggle.vim
10: /etc/vim/plugin/NERD_tree.vim
11: /home/rwalsh/.vim/plugin/camelcasemotion.vim
12: /usr/share/vim/vim72/plugin/getscriptPlugin.vim
13: /usr/share/vim/vim72/plugin/gzip.vim
14: /usr/share/vim/vim72/plugin/matchparen.vim
15: /usr/share/vim/vim72/plugin/netrwPlugin.vim
16: /usr/share/vim/vim72/plugin/rrhelper.vim
17: /usr/share/vim/vim72/plugin/spellfile.vim
18: /usr/share/vim/vim72/plugin/tarPlugin.vim
19: /usr/share/vim/vim72/plugin/tohtml.vim
20: /usr/share/vim/vim72/plugin/vimballPlugin.vim
21: /usr/share/vim/vim72/plugin/zipPlugin.vim
22: /usr/share/vim/vim72/syntax/php.vim
23: /usr/share/vim/vim72/syntax/html.vim
24: /usr/share/vim/vim72/syntax/javascript.vim
25: /usr/share/vim/vim72/syntax/vb.vim
26: /usr/share/vim/vim72/syntax/css.vim
27: /usr/share/vim/vim72/syntax/sql.vim
28: /usr/share/vim/vim72/syntax/sqloracle.vim
29: /usr/share/vim/vim72/ftplugin/php.vim
30: /usr/share/vim/vim72/ftplugin/html.vim
31: /etc/vim/nerdtree_plugin/exec_menuitem.vim
32: /etc/vim/nerdtree_plugin/fs_menu.vim
33: /home/rwalsh/.vim/autoload/camelcasemotion.vim

I was hoping php (line 22) would take care of it. I have taken a screen shot (below) which shows how it is highlighted with long tags (line 60) and with short tags (line 61, 62, 89-92).

Screenshot

4
  • 1
    Listen to Vim, for it is right. You shall not use short tags. Commented Apr 8, 2011 at 19:52
  • I actually agree with you, but my voice is in the minority and the project code already has short tags strewn through out. Commented Apr 8, 2011 at 20:17
  • How do you think they should be highlighted? What syntax script are you using? Does the syntax script you think should be loading show up in the output of :scriptnames when editing a php file? Commented Apr 13, 2011 at 23:32
  • @Randy-Morris I've updated the original post with more information Commented Apr 14, 2011 at 17:58

1 Answer 1

3

A user over on reddit found that VIM's php sytntax only checks that php_noShortTags exists. Simply commenting it out or removing from my .vimrc file fixed it.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.