Make lint-on-save and format-on-save configurable #3
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I personally do not prefer doing linting or formatting on save as it may cause confusing diffs in contributions to other projects if I autoformat every file I modify. However, janet.kak previously hardcoded this functionality, and I couldn't even disable it as the hooks had no group, so I had to remove that part of the code locally. Since I'd prefer not maintaining a fork, I decided to come up with a more constructive solution, which was simply defining config options that can be included in kakrc like so:
Additionally I made some miscellaneous changes:
<a-space>
is removed and a snippet of how the user can access the Janet user mode is added to README. It is unidiomatic to define normal mode mappings in Kakoune plugins but you can feel free to define them in your personal kakrc./usr/local/bin
; now they simply expect the command to be in PATH. Users can feel free to override this new behavior by settingjanet_formatcmd
orjanet_lintcmd
.Thank you for making this plugin, it's nice to see other Kakoune users out there. :)