tags:

views:

280

answers:

2

I would like to use spaces instead of tabs when editing Perl scripts with the native vi found on Solaris systems.

I know this can be done with the vim clone, but I don't have access to install vim on these systems as they are vendor locked.

Firstly, is there a way to configure vi to emit spaces when I press TAB?

And secondly, I am also using the auto-indent feature of vi:

:set ai

The problem is, when I manually enter spaces for indenting vi converts groups of 8 spaces into tabs automatically when it does auto-indenting. I guess if I can find a way to turn this functionality off it will be a start.

+1  A: 

For an outside-the-box option, could you export the Solaris filesystem using NFS and edit the files you need on another system with a more capable editor?

Greg Hewgill
I could, and that is a good suggestion. I would like to avoid doing this if I could though.
Andre Miller
I'm accepting this answer as there doesn't seem to be a way to do what I want 'within the box'
Andre Miller
A: 

I believe you want

:set et

(short for expandtabs). I think vi classic supports it.

chaos
I don't have a classic vi handy, but according to the vim help, it doesn't.
Greg Hewgill
Oh wait, I do! FreeBSD has classic vi. It doesn't seem to have an expandtab option at all.
Greg Hewgill
How unpleasant. I guess it can't be done, then. autoindent but not expandtabs... who woulda thunk it.
chaos
I was so hoping this would work, but alas :). If I could just get it not to convert spaces to tabs during autoindent, I'd be happy.
Andre Miller