Visual Studio Code Move Line Up



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:

  1. Click on the Finder.
  2. Click on Finder > Preferences.
  3. Click on the Advanced tab.
  4. Check the box next to Show All Filename Extensions.
  5. 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:

  1. 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.
  2. Go to VSCode Settings & copy the settings in the VSCode Settings box (everything from — & including! — the first { to the last }.
  3. Go back to VSCode & click in your settings on the right.
  4. Select all of the content in your settings by pressing ⌘A (Mac) or Ctrl-A (Windows).
  5. Paste the settings you copied, overwriting what was formerly in your settings.
  6. Save what you just pasted in.
  7. Close User Settings by clicking the × on the tab at the top of VSCode.

HTML snippets

Code

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.

  1. Select Code > Preferences > User Snippets. The Select Language for Snippet palette will appear.
  2. Either type HTML & press Enter, or click on HTML in the palette. A file named html.json will open.
  3. Go to VSCode HTML Snippets & copy the snippets in the VSCode HTML Snippets (everything from the first { to the last }, including those characters).
  4. Go back to VSCode & click inside html.json.
  5. Select all of the content in html.json by pressing ⌘A (Mac) or Ctrl-A (Windows).
  6. Paste the settings you copied, overwriting what was formerly in html.json.
  7. Save what you just pasted in.
  8. 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.

Visual Studio Code Move Line Up

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!

  1. In the Documents folder on your computer, create a new folder & name it Web Dev Projects.
  2. Inside the Web Dev Projects folder, create a new folder & name it +emmet (with the +).
  3. Now go to Emmet - snippets.json, which should take you to a webpage at GitHubGist titled “rsgranne/Emmet - snippets.json”.
  4. 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.
  5. Double click that zip file.
  6. Move the file named Emmet - snippets.json into the +emmet folder. The way you do that depends on your operating system.
    1. If you’re using a Mac…
      1. You should see new folder with the same crazily long collection of numbers & letters. Inside that is a file named Emmet - snippets.json.
      2. Drag Emmet - snippets.json into the +emmet folder you just created.
      3. Feel free to delete the folder & the zip file with the crazily-long name.
    2. If you’re using Windows…
      1. You will probably open a new window that contains a file named Emmet - snippets.json.
      2. Drag that file into the +emmet folder you just created.
      3. Close the zip window.
      4. Feel free to delete the folder & the zip file with the crazily-long name.

Now let’s get VSCode’s settings ready:

  1. 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.
  2. 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.
    1. If you’re using a Mac…
      1. Open the Finder & select Go > Home. The name at the top of the Finder window or on the tab is your user name.
      2. Simply replace YOUR-USER-NAME with your specific user name.
    2. If you’re using Windows, you actually need to replace the entire line.
      1. Go to C:Users & you should see your Windows user name.
      2. Replace /Users/YOUR-USER-NAME/Documents/Web Dev Projects/+emmet/ with C: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).
      3. Now replace YOUR-USER-NAME with your specific Windows user name that you saw in C:Users.

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 EverywhereDouble Shift
Find Action...Ctrl+Shift+A
Open Solution or Project...Ctrl+Shift+O
Open File or Folder...Ctrl+O
Show Intention ActionsAlt+Enter
Navigate To...Alt+`
Recent FilesCtrl+Comma
Find UsagesShift+F12
Select In...Alt+F1
Settings...Ctrl+Alt+S
Generate...Alt+Insert
Build SolutionCtrl+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 CodeCtrl+Alt+Enter
Code Cleanup...Ctrl+E, C

Basic editing

CutCtrl+X
CopyCtrl+C
PasteCtrl+V
Paste as Plain TextCtrl+Alt+Shift+V
Paste from History...Ctrl+Shift+V
Paste from History...Ctrl+Shift+V
Duplicate Line or SelectionCtrl+D
Copy PathsCtrl+Shift+C
Copy ReferenceCtrl+Alt+Shift+C
Save AllCtrl+Shift+S
UndoCtrl+Z
RedoCtrl+Y
Indent SelectionTab
Unindent Line or SelectionShift+Tab
Start New LineShift+Enter
Start New Line Before CurrentCtrl+Enter
Delete LineCtrl+Shift+L
Toggle CaseCtrl+Shift+U
Scratch FileCtrl+Alt+Shift+Insert
Open source in new windowShift+F4
Show WhitespacesCtrl+R, W
Soft-WrapCtrl+E, W

Caret navigation

Move Caret to Previous WordCtrl+Left
Move Caret to Next WordCtrl+Right
Move Caret to Line StartHome
Move Caret to Line EndEnd
Containing DeclarationCtrl+[
Move Caret to Matching BraceCtrl+]
Move Caret to Code Block StartAlt+Shift+[
Move Caret to Code Block EndAlt+Shift+]
Next MethodAlt+Down
Previous MethodAlt+Up
Move Caret to Page TopCtrl+Page Up
Move Caret to Page BottomCtrl+Page Down
Page UpPage Up
Page DownPage Down
Move Caret to Text StartCtrl+Home
Move Caret to Text EndCtrl+End

Select text

Select AllCtrl+A
Left with SelectionShift+Left
Right with SelectionShift+Right
Move Caret to Previous Word with SelectionCtrl+Shift+Left
Move Caret to Next Word with SelectionCtrl+Shift+Right
Move Caret to Line Start with SelectionShift+Home
Move Caret to Line End with SelectionShift+End
Up with SelectionShift+Up
Down with SelectionShift+Down
Select Containing DeclarationCtrl+Shift+[
Move Caret to Code Block Start with SelectionCtrl+Alt+Shift+[
Move Caret to Code Block End with SelectionCtrl+Alt+Shift+]
Move Caret to Page Top with SelectionCtrl+Shift+Page Up
Move Caret to Page Bottom with SelectionCtrl+Shift+Page Down
Page Up with SelectionShift+Page Up
Page Down with SelectionShift+Page Down
Move Caret to Text Start with SelectionCtrl+Shift+Home
Move Caret to Text End with SelectionCtrl+Shift+End
Extend SelectionCtrl+Alt+Right
Shrink SelectionCtrl+Alt+Left
Add Selection for Next OccurrenceAlt+Shift+.

Coding assistance

Show Intention ActionsAlt+Enter
Basic CompletionCtrl+Space
Smart CompletionCtrl+Alt+Space
Second Basic CompletionAlt+Shift+Space
Complete Current StatementCtrl+Shift+Enter
Reformat CodeCtrl+Alt+Enter
Parameter InfoCtrl+Shift+Space
Quick DocumentationCtrl+Shift+F1
Move Statement UpCtrl+Alt+Shift+Up
Move Statement DownCtrl+Alt+Shift+Down
Move Element LeftCtrl+Alt+Shift+Left
Move Statement RightCtrl+Alt+Shift+Right
Move Line UpN/A
Move Line DownN/A
Comment with Line CommentCtrl+Alt+/
Comment with Block CommentCtrl+Shift+/
Generate...Alt+Insert
Code Cleanup...Ctrl+E, C
Silent Code CleanupCtrl+E, F

Context navigation

Next MethodAlt+Down
Previous MethodAlt+Up
Go to Line/Column...Ctrl+G
SwitcherCtrl+Tab
Select In...Alt+F1
Locate/Select in Solution ViewAlt+Shift+L
Recent FilesCtrl+Comma
Recently Changed FilesCtrl+Shift+Comma
Last Edit LocationCtrl+Shift+Backspace
BackCtrl+Minus
ForwardCtrl+Shift+Minus
Select Next TabAlt+Right
Select Previous TabAlt+Left
Show BookmarksCtrl+`
Toggle BookmarkCtrl+K, K
Toggle Bookmark with MnemonicCtrl+F11
Add to FavoritesAlt+Shift+F
Show Favorites windowAlt+2
Show Structure windowCtrl+Alt+F
Show Find windowAlt+3

What Is Visual Studio Code

Find everything

Search EverywhereDouble Shift
Find...Ctrl+F
Find Next / Move to Next OccurrenceF3
Find Previous / Move to Previous OccurrenceShift+F3
Replace...Ctrl+H
Find in Files...Ctrl+Shift+F
Replace in Files...Ctrl+Shift+H
Next Occurrence of the Word at CaretCtrl+F3
Go to File...Ctrl+Shift+T
File MemberAlt+
Go to Symbol...Ctrl+Alt+Shift+T
Find Action...Ctrl+Shift+A

Navigate from symbols

Navigate To...Alt+`
Find UsagesShift+F12
Go to Declaration or UsagesF12
Go to Type DeclarationCtrl+Shift+F11
Show UsagesAlt+Shift+F12
Go to Super MethodAlt+Home
Go to Implementation(s)Ctrl+F12
Go to Super Derived SymbolsAlt+End
Highlight Usages in FileAlt+Shift+F11

Code analysis

Show Intention ActionsAlt+Enter
Next Code IssueAlt+Page Down
Previous Code IssueAlt+Page Up
Next ErrorAlt+Shift+Page Down
Previous ErrorAlt+Shift+Page Up
Toggle Code InspectionCtrl+Alt+Shift+8
Run Inspection by Name...Ctrl+Alt+Shift+I
Inspect This...Ctrl+Alt+Shift+A
Show Errors in Solution windowCtrl+Alt+2
Show Inspection Results windowCtrl+Alt+4

Build, Run, Debug

NuGet Quick ListAlt+Shift+N
Build SolutionCtrl+Shift+B
Build Current ProjectCtrl+Shift+F7
Cancel BuildCtrl+F9
Run context configurationCtrl+F5
Run...Ctrl+Alt+Shift+R
Debug context configurationAlt+F5
Debug...Alt+Shift+F9
Attach to Process...Ctrl+Alt+P
StopShift+F5
PauseCtrl+Alt+Break
Resume ProgramF5
Stop Background Processes...Ctrl+Shift+F2
Step OverF10
Force Step OverAlt+Shift+F8
Step IntoF11
Smart Step IntoShift+F7
Force Step IntoAlt+F11
Step OutShift+F11
Run To CursorCtrl+F10
Force Run To CursorCtrl+Alt+F9
Skip to CursorCtrl+Shift+F10
Show Execution PointAlt+NumPad *
Evaluate Expression...Shift+F9
Quick Evaluate ExpressionCtrl+Alt+F8
Toggle Line BreakpointF9
Toggle Temporary Line BreakpointCtrl+Alt+Shift+F8
Toggle Breakpoint EnabledCtrl+F9
View Breakpoints...Ctrl+Alt+B
Edit BreakpointAlt+F9
Show Build windowAlt+0
Show Run windowAlt+4
Show Debug windowAlt+5
Show NuGet windowAlt+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 ProjectCtrl+Alt+W
RollbackCtrl+Alt+Z
Push...Ctrl+Shift+K
Next ChangeCtrl+Alt+Shift+N
Previous ChangeCtrl+Alt+Shift+P
Show Version Control windowAlt+9
Show Commit windowN/A

Unit Testing

Unit Testing Quick List...Alt+Shift+U
Run Unit TestsCtrl+U, R
Debug Unit TestsCtrl+U, D
Stop ExecutionCtrl+U, S
Repeat Previous RunCtrl+U, U
Rerun Failed TestsCtrl+U, F
Run Tests Until FailureCtrl+U, W
Run All Tests from SolutionCtrl+U, L
Create New SessionCtrl+U, N
Append Tests to SessionCtrl+U, A
Run Current SessionCtrl+U, Y
Run Unit Tests under dotMemory UnitCtrl+U, M
Run Selected TestsShift+Enter
Debug Selected TestsCtrl+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 windowAlt+8

How To Download Visual Studio Code

Tool Windows

Hide Active Tool WindowShift+Escape
Hide All Tool WindowsCtrl+Shift+F12
Jump to Last Tool WindowCtrl+Alt+Backspace
Show Solution windowCtrl+Alt+L
Show Favorites windowAlt+2
Show Find windowAlt+3
Show Run windowAlt+4
Show Debug windowAlt+5
Show Structure windowCtrl+Alt+F
Show Services windowN/A
Show Version Control windowAlt+9
Show Commit windowN/A
Show Build windowAlt+0
Show Errors in Solution windowCtrl+Alt+2
Show Inspection Results windowCtrl+Alt+4
Show NuGet windowAlt+7
Show Unit Tests windowAlt+8
Show Terminal windowCtrl+Alt+1
Show Database windowCtrl+Alt+3