From 9d8a9f7e4e765de40e3979966825af7c6aa900a6 Mon Sep 17 00:00:00 2001 From: Benjamin Chausse Date: Fri, 6 Oct 2023 16:04:05 -0400 Subject: Add grammalecte plugin (Antidote equivalent) --- lua/ben/plugins/grammalecte.lua | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 lua/ben/plugins/grammalecte.lua diff --git a/lua/ben/plugins/grammalecte.lua b/lua/ben/plugins/grammalecte.lua new file mode 100644 index 0000000..efcdb64 --- /dev/null +++ b/lua/ben/plugins/grammalecte.lua @@ -0,0 +1,21 @@ +return { + "dpelle/vim-Grammalecte", + build = function() + local grammalecte_url = "https://grammalecte.net/zip/Grammalecte-fr-v2.1.1.zip" + Grammalecte_path = vim.fn.expand("~/.local/share/nvim/grammalecte") + -- Download the latest version of Grammalecte ~/.local/share/nvim/grammalecte: + vim.fn.mkdir(Grammalecte_path, "p") + vim.fn.system({ "curl", "-L", grammalecte_url, "-o", Grammalecte_path .. "/grammalecte.zip" }) + -- Unzip the file + vim.fn.system({ "unzip", Grammalecte_path .. "/grammalecte.zip", "-d", Grammalecte_path }) + -- Then set g:grammalecte_cli_py to the unzipped python script + end, + config = function() + vim.g.grammalecte_cli_py = vim.fn.expand("~/.local/share/nvim/grammalecte/grammalecte-cli.py") + end, + cmd = { "GrammalecteCheck", "GrammalecteClear" }, + keys = { + { "cg", "GrammalecteCheck" }, -- C.heck G.rammar + { "cs", "GrammalecteClear" }, -- C.heck S.top + }, +} -- cgit v1.2.3