summaryrefslogtreecommitdiff
path: root/lua/ben/plugins/grammalecte.lua
blob: efcdb645a4c66426b67d0013d0bde9eab93dfbb3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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
	},
}