Search code examples
c#visual-studiovisual-studio-2015vsvim

What are the key bindings for scrolling through an intellisense list in Visual Studio 2015?


What are the key bindings (hot keys) for scrolling through an intellisense list in VS 2015?

For example, in the following say I want to scroll down to "Ceil":

enter image description here

I've tried the arrow keys, pgup/pgdown, Alt-n/Alt-p, Tab, the arrow keys on Numpad with no success. It would be nice to be able to scroll a line at a time, as well as a "page" at a time.

Note: I am using the VsVim extension, so maybe this is the problem? (although I have tried vi-ish keystrokes like "j", "k", "ctrl-j", "ctrl-k" to no effect)

My apologies if this is an obvious question, but I can't find any info about it anywhere, including under

Tools->Options->Environment->Keyboard.

The mouse works of course, but since I'm a vi user I really don't want to take my hands off the keyboard.

Many Thanks.


Solution

  • After three days of receiving no answer, I assumed the answer was not obvious. So I decided to look further on my own. While I was still unable to find any "official" key bindings, I was able to figure out what the problem was, and how to map the keys on my own.

    First off, this is only a problem with the VsVim plugin installed. With this plugin disabled, the arrow keys, and pgup/pgdown work as expected. Also, I noticed that even with VsVim enabled the pgup/pgdown is scrolling the list a page at a time. I swear this wasn't working before, but at least now that appears to be working.

    I also discovered a few properties of Intellisense that alleviate the need for scrolling. First, intellisense is pretty good about presenting contexutally aware highlighting. For instance, on Mathf I select PI a lot. So whenever I dropdown on MathF, it starts with 'PI'. This somewhat alleviates the need to scroll around looking for something. Second, I also discovered that if you're presented with a choice of Atan and Atan2, for instance, you can logically scroll to Atan2 by typing A2 and then tab completing (instead of having to type out 'Atan2'). So there are ways to logically select certain entries by typing contextual "hot keys" to logicially home in on your "target".

    But still, there are lots of use cases where you simply want to scroll a line a time. I noticed that the arrow keys didn't work at all in VsVim -- even when you're just scrolling around the text. I decided I just needed to map the up/down arrows myself using Visual Studio.

    To make a long story short, I mapped Alt-j to Edit.LineDown and Alt-k to Edit.LineUp. You can either do this at the texteditor level, or the global level. I just did it at the global level, since Alt-j and Alt-k are not in use by anything else, but if you're mapping a "popular" key binding you can restrict it to just Text editor mode as well.

    Do this like so:

    1. Goto Tools->Options->Environment->Keyboard.
    2. Search for key commands containing down.
    3. Map Edit.LineDown to your specified key.
    4. Do the same thing for Edit.LineUp.

    Here is a screen print: enter image description here

    Now I can use the vi-friendly Alt-j and Alt-k to scroll through the list. This is even better than the arrow keys because I can leave my fingers on the home row. Yay!