Solved

How to move to the nth letter in a line in VI

Posted on 2011-02-17
6
369 Views
Last Modified: 2012-05-11
Hi,

  I want to move to the 134th letter in a line, regardless of where my cursor is, in that sentence in VI editor.
  Is it possible? Please advise.

  Also, can i set numbers horizontally, just like how i do :set nu to set numbers vertically?
0
Comment
Question by:pvsbandi
  • 2
  • 2
  • 2
6 Comments
 
LVL 45

Assisted Solution

by:Kdo
Kdo earned 500 total points
ID: 34917203
Hi pvsbandi,

  134|

should do it.  Where the last character in the command is the vertical bar.


Good Luck,
Kent
0
 

Author Comment

by:pvsbandi
ID: 34917244
Thanks! I'll try that.
  Is there a way to set a ruler on top so i know which place i'm in the line?
0
 
LVL 45

Accepted Solution

by:
Kdo earned 500 total points
ID: 34917338

I don't know of a horizontal ruler function.  It might be that someone has installed the feature as proprietary extension, but it's not "standard".

^G (control-G) should display the cursor position on the bottom line.



Kent
0
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 
LVL 68

Expert Comment

by:woolmilkporc
ID: 34917426
If your vi implemetation supports it you can issue

:set ruler

so you will see the current cursor position (line, column) in the lower right area of the command line.

wmp
0
 

Author Comment

by:pvsbandi
ID: 34917645
:set ruler, unfortunately didn't work..
 
   But you guys are awesome!! Thanks so much!!
0
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 34917658
You could use "vim" instead of "vi". "set ruler" will work with vim!

0

Featured Post

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
sort command HPUX 11 76
AIX  NFS  question 1 138
KSH What's the best way to pass multiple variables (some may be blank) to a function? 5 51
unix solaris snoop command 6 99
This tech tip describes how to install the Solaris Operating System from a tape backup that was created using the Solaris flash archive utility. I have used this procedure on the Solaris 8 and 9 OS, and it shoudl also work well on the Solaris 10 rel…
Every server (virtual or physical) needs a console: and the console can be provided through hardware directly connected, software for remote connections, local connections, through a KVM, etc. This document explains the different types of consol…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question