Skip to content

Code Editor Setup

VS Code

I’ve tried several tools like Neovim, Zed, Cursor, and JetBrains editors. They’re all powerful, but given my needs and minimalist approach, VS Code remains my favorite editor. My second choice is Zed, which is still in development but might take the top spot soon.

VS Code

Visual Studio Code is a lightweight yet powerful source code editor developed by Microsoft.

It comes with several built-in features that work without requiring additional extensions, including support for Docker, Git, HTML, CSS, JavaScript, TypeScript, JSON, Markdown, YAML, and more.

With extensions, you can add languages, debuggers, and tools to customize your setup and enhance your development workflow.

Live Preview

Live Preview

Live Preview allows you to preview static web projects within the editor or in an external browser.

LaTeX Workshop

LaTeX Workshop

LaTeX Workshop provides essential features for LaTeX typesetting.

Python

Python

The Python extension adds editing and debugging support for Python.

C/C++

C/C++

The C/C++ extension adds editing and debugging support for C/C++.

Terminal window
bash <(curl -fsSL raw.githubusercontent.com/marcosborgesphd/mac-setup/main/install) vscode
  1. Set up Homebrew environment

    Paste that in the terminal prompt:

    Terminal window
    if [[ "$(/usr/bin/uname -m)" == "arm64" ]]; then
    HOMEBREW='/opt/homebrew' # ARM
    else
    HOMEBREW='/usr/local' # Intel
    fi
    eval "$(${HOMEBREW}/bin/brew shellenv)"
  2. Install VS Code

    Terminal window
    brew install visual-studio-code
  3. Add VS Code command to the terminal

    Terminal window
    SOURCE='/Applications/Visual Studio Code.app/Contents/Resources/app/bin/code'
    TARGET='/usr/local/bin/code'
    sudo ln -snf "${SOURCE}" "${TARGET}"
  4. Set VS Code as the default Git editor, diff, and merge tool

    Terminal window
    git config --global core.editor 'code --wait'
    git config --global diff.tool vscode
    git config --global difftool.vscode.cmd 'code --wait --diff $LOCAL $REMOTE'
    git config --global merge.tool vscode
    git config --global mergetool.vscode.cmd 'code --wait $MERGED'
  5. Install Live Preview extension

    Terminal window
    code --install-extension ms-vscode.live-server
  6. Install Python extension

    Terminal window
    code --install-extension ms-python.python
  7. Install C/C++ extension

    Terminal window
    code --install-extension ms-vscode.cpptools
  8. Install rust-analyzer extension

    Terminal window
    code --install-extension rust-lang.rust-analyzer
  9. Install LaTeX Workshop extension

    Terminal window
    code --install-extension James-Yu.latex-workshop
  10. Backup your VS Code settings

    Terminal window
    cp "${HOME}/Library/Application Support/Code/User/settings.json" "${HOME}/Downloads"
  11. Update your VS Code settings. Copy and paste that in the terminal

    Terminal window
    SETTINGS="$(cat <<'EOF'
    {
    "window.newWindowDimensions": "maximized",
    "window.title": "${folderPath}",
    "workbench.activityBar.location":"bottom",
    "workbench.startupEditor": "newUntitledFile",
    "extensions.ignoreRecommendations": true,
    "telemetry.telemetryLevel": "off",
    "editor.fontFamily": "JetBrainsMono Nerd Font",
    "editor.fontSize": 14,
    "editor.rulers": [80, 120],
    "editor.minimap.enabled": false,
    "terminal.integrated.fontFamily": "JetBrainsMono Nerd Font",
    "terminal.integrated.fontSize": 14,
    "files.trimTrailingWhitespace": true,
    "files.associations": { "*.mdx": "markdown" },
    "latex-workshop.latex.recipe.default": "Latexmk (LuaLaTex)",
    "latex-workshop.latex.outDir": "./build",
    "latex-workshop.latex.recipes": [
    { "name": "Latexmk (LuaLaTex)", "tools": ["latexmk (lualatex)"] }
    ],
    "latex-workshop.latex.tools": [
    {
    "name": "latexmk (lualatex)",
    "command": "latexmk",
    "args": [
    "-lualatex",
    "-shell-escape",
    "-synctex=1",
    "-interaction=nonstopmode",
    "-output-directory=./build",
    "%DOC%"
    ]
    }
    ]
    }
    EOF
    )"
    echo "${SETTINGS}" > "${HOME}/Library/Application Support/Code/User/settings.json"