Operating System - HP-UX
1821191 Members
3333 Online
109631 Solutions
New Discussion юеВ

Re: number of characters for a TAB

 
Brad Beard
Occasional Advisor

number of characters for a TAB

Is there a way to set up how many characters the tab key will be? Maybe in a .profile or some other environmental file? If so, what is the command to specify the number of characters the tab will be? Thanks.
5 REPLIES 5
Rick Garland
Honored Contributor

Re: number of characters for a TAB

If you are talking in vi. can use a .exrc file and define the number of spaces for the tab.
James R. Ferguson
Acclaimed Contributor

Re: number of characters for a TAB

Hi:

The normal tab character maps to 8-blanks. In vi, use .exrc to define shiftwidth to what you want.

...JRF...
Anthony Goonetilleke
Esteemed Contributor

Re: number of characters for a TAB

You could do something like this

set ts=25

or what ever the tab length you wanted it to be.

put this in the .exrc and it will be set permanantly.
Minimum effort maximum output!
Bill Hassell
Honored Contributor

Re: number of characters for a TAB

A tab characdter is a tab character...the apparent space that it produces is a function of a LARGE number of variables.

Start with the expand/unexpand command. AS you can see from the man pages, you can define the effect (but the default is 8).

Then, as mentioned previously, the vi program can define tabs either explicitly with a :set ts=7 (for example), or the ts= option can be put into $HOME/.exrc for each user.

Finally, the terminal emulator also defines the apparent spacing which is a function of whether the terminal was preset when it was powered up or logged in (see: man tabs). The terminal emulator would have to match the current setting of $TERM.

So:

man expand
man unexpand
man vi
man ex
man tabs

will give you an overview of tabs. Essentially, they are a character count reducer and a column aligner, but otherwise, they can be annoying when exported to other computer systems. Use expand to get rid of them before sending to foreign systems.


Bill Hassell, sysadmin
Bill Hassell
Honored Contributor

Re: number of characters for a TAB

A tab characdter is a tab character...the apparent space that it produces is a function of a LARGE number of variables.

Start with the expand/unexpand command. AS you can see from the man pages, you can define the effect (but the default is 8).

Then, as mentioned previously, the vi program can define tabs either explicitly with a :set ts=7 (for example), or the ts= option can be put into $HOME/.exrc for each user.

Finally, the terminal emulator also defines the apparent spacing which is a function of whether the terminal was preset when it was powered up or logged in (see: man tabs). The terminal emulator would have to match the current setting of $TERM.

So:

man expand
man unexpand
man vi
man ex
man tabs

will give you an overview of tabs. Essentially, they are a character count reducer and a column aligner, but otherwise, they can be annoying when exported to other computer systems. Use expand to get rid of them before sending to foreign systems.


Bill Hassell, sysadmin