malashevskyi / vs-code-setup

My vs-code setup, vs-code extensions, shortcuts cheatsheet, vs code features

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

vs-code-setup website

my vs-code setup, extensions, shortcuts cheatsheet, vs code features

Contents

VS Code shortcuts

  • see my cheatsheet - more than one hundred keyboard shortcuts plus additional commands

Setup

  • I use vs code insiders instead of vs code, but I have both of them. To open file with insider use: code-insiders file-name

    • create alias to open files with c file-name
      // Ubuntu/Window
      // inside ~/.bashrc or ~/.zshrc
      alias c='code-insiders'
  • I disabled Caps Lock key to get some additional keyboard shortcuts for VS Code and Chrome extensions

    For Ubuntu I installed Tweak

    • To change Caps Lock go Tweaks / Keyboard & Mouse / Additional Layout Options / Caps Lock behavior
    • I checked Caps Lock is disabled, it still recognize the key in vs code shortcuts as Caps Lock but without any effect. tweak settings screenshot

    For Mint

    • settings -> keyboard - layouts - options - Caps Lock behavior -> Caps Lock is disabled

    For Windows I installed AutoHotkey website video installation

    • Here my config for AutoHotkey:
      #NoEnv  ; Re`ommended for performance and compatibility with future AutoHotkey releases.
      ; #Warn  ; Enable warnings to assist with detecting common errors.
      SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
      SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
      
      CapsLock::Ins
      return
    • I replace CapsLock with Insert key
    • I use a real button, because when i choose a non-existent button it shows unknown in vs code shortcuts and of course, doesn't work.

    So, I use `CapsLock` in linux and `Insert` in Windows
  • Disable file filtering in sidebar and set A and Shift + A to create file and create folder

    // settings.json
    "workbench.list.automaticKeyboardNavigation": false
    
    // keybindings.json
      {
        "key": "a",
        "command": "explorer.newFile",
        "when": "filesExplorerFocus && !inputFocus"
      },
      {
        "key": "shift+a",
        "command": "explorer.newFolder",
        "when": "filesExplorerFocus && !inputFocus"
      }
  • If a shortcut doesn't work:

  • move cursor by 7 line up / down (or how much you want)

      {
        "key": "shift+alt+up",
        "command": "cursorMove",
        "args": {
          "to": "up",
          "by": "line",
          "value": 7
        },
        "when": "editorTextFocus"
      },
      {
        "key": "shift+alt+down",
        "command": "cursorMove",
        "args": {
          "to": "down",
          "by": "line",
          "value": 7
        },
        "when": "editorTextFocus"
      },

Features

  • Refactor (Ctrl + Shift + R)
    • remove / add braces (return) remove / add braces gif.gif
  • Create keybindings snippets
    • F1 => Open Keyboard Shortcuts (JSON)
       {
          "key": "capslock 1",
          "command": "editor.action.insertSnippet",
          "when": "editorTextFocus",
          "args": {
            "snippet": "console.log('${1:log}', ${2})"
          }
        },
    will output console.log('log', )

Extensions

About

My vs-code setup, vs-code extensions, shortcuts cheatsheet, vs code features


Languages

Language:TypeScript 93.4%Language:HTML 6.6%