notomo / gesture.nvim

Mouse gesture plugin for neovim
MIT License
527 stars 2 forks source link

How to add action to map <C-o> and <C-i>? #35

Closed xaljer closed 3 years ago

notomo commented 3 years ago

You can use nvim_feedkeys() and nvim_replace_termcodes().

local gesture = require('gesture')
gesture.register({
    name = "go back",
    inputs = { gesture.right(), gesture.left() },
    action = [[lua vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes("<C-o>", true, false, true), "n", true)]]
})

📝 :help nvim_feedkeys()

notomo commented 3 years ago

https://github.com/notomo/gesture.nvim/commit/16de5dc86678ae2ade8d063af57e99e0d05553b5

xaljer commented 3 years ago

@notomo Cool~