0

For my projects I generally open several tabs some of which might involve terminals or directory trees or quickfix (since ShellCheck sends its error messages there for instance).

When I want to use commands such as :wa or :bufdo %s/pattern/to/ce I either get annoying warning messages (ok, but not great) or the command fails because these buffers are unmodifiable (not ok).

Is there a way to make such buffers invisible to commands that target all buffers? I am imagining a flag I can set when creating these buffers or something I can do after creation?

0

1 Answer 1

0

Consider loading relevant buffers into the args, quickfix, or location list and using the related commands (:argdo, :cdo, etc.).

You could also set a buffer variable and do something like

:bufdo if get(b:, 'mydontskipvar', v:false) | … | endif
4
  • It's also possible that nobuflisted and buftype options might help
    – D. Ben Knoble
    May 6, 2023 at 20:27
  • I decided to go along with tmux when ever I needed a split. I find it more clean. However I will accept this as the answer as there seems to be really no other way
    – Sina
    May 19, 2023 at 13:50
  • @Sina are you saying you split tmux with vim to open a new file? I do sometimes have multiple vims in multiple tmux panes, but one-per-file would be a bit excessive to me
    – D. Ben Knoble
    May 19, 2023 at 17:15
  • No not one per file, I use tmux when I want to have split workspaces where one work space is associated to say the header files and the other split is associated to source files. So I only have the relevant files in each work space and name completion etc works much more flawlessly and global buffer operations are faster. Of course once in a while I might need to open other files which do not exist in the workspace but still much better than having 30 files open in every window.
    – Sina
    May 20, 2023 at 22:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.