- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- How to remap the <TAB> key in vi ?
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2001 02:32 AM
10-17-2001 02:32 AM
How to remap the <TAB> key in vi ?
I've tried various combinations in .exrc, like
map!
None of them work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2001 02:59 AM
10-17-2001 02:59 AM
Re: How to remap the <TAB> key in vi ?
tab 4.
See man vi and ex
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2001 04:52 AM
10-17-2001 04:52 AM
Re: How to remap the <TAB> key in vi ?
tab key can be manipulated with the tabstop setting:
in .exrc add entry:
set tabstop=#
where # is the new value (default is 8)
OR
in vi type ie:
:set tabstop=4
Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2001 04:55 AM
10-17-2001 04:55 AM
Re: How to remap the <TAB> key in vi ?
:set all
noautoindent mesg noslowopen
autoprint nomodelines tabstop=8
noautowrite nonumber taglength=0
nobeautify nonovice tags=tags /usr/lib/tags
directory=/var/tmp nooptimize tagstack
nodoubleescape paragraphs=IPLPPPQPP LIpplpipnpbp term=ansi
noedcompatible prompt noterse
noerrorbells noreadonly timeout
noexrc redraw timeoutlen=500
flash remap ttytype=ansi
hardtabs=8 report=5 warn
noignorecase scroll=16 window=32
keyboardedit sections=NHSHH HUuhsh+c wrapscan
keyboardedit! shell=/sbin/sh wrapmargin=0
nolisp shiftwidth=8 nowriteany
nolist noshowmatch
magic noshowmode
See man ex for
set hardtabs, tags, b
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2001 06:27 AM
10-17-2001 06:27 AM
Re: How to remap the <TAB> key in vi ?
I want to prevent TAB (ie control-I) characters getting into my files in the first place.
All that "set tabstop" does is to set how many spaces are used to display each TAB.
"set hardtabs" seems to do the same, and I
can find no "tab 4" in any man page.
To see what I mean, run up vi and say
:set list
Go into insert mode and hit the TAB character a few times. What you will see is ^I^I^I...
What I want is spaces, not tabs.
Graham
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2001 07:09 AM
10-17-2001 07:09 AM
Re: How to remap the <TAB> key in vi ?
I am pretty certain that you cannot do that with good old vi! Since Bill Joy has used "white space" as delimiter for the definition of mappings, and TAB and SPACE are, the only chance would be a "post-processing" of your file after saveing it. Then you would use some script for this (none does exist - you will have to it in perl or awk or such).
Sorry,
Wodisch
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2001 11:04 PM
10-17-2001 11:04 PM
Re: How to remap the <TAB> key in vi ?
I'm not a master of vi, but have you tried to map TAB to somethink like 4 * insert space? If I remember right, you can do:
:
that repeats the command
E.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2001 11:40 PM
10-17-2001 11:40 PM
Re: How to remap the <TAB> key in vi ?
Wodisch came closest in confirming it cannot be done.
I guess I will have to continue, as before, with, in my .exrc file:
set shiftwidth=4 tabstop=4
map ^T :1,$ s/ / /g
(Where the first string is the tab character and the second is 4 spaces)
and then get all my users to remember to type ^T before exit.
Or write a wrapper.
Thanks again.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2001 01:05 AM
10-18-2001 01:05 AM
Re: How to remap the <TAB> key in vi ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2001 04:32 AM
10-18-2001 04:32 AM
Re: How to remap the <TAB> key in vi ?
hope this helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2004 08:03 AM
07-23-2004 08:03 AM
Re: How to remap the <TAB> key in vi ?
:set expandtab