0

I usually open a directory in vim with command :e path-of-dir. Because the plugin Netrw is included by default, this will be taken over by it and a netrw window will open with the content of the dir.

But recently I have found that the buffer name of an opened directory would become [No Name] sometimes. I can still run netrw operations in it, its name just gone.

The versions I am using are vim 8.1 and netrw v165. I never had this problem in vim 7. Have you guys ever encounter this problem? Is it a bug or just designed to be so? Is there any workaround, since it is a pain for attempts to restore dirs between vim sessions?

7
  • Welcome to Vi and Vim! Is there any observable pattern for those directories where it fails? – D. Ben Knoble Oct 21 '19 at 10:32
  • It happens every time when restoring dirs from a saved session. Before :mksession, set the netrw buffer to be listed via :set bl, then it will be included into the session file. Then when restored, the dirs are opened, but all become [No Name], which couldn't be recognized for the next session saving. – Terry Oct 22 '19 at 2:12
  • But why would you set bl? That doesnt make sense. – D. Ben Knoble Oct 22 '19 at 2:38
  • that is because :mksession will only save it when that is set. – Terry Oct 22 '19 at 5:20
  • Right—but why save netrw buffers? They aren’t meant to be – D. Ben Knoble Oct 22 '19 at 10:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.