Is there any method to map keys to functions now? #515
-
I remember using keymap to call function was possible in a former version. local ht = require('haskell-tools')
local def_opts = { noremap = true, silent = true, }
ht.setup {
hls = {
on_attach = function(client, bufnr)
local opts = vim.tbl_extend('keep', def_opts, { buffer = bufnr, })
-- haskell-language-server relies heavily on codeLenses,
-- so auto-refresh (see advanced configuration) is enabled by default
vim.keymap.set('n', '<space>ca', vim.lsp.codelens.run, opts)
vim.keymap.set('n', '<space>hs', ht.hoogle.hoogle_signature, opts)
end,
},
}
-- Suggested keymaps that do not depend on haskell-language-server
-- Toggle a GHCi repl for the current package
vim.keymap.set('n', '<leader>rr', ht.repl.toggle, def_opts)
-- Toggle a GHCi repl for the current buffer
vim.keymap.set('n', '<leader>rf', function()
ht.repl.toggle(vim.api.nvim_buf_get_name(0))
end, def_opts)
vim.keymap.set('n', '<leader>rq', ht.repl.quit, def_opts) It seems present keymap functions like |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Lines 137 to 142 in b3fb465 Here's an example: Lines 129 to 134 in b3fb465 As u can see it's contains a function. |
Beta Was this translation helpful? Give feedback.
nvimdots/lua/keymap/bind.lua
Lines 137 to 142 in b3fb465
Here's an example:
nvimdots/lua/keymap/tool.lua
Lines 129 to 134 in b3fb465
As u can see it's contains a function.