Split plugin in several parts

My plugin is slowly becoming extremely large and confusing. Is there a good way to split a plugin into multiple parts? E.g. in field methods, hooks, routes, tags etc.?

What do you mean by splitting?
Do you want to avoid to have all the code within the index.php? You could use different files and reference them (https://getkirby.com/docs/guide/plugins/plugin-basics#extensions__a-complex-example).
If you want split functionality, you could use event hooks for that.

Also, if your methods contain complex logic, it might make sense to move this logic into functions or even their own classes.

Hmm, let me describe. My plugin file at the moment, only index.php

// 1. a lot of simple php functions in front of the plugin
Kirby::plugin('werbschaft/shortcodes', [
  // 2. a lot of field methods
  'fieldMethods' => [...],
  // 3. a lot of hooks
  'hooks' => [...]
  // 4. a lot of roots
  'roots' => [...]
  // 5. a lot of tags
  'tags' => [...]

@pixelijn that was exact what I searched for, thanks :smiley: