Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 scrolloff 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.

like image 621
Rich Avatar asked Aug 12 '10 17:08

Rich


2 Answers

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.

like image 61
Devin Garner Avatar answered Oct 25 '22 18:10

Devin Garner


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?

like image 30
oleschri Avatar answered Oct 25 '22 19:10

oleschri