Giter Site home page Giter Site logo

Comments (4)

nightwing avatar nightwing commented on July 29, 2024 1

What do you mean by "defining <localleader>lv"? vim plugin is the same for ace and codemirror, so you should be able to use your old code.

from codemirror-vim.

nightwing avatar nightwing commented on July 29, 2024 1

I think you simply have a typo when calling unmap, CodeMirror.Vim instead of CodeMirrorVim.Vim which prevents the following lines from being executed.

from codemirror-vim.

llinfeng avatar llinfeng commented on July 29, 2024

@nightwing I should be more precise - I was using ; as my local leader, and would like to trigger a forward jump through ;lv. With the example below, I only get \lv to work from the first line.

        CodeMirrorVim.Vim.mapCommand("\\lv", "action", "jumpToPdf");
        CodeMirror.Vim.unmap(';');
        CodeMirror.Vim.unmap('l');
        CodeMirrorVim.Vim.map(";lv", "\\lv", "normal")

And, thanks for pointing out that both ace and codemirror were accessing the same Vim Mode API. This is a big relief!

from codemirror-vim.

llinfeng avatar llinfeng commented on July 29, 2024

Great catch! In summary, to use ; as part of a mapping, one needs to first unmap it properly. The following two lines does the trick, taken from this gist.

        // Use <localleader>lv, or ;lv - for forward search
        CodeMirrorVim.Vim.unmap(';');
        CodeMirrorVim.Vim.mapCommand(";lv", "action", "jumpToPdf");

from codemirror-vim.

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.