Vim paths in that context are more like shell-globs than regular-expressions.
A simple solution in a *nix shell would be
$ vim **/*.py
extglob in bash, I think, but should work out of the box in zsh.)
Inside of vim, I'm surprised it would match hidden files in the first place, though
:help wildcard is clear that it matches "anything."
If you can narrow down the patter, that might help (e.g.,
Otherwise, you could use a more complex command:
:next `find . -not -path .env -name '*.py'`
:next `git ls-files '*.py'`
You could create a mapping, if you like:
nnoremap <keys> :next `find . -not -path '*/.*' -type f -name '*.'`<Left><Left>
These commands can become quite complex, depending on what you're doing, so I won't show all the variations here.
I'll just note as an addendum that I don't generally open all my project files at once; I focus on one or two, and sometimes over a long session (or over a persistent session) lots of files accumulate.
It can be handy to add lots of things to the arglist, however, to allow
:vimgrep /.../ ##. Depending on the case, using the quickfix (combined with
:grep or similar) and
:Cfilter, etc., can be more useful/less invasive/easier to setup.
@filbranden points out
wildignore, which you could probably set to include
.* to avoid matching hidden things.
In all honesty, though, I can't really reproduce the issue. In a directory like this:
│ ├── a.py
│ ├── b.py
│ └── c.py
1 directory, 6 files
vim -u NONE --noplugin --clean, I have
[a.py] b.py c.py