Skip to content

Files

Latest commit

 

History

History

vscode

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 

Visual Studio Code

A guide for using Visual Studio Code for project development.

Visual Studio Code is a free source code editor that is available for use on Linux, MacOS, and Windows.

Installation

Pre-built binaries are available for download on the Visual Studio Code homepage.

To use Visual Studio Code as a command-line utility, users on MacOS have to run a command to add the Visual Studio Code executable to the PATH environment variable (see the official documentation).

To test the command-line utility,

$ code --help

To open a project in Visual Studio Code,

$ cd ./path/to/project
$ code .

Extensions

  • EditorConfig: extension for using EditorConfig, which helps define and maintain consistent coding styles between different editors and IDEs.

  • JSON Tools: extension for pretty printing and minifying JSON.

  • Julia: extension which provides support for Julia, including syntax highlighting, snippets, and code completion.

  • Python: extension which provides rich support for Python, including syntax highlighting, snippets, and code completion, among other features.

  • AWK: extension which provides syntax highlighting for AWK.

  • C/C++: official extension providing language support for C/C++ to Visual Studio Code. Features include IntelliSense, debugging, and code browsing.

  • Fortran: extension which provides syntax highlighting and snippets for Fortran. Once installed, configure Visual Studio Code to always open files having the file extension *.f as Fortran - Modern in your user or workspace settings.

            ...
            "files.associations": {
                "*.f": "fortran-modern"
            }
            ...
    
  • Code Spell Checker: A simple source code spell checker. See the official documentation for configuration options.

  • ESLint: extension to integrate eslint into Visual Studio Code. Once installed, you need to configure the extension to use the project ESLint configuration files in your workspace settings.

            ...
            "eslint.options": {
                "configFile": "etc/eslint/.eslintrc.js"
            }
            ...
    
  • Path Intellisense: extension that autocompletes filenames.

  • Runner: extension allowing one to run various scripts from the editor.

  • TODO Highlight: extension which marks annotations such as TODO, FIXME, etc. Once installed, you may configure the extension to your liking in your user or workspace settings, e.g. by specifying the list of keywords to be highlighted.

            ...
            "todohighlight.keywords": [
                {
                    "text": "FIXME:",
                    "color": "white",
                    "backgroundColor": "red",
                    "isWholeLine": true
                },
                {
                    "text": "HACK:",
                    "color": "darkgreen",
                    "isWholeLine": true,
                },
                {
                    "text": "NOTE:",
                    "color": "darkgreen",
                    "backgroundColor": "rgba(0,0,0,.2)",
                    "overviewRulerColor": "grey",
                    "isWholeLine": true
                },
                {
                    "text": "OPTIMIZE:",
                    "isWholeLine": true
                },
                {
                    "text": "TODO:",
                    "color": "darkred",
                    "backgroundColor": "rgba(0,0,0,.2)", 
                    "isWholeLine": true
                },
                {
                    "text": "WARNING:",
                    "color": "black",
                    "backgroundColor": "orange",
                    "isWholeLine": true
                }
            ]
            ...