• 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

vi and HTML files - ARGH!

 
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can anyone help me?

whenever I open a file in vi that has *.htm or *.html, it enters some kind of weirdo mode where typing '<' ... I dunno, it's like it stops accepting input.

If I hit escape twice and enter insert mode again, start typing normal letters, then a <, it erases everything I've typed so far, and again, appears to stop accepting input.

Also, at the bottom of the screen it says:
To see the source, hit ^Wd

It's really frickin' annoying. I just want vi to treat this file as text. Had I wanted 'help', I would have used Dreamweaver.

This page: http://thomer.com/vi/vi.html#macros gave me one clue, but I can't seem to find the file it talks about.
 
Ranch Hand
Posts: 4716
9
Scala Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i would try this. rename the file so it has no file extension. open it in vi. edit and save it. then rename it with the file extension included.
[ October 29, 2004: Message edited by: Randall Twede ]
 
Wanderer
Posts: 18671
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Mike, what OS are you using? And/or, what version of vi? I've never observed this behavior (though I haven't used vi that much the last few years)...
 
Mike Curwen
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It's slackware 9, not sure of the vi version.

I'll have to ask the sysadmin if he installed anything special. The extension rename works, but that's a huge pain in the butt. Especially if I'm editing index.html on a production server. I'd have to:

cp index.html index.foo
vi index.foo
mv index.foo index.html
 
reply
    Bookmark Topic Watch Topic
  • New Topic