This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

open the syntax color in vi

 
zb cong
Ranch Hand
Posts: 416
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello

i install the vim6.3 in my windows xp, then i download a ksh script named "ftpshell", from the unix server, then i open it with the vim, it works well, but when i open another vim windows, and copy the script content to the new vim, i found that the syntax color losed in the new windows whether or not i save it and reopen it and use the command "syntax on", the only solution is to rename it as "ftpshell.sh",but i don't want to change the name, who can help me? i think there must be a good idea.



thanks
 
Michael Ernest
High Plains Drifter
Sheriff
Posts: 7292
Netbeans IDE VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Vim supports lexical ("syntax") highlighting for a number of different language forms and identifies each one by the file extension. Without some kind of identifier, vim can't know which highlighting rules to use.

You can either change the name of your file or you can write a rules that reads a file name with no extension as a shell script.

I think it would be easiest to edit a file renamed with a .ksh extension, then copy it back to the original name when you're done.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic