Skip to content

Suggestions for more advanced sorting #358

@jorins

Description

@jorins

I have a directory that's currently sorted as:

dist/
node_modules/
src/
.eslintignore
.gitignore
.eslintrc.json
.prettierrc.json
package.json
tsconfig.json
README.md
.prettierignore
pnpm-lock.yaml
LICENSE

There's two things I'm noting that are a bit off here:

  • .prettierignore is kept separate from .eslintignore and .gitignore
  • README.md is separated from LICENSE.

I'd be very glad if CHADTree's sorting could get around this. I'm guessing the appropriate solution would be to add an additional category for chadtree_settings.view.sort_by, e.g. classification that would evaluate to different values based on regular expressions, for example

  • [A-Z]\w+file -> buildfile, matches e.g. Makefile, Dockerfile
  • \.\w*ignore -> ignorefile, matches e.g. .gitignore, .eslintignore
  • [A-Z]+(\.[a-z]+)? -> projectfile matches e.g. README.md, CONTRIBUTING, LICENSE
  • Fallback -> ""

Thank you for your work on this lovely project :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions