Loading ...
Sorry, an error occurred while loading the content.

RE: last view not restored

Expand Messages
  • Keith Roberts
    ... Exactly! Thanks for the edification, Tony. My purpose was to raise the possibility to the OP that on the other systems, he is likely not even reading
    Message 1 of 8 , Dec 29, 2003
    • 0 Attachment
      >-----Original Message-----
      >From: Antoine J. Mechelynck [mailto:antoine.mechelynck@...]
      >Sent: Monday, December 29, 2003 1:51 PM
      >To: Keith Roberts; 'Benji Fisher'; vim@...
      >Subject: Re: last view not restored
      >
      >Keith Roberts <kroberts@...> wrote:
      >> > -----Original Message-----
      >> > From: Benji Fisher [mailto:benji@...]
      >> > Sent: Monday, December 29, 2003 12:48 PM
      >> > To: vim@...
      >> > Subject: Re: last view not restored
      >> >
      >> > On Wed, Dec 24, 2003 at 04:24:07PM +0100, Antoine J. Mechelynck
      >> > wrote:
      >> > > Yakov Lerner <yakov.lerner@...> wrote:
      >> > > > On my "master" unix computers, when I open a file, vim
      >> > > > goes to the last viewed line. This is very convenient.
      >> > > >
      >> > > > On other computers (to which I copied the .vimrc and .exrc from
      >> > > > the "master" computer) vim does not go to the last viewed line.
      >> > > >
      >> > > > What am I missing on the "other" computers ?
      >> > > >
      >> > > > Can it be vim version issue ? On the "master" computer, vim is
      >> > > > 6.2.60. On "other" computers, vim is 6.1.165 (which seems
      >> > > > decently recent).
      >> > > >
      >> > > > Yakov
      >> > >
      >> > > With
      >> > > :set viminfo?
      >> > > :au vimrcEx BufRead
      >> > >
      >> > > you should be able to check that marks (including the cursor
      >> > > position) are stored in the viminfo, and that the
      >> > > cursor-positioning autocommand defined by the default vimrc is
      >> > > still there.
      >> >
      >> > To interpret the output of the :set command, see
      >> >
      >> > > help 'viminfo'
      >> >
      >> > The vimrcEx autocommands are defined in
      >> > $VIMRUNTIME/vimrc_example.vim .
      >> > I am not sure whether that changed between vim 6.1 and 6.2 , but it
      >> > may have.
      >
      >Under 6.1, it already had the cursor-positioning autocommands, since my
      >first vim was 6.1 and it positioned the cursor correctly (on recent-enough
      >files) without me having to personally take care of it.
      >
      >> >
      >> > My guess is that what you failed to copy is a system vimrc file.
      >> > If your "master" computer is a Red Hat system, for example, then you
      >> > will have a system vimrc file installed. Check the output of
      >> >
      >> > > version
      >> >
      >> > to see if this is the case.
      >> >
      >> > HTH --Benji Fisher
      >>
      >> Wouldn't it have more to do with the directory cd'd to at startup?
      >> Wouldn't that be where the viminfo file is written to? [Or
      >> conversely, it might be written to a different directory if cd'd away
      >> from the one where the file exists ... depending on his startup
      >> scripts.]
      >
      >As said under ":help viminfo-file-name" the viminfo is by default
      >$HOME/viminfo -- bit it can be anywhere else if the -i command-line option
      >is used, or if the 'viminfo' option (see ":help 'viminfo'") has a "n"
      >suboption. Also see ":help 'viminfo'" for other suboptions of the 'viminfo'
      >option, some of which may be relevant.
      >
      >Regards,
      >Tony.

      Exactly! Thanks for the edification, Tony. My purpose was to raise the
      possibility to the OP that on the "other" systems, he is likely not even
      reading the same viminfo file as was written on the "main" system.

      This is definitely going to be the case when [$HOME|$VIM]/[._]viminfo are
      used. In my setup the viminfo is always written in the "project" directory,
      to a pathname which is set on startup (and specified using the 'n' value of
      the 'viminfo' option). Thus, the same file is pointed to no matter which
      system I am editing from.
    Your message has been successfully submitted and would be delivered to recipients shortly.