Alternate file with netrw buffer in Vim 7.4 - bug or change?

322 views
Skip to first unread message

Bruno Sutic

unread,
Aug 25, 2013, 6:19:27 PM8/25/13
to vim...@googlegroups.com
Hi,
I noticed a "new" behavior with vim 7.4 and netrw plugin.
Alternate buffer command (normal mode C-^ key) works differently than in vim 7.3.

Here are the steps how to see the difference:
*vim 7.3*
1. /usr/bin/vim -u NORC -N (starting vim7.3)
2. :e Gemfile (open any random file)
3. :E (show netrw plugin buffer)
4. <in netrw buffer browse and open other random file - Gemfile.lock>
5. C-^ (alternate buffer)
At this point vim shows netrw buffer opened in step 3

*vim 7.4* (the same steps)
1. vim -u NORC -N (starting vim7.4)
2. :e Gemfile
3. :E
4. <in netrw buffer browse and open other random file - Gemfile.lock>
5. C-^
At this point vim 7.4 shows 'Gemfile' file opened in step 2

What do you think is this a bug or new behavior?
Thanks

Charles Campbell

unread,
Aug 26, 2013, 9:40:01 AM8/26/13
to vim...@googlegroups.com
That's the effect of a bugfix.

C Campbell

Bram Moolenaar

unread,
Aug 26, 2013, 1:34:52 PM8/26/13
to Bruno Sutic, vim...@googlegroups.com
I also see this problem. I prefer the old way, I often go back to the
directory view. I thought Charles had changed it...

--
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///

Charles Campbell

unread,
Aug 26, 2013, 5:11:19 PM8/26/13
to vim...@googlegroups.com
Bram Moolenaar wrote:
> Bruno Sutic wrote:
>
>> Hi,
>> I noticed a "new" behavior with vim 7.4 and netrw plugin.
>> Alternate buffer command (normal mode C-^ key) works differently than in vim 7.3.
>>
>> Here are the steps how to see the difference:
>> *vim 7.3*
>> 1. /usr/bin/vim -u NORC -N (starting vim7.3)
>> 2. :e Gemfile (open any random file)
>> 3. :E (show netrw plugin buffer)
>> 4. <in netrw buffer browse and open other random file - Gemfile.lock>
>> 5. C-^ (alternate buffer)
>> At this point vim shows netrw buffer opened in step 3
>>
>> *vim 7.4* (the same steps)
>> 1. vim -u NORC -N (starting vim7.4)
>> 2. :e Gemfile
>> 3. :E
>> 4. <in netrw buffer browse and open other random file - Gemfile.lock>
>> 5. C-^
>> At this point vim 7.4 shows 'Gemfile' file opened in step 2
>>
>> What do you think is this a bug or new behavior?
>> Thanks
> I also see this problem. I prefer the old way, I often go back to the
> directory view. I thought Charles had changed it...
>
The change supporting this was done on July 12, 2013; its for v150,
which has not been released as yet. That was the "bugfix" that I was
referring to; I think I misinterpreted what was said. That change is on
my website as an alpha/beta version of netrw (v150f).

http://www.drchip.org/astronaut/vim/index.html#NETRW

Regards,
C Campbell

tooth pik

unread,
Aug 26, 2013, 5:31:21 PM8/26/13
to vim...@googlegroups.com
is it? when I go there I see v150e...

--
_|_ _ __|_|_ ._ o|
|_(_)(_)|_| ||_)||<
|

David Fishburn

unread,
Aug 26, 2013, 6:28:04 PM8/26/13
to vim...@googlegroups.com, Bruno Sutic, vim...@googlegroups.com



On Aug 26, 2013, at 1:34 PM, Bram Moolenaar <Br...@moolenaar.net> wrote:

>
> Bruno Sutic wrote:
>
>> Hi,
>> I noticed a "new" behavior with vim 7.4 and netrw plugin.
>> Alternate buffer command (normal mode C-^ key) works differently than in vim 7.3.
>>
>> Here are the steps how to see the difference:
>> *vim 7.3*
>> 1. /usr/bin/vim -u NORC -N (starting vim7.3)
>> 2. :e Gemfile (open any random file)
>> 3. :E (show netrw plugin buffer)
>> 4. <in netrw buffer browse and open other random file - Gemfile.lock>
>> 5. C-^ (alternate buffer)
>> At this point vim shows netrw buffer opened in step 3
>>
>> *vim 7.4* (the same steps)
>> 1. vim -u NORC -N (starting vim7.4)
>> 2. :e Gemfile
>> 3. :E
>> 4. <in netrw buffer browse and open other random file - Gemfile.lock>
>> 5. C-^
>> At this point vim 7.4 shows 'Gemfile' file opened in step 2
>>
>> What do you think is this a bug or new behavior?
>> Thanks
>
> I also see this problem. I prefer the old way, I often go back to the
> directory view. I thought Charles had changed it...
>

I prefer the new way.
After opening the file I explored to I would want to toggle back and forth between the last file edited not explorer.

Sounds like an netrw option to me!
--
David Fishburn

Gary Johnson

unread,
Aug 26, 2013, 6:39:22 PM8/26/13
to vim...@googlegroups.com
On 2013-08-26, David Fishburn wrote:
As long as we're voting, I prefer the old way.

Regards,
Gary

tooth pik

unread,
Aug 26, 2013, 9:39:32 PM8/26/13
to vim...@googlegroups.com
+1 for the new way -- if I want netrw back I'll ask for it

Nikolay Pavlov

unread,
Aug 26, 2013, 11:35:45 PM8/26/13
to vim...@googlegroups.com

Old seems less surprising. I do not use netrw though, so can't really prefer one instead of the other.

Why not add a configuration option?

> --
> _|_ _  __|_|_ ._ o|
>  |_(_)(_)|_| ||_)||<
>               |
>

> --
> --
> You received this message from the "vim_dev" 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
>
> ---
> You received this message because you are subscribed to the Google Groups "vim_dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+u...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.

Tony Mechelynck

unread,
Aug 26, 2013, 11:51:33 PM8/26/13
to vim...@googlegroups.com
Abstention.

Either way is good for me. If I want to refer to more than one file from
a netrw directory listing I'll open them with o (i.e. in a new window)
then switch windows to get at them, either by clicking the respective
status lines or thanks to the following mappings defined in my vimrc:

" go to next window down or right
map <F11> <C-W>w
" go to next window left or up
map <S-F11> <C-W>W

Best regards,
Tony.
--
inoculatte:
To take coffee intravenously when you are running late.

Bruno Sutic

unread,
Aug 27, 2013, 1:12:29 AM8/27/13
to vim...@googlegroups.com
Hi guys,
I prefer the old way, but I'm sure everyone will be happy as long as there is a setting to tweak this.

Charles Campbell

unread,
Aug 27, 2013, 10:11:36 AM8/27/13
to vim...@googlegroups.com
Sorry -- netrw v150f was marked "NOT RELEASED" -- so v150e was actually
the latest version I'd made available.

I've now released v150f onto my website; it contains a new option,
g:netrw_altfile, which allows one to select the behavior of ctrl-^
vis-a-vis netrw.

I'm hoping to get sftp to work properly before I release v150 "to the
world", but as school is starting back up, and work is heating up, it
may be a bit.

Regards,
Chip Campbell

Bram Moolenaar

unread,
Aug 27, 2013, 3:17:28 PM8/27/13
to Charles Campbell, vim...@googlegroups.com
I do realize that editing the directory of the current file is something
I often do, but I never bothered to set up a mapping for it. Typing ":e
%:h" is not too difficult, but CTRL-O to jump back to the netrw
%directory view was easier.

I now added a mapping:

map ,d :e %:h<CR>

Let's see if I can get used to that.

--
hundred-and-one symptoms of being an internet addict:
126. You brag to all of your friends about your date Saturday night...but
you don't tell them it was only in a chat room.
Reply all
Reply to author
Forward
0 new messages