{"id":13617863,"url":"https://github.com/rhysd/vim-grammarous","last_synced_at":"2025-05-16T12:12:49.419Z","repository":{"id":19557485,"uuid":"22806300","full_name":"rhysd/vim-grammarous","owner":"rhysd","description":"A powerful grammar checker for Vim using LanguageTool.","archived":false,"fork":false,"pushed_at":"2022-10-25T15:36:06.000Z","size":195,"stargazers_count":1104,"open_issues_count":49,"forks_count":42,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-04-09T10:04:14.531Z","etag":null,"topics":["grammar","grammar-checker","natural-language","vim","vim-plugin"],"latest_commit_sha":null,"homepage":null,"language":"Vim script","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rhysd.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-08-10T10:05:27.000Z","updated_at":"2025-03-23T15:44:36.000Z","dependencies_parsed_at":"2022-07-22T12:02:13.634Z","dependency_job_id":null,"html_url":"https://github.com/rhysd/vim-grammarous","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhysd%2Fvim-grammarous","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhysd%2Fvim-grammarous/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhysd%2Fvim-grammarous/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhysd%2Fvim-grammarous/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rhysd","download_url":"https://codeload.github.com/rhysd/vim-grammarous/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254527099,"owners_count":22085919,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["grammar","grammar-checker","natural-language","vim","vim-plugin"],"created_at":"2024-08-01T20:01:49.565Z","updated_at":"2025-05-16T12:12:44.409Z","avatar_url":"https://github.com/rhysd.png","language":"Vim script","readme":"vim-grammarous\n==============\n\nvim-grammarous is a powerful grammar checker for Vim. Simply do `:GrammarousCheck` to see the powerful checking.\nThis plugin automatically downloads [LanguageTool](https://www.languagetool.org/), which requires Java 8+.\n\nThis plugin can use job feature on Vim 8.0.27 (or later) or Neovim. It enables asynchronous command execution so you don't need to\nbe blocked until the check has been done on Vim8+ or Neovim.\n\n![demo screen cast](https://github.com/rhysd/ss/blob/master/vim-grammarous/demo.gif?raw=true)\n\n\n## Commands\n\n```\n:[range]GrammarousCheck [--lang={lang}] [--(no-)preview] [--(no-)comments-only]\n```\n\nExecute the grammar checker for current buffer (when `[range]` is specified, the target is a text in the range).\n\n1. It makes LanguageTool check grammar (It takes a while)\n2. It highlights the locations of detected grammar errors\n3. When you move the cursor to a location of an error, it automatically shows the error with the information window (named `[Grammarous]`).\n\nPlease do `:GrammarousCheck --help` to show more detail about the command.\n\n```\n:GrammarousReset\n```\n\nReset the current check.\n\n\n## Mappings\n\n### Local mappings in the information window\n\nYou can use some mappings in the information window, which is opened to show the detail of an error when the cursor moves to the error.\n\n| Mappings | Description                                    |\n| -------- |:---------------------------------------------- |\n|   `q`    | Quit the info window                           |\n|  `\u003cCR\u003e`  | Move to the location of the error              |\n|   `f`    | Fix the error __automatically__                |\n|   `r`    | Remove the error without fix                   |\n|   `R`    | Disable the grammar rule in the checked buffer |\n|   `n`    | Move to the next error's location              |\n|   `p`    | Move to the previous error's location          |\n|   `?`    | Show help of the mapping in info window        |\n\n### `\u003cPlug\u003e` mappings to execute actions anywhere\n\nThe above local mappings are enough to deal with grammar errors.\n\nHowever, for a more convenient use, vim-grammarous provides the following global mappings to enable\nusing all grammarous actions globally within vim. This might be beneficial, as the standard mappings\nonly work within the info window, which loses focus after every action.\n\nBy mapping the actions listed below to your favorite shortcuts, it is possible to map all actions\nthat work within the info window, to work globally within vim. This is done via `:nmap` and an example\nfor a mapping would be `:nmap \u003cF5\u003e (grammarous-move-to-next-error)`.\n\n| Mappings                                    | Description                                          |\n| ------------------------------------------- |:---------------------------------------------------- |\n| `\u003cPlug\u003e(grammarous-move-to-info-window)`    | Move the cursor to the info window                   |\n| `\u003cPlug\u003e(grammarous-open-info-window)`       | Open the info window for the error under the cursor  |\n| `\u003cPlug\u003e(grammarous-reset)`                  | Reset the current check                              |\n| `\u003cPlug\u003e(grammarous-fixit)`                  | Fix the error under the cursor automatically         |\n| `\u003cPlug\u003e(grammarous-fixall)`                 | Fix all the errors in a current buffer automatically |\n| `\u003cPlug\u003e(grammarous-close-info-window)`      | Close the information window from checked buffer     |\n| `\u003cPlug\u003e(grammarous-remove-error)`           | Remove the error under the cursor                    |\n| `\u003cPlug\u003e(grammarous-disable-rule)`           | Disable the grammar rule under the cursor            |\n| `\u003cPlug\u003e(grammarous-move-to-next-error)`     | Move cursor to the next error                        |\n| `\u003cPlug\u003e(grammarous-move-to-previous-error)` | Move cursor to the previous error                    |\n\n### Operator mappings\n\nOperator mapping checks grammatical errors in the extent which the text object specifies.\nThis mapping is available when [vim-operator-user](https://github.com/kana/vim-operator-user) is installed.\n\n| Mappings                      | Description                            |\n| ----------------------------- |:-------------------------------------- |\n| `\u003cPlug\u003e(operator-grammarous)` | Execute grammar check to a text object |\n\n### `grammarous` unite.vim source\n\nIf you are [unite.vim](https://github.com/Shougo/unite.vim) user, `grammarous` unite source is available to look and search the error list incrementally.\nTo the candidates of the list, you can do the actions which are the same as ones in the info window. (`fixit`, `remove error` and `disable rule`)\nExecute below command in the buffer already checked or you want to check.\n\n```\n:Unite grammarous\n```\n\n### `grammarous` denite.nvim source\n\nFor [denite.nvim](https://github.com/Shougo/denite.nvim) users, `grammarous` denite source is available. Note that the kind is currently set to `file`,\nwhich means that actions a user can use are limited to open(jump), preview, etc. Execute below command in the buffer already checked.\n\n```\n:Denite grammarous\n```\n\n## Fix examples\n\n- [vim-themis](https://github.com/rhysd/vim-themis/commit/b2f838b29f47180ccee50488e01d6774a21d0c03)\n- [unite.vim](https://github.com/rhysd/unite.vim/commit/5716eac38781e7a233c98f2a3d7aee8909326791)\n- [vim-quickrun](https://github.com/rhysd/vim-quickrun/commit/236c753e0572266670d176e667054d55ad52a3f3)\n- [neosnippet.vim](https://github.com/rhysd/neosnippet/commit/c72e26e50ccf53f9d66a31fd9d70696c85c62873)\n\n\n## FAQ\n\n### How do I check comments only in source code by default?\n\nPlease use `g:grammarous#default_comments_only_filetypes`.\n\nFor example, below setting makes grammar checker check comments only except for markdown and vim help.\n\n```vim\nlet g:grammarous#default_comments_only_filetypes = {\n            \\ '*' : 1, 'help' : 0, 'markdown' : 0,\n            \\ }\n```\n\n### How are rules added to the default rule set?\n\nPlease use `g:grammarous#enabled_rules` to enable additional rules. The value is dictionary whose keys\nare a filetype (`*` means 'any') and whose values are a list of rule names.\n\nFor example, below setting enables `PASSIVE_VOICE` rule in all filetypes.\n\n```vim\nlet g:grammarous#enabled_rules = {'*' : ['PASSIVE_VOICE']}\n```\n\n### Some rules annoy me.\n\nPlease use `g:grammarous#disabled_rules` to disable specific rules.\n\nFor example, below setting disables some rules for each filetype. `*` means all filetypes, `help` means vim help.\n\n```vim\nlet g:grammarous#disabled_rules = {\n            \\ '*' : ['WHITESPACE_RULE', 'EN_QUOTES'],\n            \\ 'help' : ['WHITESPACE_RULE', 'EN_QUOTES', 'SENTENCE_WHITESPACE', 'UPPERCASE_SENTENCE_START'],\n            \\ }\n```\n\nThe rule names are displayed in Vim command line when you disable the rule in the info window or by `\u003cPlug\u003e(grammarous-disable-rule)`.\n\n### How are categories added to the default rule set?\n\nPlease use `g:grammarous#enabled_categories` to enable additional categories. The value is dictionary whose keys\nare a filetype (`*` means 'any') and whose values are a list of categories names.\n\nFor example, below setting enables `PASSIVE_VOICE` rule in all filetypes.\n\n```vim\nlet g:grammarous#enabled_categories = {'*' : ['PUNCTUATION']}\n```\n\n### Some categories annoy me.\n\nPlease use `g:grammarous#disabled_categories` to disable specific categories.\n\nFor example, below setting disables some categories for each filetype. `*` means all filetypes, `help` means vim help.\n\n```vim\nlet g:grammarous#disabled_categories = {\n            \\ '*' : ['PUNCTUATION'],\n            \\ 'help' : ['PUNCTUATION', 'TYPOGRAPHY'],\n            \\ }\n```\n\nThe category names are displayed in Vim command line when you disable the category in the info window or by `\u003cPlug\u003e(grammarous-disable-category)`.\n\n### How do I use this plugin with vim's spelllang?\n\nPlease use `g:grammarous#use_vim_spelllang`. Default 0, to enable 1.\n\n### I want to use above `\u003cPlug\u003e` mappings only after checking.\n\n`on_check` and `on_reset` are available.\n\nFor example, below setting defines `\u003cC-n\u003e` and `\u003cC-p\u003e` mappings as buffer-local mappings when the check has been completed.\nThey are cleared when the check is reset.\n\n```vim\nlet g:grammarous#hooks = {}\nfunction! g:grammarous#hooks.on_check(errs) abort\n    nmap \u003cbuffer\u003e\u003cC-n\u003e \u003cPlug\u003e(grammarous-move-to-next-error)\n    nmap \u003cbuffer\u003e\u003cC-p\u003e \u003cPlug\u003e(grammarous-move-to-previous-error)\nendfunction\n\nfunction! g:grammarous#hooks.on_reset(errs) abort\n    nunmap \u003cbuffer\u003e\u003cC-n\u003e\n    nunmap \u003cbuffer\u003e\u003cC-p\u003e\nendfunction\n```\n\n### I want to use system global LanguageTool command\n\n`g:grammarous#languagetool_cmd` is available for the purpose.\nIf some command is set to `g:grammarous#languagetool_cmd` in your `.vimrc`, vim-grammarous does not install\nits own LanguageTool jar and use the command to run LanguageTool.\n\n```vim\nlet g:grammarous#languagetool_cmd = 'languagetool'\n```\n\n### I want to see the first error in an information window soon after `:GrammarousCheck`\n\nPlease set `g:grammarous#show_first_error` to `1`. It opens an information window after `:GrammarousCheck` immediately when some error detected.\n\n### I want to use a location list to jump among errors\n\nPlease set `g:grammarous#use_location_list` to `1`. It sets all grammatical errors to location list.\nThis variable is set to `0` by default to avoid conflicts of location list usage with other plugins.\n\n## Automatic installation\n\nThis plugin attempts to install [LanguageTool](https://www.languagetool.org/) using `curl` or `wget` command at first time.\nIf it fails, you should install it manually. Please download zip file of LanguageTool and extract it to `path/to/vim-grammarous/misc`.\n\n\n## Requirements\n\n- Java8+ (required)\n- [vimproc.vim](https://github.com/Shougo/vimproc.vim) (optional for Vim 8.0.25 or earlier on Windows)\n- [unite.vim](https://github.com/Shougo/unite.vim) (optional)\n- [vim-operator-user](https://github.com/kana/vim-operator-user) (optional)\n\n\n## Future\n\n- __Ignore specific regions__ : Enable to specify the region which vim-grammarous should not check. It is helpful for GFM's fenced code blocks.\n- __Incremental grammarous check__ : Check only the sentences you input while starting from entering and leaving insert mode.\n\n\n## Contribution\n\nIf you find some bugs, please report it to [issues page](https://github.com/rhysd/vim-grammarous/issues).\nPull requests are welcome. None of them is too short.\n\n\n## License\n\n    Copyright (c) 2014 rhysd\n\n    Permission is hereby granted, free of charge, to any person obtaining a copy\n    of this software and associated documentation files (the \"Software\"), to deal\n    in the Software without restriction, including without limitation the rights\n    to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies\n    of the Software, and to permit persons to whom the Software is furnished to do so,\n    subject to the following conditions:\n\n    The above copyright notice and this permission notice shall be included in all\n    copies or substantial portions of the Software.\n\n    THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n    INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n    PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n    LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\n    TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR\n    THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n","funding_links":[],"categories":["Vim Script","Vim script"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frhysd%2Fvim-grammarous","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frhysd%2Fvim-grammarous","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frhysd%2Fvim-grammarous/lists"}