moveline.nvim
moveline.nvim copied to clipboard
Can anyone help with setting up keyboard shortcuts?
I'm not sure what is possible, but I would like to set the ALT+up/down combination for move line.up/down accordingly. How could I do that? (using neovim / lazy.nvim)
mappings.lua
The root view of the files is as follows:
You should be able to use something like this:
n = {
["<M-Up>"] = { function() require("moveline").up() end, "moveline: up" },
["<M-Down"] = { function() require("moveline").down() end, "moveline: down" },
}
Sorry, I still haven't figured out how to do this:(
I added, there are no errors, but nothing happens:(
Hmm I'll look into that. I'm in the process of rewriting this plugin anyways though, I would recommend using one of the other line-moving plugins for now.
Here's how I got my Alt-Up / Alt-Down to work:
-- .config/nvim/lua/plugins/moveline.lua
return {
'willothy/moveline.nvim',
build = 'make',
lazy = false,
config = function()
local moveline = require('moveline')
vim.keymap.set('n', '<a-Up>', moveline.up)
vim.keymap.set('n', '<a-Down>', moveline.down)
vim.keymap.set('v', '<as-Up>', moveline.block_up)
vim.keymap.set('v', '<as-Down>', moveline.block_down)
end
}