Path: utzoo!mnetor!uunet!oddjob!mimsy!eneevax!umd5!purdue!i.cc.purdue.edu!j.cc.purdue.edu!pur-ee!iuvax!bsu-cs!dhesi From: dhesi@bsu-cs.UUCP (Rahul Dhesi) Newsgroups: comp.unix.questions Subject: Re: VI tabs, termcap solution? Message-ID: <2034@bsu-cs.UUCP> Date: 4 Feb 88 14:25:31 GMT References: <5135@well.UUCP> <10456@mimsy.UUCP> Reply-To: dhesi@bsu-cs.UUCP (Rahul Dhesi) Followup-To: comp.editors Distribution: comp Organization: CS Dept, Ball St U, Muncie, Indiana Lines: 35 Keywords: vi tabs macros help [big discussion on tabs in vi] To all editor designers: There is much confusion about tabs. Here is a quick analysis and a specific suggestion. There is a conceptual difference between (a) typing the tab key, (b) inserting a tab character in a file. When you type a tab character, you're saying "please move the cursor to the next tab stop on my screen". When you insert a tab character in a file, you inserting an ASCII 0x09 (or equivalent in your favorite character set) in the file. The two are not equivalent. If the user has set tabs on the screen to be every 3 spaces, then when the user types a tab, move the cursor to the next tab stop. DON'T insert a tab character in the file when this happens! Instead, insert any combination of tabs and spaces that will cause the file, when typed to the screen with tabs set at every 8 spaces, to look correct. In other words, tabs in a file should always be 8-space tabs. Tabs on the screen should be whatever the user wants them to be. Similarly, if the user deletes a single character, delete only a single character as things appear on the screen. If that single character happened to be a tab character in the original file, replace it with enough spaces such that the net effect is to move text back by only one space. Follow-ups to comp.editors, assuming such a newsgroup exists. -- Rahul Dhesi UUCP: !{iuvax,pur-ee,uunet}!bsu-cs!dhesi