Positioning curser at EOF in vi


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Positioning curser at EOF in vi
# 1  
Old 12-07-2004
Tools 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  
Old 12-07-2004
You can place yourself at the last line of the file using
vi + /my/file/here

Cheers
ZB
# 3  
Old 12-07-2004
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  
Old 12-07-2004
Quote:
In vi CNTRL-G will also take you to the last line
It's Shift-G Smilie 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  
Old 12-07-2004
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  
Old 12-07-2004
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  
Old 12-08-2004
Quote:
It's Shift-G Ctrl-G prints file name, line, column, etc - information.
Smilie I knew that! Thanks for catching that.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Complex positioning

I got these entries in a file alias server.domain.com='ssh 192.168.1.1@user1 ' alias server1.domain.com='ssh user2 @192.168.1.1' alias server1.domain.com='ssh user3@192.168.1.1' In the above lines, last line is the correct format. The first is IP@username, has got a space after the... (9 Replies)
Discussion started by: anil510
9 Replies

2. UNIX for Dummies Questions & Answers

positioning words in a line

I have problem with this for last few days and I would really be grateful if you can help me :wall::wall::wall::wall::wall: I have sets of files in one directory, and each of them have few lines each one of these lines has 1 or more occurrence of words Y = I need to find the position of the... (10 Replies)
Discussion started by: A-V
10 Replies

3. Shell Programming and Scripting

Tab positioning

xx00102 1(SG): xx00102 3(SG): xx00115 lan900: xx00115 lan901: xx00116 1(SG): xx00116 3(SG): the boxes are echoed on the same line with one \t. Is there anyway to get all the boxes to line up? Or possibly is there a way to fix the position of something... (3 Replies)
Discussion started by: trimike
3 Replies

4. Shell Programming and Scripting

confused with << EOF EOF

Hi friends , I am confused with << EOF EOF Most of the cases I found sqlplus $db_conn_str << EOF some sql staments EOF another exapmle is #!/bin/sh echo -n 'what is the value? ' read value sed 's/XXX/'$value'/' <<EOF The value is XXX EOF (1 Reply)
Discussion started by: imipsita.rath
1 Replies

5. Shell Programming and Scripting

cursor positioning

Hi All, please help me to know how to move the cursor to the desired position? For example, in a shell script, I am displaying echo "\t Enter your Name:" please help me how to move cursor near the first word. for example, if the output is as below ... (3 Replies)
Discussion started by: little_wonder
3 Replies

6. Programming

need info on current curser postion.

Hi All, I have written the below code to know the current curser position. The problem with this code is - it gives me window size properly but whn it comes to current curser position then it gives (0,0) as x,y co-ordinate eventhough my curser is somewhere middle on command line interface. ... (0 Replies)
Discussion started by: swap007
0 Replies

7. Shell Programming and Scripting

curser control ~ multi line progress bar

Hi there, I have progress bars in several of my scripts, they work by deleting what has already been writen out, using: clear = "\\010"*( length of string i want to delete ) clearCmd = "echo -ne \""+clear+"\"" os.system(clearCmd) I then re-write the percent done & the progress... (4 Replies)
Discussion started by: purest
4 Replies

8. Programming

positioning cursor

I am using curses.h and signals.h to control output to screen. My code displays an unchanging prompt that waits for user input. Meanwhile alarm signals are being generated that cause other ancillary messages to appear at other locations on the screen at various times. The problem I have is with... (2 Replies)
Discussion started by: enuenu
2 Replies

9. UNIX for Dummies Questions & Answers

Cursor Positioning

Can anyone tell me how to ouput the current cursor coordinate? I have tried using tput sc and tput rc. However I want to know what the coordinate is. Thanks. (1 Reply)
Discussion started by: bestbuyernc
1 Replies

10. UNIX for Dummies Questions & Answers

Cursor positioning thru VI Editor

Is there a way that I can position cursor at say line 23, column 2? Thank you in advance. (8 Replies)
Discussion started by: Latha Nair
8 Replies
Login or Register to Ask a Question