Solution for VSCodeVim code folding issue (solves #1004)
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 15.2k
- Forks
- 1.5k
- Avg merge
- 3d 18h
- Merged PRs (30d)
- 6
Description
Solves->
#1004
Introduction->
First of all, thank you for this amazing plugin.
Without a vim plugin, I wouldn't be using vscode.
Thank you very much for your hard work.
Problem ->
vscode vim folding has been an issue for a lot of time and, AFAIK vscode devs havn't fixed the issue and it seems they don't plan to provide the required API to solve these issues.
This has been probably the most requested feature ( #1004 ) for VSCodeVim but due to the negligence of support from core vscode team, I was going to leave vscode behind, out of frustration.
Discussion ->
But I didn't want to leave vscode.
So I came up with a solution myself.
I don't know if it is the "best" solution. It works for me. And I plan to continue using it.
I'm sharing here in hope that if someone else is facing the same problem, they are able to solve the issue and enjoy using vscode.
I'm not noticing any performance degradation due to using this fix, but it's a dirty fix nonetheless.
Use->
- Setup the macros as shown in solution section.
- Use
alt+jto move down. - Use
alt+kto move up.
Solution ->
I used macros to setup alternative ways to move up and down which didn't have the code folding issue.
I downloaded this macro plugin : <<< LINK >>>
I included the following setting into settings.json
"macros": {
"vimAltDown" : [
"toggleVim",
"cursorDown",
"toggleVim"
],
"vimAltUp" : [
"toggleVim",
"cursorUp",
"toggleVim"
]
}
I added the following to keybindings.json
{
"command": "macros.vimAltDown",
"key": "alt+j"
},
{
"command": "macros.vimAltUp",
"key": "alt+k"
}
How it works ->
I used the macro library to setup proper macros that would toggle out of vim mode, move the cursor down or up and toggle vim on again.
When vim mode is toggled off, the cursor can move up and down without expanding the code folds.
Request->
If this is suitable for your needs, could you please include the solution in a more official way?
Thanks
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Read issue #1004 first, then compare the requested behavior with the workaround described in settings.json and keybindings.json. The issue names no repository files or tests, so first identify the VSCodeVim entry points for cursor movement and folding. Done means providing an official supported way to move through folded code without expanding it.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript, vscode
- Domain
- developer-experience, tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100