public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Vim and cursor position
@ 2016-02-14 16:34 James Darnley
  2016-02-14 20:23 ` Gary Johnson
  0 siblings, 1 reply; 4+ messages in thread
From: James Darnley @ 2016-02-14 16:34 UTC (permalink / raw)
  To: cygwin

[-- Attachment #1: Type: text/plain, Size: 543 bytes --]

To the maintainer, Yaakov, or anyone else who knows:

Have the compilation options of Vim changed recently?  Is there some
other recent change that would cause the behaviour described below?

Vim now appears to be remembering the last position of the cursor when
you open files.  I notice it most when running 'git commit', the cursor
never starts on the first line but would appear to be where ever I ended
the previous message.

I find this jolly annoying.

I would appreciate any insights people can offer.

Thanks, James.


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 603 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Vim and cursor position
  2016-02-14 16:34 Vim and cursor position James Darnley
@ 2016-02-14 20:23 ` Gary Johnson
  2016-02-14 21:35   ` Andrey Repin
  2016-02-14 22:18   ` James Darnley
  0 siblings, 2 replies; 4+ messages in thread
From: Gary Johnson @ 2016-02-14 20:23 UTC (permalink / raw)
  To: cygwin

On 2016-02-14, James Darnley wrote:
> To the maintainer, Yaakov, or anyone else who knows:
> 
> Have the compilation options of Vim changed recently?  Is there some
> other recent change that would cause the behaviour described below?
> 
> Vim now appears to be remembering the last position of the cursor when
> you open files.  I notice it most when running 'git commit', the cursor
> never starts on the first line but would appear to be where ever I ended
> the previous message.
> 
> I find this jolly annoying.
> 
> I would appreciate any insights people can offer.

Recent releases of the Cygwin Vim package (starting with 7.4.1179-1,
2016-01-29) have included Red Hat's or Fedora's /etc/vimrc, which is
loaded first when starting Vim.  That file contains a BufReadPost
autocommand to do what you observe.

I don't like it, either, so I have this in my ~/.vimrc:

    " Remove the (annoying) /etc/vimrc autocommand that positions
    " the cursor " to the location it last had when the file was
    " closed.
    "
    if exists("#fedora#BufRead#*")
	au! fedora BufRead *
    endif
    if exists("#redhat#BufRead#*")
	au! redhat BufRead *
    endif

For Cygwin, you need only one of those, but I'm at home, my Cygwin
installation is at work, and I don't remember whether Cygwin uses
the Fedora or the Red Hat version of /etc/vimrc.

You may want to take a look at /etc/vimrc and see if it makes any
other settings you find undesirable and undo them in your ~/.vimrc
as well.

Regards,
Gary


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Vim and cursor position
  2016-02-14 20:23 ` Gary Johnson
@ 2016-02-14 21:35   ` Andrey Repin
  2016-02-14 22:18   ` James Darnley
  1 sibling, 0 replies; 4+ messages in thread
From: Andrey Repin @ 2016-02-14 21:35 UTC (permalink / raw)
  To: Gary Johnson, cygwin

Greetings, Gary Johnson!

> Recent releases of the Cygwin Vim package (starting with 7.4.1179-1,
> 2016-01-29) have included Red Hat's or Fedora's /etc/vimrc, which is
> loaded first when starting Vim.  That file contains a BufReadPost
> autocommand to do what you observe.

> I don't like it, either, so I have this in my ~/.vimrc:

>     " Remove the (annoying) /etc/vimrc autocommand that positions
>     " the cursor " to the location it last had when the file was
>     " closed.
>     "
>     if exists("#fedora#BufRead#*")
>         au! fedora BufRead *
>     endif
>     if exists("#redhat#BufRead#*")
>         au! redhat BufRead *
>     endif

> For Cygwin, you need only one of those, but I'm at home, my Cygwin
> installation is at work, and I don't remember whether Cygwin uses
> the Fedora or the Red Hat version of /etc/vimrc.

> You may want to take a look at /etc/vimrc and see if it makes any
> other settings you find undesirable and undo them in your ~/.vimrc
> as well.

It may be worthwhile to do this only for certain names of files.
Overall, I find having editor remember where I have been in the code useful.


-- 
With best regards,
Andrey Repin
Monday, February 15, 2016 00:21:34

Sorry for my terrible english...


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Vim and cursor position
  2016-02-14 20:23 ` Gary Johnson
  2016-02-14 21:35   ` Andrey Repin
@ 2016-02-14 22:18   ` James Darnley
  1 sibling, 0 replies; 4+ messages in thread
From: James Darnley @ 2016-02-14 22:18 UTC (permalink / raw)
  To: cygwin

[-- Attachment #1: Type: text/plain, Size: 1803 bytes --]

On 2016-02-14 21:24, Gary Johnson wrote:
> On 2016-02-14, James Darnley wrote:
>> To the maintainer, Yaakov, or anyone else who knows:
>>
>> Have the compilation options of Vim changed recently?  Is there some
>> other recent change that would cause the behaviour described below?
>>
>> Vim now appears to be remembering the last position of the cursor when
>> you open files.  I notice it most when running 'git commit', the cursor
>> never starts on the first line but would appear to be where ever I ended
>> the previous message.
>>
>> I find this jolly annoying.
>>
>> I would appreciate any insights people can offer.
> 
> Recent releases of the Cygwin Vim package (starting with 7.4.1179-1,
> 2016-01-29) have included Red Hat's or Fedora's /etc/vimrc, which is
> loaded first when starting Vim.  That file contains a BufReadPost
> autocommand to do what you observe.
> 
> I don't like it, either, so I have this in my ~/.vimrc:
> 
>     " Remove the (annoying) /etc/vimrc autocommand that positions
>     " the cursor " to the location it last had when the file was
>     " closed.
>     "
>     if exists("#fedora#BufRead#*")
> 	au! fedora BufRead *
>     endif
>     if exists("#redhat#BufRead#*")
> 	au! redhat BufRead *
>     endif
> 
> For Cygwin, you need only one of those, but I'm at home, my Cygwin
> installation is at work, and I don't remember whether Cygwin uses
> the Fedora or the Red Hat version of /etc/vimrc.
> 
> You may want to take a look at /etc/vimrc and see if it makes any
> other settings you find undesirable and undo them in your ~/.vimrc
> as well.
> 
> Regards,
> Gary

Thank you very much.  For everyone's information: /etc/vimrc appears to
group things under "fedora".

P.S.  Sorry about the double mail Gary.



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 603 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-02-14 22:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-14 16:34 Vim and cursor position James Darnley
2016-02-14 20:23 ` Gary Johnson
2016-02-14 21:35   ` Andrey Repin
2016-02-14 22:18   ` James Darnley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).