Code Monkey home page Code Monkey logo

Comments (13)

fmoralesc avatar fmoralesc commented on June 1, 2024

I think the problem you found doesn't come from the "keyboard" module, but from the "formatting" one. You use the default soft wrapping mode, don't you? That maps j and k to use the virtual position instead of the default, so cursor movement is more natural. Can you confirm if the problem is fixed by commenting lines 103-106 in autoload/pantondoc/formatting.vim? I can wrap it into an option, so you can opt out of it.

BTW, why jr instead of the standard ce and cE? Just curious.

from vim-pandoc.

fmoralesc avatar fmoralesc commented on June 1, 2024

It might not be a bad idea to move this functionality into the keyboard module, so all mappings are handled in one place.

from vim-pandoc.

fmoralesc avatar fmoralesc commented on June 1, 2024

I've tried to reproduce this by placing

map jr ce

in my vimrc, and I've found vim-pantondoc's mappings don't affect it (except that when pressing j, it takes a bit to react, because it waits a bit for r). So, maybe there's something wrong in your jr mapping? Can you provide the definition for it, and also the output of :verbose map j?

from vim-pandoc.

alexeymuranov avatar alexeymuranov commented on June 1, 2024

When pantondoc is loaded, i get two extra lines in response to :verbose map j:

v  j           *@gj
        Last set from ~/.vim/bundle/vim-pantondoc-master/autoload/pantondoc/formatting.vim
n  j           *@gj
        Last set from ~/.vim/bundle/vim-pantondoc-master/autoload/pantondoc/formatting.vim

They do not appear if i set let g:pantondoc_disabled_modules = ['formatting'] in .vimrc. Calling :let g:pantondoc_disabled_modules = ['formatting'] later has no effect on mappings.

The malfunction of my jr in Markdown files seems to be related to these two lines (it happens when these lines are present).

from vim-pandoc.

alexeymuranov avatar alexeymuranov commented on June 1, 2024

My autoload/pantondoc/formatting.vim which i got from today's master only has 86 lines.

from vim-pandoc.

fmoralesc avatar fmoralesc commented on June 1, 2024

Calling :let g:pantondoc_disabled_modules = ['formatting'] later has no effect on mappings.

Yes, we don't currently have the ability to unload modules without reloading the buffer.

My autoload/pantondoc/formatting.vim which i got from today's master only has 86 lines.

Sorry, I was testing this over todays master.

Ok, then. I'll make this optional. Please note I've just merged into master some changes that change all configuration variables. When implemented, this will be handled by the g:pandoc#keyboard#display_motion variable. I still wonder what is causing this, as I mentioned above, I couldn't reproduce this issue.

from vim-pandoc.

alexeymuranov avatar alexeymuranov commented on June 1, 2024

Commenting out lines

nnoremap <buffer> j gj
nnoremap <buffer> k gk
vnoremap <buffer> j gj
vnoremap <buffer> k gk

fixes the problem.

from vim-pandoc.

fmoralesc avatar fmoralesc commented on June 1, 2024

That's what I meant ;)

from vim-pandoc.

alexeymuranov avatar alexeymuranov commented on June 1, 2024

I still wonder what is causing this, as I mentioned above, I couldn't reproduce this issue.

I can try to make a minimal example to reproduce it, but i see nothing strange in that some mappings interfere with others. My mappings are a bit complex.

About why i am using jr instead of ce. After struggling with making Vim usable in Canadian-French and Russian layouts, and reading various recommendations how to remap keys to make common operations easier to access, i gave up and remapped everything, including the <Esc>, mapped keys to operations based on the key position in Qwerty and not on the character, and added a procedure to automatically adapt the mapping to new keyboard layouts, so that the operations stay assigned to the same keyboard keys. The result is not ready to be called a plugin and is almost undocumented, but it works for me for now.

from vim-pandoc.

fmoralesc avatar fmoralesc commented on June 1, 2024

!!! That's super neat (and indeed crazy), so kudos for you.

You'll grant it is a bit of a corner case, though. Under normal assumptions there should not be a conflict, because our mapping for j should not propagate into jr, unless you are also mapping j as an operator and r as a text object (which you might). Anyways, I just pushed a fix for this. Please put

let g:pandoc#keyboard#display_motions = 0

in your vimrc.

from vim-pandoc.

fmoralesc avatar fmoralesc commented on June 1, 2024

BTW, do the other mappings in the keyboard module work for you?

from vim-pandoc.

alexeymuranov avatar alexeymuranov commented on June 1, 2024

I haven't run into any other conflicts, i suppose because i do not have maplocalleader set. It was just strange that i could not eliminate conflicting mappings by disabling 'keyboard' module. Thanks for fixing.

from vim-pandoc.

fmoralesc avatar fmoralesc commented on June 1, 2024

No problem. All keyboard mappings are now handled by the "keyboard" module, so it should be clearer where to look in case something else shows up. Thanks for reporting this issue.

from vim-pandoc.

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.