daniels@well.UUCP (Dan Smith, Social Mammal...) (02/03/88)
>Subject: Re: <tab> to space under vi, VI SUMMARY COMING SOON... >References: <462@gordon.UUCP> <239@unicom.UUCP> <6659@agate.BERKELEY.EDU> <559@riddle.UUCP> >Organization: Whole Earth 'Lectronic Link, Sausalito, CA In article <559@riddle.UUCP> domo@riddle.UUCP (Dominic Dunlop) writes: >Sender: > > >In article <6659@agate.BERKELEY.EDU> shipley@web5b.berkeley.edu.UUCP (Peter Shipley) writes: >>In article <239@unicom.UUCP> daniel@unicom.UUCP (Dan "I want to Ski Tam!" Smith) writes: >>}Is there a way to force 'vi' editor to insert appropreiate number of spaces >>}when <tab> key is hit? >>What is wrong with: >> >> :%!unexpand > >[Hope I've managed to preserve correct attributions in paring that down.] >-- >Dominic Dunlop >domo@sphinx.co.uk domo@riddle.uucp Nope. daniel@unicom (one of my other accounts) never said that. No big whoop, though :-) Here's an area I don't know a lot about, so bear with me... what about having a termcap entry invoked when you want to solve this "tabs-to-spaces" problem? The termcap entry (ta <str>) would be just like the one you usually use, except it would inform vi that your terminal really handles tabs as spaces. ...hope I'm not barking up the wrong tree with this one! The advantage of it is that it can be implemented easily when going into vi (a csh alias could set the terminal type, and go into vi), and you don't have to think about it when in vi. Two disadvantages are that your files will be a bit bigger, and will behave a little differently in vi for cursor movements (this isn't really a disadvantage, but it is different). I am guessing at this, with a 4.2 BSD programmers manual at my side (helps my guessing :-). Tell me politely if I'm wrong... I got a good deal of response from all over about my summary/ tutorial on macros. I'm working on an update, so I'd like to get some feedback/suggestions from you as to what types of things you want to see in it. I would love to get some uuencoded .exrc files from people. One quick note: A lot of terminals don't have a home key... a control caret (^^, often is control shift 6) usually generates the same key as a home key would. If you unmap it in your .exrc, you can switch off between files, and cut and paste easily via the named and numbered buffers. For those who don't have USENET access, your shar is coming... if you still don't get it in a few days, send me a better address. ucbvax, ptsfa, well, lll-* are good ones. dan dan smith, island graphics, marin co., ca|"A picture is worth a million pixels" uucp: ..!ucbvax!ucbcad!island!daniel | ph: (415) 491 1000 (w)|Impeach uucp: ..!ptsfa!unicom!daniel well!daniels| 332 FAST, 332 EASY (h)| Reagan!