Friday, July 6, 2018

Re: NetrwC losing modified buffers

On 03.07.2018 20:56, tooth pik wrote:
> i just :r!ls -AgGl * into a hidden buffer and use gf on the contents
That works if you do it once in a while but when you work with a project
with many directories and have to re/move/preview/edit files all the
time, it provokes violent behaviour.

Dirvish is very close to what I expected from a vim'ish file browser.

On 03.07.2018 15:29, Justin M. Keyes wrote:
> One may be forgiven for thinking that netrw was designed to lose
> data, but no, I don't think it was intentional. That particular bug,
> I think, was fixed in more recent versions of Vim.
I don't think so, I have latest stable (?) 8.1 on another machine and it
has the same problem.

> But other subtle, pernicious bugs still exist in netrw since 2012 or
> longer. It's difficult to fix them because netrw is too complicated
> (eleven-thousand lines of Vim script).
>
> netrw drove me crazy enough to create
> https://github.com/justinmk/vim-dirvish , which focuses on
> reliability and harmony with Vi/Vim idioms.
I like Dirvish philosophy, especially its approach to operating on files
via a visual script (:Shdo, x). But I ran into several problems -
they're below, tell me if we should discuss this directly instead of via
the list.

1. Are preview windows (p) not marked as preview? :pclose and ^W_z do
nothing on them (in netrw they close all preview windows without having
to select them manually).

2. Is there any analog to netrw_chgwin? I like to keep a directory
browser visible in a nearby window, switching to it occasionally to open
a new file (and leaving the directory window be). With netrw (if not for
that nasty bug), it could be accomplished by "setting edit window"
(:NetrwC). I wish there was a similar command in Dirvish that once
called on a window would cause all future files to be opened in that
window rather than in new splits.

3. Opening multiple files (Visual, I) for me opens all but one as hidden
buffers. Visual, O does open them all in splits. For two files, I see
the practical value (one is alternate so you can switch between both),
but how does one use it for 3 and more files?

4. Netrw has a tree listing style (g:netrw_liststyle = 3). Dirvish
claims its buffers are filenames only, but for gf and possibly other
commands leading spaces are removed. Would it be possible to implement a
similar mode with indentation used to indicate directory hierarchy, and
directories can be collapsed/expanded instead of entered?

5. Track of the preview window is lost after any of Dirvish splits were
closed, making p open marked file in the Dirvish window itself rather
than in the existing preview window. Reproduce:

vim
:Dirvish
p
o
(now have 1 Dirvish listing, 1 preview split, 1 file split)
^W^W
:q
(now have 1 Dirvish listing which is focused, 1 preview split)
p
(expected: file opened in the existing preview split)
(actual: Dirvish listing was replaced by the previewed file)

--
--
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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments: