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

Select line/yank/paste inconsistency #18

Open
chapmandu opened this issue Feb 4, 2024 · 7 comments
Open

Select line/yank/paste inconsistency #18

chapmandu opened this issue Feb 4, 2024 · 7 comments
Labels
bug Something isn't working

Comments

@chapmandu
Copy link

Give this file content:

<div data-foo="bar">
  baz
</div>

Placing the cursor on the 2nd (baz) line and using xyp (select line - yank - paste) should duplicate the "baz" line.

Helix:
image

VSCode:
image

@jasonwilliams jasonwilliams added the bug Something isn't working label Feb 4, 2024
@jasonwilliams
Copy link
Owner

Yeah its bad and needs looking at, the implementation behind that needs starting again really. I should look how vscode vim are handling it. If you have any spare capacity feel free to look at this, i may not get around to it for a while.

@jasonwilliams
Copy link
Owner

jasonwilliams commented Apr 15, 2024

One option which I think should solve this for line copies.

When you do x and then y, I may just defer to VS Code's line copy and when you do paste just use their line paste.

It should fix the problem above but won't fix block copy, that still needs some help.

Another option is to look at what the vim extension does

@jasonwilliams
Copy link
Owner

jasonwilliams commented May 6, 2024

Seeing that VSCode/Vim have fixed most of these issues I've decided to fork the modern version and add helix features back in. You can follow the branch here: https://github.com/jasonwilliams/vscode-helix/tree/helix-fork

It's a bit of a start-again approach but it will be better than re-inventing the wheel when most of these edge cases have already been dealt with.

Any help would be appreciated

@chapmandu
Copy link
Author

Hey Jason, what would you like help with (I've little experience with TypeScript).. I built and installed this branch, though I'm not sure in what state the keybinding are?

@jasonwilliams
Copy link
Owner

jasonwilliams commented May 15, 2024

Hey @chapmandu thanks for helping!

So I've decided to fork vscodeVim because that has a lot of functionality we need. We can then tweak the bits it doesn't have, but we should be able to get 90% of the way there with their code base.

Feel free to make PRs to the branch I linked above.
To start off, you can just try changing some default keybindings, for e.g V to x

@chapmandu
Copy link
Author

chapmandu commented May 16, 2024

Righto..I had a quick browse through the docs I think I can make a start.. But how did you plan on implementing Helix keybindings? Did you want to add a keybinding.json, modify the package.json or modify the /src/actions/commands/actions.ts?

Any pointers appreciated..

EDIT: I wonder if https://marketplace.visualstudio.com/items?itemName=silverquark.dancehelix is of any use?

@jasonwilliams
Copy link
Owner

Ok so this is what you need to do.

  1. checkout the branch helix-fork (https://github.com/jasonwilliams/vscode-helix/tree/helix-fork)
  2. build this branch, npm i, npm run build
  3. To change a keybinding just search that keybinding, change it then rebuild again
  4. use the debugger to test changes

So for example https://github.com/VSCodeVim/Vim/blob/46436e90f3101d3dde7779183a0fbd02750089d0/src/actions/commands/actions.ts#L914-L936 here you would change 'V' to 'x'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants