generated from chrisgrieser/nvim-pseudometa-plugin-template
-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a60690a
commit 70fddff
Showing
1 changed file
with
161 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,161 @@ | ||
*rule-breaker.txt* For NVIM v0.8.0 Last change: 2023 September 21 | ||
|
||
============================================================================== | ||
Table of Contents *rule-breaker-table-of-contents* | ||
|
||
1. nvim-rulebook |rule-breaker-nvim-rulebook-| | ||
- Features |rule-breaker-nvim-rulebook--features| | ||
- Supported Sources |rule-breaker-nvim-rulebook--supported-sources| | ||
- Installation |rule-breaker-nvim-rulebook--installation| | ||
- Configuration |rule-breaker-nvim-rulebook--configuration| | ||
- Limitations |rule-breaker-nvim-rulebook--limitations| | ||
- Credits |rule-breaker-nvim-rulebook--credits| | ||
|
||
============================================================================== | ||
1. nvim-rulebook *rule-breaker-nvim-rulebook-* | ||
|
||
Add inline-comments to rules. Lookup rule documentation online. | ||
|
||
Some LSPs provide code actions for to do that – this plugin adds commands for | ||
linters and LSPs that don’t. | ||
|
||
- |rule-breaker-features| | ||
- |rule-breaker-supported-sources| | ||
- |rule-breaker-for-adding-ignore-comments| | ||
- |rule-breaker-for-looking-up-rule-documentation| | ||
- |rule-breaker-installation| | ||
- |rule-breaker-configuration| | ||
- |rule-breaker-limitations| | ||
- |rule-breaker-credits| | ||
|
||
|
||
FEATURES *rule-breaker-nvim-rulebook--features* | ||
|
||
- Add inline-comments that ignore diagnostic rules. | ||
- Location of the ignore comment, like next line or previous line, is configurable. | ||
- Perform a web search for a diagnostic rule. | ||
- Requires diagnostics provided by a source that supports neovim’s builtin diagnostics system (`vim.diagnostic`). nvim’s builtin LSP client and nvim-lint <https://github.com/mfussenegger/nvim-lint> are such sources. | ||
|
||
|
||
SUPPORTED SOURCES *rule-breaker-nvim-rulebook--supported-sources* | ||
|
||
You easily add a custom source via the |rule-breaker-plugin-configuration|. | ||
However, please consider making a PR to add support for a linter if it is | ||
missing. | ||
|
||
Ignore Rule Data for the supported linters <./lua/rulebook/ignoreRuleData.lua> | ||
|
||
|
||
FOR ADDING IGNORE COMMENTS ~ | ||
|
||
- selene | ||
- shellcheck | ||
- vale | ||
- yamllint | ||
- stylelint | ||
- LTeX | ||
- typescript | ||
- pylint | ||
|
||
|
||
FOR LOOKING UP RULE DOCUMENTATION ~ | ||
|
||
- selene | ||
- shellcheck | ||
- pylint | ||
|
||
|
||
INSTALLATION *rule-breaker-nvim-rulebook--installation* | ||
|
||
>lua | ||
-- lazy.nvim | ||
{ | ||
"chrisgrieser/nvim-rulebook", | ||
keys = { | ||
{ "<leader>i", function() require("rulebook").ignoreRule() end }, | ||
{ "<leader>l", function() require("rulebook").lookupRule() end }, | ||
} | ||
}, | ||
< | ||
|
||
>lua | ||
-- packer | ||
use { "chrisgrieser/nvim-rulebook" } | ||
|
||
-- in your config | ||
vim.keymap.set("n", "<leader>i", function() require("rulebook").ignoreRule() end) | ||
vim.keymap.set("n", "<leader>l", function() require("rulebook").lookupRule() end) | ||
< | ||
|
||
|
||
CONFIGURATION *rule-breaker-nvim-rulebook--configuration* | ||
|
||
>lua | ||
defaultConfig = { | ||
ignoreRuleComments = { | ||
selene = { | ||
comment = "-- selene: allow(%s)", | ||
location = "prevLine", | ||
}, | ||
-- ... (full list of supported sources can be found in the README) | ||
|
||
yourCustomSource = { | ||
-- %s will be replaced with rule-id | ||
-- if location is "encloseLine", needs to be a list of two strings | ||
comment = "// disabling-comment %s", | ||
|
||
-- "prevLine"|"sameLine"|"encloseLine" | ||
location = "prevLine", | ||
} | ||
}, | ||
|
||
-- %s will be replaced with rule-id | ||
ruleDocumentations = { | ||
selene = "https://kampfkarren.github.io/selene/lints/%s.html" | ||
-- ... (full list of supported sources can be found in the README) | ||
|
||
yourCustomSource = "https://my-docs/%s.hthml" | ||
|
||
-- Search URL when no documentation definition is available for a | ||
-- diagnostic source. "%s" will be replaced with the diagnostic source & code. | ||
-- Default is the DDG "Ducky Search" (automatically opening first result). | ||
fallback = "https://duckduckgo.com/?q=%s+%21ducky&kl=en-us", | ||
} | ||
} | ||
< | ||
|
||
|
||
[!NOTE] The plugin uses `vim.ui.select()`, so the appearance of the rule | ||
selection can be customized by using a ui-plugin like dressing.nvim | ||
<https://github.com/stevearc/dressing.nvim>. | ||
|
||
LIMITATIONS *rule-breaker-nvim-rulebook--limitations* | ||
|
||
- The diagnostics have to contain the necessary data, |that is a diagnostic code and diagnostic source|. Most LSPs and most linters configured for `nvim-lint` do that, but some diagnostic sources do not (for example `efm-langserver` with incorrectly defined errorformat). Please open an issue at the diagnostics provider to fix. | ||
- This plugin does _not_ hook into `vim.lsp.buf.code_action`, but provides its own independent selector. | ||
- As opposed to null-ls <https://github.com/jose-elias-alvarez/null-ls.nvim>’s code action feature, this plugin does not support arbitrary code actions, but only actions based on a diagnostic. | ||
|
||
|
||
CREDITS *rule-breaker-nvim-rulebook--credits* | ||
|
||
**About Me** In my day job, I am a sociologist studying the social mechanisms | ||
underlying the digital economy. For my PhD project, I investigate the | ||
governance of the app economy and how software ecosystems manage the tension | ||
between innovation and compatibility. If you are interested in this subject, | ||
feel free to get in touch. | ||
|
||
**Blog** I also occasionally blog about vim: Nano Tips for Vim | ||
<https://nanotipsforvim.prose.sh> | ||
|
||
**Profiles** - reddit <https://www.reddit.com/user/pseudometapseudo> - Discord | ||
<https://discordapp.com/users/462774483044794368/> - Academic Website | ||
<https://chris-grieser.de/> - Twitter <https://twitter.com/pseudo_meta> - | ||
Mastodon <https://pkm.social/@pseudometa> - ResearchGate | ||
<https://www.researchgate.net/profile/Christopher-Grieser> - LinkedIn | ||
<https://www.linkedin.com/in/christopher-grieser-ba693b17a/> | ||
|
||
**Buy Me a Coffee** | ||
|
||
Generated by panvimdoc <https://github.com/kdheepak/panvimdoc> | ||
|
||
vim:tw=78:ts=8:noet:ft=help:norl: |