Closed kflak closed 2 years ago
The mappings
table in the config is a convenience to map the functions exported by the editor
module, basically the parts of the API that doesn't have a user command abstraction.
To map :SCNvimRecompile
you could either map the command as you have done before, or map the lua function:
vim.keymap.set('n', '<leader>sk', '<cmd>lua require"scnvim".recompile()<cr>')
It is also possible to not specify any mappings in the mappings
table of the config, and set up your own keymaps:
vim.keymap.set({'n', 'i'}, '<C-e>', '<cmd>lua require"scnvim.editor".send_block()<cr>')
~(note: I will make the eval flash effect default to true
, which is not the case at the moment when you set up mappings manually like the example above.)~ its fixed now
Maybe the scnvim.map
helper could take a function as well, that would consolidate all mappings to the config.
That would be really nice!
Its now possible to map arbitrary functions:
['<leader>sk'] = scnvim.map(scnvim.recompile), -- no need to wrap
['<F5>'] = scnvim.map(function()
vim.cmd [[ SCNvimGenerateAssets ]]
end),
Fantastic!
I usually have
<F4>
mapped to:SCNvimRecompile
and try to recreate this in the new config, but am not successful. How would I go about setting this?