Skip to content
| Marketplace
Sign in
Visual Studio>Tools>AltKeyboardModes
AltKeyboardModes

AltKeyboardModes

mariasm

|
213 installs
| (1) | Free
Additional keyboard layers and editor commands
Download

AltKeyboardModes

Additional keyboard modes to Visual Studio code editor windows. A bit like in Vim, you can map keys to commands in these new modes.

The extension adds new editor commands like goto next identifier, pop browse context, goto constructor etc.

How to use

  • Press Alt+Space to switch to Alt1 mode (or press twice left Shift)
  • Press Shift+Space to switch to Alt2 mode (or press twice right Shift)
  • Press Space to go back to normal mode
  • Press Enter to switch between Alt modes

Using alt modes makes some common tasks easier. For example if you want to surround current line with an if block, press

  • Shift+Space (Activate alt2 mode)
  • d (Select current line)
  • : (Surround with... + Go back to normal mode)

instead of

  • Home (Go to the beginning of current line)
  • Shift+End (Extend the selection to the end of current line)
  • Ctrl+k, Ctrl+s (Surround with...)

If you want to execute the same command multiple times, just type the muliplier first: e.g. 4i in Alt1 mode moves the caret up by 4 lines.

Change log

  • 1.10.2
    • Bug fixes

-1.9.8

  • Minor fixes around compatibility issues with 2019.3

  • 1.9.7

    • Go to members (m): Listing all members when popping up (not only when at least a character is typed)
    • Go to public members (mp): Only public members are listed (C# specific)
    • Go to members/all (if Current document is selected) 'ctor' lists the constructors defined in the file (C# specific)
    • GoToContainingSymbol command goes up to the namespace definition
  • 1.9.1

    • Major refactoring
    • VS 2019 support
    • Bug fixes
  • 1.7.5

    • Minimum supported version: 2017.8.6
    • Goto breakpoint provider
    • Goto open files provider
    • Goto pending files provider
    • Next/Previous Identifier
    • Next/Previous Name
    • Goto constructor
    • Goto containing identifier
    • Fixed block commands
    • Visual indicator for incorrect bindings in quick review panel
    • Using normal keyboard mode always if multiple carets are enabled
    • Naming changes: Many commands prefixed with AltCommands. Existing users may need to save/load/edit settings from Tools->Options->Altkeyboard->Alt1/2 schema right click menu
    • Workaround/hack to fix Next/Previous Location (F8/shift+F8) commmand in Find all refernces window doesn't handle the focus properly
    • Small changes in command mappings
  • 1.0

    • Pop browse context command
    • Search box in Quick review window
    • Show Quick review command (bound to F4)
    • Fixed inline rename behavior
    • New default keyboard binding for Alt1Mode and Alt2Mode (Alt+Space, Shift+Space)
    • Small changes in Alt1/2 default mappings
  • 0.9 Initial release

Command mappings

Quick review panel

To review the currently active Alt mode's command mappings press F4. It pops up a quick view panel.

prev3__2.gif

  • Press Esc to close the panel
  • Press Enter to open the mapping settings page
  • If you press any key the given entry starts blinking in the panel
  • Press Ctrl+F to activate the filter
  • Press Ctrl+C to take a screenshot of the control and copy it to the clipboard
Settings panel

To customize the bindings press both Shifts same time (Or press Enter in the review panel) The Alt1/Alt2 settings panel will be opened (Tools->Options->Alt Keyboard->Alt1/Alt2 schema)

  • Right click menu to save, load settings. Mode mappings can be persisted into simple pipe delimited files. The mapping can be set to its default any time.
  • CTRL+Space to pop up the completion window, TAB or Enter to commit the selection, Esc to close the completion window.
  • To specify a composite command, use ; (semicolon) to separate the individual commands. e.g. Edit.LineStart;Edit.LineEndExtend;Edit.MakeUppercase will convert all the characters in the current line to uppercase.

New VS commands

  • State transition commands

    • AltKeyboard.Alt1Mode
    • AltKeyboard.Alt2Mode
    • AltKeyboard.ToggleAltMode
    • AltKeyboard.BackToNormalMode
  • C# specific commands csharpcommands__2.gif

    • AltCommands.Next/PreviousIdentifier
    • AltCommands.Next/PreviousName
    • AltCommands.GoToConstructor
    • AltCommands.GoToContainingSymbol
  • Goto providers and commands navigateto__2.gif

    • AltCommands.Next/GoToPendingFile
    • AltCommands.Next/GoToOpenFile
    • AltCommands.Next/GoToBreakpoint
  • Regex based navigation commands These commands find the next/prev match of the given regular expression and may extend the selection as well. The regexes can be set in Tools->Options->AltKeyboard->General

    • AltCommands.Nav1[Next|Prev|NextExt|PrevExt]
    • AltCommands.Nav2[Next|Prev|NextExt|PrevExt]
    • AltCommands.Nav3[Next|Prev|NextExt|PrevExt]
    • AltCommands.Nav4[Next|Prev|NextExt|PrevExt]
  • Block navigation command. Continuous series of significant lines of code considered a block. A code line is insignificant if it is empty, commented out or consists of only punctuation.

    • AltCommands.StartOfBlock
    • AltCommands.EndOfBlock
    • AltCommands.StartOfBlockExt
    • AltCommands.EndOfBlockExt
  • Hump (subword) navigation commands

    • AltCommands.NextHump
    • AltCommands.PrevHump
    • AltCommands.NextHumpExt
    • AltCommands.PrevHumpExt
  • Line selection commands

    • AltCommands.SelectLineDown
    • AltCommands.SelectLineUp
  • Misc selection related commands

    • AltCommands.WidenSelection Widening selection by 1 char on both ends
    • AltCommands.ShrinkSelection Shrinking selection by 1 char on both ends
    • AltCommands.ToggleSelectMode Switching between stream and rectangular selection mode
  • Other Commands

    • AltCommands.PopBrowseContext This command is optimazied away from VS2015/2017 C# service. More info about this handy command
    • AltCommands.ToggleNavBar Switching on/off navigation bar in the editor
    • AltCommands.ToggleSplitPanel Switching between horizontal and vertical arrangement of the split panes in the editor. In case of a 16:9 screen the default vertical layout is not always ideal split__2.gif

General Settings

  • Global Alt mode If it is set all editors share the same mode. (Eg. if you switch to Alt1 mode all editors will be in Alt1 mode)

  • Log command execution Executed commands are printed out in the output window

  • Override GOTO commands If set to true Goto Members session starts always in current document context. The other GOTO commands use the whole solution context. Credits: https://vlasovstudio.com/visual-commander/commands.html

Known limitations

This extension was tested against the C# editor. Theoretically it should work same way with other editors but I have no experience. I found the following issues

  • It looks Resharper forcibly captures ; and $ characters If R# is enabled commands which are mapped to these chars won't be executed. (C#)
  • Read-only peek definition views are not supported The mapped commands in Alt modes won't be executed at all
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft