1
Fork 0
satellite/dotfiles/neovim/lua/my/plugins/idris.lua

39 lines
1 KiB
Lua
Raw Normal View History

local lspconfig = require("my.plugins.lspconfig")
local M = {}
function M.setup()
2022-08-11 12:21:41 +02:00
local idris2 = require("idris2")
2022-05-11 23:11:54 +02:00
2022-08-11 12:21:41 +02:00
idris2.setup({
server = {
on_attach = function(client, bufnr)
lspconfig.on_attach(client, bufnr)
2022-12-27 14:02:03 +01:00
local function nmap(from, to, desc)
vim.keymap.set("n", "<leader>I" .. from, function()
require("idris2.code_action")[to]()
end, { desc = desc, bufnr = true })
end
nmap("C", "make_case", "Make [c]plit")
nmap("L", "make_lemma", "Make [l]emma")
nmap("c", "add_clause", "Add [c]lause")
nmap("s", "expr_search", "Expression [s]earch")
nmap("d", "generate_def", "Generate [d]efinition")
nmap("s", "case_split", "Case [s]plit")
nmap("h", "refine_hole", "Refine [h]ole")
local status, wk = pcall(require, "which-key")
if status then
wk.register({ ["<leader>I"] = { name = "[I]dris", buffer = bufnr } })
2022-08-11 12:21:41 +02:00
end
2022-12-27 14:02:03 +01:00
end,
2022-08-11 12:21:41 +02:00
},
2022-12-27 14:02:03 +01:00
client = { hover = { use_split = true } },
2022-08-11 12:21:41 +02:00
})
end
return M