delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2016/02/14/15:24:01

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:date:from:to:subject:message-id:references
:mime-version:content-type:in-reply-to; q=dns; s=default; b=pHJU
okO5GvWbs1r2mWGrh+EOYN7m8cwmmPgn5+nKRavysD0TDrCoEMxkbYP/TAuxnW3Y
1jrW/SS9HmkIUZNTfcnLAVUhwcGS3Q3lgJj3wTBnEV/o4lgmi2MssR7EnPnZktXS
xtUOa/IgFTsXPXiMKf73GMROtpFRUL3YyDaHTw0=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:date:from:to:subject:message-id:references
:mime-version:content-type:in-reply-to; s=default; bh=eixOmPmeGp
+NoovxRBYEQ/fFTyI=; b=ECSs8rwYLp/YHanotvwBEHuZkgFNdeExrUHVy7Wamz
69/5SGLci7X5TUJF5jUZJp5flw4OWnqptSdS8Ky1+Mv37M9+OiZfL76nl8TOyPt7
DGEHp7+nv8rAzSpolRCkujZdUaWUMBpZdp5LvpCdSsINXU+ms+CuX91W9XEjO95z
k=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=0.8 required=5.0 tests=BAYES_50,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 spammy=au, positions, H*f:sk:56C0AC9, hats
X-HELO: mail.spocom.com
Date: Sun, 14 Feb 2016 12:24:33 -0800
From: Gary Johnson <garyjohn AT spocom DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: Vim and cursor position
Message-ID: <20160214202433.GA3865@phoenix>
Mail-Followup-To: cygwin AT cygwin DOT com
References: <56C0AC94 DOT 2040901 AT gmail DOT com>
MIME-Version: 1.0
In-Reply-To: <56C0AC94.2040901@gmail.com>
User-Agent: Mutt/1.5.20 (2009-06-14)
X-IsSubscribed: yes

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019