Open Shubhamsm opened 4 years ago
As an alternative, use L
, H
if you have set "editor.cursorSurroundingLines": 3
, or use native vscode command scrollLineDown
, scrollPageDown
.
VSCode v1.50.1, VsCodeVim v1.17.1 on Windows 10, I see the same behavior as @Shubhamsm and the problem also occurs with ctrl-f and ctrl-b.
This is more or less a duplicate of #5088, see this comment
Thanks for the update. Good enough for me. Too bad VSCode isn't being friendly wrt folds. Carrying on.
Is there any way we can fix this at the current stage of vscode? Does anyone know if there has been improvements in the fold api?
yeah, this drove me crazy. Avoided using code because of it. But I wrote an extension to solve it.
ctrl+d half page scroll vscode scrollPageDown hole page scroll How about use vscode scrollPageDown to handle ctrl+d
{ "vim.normalModeKeyBindingsNonRecursive": [ { "before": [ "<C-d>" ], "commands": [ "scrollPageDown" ] }, { "before": [ "<C-u>" ], "commands": [ "scrollPageUp" ] } ],
}
@prophetw
This unfortunately does not move your cursor but just the view which is not the same behavior.
@uloco You're right! So at last i do some tricks like this
{
"before": [
"<C-d>"
],
"after": [
"1",
"5",
"g",
"j",
"z",
"z",
]
},
{
"before": [
"<C-u>"
],
"after": [
"1",
"5",
"g",
"k",
"z",
"z"
]
},
@uloco You're right! So at last i do some tricks like this
...
This is awesome!
@uloco You're right! So at last i do some tricks like this
{ "before": [ "<C-d>" ], "after": [ "1", "5", "g", "j", "z", "z", ] }, { "before": [ "<C-u>" ], "after": [ "1", "5", "g", "k", "z", "z" ] },
This is actually better than the native implementation of
yeah, this drove me crazy. Avoided using code because of it. But I wrote an extension to solve it.
This ext actually solves the issue and perhaps solution could inspired.
@uloco You're right! So at last i do some tricks like this
{ "before": [ "<C-d>" ], "after": [ "1", "5", "g", "j", "z", "z", ] }, { "before": [ "<C-u>" ], "after": [ "1", "5", "g", "k", "z", "z" ] },
Its 2023 and this solution is simple and cleanest
Its 2023 and this solution is simple and cleanest
Not for me. This won't get relative half page and full page sizes like the extension or native solution would do. You could count the lines manually and try do add it but it would get verbose and stop working correctly as soon as you change your zoom level or work on another device or with another VSCode window size.
I'm using the german scroll extension which is simpler and cleaner. You maybe wanted to go too simple here @OkkarMin
Genious!
for all who struggle with this issue like me install these extensions:
https://github.com/tobealive/german-scroll.code (thanks @ttytm for a great extension)
https://marketplace.visualstudio.com/items?itemName=kaiwood.center-editor-window
then add these to vscode setting
"vim.normalModeKeyBindingsNonRecursive": [
{
"before": ["<C-u>"],
"commands": ["germanScroll.bertholdUp", "center-editor-window.center"]
},
{
"before": ["<C-d>"],
"commands": ["germanScroll.bertholdDown", "center-editor-window.center"]
}]
@uloco You're right! So at last i do some tricks like this
...
Without zz works better for me, tysm<3
"vim.normalModeKeyBindingsNonRecursive": [
{
"before": ["<C-d>"],
"after": ["1", "5", "g", "j"]
},
{
"before": ["<C-u>"],
"after": ["1", "5", "g", "k"]
}
],
Nice thanks everybody ended up doing this:
{
"before": [
"<C-d>"
],
"after": [
"1", "2", "g", "j"
]
},
{
"before": [
"<C-u>"
],
"after": [
"1", "2", "g", "k"
]
},
{
"before": [
"<C-f>"
],
"after": [
"2", "5", "g", "j"
]
},
{
"before": [
"<C-b>"
],
"after": [
"2", "5", "g", "k"
]
}
Describe the bug
Navigating using Ctrl-D Ctrl-U not working when code is folded cursor stucks there when it encounters a folded code
Environment (please complete the following information):