Code Monkey home page Code Monkey logo

vim-grammarous's Introduction

vim-grammarous

vim-grammarous is a powerful grammar checker for Vim. Simply do :GrammarousCheck to see the powerful checking. This plugin automatically downloads LanguageTool, which requires Java 8+.

This 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 be blocked until the check has been done on Vim8+ or Neovim.

demo screen cast

Commands

:[range]GrammarousCheck [--lang={lang}] [--(no-)preview] [--(no-)comments-only]

Execute the grammar checker for current buffer (when [range] is specified, the target is a text in the range).

  1. It makes LanguageTool check grammar (It takes a while)
  2. It highlights the locations of detected grammar errors
  3. When you move the cursor to a location of an error, it automatically shows the error with the information window (named [Grammarous]).

Please do :GrammarousCheck --help to show more detail about the command.

:GrammarousReset

Reset the current check.

Mappings

Local mappings in the information window

You 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.

Mappings Description
q Quit the info window
<CR> Move to the location of the error
f Fix the error automatically
r Remove the error without fix
R Disable the grammar rule in the checked buffer
n Move to the next error's location
p Move to the previous error's location
? Show help of the mapping in info window

<Plug> mappings to execute actions anywhere

The above local mappings are enough to deal with grammar errors.

However, for a more convenient use, vim-grammarous provides the following global mappings to enable using all grammarous actions globally within vim. This might be beneficial, as the standard mappings only work within the info window, which loses focus after every action.

By mapping the actions listed below to your favorite shortcuts, it is possible to map all actions that work within the info window, to work globally within vim. This is done via :nmap and an example for a mapping would be :nmap <F5> (grammarous-move-to-next-error).

Mappings Description
<Plug>(grammarous-move-to-info-window) Move the cursor to the info window
<Plug>(grammarous-open-info-window) Open the info window for the error under the cursor
<Plug>(grammarous-reset) Reset the current check
<Plug>(grammarous-fixit) Fix the error under the cursor automatically
<Plug>(grammarous-fixall) Fix all the errors in a current buffer automatically
<Plug>(grammarous-close-info-window) Close the information window from checked buffer
<Plug>(grammarous-remove-error) Remove the error under the cursor
<Plug>(grammarous-disable-rule) Disable the grammar rule under the cursor
<Plug>(grammarous-move-to-next-error) Move cursor to the next error
<Plug>(grammarous-move-to-previous-error) Move cursor to the previous error

Operator mappings

Operator mapping checks grammatical errors in the extent which the text object specifies. This mapping is available when vim-operator-user is installed.

Mappings Description
<Plug>(operator-grammarous) Execute grammar check to a text object

grammarous unite.vim source

If you are unite.vim user, grammarous unite source is available to look and search the error list incrementally. To 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) Execute below command in the buffer already checked or you want to check.

:Unite grammarous

grammarous denite.nvim source

For denite.nvim users, grammarous denite source is available. Note that the kind is currently set to file, which means that actions a user can use are limited to open(jump), preview, etc. Execute below command in the buffer already checked.

:Denite grammarous

Fix examples

FAQ

How do I check comments only in source code by default?

Please use g:grammarous#default_comments_only_filetypes.

For example, below setting makes grammar checker check comments only except for markdown and vim help.

let g:grammarous#default_comments_only_filetypes = {
            \ '*' : 1, 'help' : 0, 'markdown' : 0,
            \ }

How are rules added to the default rule set?

Please use g:grammarous#enabled_rules to enable additional rules. The value is dictionary whose keys are a filetype (* means 'any') and whose values are a list of rule names.

For example, below setting enables PASSIVE_VOICE rule in all filetypes.

let g:grammarous#enabled_rules = {'*' : ['PASSIVE_VOICE']}

Some rules annoy me.

Please use g:grammarous#disabled_rules to disable specific rules.

For example, below setting disables some rules for each filetype. * means all filetypes, help means vim help.

let g:grammarous#disabled_rules = {
            \ '*' : ['WHITESPACE_RULE', 'EN_QUOTES'],
            \ 'help' : ['WHITESPACE_RULE', 'EN_QUOTES', 'SENTENCE_WHITESPACE', 'UPPERCASE_SENTENCE_START'],
            \ }

The rule names are displayed in Vim command line when you disable the rule in the info window or by <Plug>(grammarous-disable-rule).

How are categories added to the default rule set?

Please use g:grammarous#enabled_categories to enable additional categories. The value is dictionary whose keys are a filetype (* means 'any') and whose values are a list of categories names.

For example, below setting enables PASSIVE_VOICE rule in all filetypes.

let g:grammarous#enabled_categories = {'*' : ['PUNCTUATION']}

Some categories annoy me.

Please use g:grammarous#disabled_categories to disable specific categories.

For example, below setting disables some categories for each filetype. * means all filetypes, help means vim help.

let g:grammarous#disabled_categories = {
            \ '*' : ['PUNCTUATION'],
            \ 'help' : ['PUNCTUATION', 'TYPOGRAPHY'],
            \ }

The category names are displayed in Vim command line when you disable the category in the info window or by <Plug>(grammarous-disable-category).

How do I use this plugin with vim's spelllang?

Please use g:grammarous#use_vim_spelllang. Default 0, to enable 1.

I want to use above <Plug> mappings only after checking.

on_check and on_reset are available.

For example, below setting defines <C-n> and <C-p> mappings as buffer-local mappings when the check has been completed. They are cleared when the check is reset.

let g:grammarous#hooks = {}
function! g:grammarous#hooks.on_check(errs) abort
    nmap <buffer><C-n> <Plug>(grammarous-move-to-next-error)
    nmap <buffer><C-p> <Plug>(grammarous-move-to-previous-error)
endfunction

function! g:grammarous#hooks.on_reset(errs) abort
    nunmap <buffer><C-n>
    nunmap <buffer><C-p>
endfunction

I want to use system global LanguageTool command

g:grammarous#languagetool_cmd is available for the purpose. If some command is set to g:grammarous#languagetool_cmd in your .vimrc, vim-grammarous does not install its own LanguageTool jar and use the command to run LanguageTool.

let g:grammarous#languagetool_cmd = 'languagetool'

I want to see the first error in an information window soon after :GrammarousCheck

Please set g:grammarous#show_first_error to 1. It opens an information window after :GrammarousCheck immediately when some error detected.

I want to use a location list to jump among errors

Please set g:grammarous#use_location_list to 1. It sets all grammatical errors to location list. This variable is set to 0 by default to avoid conflicts of location list usage with other plugins.

Automatic installation

This plugin attempts to install LanguageTool using curl or wget command at first time. If it fails, you should install it manually. Please download zip file of LanguageTool and extract it to path/to/vim-grammarous/misc.

Requirements

Future

  • Ignore specific regions : Enable to specify the region which vim-grammarous should not check. It is helpful for GFM's fenced code blocks.
  • Incremental grammarous check : Check only the sentences you input while starting from entering and leaving insert mode.

Contribution

If you find some bugs, please report it to issues page. Pull requests are welcome. None of them is too short.

License

Copyright (c) 2014 rhysd

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
THE USE OR OTHER DEALINGS IN THE SOFTWARE.

vim-grammarous's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vim-grammarous's Issues

How to enable spell-check with Grammarous by default?

LanguageTool is powerful enough to handle grammar and spelling simultaneously.

However, I find spell-check disabled by default in vim-grammarous. All that I find in documentation is this:
how-do-i-use-this-plugin-with-vims-spelllang
This looks only like an option for the spell check which should first be enabled.

How to enable spell check by default?

Update:
I find this option:
let g:grammarous#enable_spell_check=1, and it works! But the annoying problem is that

  • Navigation doesn't include spelling-errors
  • No suggestions are shown for spelling errors
  • There is no way I can distinguish between errors of spelling & grammar (for e.g. like the traditional Green and Red zig-zag lines)

Another issue: Can I have the quickfix-window open all the time? Its annoying to see it getting open and closed. I would like to close it manually once everything is fixed!

vim-grammarous: Grammar check was failed with exit status 1

Hi there, I am getting the following error message when after I follow all the instructions in installing grammarous:

vim-grammarous: Grammar check was failed with exit status 1

It has installed LanguageTool in the right place, and I installed the package using Vundle. The excerpt from my .vimrc is as so:

Plugin 'rhysd/vim-grammarous' -- perhaps that is not correct?

Any insights would be greatly appreciated, seems like an excellent plugin.

Repeated white space

Hi, First of all I would really appreciate your awesome plugin!

I have two concerns.

  1. I used to make double space when I start a sentence and grammarous check this a typo as below figure. I disable white space rule in my vimrc but still have it

screen shot 2017-09-19 at 7 26 20 am

  1. I saw someone talking about using in tex. Are you planning to implement this for tex as well? I am so looking forward if you will.

Thank you

Execute the checker in background using vimproc

  • Executing the checker for large file takes a while.
  • Executing the checker in background and polling the result makes the process non-blocking.
  • Non-blocking execution takes longer than blocking version.
    • It is good design that a user can chose blocking or non-blocking.
  • I should start to resolve this issue after making dependency on vimproc optional.
  • Vital.Reunion may be useful.
    • It makes executing in background easier.
    • It has a few tests.
    • It is not tested and developed in OS X. (Keep in mind that it may not work properly)

Vim が SEGV する

Lingr で言っていたやつですがとりあえず、立てておきます。

再現環境

  • Ubuntu 13.10
  • Vim 7.4.343、7.5.398

再現 vimrc

" set runtimepath+=~/.vim/bundle/neobundle.vim
if has('vim_starting')
    set nocompatible
endif
filetype off
filetype plugin indent off     " required!

call neobundle#rc(expand($HOME."/neobundle"))

filetype plugin indent on

NeoBundle "rhysd/vim-grammarous"
NeoBundle "Shougo/vimproc.vim"

" indentLine と併用して使用すると再現する
NeoBundle "Yggdroot/indentLine"

syntax enable

再現手順

  1. vim起動
Paste your own text here. or check this text too see an few of of the problems that LanguageTool can detecd. What do you thinks of grammar checkers? Please not that they are not perfect.

をバッファに貼り付ける。
3. :GrammarousCheck
4. 適当にカーソルを移動させる。
5. (おそらく)エラー箇所にカーソルが移動した時に SEGV

状況

エラー箇所にカーソルを移動させると SEGV する時がある。
再現率は100%ではない。

Error message when quitting the check window with

When I close the checking window with q, I always see the following error message:

Error detected while processing function grammarous#info_win#action_quit:
line    3:
E108: No such variable: "b:grammarous_preview_bufnr"

handle syntax/markup

I use the plug-in mainly for Latex, and it clashes quite a lot with latex `markup' syntax.

Is there a way to better handle it? Possible solutions coming to my mind are

  • giving regular expressions what to ignore (very bothersome to configure)
  • using vim's syntax groups to ignore things
  • using external tools like detex (for Latex) as helper.

support for pylanguagetool?

I wanted to ask if it is also possible to support pylanguagetool? I find it very bothersome to get LanguageTool running on Debian, as it is difficult to get Java8, and using a legacy version of the LanguageTool is a bit cumbersome even if it's doable.
pylanguagetool on the other hand is just one pip-command away, as python is on every Linux by default.

Furthermore pylanguagetool seems to be a lot faster.

Some dictionaries of errors are broken.

Some odd keys and values are inserted in some error dictionaries. And some values are illegally the same as their keys.

Vital.Web.XML.parse() may be broken. In the case, investigation is needed.

Example

    {
        '-..."': '-..."',
        ':': ':',
        'bufnr': 'bufnr',
        'category': 'Miscellaneous',
        'context': '...ow  -> all hooks except for ''diff_open'' hook ',
        'contextoffset': '48',
        'errorlength': '1',
        'fromx': '0',
        'fromy': '42',
        'id': 7,
        'locqualityissuetype': 'typographical',
        'msg': 'Unpaired bracket or similar symbol',
        'of': 'of',
        'offset': '1528',
        'replacements': 'replacements',
        'ruleId': 'EN_UNPAIRED_BRACKETS',
        'status': 'status',
        'status_bufnr': 'status_bufnr',
        'tox': '1',
        'toy': '42',
        'window': 'window'
    },

Missing function: grammarous#close_info_window

I get this error when using <Plug>(grammarous-close-info-window):

Error detected while processing /home/???/.config/nvim/bundle/repos/github.com/rhysd/vim-grammarous/autoload/grammarous.vim:
line    9:
E741: Value is locked: g:grammarous#root
E117: Unknown function: grammarous#close_info_window

The [grammarous] window cause airline's denite extension to crash

When writing #45 , I found that if the airline's denite extension is enabled, whenever the [grammarous] is closed before calling denite, airline will crash with the message output below when one candidate is opened and vim jumped to a position with grammar error.

minimal init.nvim:

call plug#begin('~/.config/nvim/plugged')
Plug 'vim-airline/vim-airline'
Plug 'Shougo/denite.nvim', { 'do': ':UpdateRemotePlugins' }
Plug 'rhysd/vim-grammarous' " with the denite source
call plug#end()

let g:python3_host_prog = $HOME . "/.pyenv/versions/neovim3/bin/python"

way to produce

start neovim with the minimal init.nvim, type the following text in insert mode:

This is a error

then call :GrammarousCheck, one error should be detected at the a position. Move the cursor away from a and close the [grammarous] window manually. Then call :Denite grammarous, which is added in the PR #45 so maybe you can use my fork here. (It's just merged). At now the Denite window should be opened while the [grammarous] window is closed. Now open the a candidate in denite, airline will crash with the message below.

"[Grammarous]"  19 lines --5%--
Error detected while processing function airline#extensions#denite#check_denite_mode[1]..denite#get_status_mode:
line    1:
E121: Undefined variable: b:denite_statusline_mode
Error detected while processing function airline#extensions#denite#check_denite_mode[1]..denite#get_status_mode:
line    1:
E15: Invalid expression: b:denite_statusline_mode
Error detected while processing function airline#extensions#denite#check_denite_mode:
line    2:
E684: list index out of range: 1
Error detected while processing function airline#extensions#denite#check_denite_mode:
line    2:
E116: Invalid arguments for function tolower(l:mode[1])
Error detected while processing function airline#extensions#denite#check_denite_mode:
line    2:
E15: Invalid expression: tolower(l:mode[1])
Error detected while processing function airline#extensions#denite#check_denite_mode[4]..airline#highlighter#highlight:
line    6:
E691: Can only compare List with List
Error detected while processing function airline#extensions#denite#check_denite_mode[4]..airline#highlighter#highlight:
line    6:
E15: Invalid expression: a:modes[0] == 'inactive' ? '_inactive' : ''
Error detected while processing function airline#extensions#denite#check_denite_mode[4]..airline#highlighter#highlight:
line    8:
E691: Can only compare List with List
Error detected while processing function airline#extensions#denite#check_denite_mode[4]..airline#highlighter#highlight:
line    8:
E15: Invalid expression: mode == 'inactive' && winnr('$') == 1
Error detected while processing function airline#extensions#denite#check_denite_mode[4]..airline#highlighter#highlight:
line   13:
E730: using List as a String
Error detected while processing function denite#get_status_sources:
line    1:
E121: Undefined variable: b:denite_statusline_sources
Error detected while processing function denite#get_status_sources:
line    1:
E15: Invalid expression: b:denite_statusline_sources
Error detected while processing function denite#get_status_path:
line    1:
E121: Undefined variable: b:denite_statusline_path
Error detected while processing function denite#get_status_path:
line    1:
E15: Invalid expression: b:denite_statusline_path
Error detected while processing function denite#get_status_linenr:
line    1:
E121: Undefined variable: b:denite_statusline_linenr
Error detected while processing function denite#get_status_linenr:
line    1:
E15: Invalid expression: b:denite_statusline_linenr
Error detected while processing function airline#extensions#denite#check_denite_mode[1]..denite#get_status_mode:
line    1:
E121: Undefined variable: b:denite_statusline_mode
Error detected while processing function airline#extensions#denite#check_denite_mode[1]..denite#get_status_mode:
line    1:
E15: Invalid expression: b:denite_statusline_mode
Error detected while processing function airline#extensions#denite#check_denite_mode:
line    2:
E684: list index out of range: 1
Error detected while processing function airline#extensions#denite#check_denite_mode:
line    2:
E116: Invalid arguments for function tolower(l:mode[1])
Error detected while processing function airline#extensions#denite#check_denite_mode:
...
...

This is easy to reproduce in my environment with the denite source I PRed. And when I disable airline, nothing will crash.

I'm not very familar with vim's feature and vimscript, but I guess it's because the denite window is kept by [grammarous], thus make airline confused. For reference, unite will not cause such a crash because unite's window is at the top while denite's is at the bottom.

In addition, when the [grammarous] window is open, nothing will crash either.

Filetype specific ignore pattern

g:grammarous#ignore_patterns is a dictionary whose key is filetype and whose value is array of pattern. Ignored area should be linewise because line and col will be changed if it is characterwise. The pattern in the array is a dictionary and it should has a key "start" and "end" or "start" and "post_end" or simply "pattern" only. "end" means the ignored area ends with the pattern "end" indicates. "post_end" means the ignored area ends just before the pattern "post_end" indicates.
"pattern" means the matched lines are simply ignored.

Example

{
  \ 'markdown' : [{'start' : '^```', 'end' : '```'}],
  \ 'help' : [{'pattern' : '^[<>]'}, {'start' : '^>$', 'end' : '^<$'}]
\ }

Note

Before resolving this issue by Vim script, Investigation of languagetool-commandline's feature should be done.

vim-grammarous: Could not download jar file because 'curl' and 'wget' are not found.

The GrammarousCheck command warns me, while curl is available.

vim-grammarous: Could not download jar file because 'curl' and 'wget' are not found. Please download zip from https://languagetool.org/download/LanguageTool-2.6.zip and extract it to /path/to/grammarous/misc.
:echo executable('curl')
1
:echo system('which curl')
/usr/bin/curl
:echo system('curl --version')
curl 7.37.1 (x86_64-apple-darwin14.0) libcurl/7.37.1 SecureTransport zlib/1.2.5
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp smtp smtps telnet tftp
Features: AsynchDNS GSS-Negotiate IPv6 Largefile NTLM NTLM_WB SSL libz
:echo executable('wget')
0

Problem: fixing error in line with multiple errors will shift selection

You can see the behavior in the following two screenshots on the second line:

This one is before the fix:
screenshot from 2016-07-05 17-38-09

And this one is after:
screenshot from 2016-07-05 17-38-23

One solution would be the to re-check the current paragraph, if vim-operator-user is installed to avoid too much overhead. Not sure though how much troubles that creates.

Grammar check in Strings

Hey,
Is there a way to force the checker to validate only 'strings' and 'comments' for grammar.

Use of location-list

I think it would be a good idea to put the Error (not the suggested fix) into the location-list.

This would make moving between errors via :lNext and :lPrevious

help がない

久しぶりに grammarous を使おうとして、使い方をすっかり忘れてしまったのでヘルプを参照しようと :help grammarous を実行しましたが、使い方が書かれていませんでした。
いちいちブラウザを開かないと使い方が参照できないのはとてつもなく不便だと感じたので、help があると嬉しいです。

LanguageTools server

LanguageTools has a server implementation. We can spawn server once and send requests to it. It would be much faster than executing one command for each :GrammarousCheck.

#7 (comment)

Issues with navigation+correction cycle (never having to switch windows)

First of all, this is a simple yet powerful tool. A must add-on for writers, for its amazing use.

I am annoyed at only one issue: I am not able to comfortably navigate among errors & correct them.

It involves multiple steps such as moving to quickfix window (Ctrl-w Ctrl-w etc) and then pressing n or p and then again move to quickfix window and so on.

This feels uncomfortable because when compared to the default :set spell utility itself this is annoying. With :set spell, I can jump easily using [s and ]s. Ideally with this plugin one may simply use n and p (until :GrammarousReset used) to move from current error to next, understand from the quickfix window what went wrong at that place correct and move on. In otherwords, it is simply the way the infamous spell-check works in MS-Word.

How can I achieve this? If it involves much work, can you have feature-addition in future release?? Please let me know.

Filetype specific ignore rules

I'll extend g:grammarous#disabled_rules from array to dictionary whose keys are filetypes. "*" key means global. For compatibility, if user sets g:grammarous#disabled_rules as array, vim-grammarous automatically convert it to {"*" : user_specified_array } on initialization.

Jump to the error's location

It's very handy to jump cursor to the next/previous error's location. It should be available as <Plug> mappings and local mappings in the info window. In addition, an option to jump to the first error on completing the check should be also provided.

vim stalls on simple pattern

When executing :GrammrousCheck in vim on a file containing the following pattern

a 

b

that is a line with a space at the end and two subsequent new lines, then after
I receive the report by grammarous (e.g. Detected 3 grammatical error), vim
stalls using 100% CPU. I can only stop it with Ctrl-C.

Git commit fails using neovim

Git commit fails when vim-grammarous is loaded, it's fine otherwise. The version of neovim is v0.2.0 and I'm running on a mac: Darwin mac 16.6.0 Darwin Kernel Version 16.6.0: Fri Apr 14 16:21:16 PDT 2017; root:xnu-3789.60.24~6/RELEASE_X86_64 x86_64.

The error is:

error: There was a problem with the editor 'vi'.
Please supply the message using either -m or -F option.

Doing echo $? immediately after exiting vim shows a return value of 1

Problem: vim-grammarous cannot do background checks

Hi,

this is something I like to help with. The lastest version of language-tool offers a REST-JSON API that can be queried simultaniously. Here are some issue I need help with to resolve:

  • How do I send HTTP request with vimscript?
  • How do I parse JSON with vimscript?
  • How do I split a vim buffer in paragraphs or something similar (parallel buffer check)?
  • How can I get the current paragraph that a user is editing to do background checks?

Regards
Kevin

Problem: vim-grammarous no longer works on 7.4.x

When I run vim-grammarous on vim 7.4.x it starts with the following message:

Grammar check has started with job(process 22703 run)...

and after spell checking finished it comes back with the following error:

Error detected while processing function <SNR>221_on_check_done_vim8:
line    2:
E118: Too many arguments for function: ch_status
E15: Invalid expression: ch_status(a:channel, {'part' : 'out'}) ==# 'buffered'

Does not work on Cygwin

The call to execute LanguageTool in Cygwin fails unsurprisely as the Java on Windows is unable to recognise the posix path of the jarfile given to it.
A fix involves passing the posix path through cygpath command then to Java.
I does not have any vimscript experience, only Python so I may not be able to implement a fix any time soon.

Unknown function: vital#grammarous#new

I get this error after the vital modules update:

Error detected while processing /home/xyz/.local/share/nvim/dein/repos/github.com/rhysd/vim-grammarous/autoload/grammarous.vim:
line 4:
E117: Unknown function: vital#grammarous#new
E15: Invalid expression: vital#grammarous#new()

Check comments only.

Checking only comments is useful for source code. It can be implemented by filtering the errors using the highlight of its location. I'm considering this feature's API. It should be an option of :GrammarousCheck?

add support for markup language

It would be nice to have support for mark-up language like latex or markdown.
Using grammarous with those languages raise a lot of error due to the tag and automatic styling (for latex mostly because the latex compiler handle a lot of style issues).

Furthermore, having things like piece of code in the text can make the usage of grammarous less pleasant due to number of error raised. Supporting those mark-up languages would mean being able to disable spell checking for things like the verbatim environment in latex or code quote (``) in markdown.

I've asked LanguageTool if they could add the support of markup language, their answer is that it's up to the editor to handle the markup language parsing.

This look like an enhanced version of #10 (if I've understood the issue).

An idea could be to have a dictionary of command (by filetype). Those command would parse the file and return the raw text, without the markup and ignored text (like the content of the verbatim environment)

Error when no replacement suggested

Using latest Grammarous version
Languagetool version: 3.9
Language: French

When there is no replacement for a spelling error, Grammarous uses 'replacement' as the replacement string.
I found the bug on french text, but I think it may be present in other languages

Python comments ignored

If I run GrammarCheck --comments-only against the following python example:

def myfunction():
    """It doesn't works for multi line python."""

    # I doesn't work for single line comments.
    pass

The first mistakes are ignored. They are both picked up if I remove '--comments-only' but so is all the code.

I get the same result if I use in .vimrc:

let g:grammarous#default_comments_only_filetypes = {
            \ '*' : 1, 'help' : 0, 'markdown' : 0,
            \ }

Check specified range

Add -range to :GrammarousCheck.
To implement the checking with reasonable cost, the temporary buffer should be below:

  • line 1 - line <line1> - 1 : blank lines are inserted
  • <line1> - <line2> : the normal lines from the buffer are inserted
  • after <line2> : nothing

A buffer number grows up massively

This issue is reported in #1.
Despite specifying bufhidden=wipe, the buffer number grows up. I should investigate:

  • it's the normal behavior or not
  • it's no problem even if the number grows up massively or not

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.