To go to a line in the file, you use ctrl + g, then type a line number.
We can simply use Ctrl+Shift+P in windows and ⇧⌘P(Command + Shift+ P) for mac to open command Palette.
VS Code Open Command PaletteĬtrl+Shift+P : The command palette is very useful in VS Code. If we have moved from one location to another we can use the keyboard sequence Ctrl+– to move to the previous location and then you can return using Ctrl+Shift+–. When we have multiple files open at the same time, we might need a way to quickly move back and forth between two or three different locations in your code. VS Code Navigate Forward/Backward Ctrl+–/Ctrl+Shift+– You can mac shortcut for same in above table. For Block Comment, we can select lines of code and use Shift+Alt+A. We can select a block of code and use the key sequence Ctrl+K+C, it will comment out the section of code. In vscode many time we have to comment/uncomment the line of code or block of code from time to time. VS Code shortcuts vs code comment shortcut Select all occurrences of current selection Here is VS Code Keyboard Shortcuts for Windows, Mac and linux Command Action
Select all occurrences of Find match: Alt+Enter.To open Keyboard Shortcuts: Ctrl+K Ctrl+S.To Close window or instance: Ctrl+Shift+W.New visual code window or instance: Ctrl+Shift+N.To Show Command Palette: Ctrl+Shift+P, F1.Here is list of VS Code Keyboard Shortcuts: Here in this post, we will see some keyboard shortcuts for visual studio code which might help in increasing productivity for developers. Visual Studio Code can be used with many programming languages. This editor has easy-to-install extensions for syntax highlighting, code completion, and more. It’s free, open-source, and available for Windows, Linux, and macOS. Visual Studio Code is the go-to code editor for Salesforce developers. VS Code Navigate Forward/Backward Ctrl+–/Ctrl+Shift+–.I have only covered the ones that I use the most. There are a lot more shortcuts that are set in Visual Studio. Note: Assumes Visual Studio keyboard layout Note: Assumes Visual Studio keyboard layout for Resharper Name If you have Resharper there are several additional options that you get for searching. If you have Visual Studio 2013 and below, you can use use the Visual Studio extension, Layouts O Rama Resharper Searching/Navigation There is also a shortcut key for each of the saved Windows layouts. To Apply Layout: In Visual Studio 2015, under the Windows menu, select the Apply Windows layout popout and pick the layout to apply.To Save: In Visual Studio 2015, under the Windows menu, click the Save Windows Layout.In Visual Studio 2015, you can now save the Windows Layout and change them with a shortcut key. Modify what the debugger displays for an object Run to Cursor and then stop like there is a breakpoint on that line
Open a file and Ctrl+Alt+\ to run the the code analysis for the project.Set shortcut for Build.RunCodeAnalysisonSelection.To accomplish this, I set the keyboard shortcut Ctrl+Alt+\ You can also run code analysis on the current project like you can on the whole solution. Open a file and Ctrl+\ should now build that project.Tools -> Options -> Keyboard or Ctrl + Q, type Keyboard, and hit Enter.To accomplish this, I set the keyboard shortcut Ctrl + \.
You can go under the Build menu and select to build just the current project but this is a manual step that requires you to navigate through the menus. There is no default shortcut for building the current project or running code analysis on it. Here is a list of Visual Studio Community Edition shortcuts that I use.