Use Visual Studio Code on Chromium code base

Visual Studio Code (Wikipedia) is a multi-platform code editor that is itself based on Electron which is based on Chromium. Visual Studio Code has a growing community and base of installable extensions and themes. It works without too much setup.

Install extensions

F1 paste ext install cpptools you-complete-me clang-format chromium-codesearch then enter. For more extensions:

Highly recommend you also install your favorite keymap.

An Example to install eclipse keymaps ext install vscode-eclipse-keybindings. You can search keymaps here.


Open Settings File/Code - Preferences - Settings and add the following settings.

  "editor.tabSize": 2,
  "editor.rulers": [80],
  "[cpp]": {
    "editor.quickSuggestions": true
  // Exclude
  "files.exclude": {
    "**/.git": true,
    "**/.svn": true,
    "**/.hg": true,
    "**/.DS_Store": true,
    "**/out": true
  // YCM
  "ycmd.path": "<your_ycmd_path>",
  "ycmd.confirm_extra_conf": false,
  "ycmd.use_imprecise_get_type": true,
  // clang-format
  "clang-format.executable": "<your_depot_tools>/clang-format",
  "": "file"

Install auto-completion engine(ycmd)

$ git clone ~/.ycmd
$ cd ~/.ycmd
$ ./ --clang-completer

Work flow

  1. ctrl+p open file.
  2. ctrl+o goto symbol. ctrl+l goto line.
  3. ctrl+` toggle terminal.
  4. F1 - CodeSearchOpen open current line in code search on chrome.
  5. F1 - CodeSearchReferences open XRef Infomation of current symbol.
  6. Use right click menu call go to definition or peek definition.
  7. Use right click menu call find all references.


On laptop

Because we use ycmd to enable auto completion. We can disable CPP autocomplete and index to save battery. We can also disable git status autorefresh to save battery.

"git.autorefresh": false,
"C_Cpp.autocomplete": "Disabled",
"C_Cpp.addWorkspaceRootToIncludePath": false

Enable Sublime-like minimap

"editor.minimap.enabled": true,
"editor.minimap.renderCharacters": false