summaryrefslogtreecommitdiff
path: root/lua
diff options
context:
space:
mode:
authorBenjamin Chausse <benjamin@chausse.xyz>2023-10-06 16:04:05 -0400
committerBenjamin Chausse <benjamin@chausse.xyz>2023-10-06 16:04:05 -0400
commit9d8a9f7e4e765de40e3979966825af7c6aa900a6 (patch)
tree95c0ee6eae1a8cf136aa3cef71f149d06b4d8603 /lua
parent85768cdcfd82fccd082b41fc435bff92a628dfe3 (diff)
Add grammalecte plugin (Antidote equivalent)
Diffstat (limited to 'lua')
-rw-r--r--lua/ben/plugins/grammalecte.lua21
1 files changed, 21 insertions, 0 deletions
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 = {
+ { "<leader>cg", "<cmd>GrammalecteCheck<cr>" }, -- C.heck G.rammar
+ { "<leader>cs", "<cmd>GrammalecteClear<cr>" }, -- C.heck S.top
+ },
+}