The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
curser control ~ multi line progress bar purest Shell Programming and Scripting 4 10-29-2007 03:58 AM
positioning cursor enuenu High Level Programming 2 06-02-2007 12:35 AM
Help with Data Positioning from Columns in a flat file. oott1 Shell Programming and Scripting 3 06-14-2006 10:22 AM
Cursor Positioning bestbuyernc UNIX for Dummies Questions & Answers 1 09-06-2005 05:50 AM
Cursor positioning thru VI Editor Latha Nair UNIX for Dummies Questions & Answers 8 08-11-2004 04:56 AM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 12-07-2004
Registered User
 

Join Date: Nov 2004
Posts: 22
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Spurl this Post!
Cool Positioning curser at EOF in vi

Hi there,

Is there a way to position the cursor at EOF in vi, I know from the man pages how to position the cursor at the end of a paragraph, but what about the EOF (End Of File).

Regards
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 12-07-2004
zazzybob's Avatar
Registered Geek
 

Join Date: Dec 2003
Location: Melbourne, Australia
Posts: 2,100
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Spurl this Post!
You can place yourself at the last line of the file using
vi + /my/file/here

Cheers
ZB
Reply With Quote
  #3 (permalink)  
Old 12-07-2004
google's Avatar
Moderator
 

Join Date: Jul 2002
Location: Atlanta
Posts: 740
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Spurl this Post!
For what is worth, In vi CNTRL-G will also take you to the last line. Shift-A will take you to the end of a line (though you will be appending). Maybe not exactly what you wanted but it might be the closest you will get.
Reply With Quote
  #4 (permalink)  
Old 12-07-2004
zazzybob's Avatar
Registered Geek
 

Join Date: Dec 2003
Location: Melbourne, Australia
Posts: 2,100
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Spurl this Post!
Quote:
In vi CNTRL-G will also take you to the last line
It's Shift-G Ctrl-G prints file name, line, column, etc - information.

To place your self at the end of the last line do...
ESC (to place yourself in command mode)
Shift-G (to go to the last line)
$ (to go to the end of the line - not appending)

Cheers
ZB
Reply With Quote
  #5 (permalink)  
Old 12-07-2004
bhargav's Avatar
Registered User
 

Join Date: Sep 2004
Location: USA
Posts: 511
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Spurl this Post!
ESC
:
$

aswell takes u to the last line in the file.

and one more $ takes you to the EOF.


or as said before by google Zbob ,

CTRL+G gives M of N .... where N is total number of lines in that file.

Goto last line and reach EOF by

ESC
:
N
and then $ to reach EOF.
Reply With Quote
  #6 (permalink)  
Old 12-07-2004
zazzybob's Avatar
Registered Geek
 

Join Date: Dec 2003
Location: Melbourne, Australia
Posts: 2,100
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Spurl this Post!
Quote:
Originally posted by bhargav
CTRL+G gives M of N .... where N is total number of lines in that file.

Goto last line and reach EOF by

ESC
:
N
and then $ to reach EOF.
Yes, but having to look at the output from CTRL+G, then plugging that into :N (i.e. :230 or whatever) is all extra uneccesary keystrokes. A simple SHIFT-G gets you down to the last line with no hassle. Or, as you suggest :$ does the same thing.

Cheers
ZB
Reply With Quote
  #7 (permalink)  
Old 12-08-2004
google's Avatar
Moderator
 

Join Date: Jul 2002
Location: Atlanta
Posts: 740
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Spurl this Post!
Quote:
It's Shift-G Ctrl-G prints file name, line, column, etc - information.
I knew that! Thanks for catching that.
Reply With Quote
Google UNIX.COM
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 04:41 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101