Allow for disabling auto-formatting with a global or buffer-local
variable, based on
62eba813b7/doc/recipes.md (autoformat-with-extra-features).
In the future, it would be interesting to do this based on the presence
of a file in the repository, such as `.do-not-auto-format`.
I've replaced it with edit_alternate.vim in the previous commit, which
works with `.twig` and `.config.yml` files in Fractal projects as well
as test classes in Drupal, which is all I need alternate files for at
the moment.
https://github.com/tjdevries/edit_alternate.vim
This works for switching between classes and tests in Drupal modules,
which is something I was struggling to do with Projectionist.
Different to Projectionist, though, this plugin doesn't create an
alternate file if it doesn't exist, and doesn't prompt to select from
multiple options and returns the first matching one.
From the README file:
```lua
-- Whether to set Vim's settings for statusline (make it always shown
-- with 'laststatus' set to 2).
-- To use global statusline, set this to `false` and 'laststatus' to 3.
set_vim_settings = true,
```
I've usually been against auto-formatting on save and instead preferred
to trigger it manually using its own keybinding.
I'm enabling it for now to see how I feel about it and I'll either keep
or revert it.
Whilst I wasn't able to get it to work for all my use cases previously,
it is useful for creating alternative files in Fractal, such as
switching between the `*.config.yml` and `*.twig` files for a component.
Other use cases, such as creating alternative files for classes and
tests in PHP and Drupal projects, I can look at again now the plugin is
installed.