Wednesday, June 26, 2013

Using Vim to open all classfiles recursively in a directory tree

Assuming your classfiles are MixedCase, you can use ...

  :args **/[A-Z]*.py

... to open all classfiles into Vim. And you can use ...

  :args **/[^test]*.py

... to open all files that are not test files. And you can use ...

  :args **/[^test_]*.py

... to open all files that are neither test files nor __init__.py files.

And you can use ...

  :args **/subpackage/[A-Z]*/[A-Z]*.py

to open all the classfiles in specific subpackage (assuming each classfile is housed in an eponymous directory).

After running any of these commands in Vim, you can use ...

  :args

... to see the complete list of files Vim has opened.

No comments: