Help needed to : Start on the line where I left when I opened the file last time

2007-02-21 Thread durgaprasad jammula
Hi,

I just need some help on vim configuration.

Let say the file is good.text. I open the file and goto 66 line and come 
out by typing :wq in escape mode.

Now, when I open it again, my cursor is placed in line 0. I want it to be 
placed in line 66.

I am facing this problem in my Solaris 10 x86 machine. The same thing is 
working fine in Linux.

Can you please help me what configuration do I need to change to enable 
this feature. [I have tried Google search and could not get useful links].

Thank you
Durga Prasad



 

Looking for earth-friendly autos? 
Browse Top Cars by Green Rating at Yahoo! Autos' Green Center.
http://autos.yahoo.com/green_center/


Re: Help needed to : Start on the line where I left when I opened the file last time

2007-02-21 Thread Swaroop C H

Let say the file is good.text. I open the file and goto 66 line and come 
out by typing :wq in escape mode.

Now, when I open it again, my cursor is placed in line 0. I want it to be 
placed in line 66.
Can you please help me what configuration do I need to change to enable 
this feature. [I have tried Google search and could not get useful links].


Maybe http://tech.groups.yahoo.com/group/vim/message/77644 can help you.

HTH,
Swaroop


Re: Help needed to : Start on the line where I left when I opened the file last time

2007-02-21 Thread durgaprasad jammula
Hi Swaroop,

  Thank you for the reply. 

   I have tried the option suggested by you. But unfortunately it is not 
working. After reading some documentation, I came to know that we can do that 
by typing `  [backquote  doublequote ]. But I want to do this automatically 
at the time when I open the file.

Can you please help regarding this?

 -
Durga Prasad Jammula
webpage : http://durgaprasad.wordpress.com


- Original Message 
From: Swaroop C H [EMAIL PROTECTED]
To: durgaprasad jammula [EMAIL PROTECTED]
Cc: vim@vim.org
Sent: Wednesday, February 21, 2007 11:07:25 PM
Subject: Re: Help needed to : Start on the line where I left when I opened the 
file last time

 Let say the file is good.text. I open the file and goto 66 line and come 
 out by typing :wq in escape mode.

 Now, when I open it again, my cursor is placed in line 0. I want it to be 
 placed in line 66.
 Can you please help me what configuration do I need to change to enable 
 this feature. [I have tried Google search and could not get useful links].

Maybe http://tech.groups.yahoo.com/group/vim/message/77644 can help you.

HTH,
Swaroop





 

It's here! Your new message!  
Get new email alerts with the free Yahoo! Toolbar.
http://tools.search.yahoo.com/toolbar/features/mail/


Re: Help needed to : Start on the line where I left when I opened the file last time

2007-02-21 Thread A.J.Mechelynck

durgaprasad jammula wrote:

Hi,

I just need some help on vim configuration.

Let say the file is good.text. I open the file and goto 66 line and come 
out by typing :wq in escape mode.

Now, when I open it again, my cursor is placed in line 0. I want it to be 
placed in line 66.

I am facing this problem in my Solaris 10 x86 machine. The same thing is 
working fine in Linux.

Can you please help me what configuration do I need to change to enable 
this feature. [I have tried Google search and could not get useful links].

Thank you
Durga Prasad



There is an autocommand near the end of the vimrc_example which does just 
that; so adding


runtime vimrc_example.vim

near the top of your vimrc should be enough.


Best regards,
Tony.
--
Puns are little plays on words that a certain breed of person loves
to spring on you and then look at you in a certain self-satisfied way
to indicate that he thinks that you must think that he is by far the
cleverest person on Earth now that Benjamin Franklin is dead, when in
fact what you are thinking is that if this person ever ends up in a
lifeboat, the other passengers will hurl him overboard by the end of
the first day even if they have plenty of food and water.
-- Dave Barry, Why Humor is Funny


Re: Help needed to : Start on the line where I left when I opened the file last time

2007-02-21 Thread Charles E Campbell Jr

durgaprasad jammula wrote:


   I just need some help on vim configuration.

   Let say the file is good.text. I open the file and goto 66 line and come out 
by typing :wq in escape mode.

   Now, when I open it again, my cursor is placed in line 0. I want it to be 
placed in line 66.

   I am facing this problem in my Solaris 10 x86 machine. The same thing is 
working fine in Linux.

   Can you please help me what configuration do I need to change to enable this 
feature. [I have tried Google search and could not get useful links].
 



Read http://vim.sourceforge.net/tips/tip.php?tip_id=80 ,
Restore cursor to file position in previous editing session.

HTH,
Chip Campbell



Re: Help needed to : Start on the line where I left when I opened the file last time

2007-02-21 Thread durgaprasad jammula
Hi,

 I have solved this problem myself.

 I have taken the following from my suse linux /etc/vimrc and added the same in 
my Solaris .vimrc file. Now, it is working fine. 

if has(autocmd)
  autocmd BufReadPost *
\ if line('\)  0  line('\) = line($) |
\   exe normal g`\ |
\ endif
endif

 
Thank you for your help.

-
Durga Prasad Jammula
webpage : http://durgaprasad.wordpress.com


- Original Message 
From: durgaprasad jammula [EMAIL PROTECTED]
To: Swaroop C H [EMAIL PROTECTED]
Cc: vim@vim.org
Sent: Wednesday, February 21, 2007 11:25:27 PM
Subject: Re: Help needed to : Start on the line where I left when I opened the 
file last time

Hi Swaroop,

  Thank you for the reply. 

   I have tried the option suggested by you. But unfortunately it is not 
working. After reading some documentation, I came to know that we can do that 
by typing `  [backquote  doublequote ]. But I want to do this automatically 
at the time when I open the file.

Can you please help regarding this?

 -
Durga Prasad Jammula
webpage : http://durgaprasad.wordpress.com


- Original Message 
From: Swaroop C H [EMAIL PROTECTED]
To: durgaprasad jammula [EMAIL PROTECTED]
Cc: vim@vim.org
Sent: Wednesday, February 21, 2007 11:07:25 PM
Subject: Re: Help needed to : Start on the line where I left when I opened the 
file last time

 Let say the file is good.text. I open the file and goto 66 line and come 
 out by typing :wq in escape mode.

 Now, when I open it again, my cursor is placed in line 0. I want it to be 
 placed in line 66.
 Can you please help me what configuration do I need to change to enable 
 this feature. [I have tried Google search and could not get useful links].

Maybe http://tech.groups.yahoo.com/group/vim/message/77644 can help you.

HTH,
Swaroop





 

It's here! Your new message!  
Get new email alerts with the free Yahoo! Toolbar.
http://tools.search.yahoo.com/toolbar/features/mail/





 

No need to miss a message. Get email on-the-go 
with Yahoo! Mail for Mobile. Get started.
http://mobile.yahoo.com/mail


RE: Help needed to : Start on the line where I left when I opened the file last time

2007-02-21 Thread David Fishburn
 
 Read http://vim.sourceforge.net/tips/tip.php?tip_id=80 , 
 Restore cursor to file position in previous editing session.


This tip does most of what I want thanks to the additional notes section.

I have realized, this only returns us to the row we were on.  Does anyone
know if it is also possible to return the the row and column position?

I am not sure if the column position is also stored within the viminfo file.

TIA,
Dave



Re: Help needed to : Start on the line where I left when I opened the file last time

2007-02-21 Thread A.J.Mechelynck

David Fishburn wrote:
Read http://vim.sourceforge.net/tips/tip.php?tip_id=80 , 
Restore cursor to file position in previous editing session.



This tip does most of what I want thanks to the additional notes section.

I have realized, this only returns us to the row we were on.  Does anyone
know if it is also possible to return the the row and column position?

I am not sure if the column position is also stored within the viminfo file.

TIA,
Dave




The row and column are both stored as part of the mark. Just make sure you 
execute g` where the first character after the g is a backtick. The 
vimrc_example.vim does it as follows:


   When editing a file, always jump to the last known cursor position.
   Don't do it when the position is invalid or when inside an event handler
   (happens when dropping a file on gvim).
  autocmd BufReadPost *
\ if line('\)  0  line('\) = line($) |
\   exe normal! g`\ |
\ endif


Best regards,
Tony.
--
Honesty pays, but it doesn't seem to pay enough to suit some people.
-- F. M. Hubbard