开发者

Is there a Visual Studio equivalent of Vim scrolloff or Emacs scroll-margin?

Is there a standard option built into Visual Studio to act like the Vim scro开发者_Python百科lloff option or the Emacs scroll-margin option?

The aim is for Visual Studio to always show at least x lines above and below the current point.


If you hold control when you use the arrow key for up/down, it'll scroll the text up/down without moving the cursor.

Also, there is a command called Edit.ScrollLineCenter which you can search for under tools/options/environment/keyboard & assign a hotkey to it.


I only know of the "Split View" feature in Visual Studio

As in http://msdn.microsoft.com/en-us/library/z01zks9a(v=vs.71).aspx it says:

Splitting the View

A Code Editor can be split into two separate parts for easier editing.

To split a pane

  1. Click the splitter bar (located above the scroll bar).
  2. Drag the splitter bar downward.
  3. To go back to a single pane, double-click the splitter bar dividing the two panes.

The new pane contains the same document, and any changes made to it are reflected in the other pane as long as that pane displays the same place in the document.

You can additionaly open a file in a new window (Menu Window>New Window) and dock it next to the original window to view additional different parts of that file simultaneously as in http://msdn.microsoft.com/en-us/library/z4y0hsax(v=VS.90).aspx

Tiling Document Windows

If you want to view more than one document at a time while editing code, you can tile the document windows.

To tile document windows

If the IDE is running in Tabbed documents mode, select a tab and drag it below or above the current document tile. A rectangular outline appears in the location where the new document tile will be placed.

Some screenshots for both options: http://www.kevinwilliampang.com/2008/08/19/visual-studio-tip-split-views/

Update:

Does navigating with Ctrl+ / Ctrl+ inside the editor window help you?


In short: No there isn't.

Longer: No there isn't any that I am aware of. But there should be. Search the extensions and please report back.


Way old answer, but anyway: there's an option now. Open UI Settings and search for Cursor Surrounding Lines. That's exactly what vim's scrolloff is.


You can add editor.cursorSurroundingLines to your settings.json

e.g

"editor.cursorSurroundingLines": 8,
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜