This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: 1.7.35: possible backspace key and arrow keys bug


On 2015-04-09, René Berber wrote:
> On 4/9/2015 12:34 PM, Corinna Vinschen wrote:
> > On Apr  9 09:54, Weston Turner wrote:
> >> I corroborate the original poster's experience with this issue.
> >> 
> >> Steps to reproduce the issue: for example open a file with vim 
> >> under Cygwin, press: up, up, down, down, left, left, right,
> >> right. Vim under Cygwin places:
> >> 
> >> C C D D B B A A
> >> 
> >> in the file due to the arrow keys being pressed. Vim under bash
> >> on Linux or the Mac terminal does not treat the arrow keys as
> >> file input, but rather simply uses them to move the cursor about
> >> in the file.
> > 
> > WJFFM, as on Linux, in command mode as well as in insert mode.
> 
> You probably have a .vimrc on Cygwin, and the same or /etc/vimrc on Linux.
> 
> The real question:
> 
> Why vim on Cygwin doesn't install, or use if you add one, /etc/vimrc?

Executing

    $ vim --version

shows

       system vimrc file: "$VIM/vimrc"
         user vimrc file: "$HOME/.vimrc"
     2nd user vimrc file: "~/.vim/vimrc"
          user exrc file: "$HOME/.exrc"
      fall-back for $VIM: "/etc"
     f-b for $VIMRUNTIME: "/usr/share/vim/vim74"

>From within vim,

    :echo $VIM

shows

    /usr/share/vim

To find out more about the value of $VIM, execute

    :help $VIM

So, Cygwin's vim looks for the system vimrc at /usr/share/vim/vimrc,
not /etc/vimrc.  If you create that file, start vim and execute

    :scriptnames

you will see

    1: /usr/share/vim/vimrc

at the top of the list.

Personally, I really like that Cygwin does not include a system
vimrc in its vim package.  If it did, I'd have to undo all those
settings or rm the file.  I have a ~/.vimrc that works on Windows,
Cygwin, Ubuntu and Fedora and ensures that vim behaves the same on
all platforms.  I don't want somebody else making those
configuration decisions for me.

> On Linux I have one with the following contents (which fixes the
> thread problem):
> 
> " Begin /etc/vimrc
> 
> set nocompatible
> set backspace=2
> syntax on
> set background=dark
> if (&term == "iterm") || (&term == "putty")
>   set background=dark
> endif
> 
> " End /etc/vimrc
> 
> The 5th line doesn't work with the version installed on Cygwin, so you
> have to comment it; but it would be nice to also have syntax highlighting.

I don't understand what you mean that the 5th line doesn't work and
has to be commented.  I have "syntax on" in my ~/.vimrc file and
syntax highlighting works just fine.  I have "set background=light"
in my colorscheme file and it works fine as well.  Further, I can
execute ":set background=dark" and ":set background=light" from the
vim command line and see the color differences.

It sounds like some part of your installation is broken.

I'm using Cygwin's vim 7.4.663-1.

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]