aspose file tools*
The moose likes Linux / UNIX and the fly likes open the syntax color in vi Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Linux / UNIX
Bookmark "open the syntax color in vi" Watch "open the syntax color in vi" New topic
Author

open the syntax color in vi

zb cong
Ranch Hand

Joined: Jan 14, 2002
Posts: 416
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

Joined: Oct 25, 2000
Posts: 7292

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.


Make visible what, without you, might perhaps never have been seen.
- Robert Bresson
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: open the syntax color in vi
 
Similar Threads
serializable not creating end of file
Java Newbie
TextMate meets Vi on the Mac
problem on expect command
Editor