Skip to content

Instantly share code, notes, and snippets.

@teshanshanuka
Last active August 17, 2022 07:05
Show Gist options
  • Save teshanshanuka/88aaeffd5bde83be01980ee9f24c7872 to your computer and use it in GitHub Desktop.
Save teshanshanuka/88aaeffd5bde83be01980ee9f24c7872 to your computer and use it in GitHub Desktop.

VSCode Configs

Configs

  1. Change font

    (Powerline font to suport my $PS1 with a git character: see .zshrc, and need apt install fonts-powerline/ powerline-fonts-git for arch)

     "terminal.integrated.fontFamily": "DejaVu Sans Mono for Powerline"
    
  2. Add rulers

     "editor.rulers": [
         120
     ]
    
  3. Autosave

    "files.autoSave": "afterDelay",
    "files.autoSaveDelay": 5000,
    
  4. Exclude watch/ files/ search

    Specify the exclude patterns in "files.watcherExclude"/ "files.exclude"/ "search.exclude"

    "files.watcherExclude": {
        "**/.git/objects/**": true,
        "**/.git/subtree-cache/**": true,
        "**/node_modules/**": true,
        "**/lib/**": true,
        "**/.yarn/**": true,
        "**/tmp/**": true,
        "**/.git": true,
        "**/.svn": true,
        "**/.hg": true,
        "**/CVS": true,
        "**/.DS_Store": true,
        "**/node_modules": true,
        "**/lib": true,
        "**/.yarn": true,
        "**/build": true,
        "**/dist/**": true,
        "**/log/**": true,
        "**/logs/**": true,
        "**/.fdk/**": true,
        "**/venv/**": true,
        "**/*.pyc": true
    }
    
  5. Formatters

     // pip install black
     "python.formatting.provider": "black",
     "python.formatting.blackArgs": ["--line-length", "120"],
    
     // With prettier extension
     "prettier.printWidth": 120,
     "[javascript]": {
         "editor.defaultFormatter": "esbenp.prettier-vscode",
         "editor.formatOnSave": true
     },
    
     // Get config/values available -> $ clang-format -style=google -dump-config
     "C_Cpp.clang_format_fallbackStyle": "{ BasedOnStyle: Google, IndentWidth: 4, ColumnLimit: 120 }",
     "[cpp]": {
         "editor.defaultFormatter": "ms-vscode.cpptools"
     }
    

C++

  1. Show string variables in debug

    In debug console, -exec -enable-pretty-printing

    or add "setupCommands": [ { "text": "-enable-pretty-printing" } ] to launch.json

    This says it is already set by default now but was not in v1.66.2

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