Monday, May 17, 2010

Re: New file opened when clicking on a file in netrw column list (v138b)

On May 17, 4:59 am, Charles E Campbell Jr <drc...@campbellfamily.biz>
wrote:
> The "default" _vimrc is no _vimrc; and that means "compatible" mode, so
> no plugins.  Somehow I don't think that's what you meant.
>
> So, I set up a <simple.vimrc> file:
> set nocp
> filetype plugin on
>
> and used
> gvim -u ../simple.vimrc file1
>
> in a directory containing only two files (file1, file2), with
> simple.vimrc in the directory above.  Following the rest of your
> instructions, I saw no problems (ie. switched to "wide" listing style,
> and no "ile2" when attempting to open file2 by using the mouse).

Hello Chip,
You are right, no problem with your "simple.vimrc".

What I call the default _vimrc is the "_vimrc" file located in "C:
\Program Files\vim" in the case of a standard windows installation
(copied below). This file is used by default if you just type "gvim
file" at the command prompt.

If you copy this file in your test directory and type
gvim -u .\_vimrc file1 (or simply gvim file1)
:e .
i twice
click on file2

you will probably see the problem (I do).
I have not tried yet to see exactly what causes the pb.

Best regards
Jean Johner
______________________
_vimrc file below

set nocompatible
source $VIMRUNTIME/vimrc_example.vim
source $VIMRUNTIME/mswin.vim
behave mswin

set diffexpr=MyDiff()
function MyDiff()
let opt = '-a --binary '
if &diffopt =~ 'icase' | let opt = opt . '-i ' | endif
if &diffopt =~ 'iwhite' | let opt = opt . '-b ' | endif
let arg1 = v:fname_in
if arg1 =~ ' ' | let arg1 = '\"' . arg1 . '\"' | endif
let arg2 = v:fname_new
if arg2 =~ ' ' | let arg2 = '\"' . arg2 . '\"' | endif
let arg3 = v:fname_out
if arg3 =~ ' ' | let arg3 = '\"' . arg3 . '\"' | endif
let eq = ''
if $VIMRUNTIME =~ ' '
if &sh =~ '\<cmd'
let cmd = '\"' . $VIMRUNTIME . '\diff\"'
let eq = '\"\"'
else
let cmd = substitute($VIMRUNTIME, ' ', '\" ', '') . '\diff\"'
endif
else
let cmd = $VIMRUNTIME . '\diff'
endif
silent execute '!' . cmd . ' ' . opt . arg1 . ' ' . arg2 . ' > ' .
arg3 . eq
endfunction


--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments: