| 1 |
For a smoother experience, you can run `autoimport` automatically each |
| 2 |
time you save your file in your editor or when you run `git commit`. |
| 3 |
|
| 4 |
# Vim |
| 5 |
|
| 6 |
To integrate `autoimport` into Vim, I recommend using the [ale |
| 7 |
plugin](https://github.com/dense-analysis/ale). |
| 8 |
|
| 9 |
!!! note "" |
| 10 |
|
| 11 |
If you are new to ALE, check [this |
| 12 |
post](https://lyz-code.github.io/blue-book/linux/vim/vim_plugins/#ale). |
| 13 |
|
| 14 |
`ale` is configured to run `autoimport` automatically by default. |
| 15 |
|
| 16 |
# [pre-commit](https://pre-commit.com/) |
| 17 |
|
| 18 |
You can run `autoimport` before we do a commit using the |
| 19 |
[pre-commit](https://pre-commit.com/) framework. If you don't know how to use |
| 20 |
it, follow [these |
| 21 |
guidelines](https://lyz-code.github.io/blue-book/devops/ci/#configuring-pre-commit). |
| 22 |
|
| 23 |
You'll need to add the following lines to your project's |
| 24 |
`.pre-commit-config.yaml` file. |
| 25 |
|
| 26 |
```yaml |
| 27 |
repos: |
| 28 |
- repo: https://github.com/lyz-code/autoimport/ |
| 29 |
rev: master |
| 30 |
hooks: |
| 31 |
- id: autoimport |
| 32 |
``` |