• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

open the syntax color in vi

 
Ranch Hand
Posts: 416
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
High Plains Drifter
Posts: 7289
Netbeans IDE VI Editor
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic