Skip to content

Instantly share code, notes, and snippets.

@tabrez
Created December 9, 2023 05:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tabrez/6f9239e7df5cba754037b7b98aead810 to your computer and use it in GitHub Desktop.
Save tabrez/6f9239e7df5cba754037b7b98aead810 to your computer and use it in GitHub Desktop.
My VS Code setup
  • Download and install VS Code

  • Install VS Code extensions:

    VS Code extensions

    wget https://gitlab.com/tabrez/kinoite-setup/-/raw/main/install/install_vscode_extensions.sh?ref_type=heads -O install-vscode-extensions.sh
    bash install-vscode-extensions.sh
  • Replace the default settings.json file:

    settings.json

    mv ~/.config/Code/User/{settings.json,settings.json.bak}
    wget https://raw.githubusercontent.com/tabrez/dotfiles/main/private_dot_config/private_Code/User/settings.json -O ~/.config/Code/User/settings.json
  • Set up Python virtual environment:

    requirements.txt

    python -v venv .venv
    source .venv/bin/activate
    wget https://gist.github.com/tabrez/fe588ea1f54378e1630e7743381b86b9 -O requirements.txt
    pip install -r requirements.txt
  • Notes

    • Go through the above files and remove what you don't like/need.

    • ruff-lsp can be configured through pyproject.toml file in the root of the project directory. E.g.:

      [tool.ruff]
      exclude = [
          ".bzr",
          ".direnv",
          ".eggs",
          ".git",
          ".git-rewrite",
          ".hg",
          ".mypy_cache",
          ".nox",
          ".pants.d",
          ".pytype",
          ".ruff_cache",
          ".svn",
          ".tox",
          ".venv",
          "__pypackages__",
          "_build",
          "buck-out",
          "build",
          "dist",
          "node_modules",
          ".venv",
      ]
      fix = true
      indent-width = 2
      
      # Allow unused variables when underscore-prefixed.
      dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
      
      [tool.ruff.format]
      # 5. Use single quotes for non-triple-quoted strings.
      quote-style = "single"
    • You have to run source .venv/bin/activate every time you restart your terminal, use direnv tool if you like to automate this.

    • Use asdf tool if you want granular control over which Python version to use.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment