how to determine column number in vi etc.

how to determine column number in vi etc.

Post by keyma » Fri, 20 Jul 2001 03:11:42



Is there a command or utility to show a column number while viewing a file?

I have seen mainframers use a tool that displays something like this

|234|6789|234|6789|234|6789|234|6789|234|6789|234|6789|234|6789|234|6789|234
|6789

at the top of the screen.  You can scroll through the file and this stays
at the top of the display.  Yes, I am working with positional data.
TIA

 
 
 

how to determine column number in vi etc.

Post by John » Fri, 20 Jul 2001 09:26:13


Try Ctrl-g?

> Is there a command or utility to show a column number while viewing a file?
> I have seen mainframers use a tool that displays something like this
> |234|6789|234|6789|234|6789|234|6789|234|6789|234|6789|234|6789|234|6789|234
> |6789
> at the top of the screen.  You can scroll through the file and this stays
> at the top of the display.  Yes, I am working with positional data.
> TIA


 
 
 

how to determine column number in vi etc.

Post by Zul Khera » Sat, 21 Jul 2001 02:05:09


Vim would be a better option for this.

Vim has an option to set the ruler and display the row / column positions
as the cursor is being moved.

Zul


> Is there a command or utility to show a column number while viewing a file?

> I have seen mainframers use a tool that displays something like this

> |234|6789|234|6789|234|6789|234|6789|234|6789|234|6789|234|6789|234|6789|234
> |6789

> at the top of the screen.  You can scroll through the file and this stays
> at the top of the display.  Yes, I am working with positional data.
> TIA

 
 
 

how to determine column number in vi etc.

Post by David Douthit » Sat, 21 Jul 2001 23:10:25



> Try Ctrl-g?

ctrl-g doesn't always display the column number.  In fact, it doesn't do
this under HP-UX nor under Unixware.  It may be specific to vim.

However, if you want to go to a particular column, you can use | - for
example, 79| takes you to column 79.  This should work in most complete
vi implementations.

 
 
 

how to determine column number in vi etc.

Post by keym » Wed, 25 Jul 2001 02:51:28




> > Try Ctrl-g?

> ctrl-g doesn't always display the column number.  In fact, it doesn't do
> this under HP-UX nor under Unixware.  It may be specific to vim.

> However, if you want to go to a particular column, you can use | - for
> example, 79| takes you to column 79.  This should work in most complete
> vi implementations.

I'm using HPUX, vim not available nor can I install anything.
 
 
 

how to determine column number in vi etc.

Post by keym » Wed, 25 Jul 2001 03:07:16




> > Try Ctrl-g?

> ctrl-g doesn't always display the column number.  In fact, it doesn't do
> this under HP-UX nor under Unixware.  It may be specific to vim.

> However, if you want to go to a particular column, you can use | - for
> example, 79| takes you to column 79.  This should work in most complete
> vi implementations.

What I wanted at the top of the screen was something like:

----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----+

 
 
 

how to determine column number in vi etc.

Post by Ari Makel » Wed, 25 Jul 2001 05:39:12



> I'm using HPUX, vim not available nor can I install anything.

Not even in your home directory? You don't have a compiler?

--

#                                                 http://arska.org/hauva/ #

print "Navigare necesse est, vivere non est necesse - Pompeius\n";

 
 
 

how to determine column number in vi etc.

Post by Ben.Altma » Wed, 25 Jul 2001 03:45:43



> Is there a command or utility to show a column number while viewing a file?

Write a function or a script like this:
E.g.
    function lines {
        awk 'BEGIN {line =
"----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----+"

                               print line}

    }

Then you can do any of:
    lines file.txt
or
    lines < file.txt
or
    cat file.txt | lines

 
 
 

how to determine column number in vi etc.

Post by Stephane Chazel » Wed, 25 Jul 2001 16:18:20



Quote:

> What I wanted at the top of the screen was something like:

> ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----+

If screen (a virtual terminal manager) is installed on your system, you
can use it with this line in ~/.screenrc:

caption always ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----+

This line will appear permanently in reverse video at the bottom of your
screen.

--
Stphane

 
 
 

how to determine column number in vi etc.

Post by David Douthit » Wed, 25 Jul 2001 21:31:59




> > ctrl-g doesn't always display the column number.  In fact, it doesn't do
> > this under HP-UX nor under Unixware.  It may be specific to vim.

> > However, if you want to go to a particular column, you can use | - for
> > example, 79| takes you to column 79.  This should work in most complete
> > vi implementations.

> I'm using HPUX, vim not available nor can I install anything.

This has no effect on what I recommended to you.  The column command (|)
works just as fine under HPUX vi as it does under vim.

However, having said that, vim works fine under HP-UX.  However, for
those who don't know, HP-UX does NOT come with a working C compiler; the
C compiler included with HP-UX is a crippled version which is only
useful for compiling the HP-UX kernel.  A working C compiler (HP ANSI C)
is an additional cost software package.  gcc is available for HP-UX,
however, so all is not lost.

There is also binary packages (depots they're called) for HP-UX, and
there is a large "HP-UX Software Porting Archive" available - I use
hpux.cae.wisc.edu, but right now they're down, but at least they point
you to other mirrors.

 
 
 

how to determine column number in vi etc.

Post by keym » Thu, 26 Jul 2001 05:10:19




> > What I wanted at the top of the screen was something like:

> > ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----+

> If screen (a virtual terminal manager) is installed on your system, you
> can use it with this line in ~/.screenrc:

> caption always ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----+

> This line will appear permanently in reverse video at the bottom of your
> screen.

This sound exactly like what I need, but "screen" is not installed.
I'm in a corporate environment - no root and a tightly controlled box.
 
 
 

how to determine column number in vi etc.

Post by Stephane Chazel » Thu, 26 Jul 2001 20:00:07



Quote:

> What I wanted at the top of the screen was something like:

> ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----+

A method that worked for me on a Solaris machine, with an Xfree86 xterm
terminal but could be adapated using the same idea to other
environments.

get the terminfo entries for the current terminal:
infocmp > file
edit "file" and change the csr, home and clear capabilities.
For example (let's say your terminal is 80 columns x 50 lines)

clear=\E[H\E[2J\E[2;50r----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----+\E[H^J
csr=\E[2;50r----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----+\E[H^J
home=\E[H^J

Then
FAKED_TI=$HOME/.faked-terminfo
mkdir $FAKED_TI
TERMINFO=$FAKED_TI tic file

then run vi with TERMINFO set to $FAKED_TI
TERMINFO=$FAKED_TI vi
or even your shell
TERMINFO=$FAKED_TI $SHELL
(and "clear" after to setup the new scroll region)

If this doesn't work, maybe it's because vi uses termcap instead of
terminfo. You can probably do something similar with termcap.

Also, think of the "script" utility to help you fine tuning your
terminfo configuration.

--
Stphane

 
 
 

how to determine column number in vi etc.

Post by Sven Maschec » Fri, 27 Jul 2001 00:34:27



> HP-UX does NOT come with a working C compiler; the C compiler included
> with HP-UX is a crippled version which is only useful for compiling the
> HP-UX kernel.

...and bootstrapping gcc.

Sven

 
 
 

1. Displaying column number on vi

unix/vi user group,
   Can we display the cursor position in terms of column position in
vi editor. the "n"| command can bring you to the specific position,
but I want to see it when typing. Any help will be appreciated.

--
Boone Teh
Consultant
Technology Partners Inc.
St. Louis

2. help need

3. Column number in vi

4. HOW DO I DO THIS ??

5. column number of cursor in vi?

6. Additionals for support PC-9800 (0/10) summary

7. vi to swap the two columns of the file /etc/hosts

8. How to migrate solaris user to linux ?

9. determine throughput from LAN to Internet, Durchsatz vom LAN ins Internet berechnen

10. Netscape plug-ins, helper files, Acrobat etc.

11. Column in VI / Landscape in lp ?

12. deleting columns in vi