Giter VIP home page Giter VIP logo

Comments (2)

mawkler avatar mawkler commented on June 11, 2024 1

Ah, that makes sense. Thank you!

from nvim-libmodal.

Iron-E avatar Iron-E commented on June 11, 2024

I see what's going on here— sorry in advance for the confusion. Keys are not preprocessed by nvim_replace_termcodes, just on the off case someone really does want to bind the sequence < c - n > (and if you press that sequence in the the example mode you'll see it runs vim.notify).

To fix it, you can do this:

local M = {}

-- neovim >= 0.10
local k = vim.keycode

-- neovim < 0.10
local function k(s)
  return vim.api.nvim_replace_termcodes(s, true, true, true)
end

M.mode = {
  -- (the rest of your mode)

  -- ↓ call `k`
  [k'<c-n>'] = function()
    -- (the definition)
  end,

  -- ↓ call `k`
  [k'<m-n>'] = function()
    -- (the definition)
  end
}

-- (the rest of the module)

Alternatively, in insert mode if you press <C-v> and then another control sequence it will replace termcodes directly into the file (e.g. <C-v><Esc>)

from nvim-libmodal.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.