[vi] using modelines (was: setting tab length from within perl file)

[vi] using modelines (was: setting tab length from within perl file)

Post by Antony Scr » Tue, 01 Apr 2008 20:00:15

On Mar 31, 2:30 am, Bob Harris

> In article

> > Hi
> > I'm editing perl files with the hp's original files
> > I was wondering if there was a way to add a line to the
> > perl file so that when the vi editor reads the file it
> > sets ts to 4. I saw an old example for c files. Like
> > /* vi:set ts=4: */
> > can the same be done in perl files
> I've been using
> # vim: ts=4 noexpandtab
> NOTE: there is no 'set' in my usage.

That won't work in vi. Time to change the subject line.

> The mode line must be within a couple of lines of the
> beginning or end of the file. Whatever
> :set modelines?
> says is your limit.
> Also 'modeline' must be enabled
> :set modeline?
> to see what it is set to when you edit a file

I reckon that could be the problem too, but in HP-UX vi
'modeline' doesn't exist; you can only turn it on or
off using :set modlines or :set ml --Antony

1. How do I pass data between the main VI and VI within a sub-VI?

2. [vi] Upload file of commands to execute within vi


This seems like it should be an easy thing to do, I just can't figure
out how. I've got a series of files that I need to do a long list of
'find and replace's on. Someone has also nicely provided me with a
file that contains all of the vi commands to do all of these 'find and
replace's, e.g. the file is a long list of

:g/HD13 ILE/s//HD3 ILE/g
:g/HB2 LEU/s//HB1 LEU/g

Instead of cuting and pasting each and every ':g ...' line into vi to
do each find and replace I'd like to just read in the file that
contains the commands and execute them on the file that I'm editing.
Is this possible? I realize that I could easily just write a little
script to do the above but I'm curious to see if I can do it in vi
with one fell swoop. Thanks for any help in advance!



3. entering tab in vi without using tab key

4. [vim] using modeline to set procmail filetype

5. Set Control Value By another control in same vi (Without Using VI Server)

6. Can i set up tabs within tabs on Excel?

7. [vim] setting the file type from modelines

8. How do I tab within a column using the tab key?

9. Using the TAB key within a tab control page

10. Can I set different tab setting within a document?

11. Can INI files be used to set the same control in another VI?

12. I am having trouble stopping a sub VI from the front panel of my main VI.

13. close a vi from within another vi

14. "Running a vi within a vi"

15. How to display and control a VI or EXE within another VI?