lobo_tuerto's notes
for greatly improving DX
Blog
Notes
About

Install VSCode in Linux

The one and only, the fabulous Visual Studio Code in Linux.

📅Date04 April 2020Updated30 December 2020
🏷️
devlinuxvscode

Install Visual Studio Code

One code editor to rule them all…
Visual Studio Code is fast, nimble, agile and beautiful.

cd ~/tmp
git clone https://aur.archlinux.org/visual-studio-code-bin.git
cd visual-studio-code-bin/
makepkg -si

Execute with:

code &

Increase the amount of inotify watchers

This is needed so Visual Studio Code can manage projects with a lot of files:

echo fs.inotify.max_user_watches=524288 | sudo tee \
/etc/sysctl.d/40-max-user-watches.conf && sudo sysctl --system

The most useful Visual Studio Code extensions

These are the ones I usually install:

  • Better Comments: Improve your code commenting by annotating with alert, informational, TODOs, and more.
  • ElixirLinter: Provides linting for Elixir files using Credo for Visual Studio Code.
  • ElixirLS: Elixir support with debugger, autocomplete, and more.
  • ESLint: Integrates ESLint JavaScript into VS Code.
  • gettext: Gettext PO files language support for Visual Studio Code.
  • GitLens: Supercharge the Git capabilities built into Visual Studio Code.
  • indent-rainbow: Makes indentation easier to read.
  • Jest Runner: Simple way to run or debug a single (or multiple) tests from context-menu.
  • Live Share: Real-time collaborative development from the comfort of your favorite tools.
  • markdownlint: Markdown linting and style checking for Visual Studio Code.
  • Peacock: Subtly change the workspace color of your workspace.
  • Phoenix Framework: Syntax highlighting support for HEEx.
  • Prettier: Prettier is an opinionated code formatter.
  • Sass: Indented Sass syntax Highlighting, Autocomplete & Formatter.
  • stylelint: Modern CSS/SCSS/Less linter
  • Surface: A component based library for Phoenix.
  • Tailwind CSS IntelliSense: Intelligent Tailwind CSS tooling for VS Code.
  • Volar: Language support for Vue 3.
  • vscode-icons: Icons for Visual Studio Code.

For Ruby:

  • Ruby Solargraph: A Ruby language server featuring code completion, intellisense, and inline documentation.
  • endwise: Wisely add “end” in Ruby.

The best dark themes around:

  • Dracula Official: Official Dracula Theme. A dark theme for many editors, shells and more.
  • Monokai Pro: Professional theme and matching icons.
  • Night Owl: A VS Code theme for the night owls out there.
  • One Dark Pro: Atom’s iconic One Dark theme for Visual Studio Code.
  • Palenight Theme: An elegant and juicy material-like theme for Visual Studio Code.

My settings.json

You can open your settings with CTRL + ,:

{
  "css.validate": false,
  "editor.acceptSuggestionOnCommitCharacter": false,
  "editor.bracketPairColorization.enabled": true,
  "editor.detectIndentation": false,
  "editor.formatOnSave": false,
  "editor.insertSpaces": true,
  "editor.minimap.enabled": false,
  "editor.fontFamily": "'Fira Code', 'Droid Sans Mono', 'monospace', monospace, 'Droid Sans Fallback'",
  "editor.fontLigatures": true,
  "editor.renderWhitespace": "boundary",
  "editor.tabSize": 2,
  "editor.tokenColorCustomizations": {
    "textMateRules": [
      {
        "scope": "markup.bold",
        "settings": {
          "foreground": "#f8f528",
          "fontStyle": "bold"
        }
      },
      {
        "scope": "markup.italic",
        "settings": {
          "foreground": "#ff6daa",
          "fontStyle": "italic bold"
        }
      },
      {
        "scope": "markup.quote",
        "settings": {
          "foreground": "#c5cc83",
          "fontStyle": "italic bold"
        }
      }
    ]
  },
  "emmet.includeLanguages": {
    "html-eex": "html"
  },
  "explorer.confirmDragAndDrop": false,
  "files.autoSave": "onFocusChange",
  "files.insertFinalNewline": true,
  "files.trimFinalNewlines": true,
  "gitlens.defaultDateStyle": "absolute",
  "javascript.validate.enable": false,
  "markdownlint.config": {
    "MD012": false, // MD012/no-multiple-blanks: Multiple consecutive blank lines
    "MD024": {
      "siblings_only": true // MD024/no-duplicate-heading/no-duplicate-header: Multiple headings with the same content
    },
    "MD025": false, // MD025/single-title/single-h1: Multiple top-level headings in the same document
    "MD033": false, // MD033/no-inline-html: Inline HTML
    "MD034": false, // MD034/no-bare-urls: Bare URL used
    "MD038": false // MD038/no-space-in-code: Spaces inside code span elements
  },
  "peacock.favoriteColors": [
    {
      "name": "Angular Red",
      "value": "#b52e31"
    },
    {
      "name": "Auth0 Orange",
      "value": "#eb5424"
    },
    {
      "name": "Azure Blue",
      "value": "#007fff"
    },
    {
      "name": "C# Purple",
      "value": "#68217A"
    },
    {
      "name": "Gatsby Purple",
      "value": "#639"
    },
    {
      "name": "Go Cyan",
      "value": "#5dc9e2"
    },
    {
      "name": "Java Blue-Gray",
      "value": "#557c9b"
    },
    {
      "name": "JavaScript Yellow",
      "value": "#f9e64f"
    },
    {
      "name": "Mandalorian Blue",
      "value": "#1857a4"
    },
    {
      "name": "Node Green",
      "value": "#215732"
    },
    {
      "name": "React Blue",
      "value": "#00b3e6"
    },
    {
      "name": "Something Different",
      "value": "#832561"
    },
    {
      "name": "Vue Green",
      "value": "#42b883"
    },

    {
      "name": "Agua 1",
      "value": "#b8e8e8"
    },
    {
      "name": "Azul 1",
      "value": "#3b5487"
    },
    {
      "name": "Durazno 1",
      "value": "#fcdca8"
    },
    {
      "name": "Menta 1",
      "value": "#53c5d0"
    },
    {
      "name": "Naranja 1",
      "value": "#9e5e24"
    },
    {
      "name": "Púrpura 1",
      "value": "#76618f"
    },
    {
      "name": "Rosa 1",
      "value": "#98616e"
    },
    {
      "name": "Verde 1",
      "value": "#336144"
    },
    {
      "name": "Verde 2",
      "value": "#bceec0"
    },
    {
      "name": "Vino 1",
      "value": "#73153d"
    }
  ],
  "solargraph.diagnostics": true,
  "solargraph.formatting": true,
  "volar.codeLens.pugTools": false,
  "window.titleBarStyle": "custom",
  "workbench.colorCustomizations": {
    "editor.background": "#131212",
    // "editor.background": "#1f252b",
    "editorCursor.foreground": "#ff00ff",
    "editorWhitespace.foreground": "#ff00ff60",
    "sideBar.background": "#1a1a1a"
    //"sideBar.background": "#272c35"
  },
  "workbench.colorTheme": "Palenight Theme",
  "workbench.editor.decorations.badges": true,
  "workbench.editor.decorations.colors": false,
  "workbench.iconTheme": "vscode-icons",
  "[css]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode",
    "editor.formatOnSave": true
  },
  "[elixir]": {
    "editor.formatOnSave": true
  },
  "[html]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "[javascript]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode",
    "editor.formatOnSave": true
  },
  "[json]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode",
    "editor.formatOnSave": true
  },
  "[jsonc]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode",
    "editor.formatOnSave": true
  },
  "[ruby]": {
    "editor.formatOnSave": true
  },
  "[typescript]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode",
    "editor.formatOnSave": true
  },
  "[vue]": {
    "editor.codeActionsOnSave": {
      "source.fixAll.eslint": true
    },
    "editor.defaultFormatter": "esbenp.prettier-vscode",
    "editor.formatOnSave": true
  }
}

Undocumented keyboard shortcuts

To open a terminal press CTRL + j

My usual .prettierrc

{
  "semi": false,
  "singleQuote": true
}

Got comments or feedback?
Follow me on
rev-7175614