| 1 |
# Contributing to Vim |
| 2 |
|
| 3 |
Patches are welcome in whatever form. |
| 4 |
Discussions about patches happen on the [vim-dev][0] mailing list. |
| 5 |
If you create a pull request on GitHub it will be |
| 6 |
forwarded to the vim-dev mailing list. You can also send your patch there |
| 7 |
directly (but please note, the initial posting is subject to moderation). |
| 8 |
In that case an attachment with a unified diff format is preferred. |
| 9 |
Information about the mailing list can be found [on the Vim website][0] |
| 10 |
|
| 11 |
A pull request has the advantage that it will trigger the Continuous |
| 12 |
Integration tests, you will be warned of problems (you can ignore the coverage |
| 13 |
warning, it's noisy). |
| 14 |
|
| 15 |
Please always add a test, if possible. All new functionality should be tested |
| 16 |
and bug fixes should be tested for regressions: the test should fail before the |
| 17 |
fix and pass after the fix. Look through recent patches for examples and find |
| 18 |
help with ":help testing". The tests are located under "src/testdir". |
| 19 |
|
| 20 |
Contributions will be distributed with Vim under the Vim license. Providing a |
| 21 |
change to be included implies that you agree with this and your contribution |
| 22 |
does not cause us trouble with trademarks or patents. There is no CLA to sign. |
| 23 |
|
| 24 |
## Signing-off commits |
| 25 |
|
| 26 |
While not required, it's recommended to use **Signed-off commits** to ensure |
| 27 |
transparency, accountability, and compliance with open-source best practices. |
| 28 |
Signed-off commits follow the [Developer Certificate of Origin (DCO)][15], |
| 29 |
which confirms that contributors have the right to submit their changes under |
| 30 |
the project's license. This process adds a `Signed-off-by` line to commit |
| 31 |
messages, verifying that the contributor agrees to the project's licensing |
| 32 |
terms. To sign off a commit, simply use the -s flag when committing: |
| 33 |
|
| 34 |
```sh |
| 35 |
git commit -s |
| 36 |
``` |
| 37 |
|
| 38 |
This ensures that every contribution is properly documented and traceable, |
| 39 |
aligning with industry standards used in projects like the Linux Kernel or |
| 40 |
the git project. By making Signed-off commits a standard practice, we help |
| 41 |
maintain a legally compliant and well-governed codebase while fostering trust |
| 42 |
within our contributor community. |
| 43 |
|
| 44 |
When merging PRs into Vim, the current maintainer @chrisbra usually adds missing |
| 45 |
`Signed-off-by` trailers for the author user name and email address as well for |
| 46 |
anybody that explicitly *ACK*s a pull request as a statement that those |
| 47 |
approvers are happy with that particular change. |
| 48 |
|
| 49 |
## Using AI |
| 50 |
|
| 51 |
When using AI for contributions, please disclose this. Any AI-generated code |
| 52 |
must follow the Vim code style. In particular, [test_codestyle.vim][18] |
| 53 |
must not report any failures. Check the CI output for any test failures. |
| 54 |
|
| 55 |
Ensure that changes are properly tested. Do not submit a single PR that |
| 56 |
addresses multiple unrelated issues. |
| 57 |
|
| 58 |
# Reporting issues |
| 59 |
|
| 60 |
We use GitHub [issues][17], but that is not a requirement. Writing to the Vim |
| 61 |
mailing list is also fine. |
| 62 |
|
| 63 |
Please use the GitHub issues only for actual issues. If you are not 100% sure |
| 64 |
that your problem is a Vim issue, please first discuss this on the Vim user |
| 65 |
mailing list. Try reproducing the problem without any of your plugins or settings: |
| 66 |
|
| 67 |
vim --clean |
| 68 |
|
| 69 |
If you report an issue, please describe exactly how to reproduce it. |
| 70 |
For example, don't say "insert some text" but say what you did exactly: |
| 71 |
`ahere is some text<Esc>`. |
| 72 |
Ideally, the steps you list can be used to write a test to verify the problem |
| 73 |
is fixed. |
| 74 |
|
| 75 |
Feel free to report even the smallest problem, also typos in the documentation. |
| 76 |
|
| 77 |
You can find known issues in the todo file: `:help todo`. |
| 78 |
Or open [the todo file][todo list] on GitHub to see the latest version. |
| 79 |
|
| 80 |
# Syntax, indent and other runtime files |
| 81 |
|
| 82 |
The latest version of these files can be obtained from the repository. |
| 83 |
They are usually not updated with numbered patches. However, they may |
| 84 |
or may not work with older Vim releases (since they may depend on new |
| 85 |
features). |
| 86 |
|
| 87 |
If you find a problem with one of these files or have a suggestion for |
| 88 |
improvement, please first try to contact the maintainer directly. |
| 89 |
Look in the header of the file for the name, email address, github handle and/or |
| 90 |
upstream repository. You may also check the [MAINTAINERS][11] file. |
| 91 |
|
| 92 |
The maintainer will take care of issues and send updates to the Vim project for |
| 93 |
distribution with Vim. |
| 94 |
|
| 95 |
If the maintainer does not respond, contact the [vim-dev][0] mailing list or |
| 96 |
open an [issue][17] here. |
| 97 |
|
| 98 |
Note: Whether or not to use Vim9 script is up to the maintainer. For runtime |
| 99 |
files maintained here, we aim to preserve compatibility with Neovim if |
| 100 |
possible. Please wrap Vim9 script with a guard like this: |
| 101 |
```vim |
| 102 |
if has('vim9script') |
| 103 |
" use Vim9 script implementation |
| 104 |
[...] |
| 105 |
endif |
| 106 |
``` |
| 107 |
|
| 108 |
## Contributing new runtime files |
| 109 |
|
| 110 |
If you want to contribute new runtime files for Vim or Neovim, please create a |
| 111 |
PR with your changes against this repository here. For new filetypes, do not forget: |
| 112 |
|
| 113 |
- to add a new [filetype test][12] (keep it similar to the other filetype tests). |
| 114 |
- all configuration switches should be documented |
| 115 |
(check [filetype.txt][13] and/or [syntax.txt][14] for filetype and syntax plugins) |
| 116 |
- add yourself as Maintainer to the top of file (again, keep the header similar to |
| 117 |
other runtime files) |
| 118 |
- add yourself to the [MAINTAINERS][11] file. |
| 119 |
- add a guard `if has('vim9script')` if you like to maintain Neovim |
| 120 |
compatibility but want to use Vim9 script (or restrict yourself to legacy Vim |
| 121 |
script) |
| 122 |
|
| 123 |
# Translations |
| 124 |
|
| 125 |
Translating messages and runtime files is very much appreciated! These things |
| 126 |
can be translated: |
| 127 |
|
| 128 |
- Messages in Vim, see [src/po/README.txt][1] |
| 129 |
Also used for the desktop icons. |
| 130 |
- Menus, see [runtime/lang/README.txt][2] |
| 131 |
- Vim tutor, see [runtime/tutor/README.txt][3] |
| 132 |
- Manual pages, see [runtime/doc/\*.1][4] for examples |
| 133 |
- Installer, see [nsis/lang/README.txt][5] |
| 134 |
|
| 135 |
The help files can be translated and made available separately. |
| 136 |
See https://www.vim.org/translations.php for examples. |
| 137 |
|
| 138 |
# How do I contribute to the project? |
| 139 |
|
| 140 |
Please have a look at the following [discussion][6], which should give you some |
| 141 |
ideas. Please also check the [develop.txt][7] helpfile for the recommended |
| 142 |
coding style. Often it's also beneficial to check the surrounding code for the style |
| 143 |
being used. |
| 144 |
|
| 145 |
For the recommended documentation style, please check [helphelp.txt][16]. |
| 146 |
|
| 147 |
# I have a question |
| 148 |
|
| 149 |
If you have some question on the style guide, please contact the [vim-dev][0] |
| 150 |
mailing list. For other questions you can join [`#vim`][19], use the |
| 151 |
[Vi Stack Exchange][8] website, the [vim-use][9] mailing list or make use of the |
| 152 |
[discussion][10] feature here at github. |
| 153 |
|
| 154 |
[todo list]: https://github.com/vim/vim/blob/master/runtime/doc/todo.txt |
| 155 |
[0]: http://www.vim.org/maillist.php#vim-dev |
| 156 |
[1]: https://github.com/vim/vim/blob/master/src/po/README.txt |
| 157 |
[2]: https://github.com/vim/vim/blob/master/runtime/lang/README.txt |
| 158 |
[3]: https://github.com/vim/vim/blob/master/runtime/tutor/README.txt |
| 159 |
[4]: https://github.com/vim/vim/blob/master/runtime/doc/vim.1 |
| 160 |
[5]: https://github.com/vim/vim/blob/master/nsis/lang/README.txt |
| 161 |
[6]: https://github.com/vim/vim/discussions/13087 |
| 162 |
[7]: https://github.com/vim/vim/blob/master/runtime/doc/develop.txt |
| 163 |
[8]: https://vi.stackexchange.com |
| 164 |
[9]: http://www.vim.org/maillist.php#vim-use |
| 165 |
[10]: https://github.com/vim/vim/discussions |
| 166 |
[11]: https://github.com/vim/vim/blob/master/.github/MAINTAINERS |
| 167 |
[12]: https://github.com/vim/vim/blob/master/src/testdir/test_filetype.vim |
| 168 |
[13]: https://github.com/vim/vim/blob/master/runtime/doc/filetype.txt |
| 169 |
[14]: https://github.com/vim/vim/blob/master/runtime/doc/syntax.txt |
| 170 |
[15]: https://en.wikipedia.org/wiki/Developer_Certificate_of_Origin |
| 171 |
[16]: https://github.com/vim/vim/blob/master/runtime/doc/helphelp.txt |
| 172 |
[17]: https://github.com/vim/vim/issues |
| 173 |
[18]: https://github.com/vim/vim/blob/master/src/testdir/test_codestyle.vim |
| 174 |
[19]: https://web.libera.chat/#vim |