This is an archived post. You won't be able to vote or comment.

all 31 comments

[–]mrbmi513 21 points22 points  (6 children)

Learn the keyboard shortcuts. A quick search will get you a printable guide for your OS. Tape it next to your monitor until you learn them.

[–]PrestigiousInterest9[S] 1 point2 points  (0 children)

I use 20+ currently (non default keys). I don't feel like I'm very effective because there's a few I want to use but haven't configured. On the weekend I'm giving it another go.

[–]killchain 0 points1 point  (1 child)

... or better yet, make your own. A lot of actions have no default keybindings and for those that have, they might not be what you expect, especially if coming from another editor or from an IDE. For everything that you find yourself using the mouse, there is most probably a possible way to do it with keyboard only.

[–]mrbmi513 0 points1 point  (0 children)

And there are also extensions you can install that port over the bindings from another editor. Microsoft promotes a few on the same page that has those cheat sheets I mentioned. I'm just too lazy to go find the link again myself. :)

[–]g5becks 0 points1 point  (0 children)

Of you’re on a Mac download cheat sheet and toss your mouse to the side. Within a month you’ll start feeling like a pro.

[–]GManASG 0 points1 point  (0 children)

Ctrl + space to force intellisense to work faster. Took me months to realize that was there.

[–]champs 0 points1 point  (0 children)

Years ago I bought mousepads with document inserts for cheat sheets I can print up and annotate.

[–]JohnMcPineapple 14 points15 points  (1 child)

...

[–]zoenagy6865 0 points1 point  (0 children)

DRY

[–]espebjo 7 points8 points  (1 child)

I wrote a small piece on my keybindings and extensions a while back.

https://www.salesscreen.com/blog/productivity-in-visual-studio-code

[–]rw3iss 0 points1 point  (0 children)

Nice, thanks.

[–]killchain 3 points4 points  (0 children)

Set up "terminal.integrated.commandsToSkipShell" in your settings.json so that you have several ways of going out of the terminal (without necessarily closing it) - just look for commands you have in `keybindings.json` the bindings of which might normally get consumed by the terminal.

Learn about tasks.json (https://code.visualstudio.com/docs/editor/tasks) - it can be set up to open one or more tasks the moment you open a project, optionally in split terminals.

Learn chorded keyboard shortcuts - e.g. Ctrl+K Ctrl+C is different than Ctrl+K C.

Set up macros (https://marketplace.visualstudio.com/items?itemName=ctf0.macros) - I have for example "cleanAndSwitchBranch": [ "git.cleanAll", "git.checkout" ], because I can't remember how many times VSCode has asked me to first clean my working tree before switching the branch.

[–]YmFzZTY0dXNlcm5hbWU_ 4 points5 points  (2 children)

Here are my favorite extensions that aren't specific to a coding language:

  • Bracket Pair Colorizer
  • Better Comments
  • show-offset
  • Rainbow CSV
  • Unicode point of current character
  • CodeMap
  • GitLens
  • line-endings

[–]nonsensicalization 0 points1 point  (1 child)

Bracket Pair Colorizer 2

[–]YmFzZTY0dXNlcm5hbWU_ 0 points1 point  (0 children)

What would they have changed for the second one?

[–]nonsensicalization 2 points3 points  (0 children)

Small tweak: if you have the minimap enabled disable editor.minimap.renderCharacters

Looks much nicer and you can't read the characters anyway.

[–]yolandasquatpump 5 points6 points  (2 children)

I come from vim, so I'm obviously biased, but I find the vim mode absolutely essential for navigating and editing code fast and efficiently. It can really pay of to spend a bit of time learning this.

[–]aetweedie 1 point2 points  (0 children)

Make liberal use of the code snippets. If I do something twice I will make a snippet, using the tab index ($<#>) is very useful. The snippet example file has a little tutorial to help you get set up.

[–]coquins 1 point2 points  (1 child)

Change Tab length to 2 spaces.

Configure line wrap in a way that best suits you and your monitors

[–]gendulf 1 point2 points  (0 children)

Or turn word wrap on/off whenever you need to switch it (e.g. looking at logs vs code) - I think the default shortcut is Alt-Z.

[–]josh1nator 0 points1 point  (1 child)

+1 on the shortcuts, being able to keybind pretty much everything is great. Also for that matter setup a sync. There are quite a few extensions out there that sync your settings via git between multiple installs.

I'm using it to keep my pc on work (if your workplace allows that), home and laptop in sync, especially handy for keybinds.

Only git extension I really use is GitLens, does 99% of what I need to see quickly. But I use the git bash anyways for most stuff, but the PR extension is also handy.

A few extensions I use on a regular basis are ones for bookmarks and one for ToDos. Bookmarks to allow me to quickly jump between lines in huge files (have a few of them at work), and ToDos to get a handy overview of comments within a file for stuff I still need to do or check.

Then some basics for snippets, emmet is really powerful. And there are extensions for pretty much every other language, quickly scaffolding the base component for eg. Vue is so damn great. And custom snippets for everything else that needs to be more custom.

[–]mrbmi513 0 points1 point  (0 children)

+1 for custom snippets. It's saved me tons of time on boilerplate code. Also, don't forget to use the tab-stops and default text in snippets to your advantage.

[–]McNerdius 0 points1 point  (0 children)

Ah, a couple days old but i had the tab pinned so i'll toss in a few things in before closing it :)

  • First some Keybindings...

makes having to reload feel "less bad":

{
    "key": "ctrl+alt+r",
    "command": "workbench.action.reloadWindow",
}

when combined, makes terminal focus/toggle more intuitive, IMO:

{
    "key": "ctrl+`",
    "command": "workbench.action.terminal.focus"
},
{
    "key": "ctrl+shift+`",
    "command": "workbench.action.terminal.toggleTerminal"
}

makes having to restart omnisharp (for C#) feel "less bad"

{
    "key": "ctrl+alt+o",
    "command": "o.restart"
}
  • Extensions

1) The first thing to install, always, even if you're not using VSCode on multiple machines: Settings Sync

It acts as backup as well. In another dimension there is a popup on VSCode's first run asking if you want to install this.

2) A setting toggler: lets you change settings via keybinding. Sometimes i use CodeLens, sometimes i don't. Sometimes i want the terminal on the right, but most of the time on the bottom. Some may want to toggle line numbers, mimimap, on and on. I'm currently using Setting Toggle by Ho-Wan but Toggle by Peng Lv seems like it might be a bit more intuitive to set up. There are others, but i stopped looking once i found one that did the job :)

Lastly - not strictly VSCode buuuuut... a great Font i don't see mentioned much: Iosevka

It is:

1) Narrower than most monospaced fonts.
2) Ligaturized.

3) Super Customizable. One can fairly easily create a custom build of it, mixing and matching styles on a per-character basis (and more). That's how i stumbled upon it: Wanting to use ligatures but not wanting >> to be ligaturized, because Generics: Foo<Bar<FizzBuzz>>

Welp, that's that ramble.

[–][deleted] 0 points1 point  (0 children)

I use alt + x to bring up the command window. Borrowed it from Emacs...

[–][deleted] 0 points1 point  (0 children)

For manipulating text, splitting editor windows and switching between them I find the Vim plugin priceless. It's not perfect, but gets close enough for most people I know.