Skip to content

peterneave/vscode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Visual Studio Code

Tips and Tricks

Foreword

📝 Contribute on w:48 GitHub

🔗 View Online neave.dev/vscode

⬇️ Download PowerPoint and PDF

What is VS Code?

Visual Studio Code is a free code editor that is optimized for building and debugging modern web and cloud applications.

You can run it on Windows, Linux, Mac or Online https://vscode.dev


Key Features:

  • It supports a range of languages,
  • Productivity shortcut circuits
    • Keyboard shortcuts
    • Tasks
    • Snippets
  • Customizable with
    • Themes
    • Extensions
  • Integrated terminal.

Documentation and Updates

Inbuilt Features

Help Menu

Settings

Profiles

bg right:40% fit

VS Code has a Default Profile. Customize Settings, Keyboard Shortcuts, User Snippets, User Tasks or Extensions.

You can have additional profiles.


  • Have a profile for Frontend, Backend, AWS and Azure or a Project.
  • Customize the profile for a stack ie (Jira, AWS and Python).
  • You could install the tools and extensions as part of that project.

Customisation

  • Edit the setings via the UI or the underlying JSON.
  • Default settings or open Preferences: Open Default Settings (JSON)
  • Customize the User settings Ctrl+, (UI) - Ctrl+P and go to Open User Settings (JSON)
{
  "editor.fontFamily": "'Cascadia Code'",
  "editor.formatOnSave": true,
  "editor.rulers": [ 120 ],
  "editor.stickyScroll.enabled": true,
  "editor.trimAutoWhitespace": true,
  "explorer.fileNesting.enabled": true,
  "files.trimTrailingWhitespace": true,
  "git.branchPrefix": "yourusername/",
  "terminal.integrated.fontFamily": "'CaskaydiaCove Nerd Font Mono','Cascadia Code',Consolas,'Courier New',monospace",
  "workbench.sideBar.location": "right"
}

Synchronized Settings

bg right h:300px

Settings sync across multiple instances of VS Code

Layout

w:800px

Customize the layout

  • You could move the sidebar to the right then when you Toggle Sidebar/Ctrl+B it doesn't make the code jump around.
  • Add a secondary sidebar with Outline view for better navigation.

Grouping

Ctrl+\

bg right


Switch to next group with Ctrl+[1,2,3...]

w:1000px

Alternatively: Ctrl+P and View: Move Editor to Next Group

Navigation

Ctrl+R Displays a Quick Pick dropdown with the list from File > Open Recent with recently opened folders and workspaces followed by files.

Multi-Root Workspaces

Normally your workspace has a single root/project folder but you can have a workspace with multiple project folders in Visual Studio Code with multi-root workspaces. Uses a .code-workspace file


{
  "folders": [
    {
      // Source code
      "name": "Product",
      "path": "vscode"
    },
    {
      // Docs and release notes
      "name": "Documentation",
      "path": "vscode-docs"
    },
    {
      // Yeoman extension generator
      "name": "Extension generator",
      "path": "vscode-generator-code"
    }
  ]
}

Command Palette

w:600px Ctrl+Shift+P

Quick Open File

w:600px Ctrl+P


w:600px

Ctrl+P and type ?term to open a new terminal

Others

Ctrl+T - Go To Symbol Ctrl+G - Go to Line Alt+ ← / → - Jump forward and back

Editing

Text Manipulation

  • Sort Lines Ascending/Descending
  • Join Lines
  • Transform Text

Tranform Example
Title Hello World
Upper HELLO WORLD
Lower hello world
Camel helloWorld
Snake helloWorld → hello_world
Kebab helloWorld → hello-world

Code Formatting

w:700px

Regex Search and Replace

w:800px

Multi Cursor

Edit Text Vertically with multi-cursor

Keep selecting text with Ctrl+D and update over multiple locations in a file.

w:600px

Expanding and Shrinking Selection

Shift+Alt+Left and Shift+Alt+Right

Find the start and end of a long <div> in HTML

Folding

Hide Text for easier reading

bg right w:500px

Fold Level [1|2|3|4], Fold All, Unfold All

Sticky Scroll

See the code context with Sticky Scroll - useful for long methods

w:600px

Emmet

Generate HTML and CSS from shorthand. Works with multi-cursors

bg left w:600px

Markdown preview

w:800px

Productivity / Focus

Zen Mode

Focus on the code with Zen Mode

w:800px

Errors

Jump to the next error with F8.

Really useful for going through compiler errors.

File Nesting

Nest related files under a parent file in the explorer.

"explorer.fileNesting.patterns": {
    "*.component.ts": "$(capture).component.html, $(capture).component.spec.ts, $(capture).component.scss",
    "README*": "AUTHORS,CHANGELOG*,CODE_OF_CONDUCT*,CONTRIBUTING*,LICENSE*"
  }

Pinned Tabs

Pinned Tabs allow you to keep a file open

w:800px

Vertical Rulers

Make sure your code isn't getting too long and hard to read.

w:800px

LogPoints

Non-breaking log points to show logging

w:800px

Screencast Mode

w:600px

Task Runners

Run tasks like build, test and other custom tasks in Task Runners.

bg right w:500px

Remote Development

Remote Description
Remote via SSH Connect to remote machines with Visual Studio Code via SSH.
Work in WSL Work in Windows Subsystem for Linux.
Develop in Containers Work in a Docker Container.
GitHub Codespaces Work in codespace with Visual Studio Code.

Dev Containers

Dev Containers uses a devcontainer.json file in your project tells VS Code how to access (or create) a development container with a well-defined tool and runtime stack.

You can use prebuild images to dev container setup. Also supports switching between multiple containers


Extensions

Installation

Install extensions with Ctrl+Shift+X. You can add to the workspace @recommended extensions for a project.

Most Popular extensions can be found with @popular

Extension Packs

bg content opacity:.2

Extension Packs

Marp

This slide deck was written in Markdown within VSCode. I used the Marp for VS Code extension to preview it.

Marp has a CLI - so this slide has a CICD pipeline 😁

Peacock

bg right:50% w:500px

Peacock allows you to colour code VS Code.

IntelliCode

AI-assisted development features for Python, TypeScript/JavaScript and Java developers

IntelliCode

bg right w:500px

LiveServer

bg left:50% w:600px

Launch a development local Server with live reload feature for static & dynamic pages

LiveServer

Indent Rainbow

Indent Rainbow makes indentation more readable. Highlights when you get indenting wrong.

Path Intellisense

bg left w:500px

Path Intellisense autocompletes filenames

Code Spell Checker

bg right w:500px

Code Spell Checker for source code

Error Lens

Improve highlighting of errors, warnings and other language diagnostics.

Error Lens

Inline Fold

bg left fit

Inline fold A custom decorator that "fold" matching content in single line. Helps with Tailwind CSS.

Polacode

bg right fit

📸 Polaroid for your code. Take screenshots of your code

Polacode

LiveShare

Real-time collaborative development from the comfort of your favourite tools.

bg left w:400px

LiveShare / Docs

Jira and Bitbucket

Bringing the power of Jira and Bitbucket to VS Code

  • You can create and view issues
  • Start work on issues
  • Create pull requests
  • Do code reviews
  • Start builds
  • Get build statuses and more!

Jira and Bitbucket

GitHub Copilot

GitHub Copilot Your AI pair programmer

bg right w:800px

C# Dev Kit

Official C# extension from Microsoft

  • Project System / Solution Explorer
  • Code Editing (Uses the C# extension)
  • Package Management
  • Debugging
  • Testing

C# Dev Kit

Polygot Notebooks

bg left

Polygot Notebooks allows

C#, F#, PowerShell, JavaScript, SQL, KQL, Python, R, HTML, HTTP, Mermaid.

API Clients

REST Client

GET https://example.com/topics/1 HTTP/1.1

POST https://example.com/comments HTTP/1.1
content-type: application/json

{
    "name": "sample",
    "time": "Wed, 21 Oct 2015 18:27:50 GMT"
}
curl https://www.example.com

bg right fit

Thunder Client

Lightweight Rest API Client for VS Code

Better Comments

bg left fit

Better Comments colour codes your commit messages

TODO Tree

TODO Tree quickly find all your todo items.

bg left fit

Conventional Commits

bg right:40% fit

Conventional Commits

<type>[optional scope]: <description>

[optional body]

[optional footer(s)]

Follows conventionalcommits.org and uses gitmoji which then dovetails to semver.org

feat(api): ✨ Add Get User Endpoint

Allow users to access their profile

ABC-123

bg right:40% fit

Unique Lines

Keep unique lines of text and remove duplicates from current selection. Also includes a command to shuffle currently selected lines.

A    A
B => B
B    C
C
C

Encode Decode

Encode Decode converts text.

  • Convert String to/from Base64, HTML Entities, JSON Byte Array, JSON String, Unicode, XML Entities
  • Convert String to MD5/SHA1/SHA256/SHA512 (as Base64 or Hex)

Bookmarks

bg left fit

Bookmark your code and quickly jump to bookmarks.

Markdown Preview Mermaid Support

bg right:30%

Markdown Preview Mermaid Support allows you to create Mermaid JS documents that can be included in Markdown documents.

graph TD;
    A-->B;
    A-->C;
    B-->D;
    C-->D;
Loading

Aside: Mermaid JS can generate

  • Generate Flowchart
  • Sequence Diagram
  • Class Diagram
  • State Diagram
  • Entity Relationship Diagram
  • User Journey
  • Gantt
  • Pie Chart
  • Quadrant Chart
  • Requirement Diagram

bg right w:400px bg right w:400px

sequenceDiagram
    Alice->>+John: Hello John, how are you?
    Alice->>+John: John, can you hear me?
    John-->>-Alice: Hi Alice, I can hear you!
    John-->>-Alice: I feel great!
Loading
flowchart TD
    A[Christmas] -->|Get money| B(Go shopping)
    B --> C{Let me think}
    C -->|One| D[Laptop]
    C -->|Two| E[iPhone]
    C -->|Three| F[fa:fa-car Car]
Loading

JSON Crack

bg left:60% fit

JSON Crack seamlessly visualize your JSON data instantly into graphs.

SemanticDiff

bg fit right:60%

SemanticDiff is a programming language aware diffs.

Can show differences when you move code.

FootSteps

bg fit left:60%

FootSteps Highlight and navigate between your most recently edited chunks of code

Pets for your VS Code

bg fit right:60%

Pets gives you a virtual pet to play with while you are coding.

Database Connections

bg fit left:60%

Docker

bg right fit

Makes it easy to create, manage, and debug containerized applications.

Docker

Azure Tools

bg left fit Get web site hosting, SQL and MongoDB data, Docker Containers, Serverless Functions and more, all on Azure.

Azure Tools

AWS Toolkit

bg right fit

Including CodeWhisperer, CodeCatalyst, and support for Lambda, S3, CloudWatch Logs, and many other services

AWS Toolkit

About

VS Code Slide Deck

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published