This is a list of common and less well known tips, not a comprehensive list.
Note: The shortcuts involving a letter are Uppercase to make them easier to read but they can be lowercase as well (and usually are).
CTRL+S
to open Keyboards ShortcutsALT+#
to switch between open tabs (not numpad numbers)CTRL+P
to search for file and openCTRL+TAB
to cycle thru open tabsCTRL+ENTER
while anywhere in a line of code to place your cursor on a new line for the next line of codeCTRL+,
to open Setings pageCTRL+J
or ` CTRL+``` to toggle terminal/command lineCTRL+B
to toggle sidebarCTRL+L
to select multiple linesCTRL+ARROWS
to jump between words, that's Arrow Left and Arrow RightF1
to open command paletteF1
+ type 'format' for format a selection or a documentF1
+ start typing emmet and select "Emmet: Wrap with Abbreviation". Best for wrapping a block of HTML with a tag- Double-click 'item' then
CTRL+D
to select other occurrences ALT+Click
for multiple cursorsCTRL+F
to open search box, thenALT+R
to toggle RegEx optionCTRL+SHIFT+P
to open the command palette and show the names of the variables and functions in a long fileCTRL+SHIFT+Arrow-down
to copy cursor focus line or selected line(s) down, Arrow-Up to copy it upALT+Arrow-Up
or Down to move a line up or downF1
to open command palette - try out ~Emmet: Wrap with abbreviation`F2
while on a var or function name to rename throught out your projectSHIFT+ALT+F
to format the entire document, orCTRL+K CTRL+F
for current selectionSHIFT+CTRL+arrow-right
orarrow-left
- selects groups of characters like words, keywords, numbers - similar to double-clicking in a word doc or webpage and then dragging your mouse.
tdn
fortext-decoration: none
tac
fortext-align: center
Here is a GitHub repo that has a lot of VS Code tips (redundant?):
https://github.com/microsoft/vscode-tips-and-tricks
However, it's really comprehensive. I think a more scaled-down version would be useful for beginners, as opposed to advanced users.
- You need an HTML and JS file
- Click the left sidebar debug icon
- Clik the gear icon at the top to select the browser - BRAVE is not an option!
- Check out Stackoverflow: How to attach the VSCode debugger to the Brave browser?
Video: The New Way To Debug JavaScript in VS Code - No Extension Required by James Q Quick
- need to have your JS app running locally so open with live server
- I need to switch to Chrome - after clicking the gear icon select chrome and then you get a JSON config file called launch.json
- live server runs on port 5500 so change the config file from 8000 to 5500
- then click the play button top left to trigger the debugging instance
- your app will then relaunch in chrome
Actual debugging
- you need to create a breakpoint inside of vs code to do the debugging
- you create a brakpoint by clicking the red dot to the line of the line numbers - start at the top of your code
- then click the run button again
Change terminal from Powershell on Windows to Git Bash:
- in settings search for
terminal
- scroll way down to
Terminal > Integrated > Default Profile: Windows
- Change the default setting of
null
toGit Bash
Token: vscode://vscode.github-authentication/did-authenticate?windowid=1&code=ENTER_CODE_HERE
- Copy the token.
- Switch back to VS code.
- Click Signing in to github.com... in the status bar.
- Paste the token and hit enter.
Testing ins and u tags:
underlined text with INS
underlined text with U TAG
ERROR: node -v gives v12.18.2 and in d\l folder is v16.13.0
- think I need to update node.js and maybe npm too
- How to update Node.js and NPM to next version
nvm install <version>
nvm list
nvm use <version>
npm install -g npm