vim-Grammalecte icon indicating copy to clipboard operation
vim-Grammalecte copied to clipboard

no .vim directory

Open arnauldb opened this issue 8 years ago • 8 comments

Hello,

I'm trying to install grammalecte. I use vim 8.0.243 but I can't find a .vim directory on my ubuntu. So I am stucked at :

Copy those files respectively into ~/.vim/plugin and ~/.vim/doc/ directories, and update the documentation tags using:

vim -c 'helptags ~/.vim/doc'

I'm a kind of newbie using Linux, I just switched from windows. I installed vim following these steps : http://www.vim.org/git.php

thanks for any help.

arnauldb avatar Jan 27 '17 10:01 arnauldb

The ~/.vim/ directory is where you can store the vim plugins (and syntax files, help files, color schemes, etc.), which are not part of the official distribution of vim. If you don't have this directory yet, you can create it:

  $ mkdir ~/.vim
  $ mkdir ~/.vim/doc
  $ mkdir ~/.vim/plugin

You can also find more information about this in vim help:

  :help add-global-plugin
  :help add-local-help

dpelle avatar Jan 27 '17 12:01 dpelle

I used Vundle.vim, and installed grammalecte. terminal_008 then ran :GrammalecteCheck terminal_010 and have this : terminal_011

sorry to bother you with this...

arnauldb avatar Jan 27 '17 16:01 arnauldb

sorry to bother you with this...

It's not bothering at all. If there is a bug, I want to fix it. So thanks for the bug report.

It was working for me until recently. But I just downloaded Grammalecte-fr-v0.5.14 and tried the latest plugin and I see an error too!? Strange, json_decode(...) fails. If that happens, the plugin should catch the exception and give a proper error. So I'll improve that soon. But of course it should also succeed to begin with. I tried grammalecte directly in command line and it gives an error, so there is bug in Grammalecte itself which is the root cause of the problem:

$ python3 Grammalecte-fr-v0.5.14/pythonpath/cli.py -f ~/foo.txt -j
{ "grammalecte": "0.5.14", "lang": "fr", "data" : [
Traceback (most recent call last):
  File "Grammalecte-fr-v0.5.14/pythonpath/cli.py", line 251, in <module>
    main()
  File "Grammalecte-fr-v0.5.14/pythonpath/cli.py", line 182, in main
    sText = generateJSON(i, sText, oTokenizer, oDict, bContext=xArgs.context, bDebug=False, bEmptyIfNoErrors=xArgs.only_when_errors, lLineSet=lLineSet)
  File "Grammalecte-fr-v0.5.14/pythonpath/cli.py", line 67, in generateJSON
    return json.dumps({ "lGrammarErrors": aGrammErrs, "lSpellingErrors": aSpellErrs }, ensure_ascii=False)
  File "/usr/lib/python3.4/json/__init__.py", line 237, in dumps
    **kw).encode(obj)
  File "/usr/lib/python3.4/json/encoder.py", line 192, in encode
    chunks = self.iterencode(o, _one_shot=True)
  File "/usr/lib/python3.4/json/encoder.py", line 250, in iterencode
    return _iterencode(o, 0)
  File "/usr/lib/python3.4/json/encoder.py", line 173, in default
    raise TypeError(repr(o) + " is not JSON serializable")
TypeError: dict_values([{'sMessage': 'Accord de genre erroné : « test » est masculin.', 'sAfter': ' test. ', 'sUnderlined': 'une', 'nStartX': 9, 'sLineId': '4494s', 'sRuleId': 'gn_une_accord', 'URL': '', 'nEndY': 1, 'nStartY': 1, 'sType': 'gn', 'nEndX': 12, 'aSuggestions': ['un'], 'sBefore': 'Ceci est '}, {'sMessage': 'Doublon.', 'sAfter': ' ca marche.', 'sUnderlined': 'si si', 'nStartX': 31, 'sLineId': '971s', 'sRuleId': 'doublon', 'URL': '', 'nEndY': 2, 'nStartY': 1, 'sType': 'notype', 'nEndX': 2, 'aSuggestions': ['si'], 'sBefore': 'Voyons voir '}]) is not JSON serializable

Strange, I thought I used Grammalecte-fr-v0.5.14 before. Could it be that that version 0.5.14 was changed afterwards? I'll report the bug soon to dicollecte.org and make the necessary change to the vim plugin.

dpelle avatar Jan 27 '17 17:01 dpelle

ok. Thanks, I already use grammalecte in Libreoffice and Firefox and would be happy to be able to use it in a light editor like vim. I'm french by the way...

arnauldb avatar Jan 27 '17 17:01 arnauldb

I'm french by the way...

Moi aussi. On continue en français. J'ai signalé le bug de Grammalecte ici :

http://www.dicollecte.org/thread.php?prj=fr&t=598

dpelle avatar Jan 27 '17 20:01 dpelle

Peux-tu relélécharger Grammalecte? Le fichier http://www.dicollecte.org/grammalecte/oxt/Grammalecte-fr-v0.5.14.oxt a été réparé d'après http://www.dicollecte.org/thread.php?prj=fr&t=598

dpelle avatar Jan 28 '17 14:01 dpelle

C'est fait, téléchargé de nouveau et voici le résultat :

terminal_008

Par contre je ne comprends pas pourquoi les mots "editeurs", "gramaire" et "ortographes" ne sont pas signalés comme faux.

edit : bien sur c'est grammalecte, il est donc normal que "editeurs", "gramaire" et "ortographes" ne soient pas signalés...

Merci beaucoup pour ce plugin !

arnauldb avatar Jan 28 '17 15:01 arnauldb

Grammalecte signale les erreurs d’orthographe (même si le module indépendant ne sait pas faire de suggestion). Mais sur votre capture d’écran la colorisation des erreurs d’orthographe est si faible qu’on la distingue à peine. :)

olr avatar Jan 30 '17 00:01 olr