Clearly Emmet abbreviation is a very powerful tool that makes coding very easy in Visual Studio code. Moving a line up/down: We can easily move a line up and down in the Visual Studio Code. This helps us reposition the content with ease. VSCode will move a line up when you use OPT+UPARROW or down when you use OPT+DOWNARROW. # Go to Next Error or Warning When you have multiple errors or warnings, you can visit each of them in the current file using the Go to Next Error or Warning. Press F8 and you will see the first error or warning.
Show file extensions
Before you do anything else in this course, we need to make sure that extensions (e.g., .html
, .zip
, .jpeg
) show up at the ends of files.
If you use a Mac, do the following:
- Click on the Finder.
- Click on Finder > Preferences.
- Click on the Advanced tab.
- Check the box next to Show All Filename Extensions.
- Close the Preferences window.
If you use Windows, please refer to Configuring Windows To Show Extensions & follow those directions.
Install Visual Studio Code (VSCode)
Download Visual Studio Code & install it on your computer.
VSCode settings
When you change the settings in most apps, you click on buttons & check checkboxes & so on. In VSCode (& many other developers’ text editors), you instead edit text files. To change your settings in VSCode, go to Code > Preferences > Settings. The Default Settings are on the left, & your settings (called User Settings) are on the right. To change a setting, copy it from the default on the left, paste it into your settings on the right, make your change, & Save.
I have already created settings for you. To use them, do the following:
- Select Code > Preferences > Settings. A new tab will open in VSCode labeled User Settings, with Default Settings on the left & User Settings on the right.
- Go to VSCode Settings & copy the settings in the VSCode Settings box (everything from — & including! — the first
{
to the last}
. - Go back to VSCode & click in your settings on the right.
- Select all of the content in your settings by pressing ⌘A (Mac) or Ctrl-A (Windows).
- Paste the settings you copied, overwriting what was formerly in your settings.
- Save what you just pasted in.
- Close User Settings by clicking the × on the tab at the top of VSCode.
HTML snippets
VSCode has a fantastic feature (shared by other editors) that allows you to type a few letters (a snippet) & have them expand into code for you. I have created some HTML snippets for you to use, but you have to install them first.
- Select Code > Preferences > User Snippets. The Select Language for Snippet palette will appear.
- Either type
HTML
& press Enter, or click on HTML in the palette. A file namedhtml.json
will open. - Go to VSCode HTML Snippets & copy the snippets in the VSCode HTML Snippets (everything from the first
{
to the last}
, including those characters). - Go back to VSCode & click inside
html.json
. - Select all of the content in
html.json
by pressing ⌘A (Mac) or Ctrl-A (Windows). - Paste the settings you copied, overwriting what was formerly in
html.json
. - Save what you just pasted in.
- Close
html.json
by clicking the × on the tab at the top of VSCode.
Extensions
Now you need to install some necessary extensions. Get to the Extensions View of VSCode in one of the following ways:
- Go to View > Extensions.
- Press ⇧⌘X if you use a Mac & Ctrl+Shift+X if you use Windows.
- On the left side is the Activity Bar, which shows 5 icons running from top to bottom. Click on the bottom icon, which looks like a small square inside another square. If you hover over it, it should say Extensions.
To find an extension, type the name of the extension in the Search box at the top of the Extensions View. You will see a list of extensions that match what you typed. To find out more about an extension, click on it in the list of results. To actually install it, click on the green Install button.
Install the following extensions:
- Auto Complete Tag by Jun Han (which actually installs Auto Close Tag & Auto Rename Tag)
- Bracket Pair Colorizer by CoenraadS
- expand-region by Le Trieu
- File Templates by Bruno Paz
- File Utils by Steffen Leistner
- HTML Snippets by Mohamed Abusaid
- htmltagwrap by Brad Gashler
- Live Server by Ritwick Day
- Path Autocomplete by Mihai Vilcu
- Placeholder Images by Jake Wilson
- Project Manager by Alessandro Fragnani
Go ahead & install these too, but we won’t use them until we get to CSS:
- Autoprefixer by mrmlnc
- Beautify css/sass/scss/less by michelemelluso
- CSS Peek by Pranay Prakash
- HTML CSS Support by ecmel
Themes
I want you to make VSCode into your workspace. One way to do that is to install Color Themes & File Icon Themes. A color theme changes the colors of everything in VSCode, while a file icon theme puts little icons to the left of your files when you are in Explorer View. You install these themes as extensions.
Search for color theme
to see the full list. I suggest searching for these in particular (e.g., color theme monokai
), as they are widely supported by almost all code editors:
- Solarized (both light & dark)
- Soda (weirdly, there aren’t any light Soda themes)
- Monokai (I use Monokai Dark Soda by Adam Caviness myself, as it combines the best of Monokai & Dark Soda)
- Material
- GitHub
- Dracula
To apply your color theme, go to Code > Preferences > Color Theme. The Select Color Theme palette will open. Make your selection & press Return.
Search for icon theme
to see the full list. I suggest looking at one of these:
- Material Icon Theme by Philipp Kief
- vscode-icons by Roberto Huertas (it’s what I use).
To apply your file icon theme, go to Code > Preferences > File Icon Theme. The Select File Icon Theme palette will open. Make your selection & press Return.
Advanced Only
You do not have to do the following, unless you’re feeling super-nerdy or want a challenge.
Emmet
First, let’s set up Emmet.
You must name folders exactly what I tell you in this section!
- In the
Documents
folder on your computer, create a new folder & name itWeb Dev Projects
. - Inside the
Web Dev Projects
folder, create a new folder & name it+emmet
(with the+
). - Now go to Emmet - snippets.json, which should take you to a webpage at GitHubGist titled “rsgranne/Emmet - snippets.json”.
- In the top right you should see a button labeled Download ZIP. Click that, & a zip file should appear in your Downloads folder named with a crazily-long collection of numbers & letters.
- Double click that zip file.
- Move the file named
Emmet - snippets.json
into the+emmet
folder. The way you do that depends on your operating system.- If you’re using a Mac…
- You should see new folder with the same crazily long collection of numbers & letters. Inside that is a file named
Emmet - snippets.json
. - Drag
Emmet - snippets.json
into the+emmet
folder you just created. - Feel free to delete the folder & the zip file with the crazily-long name.
- You should see new folder with the same crazily long collection of numbers & letters. Inside that is a file named
- If you’re using Windows…
- You will probably open a new window that contains a file named
Emmet - snippets.json
. - Drag that file into the
+emmet
folder you just created. - Close the zip window.
- Feel free to delete the folder & the zip file with the crazily-long name.
- You will probably open a new window that contains a file named
- If you’re using a Mac…
Now let’s get VSCode’s settings ready:
- Select Code > Preferences > Settings. A new tab will open in VSCode labeled User Settings, with Default Settings on the left & User Settings on the right.
- You need to make a very important change. Look for the line in the settings file that starts with
emmet.extensionsPath
. Next to it is/Users/YOUR-USER-NAME/Documents/Web Dev Projects/+emmet/
. That needs to be changed.- If you’re using a Mac…
- Open the Finder & select Go > Home. The name at the top of the Finder window or on the tab is your user name.
- Simply replace
YOUR-USER-NAME
with your specific user name.
- If you’re using Windows, you actually need to replace the entire line.
- Go to
C:Users
& you should see your Windows user name. - Replace
/Users/YOUR-USER-NAME/Documents/Web Dev Projects/+emmet/
withC:UsersYOUR-USER-NAMEDocumentsWeb Dev Projects+emmet
(if you placed the+emmet
folder where I told you to above in the Emmet section, this should work for you). - Now replace
YOUR-USER-NAME
with your specific Windows user name that you saw inC:Users
.
- Go to
- If you’re using a Mac…
When consulting this documentation, you can see keyboard shortcuts for the keymap that you use — choose it with the selector at the top of the page:
JetBrains Rider's top keyboard shortcuts
Search Everywhere | Double Shift |
Find Action... | Ctrl+Shift+A |
Open Solution or Project... | Ctrl+Shift+O |
Open File or Folder... | Ctrl+O |
Show Intention Actions | Alt+Enter |
Navigate To... | Alt+` |
Recent Files | Ctrl+Comma |
Find Usages | Shift+F12 |
Select In... | Alt+F1 |
Settings... | Ctrl+Alt+S |
Generate... | Alt+Insert |
Build Solution | Ctrl+Shift+B |
Debug... | Alt+Shift+F9 |
View Breakpoints... | Ctrl+Alt+B |
Attach to Process... | Ctrl+Alt+P |
VCS Operations Popup... | Ctrl+Alt+Q |
Refactor This... | Ctrl+Shift+R |
Inspect This... | Ctrl+Alt+Shift+A |
Reformat Code | Ctrl+Alt+Enter |
Code Cleanup... | Ctrl+E, C |
Basic editing
Cut | Ctrl+X |
Copy | Ctrl+C |
Paste | Ctrl+V |
Paste as Plain Text | Ctrl+Alt+Shift+V |
Paste from History... | Ctrl+Shift+V |
Paste from History... | Ctrl+Shift+V |
Duplicate Line or Selection | Ctrl+D |
Copy Paths | Ctrl+Shift+C |
Copy Reference | Ctrl+Alt+Shift+C |
Save All | Ctrl+Shift+S |
Undo | Ctrl+Z |
Redo | Ctrl+Y |
Indent Selection | Tab |
Unindent Line or Selection | Shift+Tab |
Start New Line | Shift+Enter |
Start New Line Before Current | Ctrl+Enter |
Delete Line | Ctrl+Shift+L |
Toggle Case | Ctrl+Shift+U |
Scratch File | Ctrl+Alt+Shift+Insert |
Open source in new window | Shift+F4 |
Show Whitespaces | Ctrl+R, W |
Soft-Wrap | Ctrl+E, W |
Caret navigation
Move Caret to Previous Word | Ctrl+Left |
Move Caret to Next Word | Ctrl+Right |
Move Caret to Line Start | Home |
Move Caret to Line End | End |
Containing Declaration | Ctrl+[ |
Move Caret to Matching Brace | Ctrl+] |
Move Caret to Code Block Start | Alt+Shift+[ |
Move Caret to Code Block End | Alt+Shift+] |
Next Method | Alt+Down |
Previous Method | Alt+Up |
Move Caret to Page Top | Ctrl+Page Up |
Move Caret to Page Bottom | Ctrl+Page Down |
Page Up | Page Up |
Page Down | Page Down |
Move Caret to Text Start | Ctrl+Home |
Move Caret to Text End | Ctrl+End |
Select text
Select All | Ctrl+A |
Left with Selection | Shift+Left |
Right with Selection | Shift+Right |
Move Caret to Previous Word with Selection | Ctrl+Shift+Left |
Move Caret to Next Word with Selection | Ctrl+Shift+Right |
Move Caret to Line Start with Selection | Shift+Home |
Move Caret to Line End with Selection | Shift+End |
Up with Selection | Shift+Up |
Down with Selection | Shift+Down |
Select Containing Declaration | Ctrl+Shift+[ |
Move Caret to Code Block Start with Selection | Ctrl+Alt+Shift+[ |
Move Caret to Code Block End with Selection | Ctrl+Alt+Shift+] |
Move Caret to Page Top with Selection | Ctrl+Shift+Page Up |
Move Caret to Page Bottom with Selection | Ctrl+Shift+Page Down |
Page Up with Selection | Shift+Page Up |
Page Down with Selection | Shift+Page Down |
Move Caret to Text Start with Selection | Ctrl+Shift+Home |
Move Caret to Text End with Selection | Ctrl+Shift+End |
Extend Selection | Ctrl+Alt+Right |
Shrink Selection | Ctrl+Alt+Left |
Add Selection for Next Occurrence | Alt+Shift+. |
Coding assistance
Show Intention Actions | Alt+Enter |
Basic Completion | Ctrl+Space |
Smart Completion | Ctrl+Alt+Space |
Second Basic Completion | Alt+Shift+Space |
Complete Current Statement | Ctrl+Shift+Enter |
Reformat Code | Ctrl+Alt+Enter |
Parameter Info | Ctrl+Shift+Space |
Quick Documentation | Ctrl+Shift+F1 |
Move Statement Up | Ctrl+Alt+Shift+Up |
Move Statement Down | Ctrl+Alt+Shift+Down |
Move Element Left | Ctrl+Alt+Shift+Left |
Move Statement Right | Ctrl+Alt+Shift+Right |
Move Line Up | N/A |
Move Line Down | N/A |
Comment with Line Comment | Ctrl+Alt+/ |
Comment with Block Comment | Ctrl+Shift+/ |
Generate... | Alt+Insert |
Code Cleanup... | Ctrl+E, C |
Silent Code Cleanup | Ctrl+E, F |
Context navigation
Next Method | Alt+Down |
Previous Method | Alt+Up |
Go to Line/Column... | Ctrl+G |
Switcher | Ctrl+Tab |
Select In... | Alt+F1 |
Locate/Select in Solution View | Alt+Shift+L |
Recent Files | Ctrl+Comma |
Recently Changed Files | Ctrl+Shift+Comma |
Last Edit Location | Ctrl+Shift+Backspace |
Back | Ctrl+Minus |
Forward | Ctrl+Shift+Minus |
Select Next Tab | Alt+Right |
Select Previous Tab | Alt+Left |
Show Bookmarks | Ctrl+` |
Toggle Bookmark | Ctrl+K, K |
Toggle Bookmark with Mnemonic | Ctrl+F11 |
Add to Favorites | Alt+Shift+F |
Show Favorites window | Alt+2 |
Show Structure window | Ctrl+Alt+F |
Show Find window | Alt+3 |
What Is Visual Studio Code
Find everything
Search Everywhere | Double Shift |
Find... | Ctrl+F |
Find Next / Move to Next Occurrence | F3 |
Find Previous / Move to Previous Occurrence | Shift+F3 |
Replace... | Ctrl+H |
Find in Files... | Ctrl+Shift+F |
Replace in Files... | Ctrl+Shift+H |
Next Occurrence of the Word at Caret | Ctrl+F3 |
Go to File... | Ctrl+Shift+T |
File Member | Alt+ |
Go to Symbol... | Ctrl+Alt+Shift+T |
Find Action... | Ctrl+Shift+A |
Navigate from symbols
Navigate To... | Alt+` |
Find Usages | Shift+F12 |
Go to Declaration or Usages | F12 |
Go to Type Declaration | Ctrl+Shift+F11 |
Show Usages | Alt+Shift+F12 |
Go to Super Method | Alt+Home |
Go to Implementation(s) | Ctrl+F12 |
Go to Super Derived Symbols | Alt+End |
Highlight Usages in File | Alt+Shift+F11 |
Code analysis
Show Intention Actions | Alt+Enter |
Next Code Issue | Alt+Page Down |
Previous Code Issue | Alt+Page Up |
Next Error | Alt+Shift+Page Down |
Previous Error | Alt+Shift+Page Up |
Toggle Code Inspection | Ctrl+Alt+Shift+8 |
Run Inspection by Name... | Ctrl+Alt+Shift+I |
Inspect This... | Ctrl+Alt+Shift+A |
Show Errors in Solution window | Ctrl+Alt+2 |
Show Inspection Results window | Ctrl+Alt+4 |
Build, Run, Debug
NuGet Quick List | Alt+Shift+N |
Build Solution | Ctrl+Shift+B |
Build Current Project | Ctrl+Shift+F7 |
Cancel Build | Ctrl+F9 |
Run context configuration | Ctrl+F5 |
Run... | Ctrl+Alt+Shift+R |
Debug context configuration | Alt+F5 |
Debug... | Alt+Shift+F9 |
Attach to Process... | Ctrl+Alt+P |
Stop | Shift+F5 |
Pause | Ctrl+Alt+Break |
Resume Program | F5 |
Stop Background Processes... | Ctrl+Shift+F2 |
Step Over | F10 |
Force Step Over | Alt+Shift+F8 |
Step Into | F11 |
Smart Step Into | Shift+F7 |
Force Step Into | Alt+F11 |
Step Out | Shift+F11 |
Run To Cursor | Ctrl+F10 |
Force Run To Cursor | Ctrl+Alt+F9 |
Skip to Cursor | Ctrl+Shift+F10 |
Show Execution Point | Alt+NumPad * |
Evaluate Expression... | Shift+F9 |
Quick Evaluate Expression | Ctrl+Alt+F8 |
Toggle Line Breakpoint | F9 |
Toggle Temporary Line Breakpoint | Ctrl+Alt+Shift+F8 |
Toggle Breakpoint Enabled | Ctrl+F9 |
View Breakpoints... | Ctrl+Alt+B |
Edit Breakpoint | Alt+F9 |
Show Build window | Alt+0 |
Show Run window | Alt+4 |
Show Debug window | Alt+5 |
Show NuGet window | Alt+7 |
Visual Studio Copy Line Down
Refactorings
Refactor This... | Ctrl+Shift+R |
Rename... | Ctrl+R, R |
Change Signature... | Ctrl+R, S |
Inline... | Ctrl+R, I |
Move... | Ctrl+R, O |
Extract Method... | Ctrl+R, M |
Introduce Field... | Ctrl+R, F |
Introduce Parameter... | Ctrl+R, P |
Introduce Variable... | Ctrl+R, V |
Safe Delete... | Ctrl+R, D |
Global VCS actions
VCS Operations Popup... | Ctrl+Alt+Q |
Commit... | Ctrl+Alt+K |
Update Project | Ctrl+Alt+W |
Rollback | Ctrl+Alt+Z |
Push... | Ctrl+Shift+K |
Next Change | Ctrl+Alt+Shift+N |
Previous Change | Ctrl+Alt+Shift+P |
Show Version Control window | Alt+9 |
Show Commit window | N/A |
Unit Testing
Unit Testing Quick List... | Alt+Shift+U |
Run Unit Tests | Ctrl+U, R |
Debug Unit Tests | Ctrl+U, D |
Stop Execution | Ctrl+U, S |
Repeat Previous Run | Ctrl+U, U |
Rerun Failed Tests | Ctrl+U, F |
Run Tests Until Failure | Ctrl+U, W |
Run All Tests from Solution | Ctrl+U, L |
Create New Session | Ctrl+U, N |
Append Tests to Session | Ctrl+U, A |
Run Current Session | Ctrl+U, Y |
Run Unit Tests under dotMemory Unit | Ctrl+U, M |
Run Selected Tests | Shift+Enter |
Debug Selected Tests | Ctrl+D |
Run Current Session (Tool Window) | Ctrl+Y |
Create New Session (Tool Window) | Alt+Shift+Insert |
Append Tests to Session (Tool Window) | Ctrl+Alt+Insert |
Remove Selected Tests (Tool Window) | Delete |
Run All Tests from Solution (Tool Window) | Ctrl+L |
Show Unit Tests window | Alt+8 |
How To Download Visual Studio Code
Tool Windows
Hide Active Tool Window | Shift+Escape |
Hide All Tool Windows | Ctrl+Shift+F12 |
Jump to Last Tool Window | Ctrl+Alt+Backspace |
Show Solution window | Ctrl+Alt+L |
Show Favorites window | Alt+2 |
Show Find window | Alt+3 |
Show Run window | Alt+4 |
Show Debug window | Alt+5 |
Show Structure window | Ctrl+Alt+F |
Show Services window | N/A |
Show Version Control window | Alt+9 |
Show Commit window | N/A |
Show Build window | Alt+0 |
Show Errors in Solution window | Ctrl+Alt+2 |
Show Inspection Results window | Ctrl+Alt+4 |
Show NuGet window | Alt+7 |
Show Unit Tests window | Alt+8 |
Show Terminal window | Ctrl+Alt+1 |
Show Database window | Ctrl+Alt+3 |