Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[netrw] Netrw will ignore any files after a directory when using :bnext #5073

Open
joereynolds opened this issue Oct 17, 2019 · 2 comments
Open

Comments

@joereynolds
Copy link

The Bug

When I open vim with vim * and there's a directory present in the buffers, using :bnext will restart the cycle once it hits the directory.

Example

If I have the following file list

├── file1.php
├── another-file.php
├── one-more.php
├── A-Directory
├── a-file-after-the-directory-in-the-list.php
└── and-another.php

When navigating through using :bnext (starting at file1.php), once it hits A-Directory it will begin cycling at file1.php instead of continuing on to a-file-after-the-directory-in-the-list.php

Description

:bnext will restart at the 0th buffer once it hits a directory in the list in :ls

Steps

  1. Run vim * on a directory that has both files and a directory
  2. Go through the buffers with :bnext
  3. Once it hits the directory, the next :bnext will begin at the start of the list of buffers instead of continuing on to the next buffer.

Expected

I would expect it to the go the next buffer in the list, not restart the cycle.

Environment

  • Vim version 8.0.1453
  • OS: Ubuntu 18.04
  • Terminal: GNOME Terminal

Additional

@chrisbra
Copy link
Member

Yes, what happens is. Vim notices that it tries to open a directory. Then netrw kicks in and creates a new unnamed buffer, that contains the filecontent for that buffer. As it created a new buffer, this buffer will be at then end of the current buffer list, so the next :bnext wraps over and starts from the beginning.

@chrisbra
Copy link
Member

this looks indeed like a duplicate of #2597

atweiden pushed a commit to atweiden/macfiles that referenced this issue Jul 27, 2020
summary
- don't use gQ to enter ex mode
- don't use gq to format text
- don't use gw to format text
- add more default plugins to disable
  - allow netrw
    - which could be disabled
      - via
        - let g:loaded_netrwPlugin = 1
      - see
        - vim/vim#5073

credit
- https://github.com/mengelbrecht/dotfiles/blob/master/config/nvim/init.vim
atweiden pushed a commit to atweiden/pacfiles that referenced this issue Jul 27, 2020
summary
- don't use gQ to enter ex mode
- don't use gq to format text
- don't use gw to format text
- add more default plugins to disable
  - allow netrw
    - which could be disabled
      - via
        - let g:loaded_netrwPlugin = 1
      - see
        - vim/vim#5073

credit
- https://github.com/mengelbrecht/dotfiles/blob/master/config/nvim/init.vim
atweiden pushed a commit to atweiden/ttyfiles that referenced this issue Jul 27, 2020
summary
- don't use gQ to enter ex mode
- don't use gq to format text
- don't use gw to format text
- add more default plugins to disable
  - allow netrw
    - which could be disabled
      - via
        - let g:loaded_netrwPlugin = 1
      - see
        - vim/vim#5073

credit
- https://github.com/mengelbrecht/dotfiles/blob/master/config/nvim/init.vim
atweiden pushed a commit to atweiden/voidfiles that referenced this issue Jul 27, 2020
summary
- don't use gQ to enter ex mode
- don't use gq to format text
- don't use gw to format text
- add more default plugins to disable
  - allow netrw
    - which could be disabled
      - via
        - let g:loaded_netrwPlugin = 1
      - see
        - vim/vim#5073

credit
- https://github.com/mengelbrecht/dotfiles/blob/master/config/nvim/init.vim
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants