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

Please add support for scrolloff #1427

Closed
Tobbe opened this issue Mar 25, 2017 · 12 comments
Closed

Please add support for scrolloff #1427

Tobbe opened this issue Mar 25, 2017 · 12 comments

Comments

@Tobbe
Copy link

Tobbe commented Mar 25, 2017

Please add support for the vim setting scrolloff

Thanks! :)

@Chillee
Copy link
Member

Chillee commented Apr 24, 2017

This seems like more of a VSCode thing than for us.

Relevant: microsoft/vscode#12048

@Tobbe
Copy link
Author

Tobbe commented Apr 24, 2017

Could this be implemented in VSCodeVim while waiting for native support in VSCode?

@Chillee
Copy link
Member

Chillee commented May 19, 2017

@Tobbe Seems unlikely to me. VSCode exposes almost nothing about the view window to us. The only way we can even interact with the viewport (for commands like zt for example) is through the API's VSCode provides us.

@bendman
Copy link

bendman commented Jul 14, 2017

There is a scrolloff extension, but at least locally it breaks some vim functionality (ctrl-d and ctrl-u commands only move one line, for example) and causes a flash before adjusting the scroll position.

@girishpattabiraman
Copy link

The feature is supported in Visual Studio with VSVIM. Why does it not work on VSCode?

@jpoon
Copy link
Member

jpoon commented Nov 8, 2018

The feature is supported in Visual Studio with VSVIM

This argument comes up more often than it should. Visual Studio/VSCode are both editors maintained by Microsoft and VSVim/VSCodeVim are both VIM emulator plugins, but that is where the commonality ends. Visual Studio+VSVim and VSCode+VSCodeVim are different projects with different code bases supported by different teams/communities.

Contributions are more than welcome to add this support to vscodevim; however, as argued in microsoft/vscode#12048, it'd be great to push these requirements down to vscode so that non-vim users would benefit, so please upvote that issue. Have you tried using https://github.com/TickleForce/vscode-scrolloff? Or maybe in vscodevim, we can integrate with the vscode-scrolloff extension.

@folksgl
Copy link

folksgl commented Nov 16, 2018

There are always other extensions that can help get this functionality. I use VSCodeVim for a lot of things, but when I needed scrolloff, I found another extension.
https://marketplace.visualstudio.com/items?itemName=tickleforce.scrolloff

@trkoch
Copy link
Contributor

trkoch commented Dec 5, 2018

For the record, I've tried scrollof, but it did not have any effect on zt (only zb).

@trkoch
Copy link
Contributor

trkoch commented Dec 5, 2018

After taking another look, I noticed scrollof offsets after moving up or down. Here is how I hacked it to work as intended.

    "vim.normalModeKeyBindingsNonRecursive": [
       {
            "before": ["z", "t"],
            "after": ["z", "t", "j", "k"]
        },
        {
            "before": ["z", "b"],
            "after": ["z", "b", "j", "k"]
        }
    ],

Obviously this is very messy and could cause all sorts of other issues. I don't know where to fix this?

@J-Fields
Copy link
Member

J-Fields commented Aug 2, 2019

This is addressed, as best as possible, in #3940. If you're waiting on this feature, it'd be very helpful if you checked out that branch and did some manual testing. Thanks!

@rebornix
Copy link
Member

rebornix commented Aug 12, 2019

It's already implemented in VS Code and the setting for this feature is editor.cursorSurroundingLines. Besides, it doesn't require any code change from the Vim extension. I'll suggest to close this issue.

@J-Fields
Copy link
Member

@rebornix Thanks, I chose the wrong time to tackle this one 🙂

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

Successfully merging a pull request may close this issue.

9 participants