0

I'm using the pencil plugin which remaps the jk movement buttons to go up/down by row (text is soft wrapped) rather than line, which is usually helpful. But at times I want to have the normal behavior so that I can quickly move from one line to another.

How can I restore the remapped keys (j and k) temporarily so I can toggle the pencil behavior on and off? Or is there another way of doing this?

I can't toggle pencil itself, because for one reason or another (probably buginess) it messes up the formatting.

My actual need is to go from one paragraph to another (the beginning would be fine). But I don't mean a vim paragraph that is set off by blank lines. My text document has paragraphs set off by indentation (so each paragraph is effectively one vim line). So if there's another way besides using the vim key to move from one paragraph to another. That would work for me. I can't use the { key because it jumps to blank lines.

3
  • Can you show some examples with an edit? I'm having a hard time visualizing—my questions would be, (1) what are j and k mapped too? (2) What is some text that you would consider "paragraphs set off by indentation," and where would you like to jump to? (AFAIK there is no simple way to save/restore mappings, though there may be some more complex ways) – D. Ben Knoble Oct 19 '20 at 17:32
  • I have edited. Hope that helps. THank you! – aris Oct 19 '20 at 18:03
  • Could you give some example text, please? (even just lorem-ipsum formatted the way you describe would be helpful – D. Ben Knoble Oct 19 '20 at 18:05
0

It looks like pencil (sometimes?) switches j with gj and k with gk, so you could use gj and gk as substitutes.

I'm not sure why toggling pencil would mess up the formatting (perhaps it only changes how the text is displayed, or perhaps they like to automatically reflow text), but you might be able to toggle modes (hard and soft wrap) to get other mappings back.

2
  • Wow, thanks so much! I missed that. Maybe it wasn't documented. – aris Oct 19 '20 at 18:51
  • @aris haha probably the latter – D. Ben Knoble Oct 19 '20 at 18:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.