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

Posted on 2011-02-17
Last Modified: 2012-05-11

  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?
Question by:pvsbandi
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2
LVL 45

Assisted Solution

by:Kent Olsen
Kent Olsen earned 500 total points
ID: 34917203
Hi pvsbandi,


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

Good Luck,

Author Comment

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?
LVL 45

Accepted Solution

Kent Olsen 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.

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

LVL 68

Expert Comment

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.


Author Comment

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

Expert Comment

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


Featured Post

[Live Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.

Question has a verified solution.

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

Hello fellow BSD lovers, I've created a patch process for patching openjdk6 for BSD (FreeBSD specifically), although I tried to keep all BSD versions in mind when creating my patch. Welcome to OpenJDK6 on BSD First let me start with a little …
Let's say you need to move the data of a file system from one partition to another. This generally involves dismounting the file system, backing it up to tapes, and restoring it to a new partition. You may also copy the file system from one place to…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

636 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