The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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 07:58 AM
positioning cursor enuenu High Level Programming 2 06-02-2007 03:35 AM
Help with Data Positioning from Columns in a flat file. oott1 Shell Programming and Scripting 3 06-14-2006 01:22 PM
Cursor Positioning bestbuyernc UNIX for Dummies Questions & Answers 1 09-06-2005 08:50 AM
Cursor positioning thru VI Editor Latha Nair UNIX for Dummies Questions & Answers 8 08-11-2004 07:56 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 12-07-2004
JimJim JimJim is offline
Registered User
  
 

Join Date: Nov 2004
Posts: 22
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
  #2 (permalink)  
Old 12-07-2004
zazzybob's Avatar
zazzybob zazzybob is offline Forum Advisor  
Registered Geek
  
 

Join Date: Dec 2003
Location: Melbourne, Australia
Posts: 2,100
You can place yourself at the last line of the file using
vi + /my/file/here

Cheers
ZB
  #3 (permalink)  
Old 12-07-2004
google's Avatar
google google is offline Forum Advisor  
Moderator
  
 

Join Date: Jul 2002
Location: Atlanta
Posts: 740
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.
  #4 (permalink)  
Old 12-07-2004
zazzybob's Avatar
zazzybob zazzybob is offline Forum Advisor  
Registered Geek
  
 

Join Date: Dec 2003
Location: Melbourne, Australia
Posts: 2,100
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
  #5 (permalink)  
Old 12-07-2004
bhargav's Avatar
bhargav bhargav is offline Forum Advisor  
Registered User
  
 

Join Date: Sep 2004
Location: USA
Posts: 511
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.
  #6 (permalink)  
Old 12-07-2004
zazzybob's Avatar
zazzybob zazzybob is offline Forum Advisor  
Registered Geek
  
 

Join Date: Dec 2003
Location: Melbourne, Australia
Posts: 2,100
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
  #7 (permalink)  
Old 12-08-2004
google's Avatar
google google is offline Forum Advisor  
Moderator
  
 

Join Date: Jul 2002
Location: Atlanta
Posts: 740
Quote:
It's Shift-G Ctrl-G prints file name, line, column, etc - information.
I knew that! Thanks for catching that.
Sponsored Links
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 04:09 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language translation by Google.
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0