Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Treat lines with soft wrap the same way as non-broken lines when using j,k #2186

Closed
elmewo opened this issue Nov 30, 2017 · 6 comments

Comments

@elmewo
Copy link

elmewo commented Nov 30, 2017

  • Click thumbs-up 👍 on this issue if you want it!
  • Click confused 😕 on this issue if not having it makes VSCodeVim unusable.

The VSCodeVim team prioritizes issues based on reaction count.


FEATURE REQUEST:

Environment:

  • VSCode Version: 1.18.1
  • VsCodeVim Version: 0.10.5
  • OS: Win10

When I work on a LaTeX document I usually turn on automatic word wrap in VS Code because of long sentences. Navigating with j,k up and down the lines is a pain then because the cursor jumps right to the next line (with line number) rather than going down one screen line.
I'd love to navigate in those lines with soft line breaks the same way as in those with hard line breaks.

Undesired behaviour can be reproduced as follows:

  1. Add lorem ipsum to document.
  2. Turn on word wrap (ALT-Z).
  3. Navigate in broken lines with j,k. Cursor will skip some screen lines and jump to next numbered line.

Desired behaviour:

Cursor should move like it does with UP,DOWN when Vim-Mode is deactivated, namely from screen line to screen line.

@Chillee
Copy link
Member

Chillee commented Nov 30, 2017

@elmewo I believe you're looking for gj

@elmewo
Copy link
Author

elmewo commented Nov 30, 2017

That is correct, thank you. Unfortunately, I don't see a possibility to add conditions, such as

nnoremap <expr> k (v:count == 0 ? 'gk' : 'k')
nnoremap <expr> j (v:count == 0 ? 'gj' : 'j')

Can I do that here?

@Chillee
Copy link
Member

Chillee commented Nov 30, 2017

@elmewo unluckily, we can't do that currently.

@elmewo
Copy link
Author

elmewo commented Nov 30, 2017

Ok, thanks a lot! I'll close the issue, because my actual feature request is not needed. However, I'd appreciate conditional bindings in VSCodeVim.

@elmewo elmewo closed this as completed Nov 30, 2017
@Chillee
Copy link
Member

Chillee commented Nov 30, 2017

@elmewo honestly, it seems unlikely to me that we'll be able to add conditional keybindings currently. I don't see a good way to do it that isn't fairly awkward.

However, when we integrate neovim https://github.com/Chillee/VSCodeNeovim that should be easily possible :)

@karlhorky
Copy link
Contributor

It's possible to move among display lines with j, k, or by remapping key bindings as I documented in #3623.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants