Skip to content

Instantly share code, notes, and snippets.

@yokawasa
Last active February 7, 2024 18:54
Show Gist options
  • Select an option

  • Save yokawasa/40b064befc8d474762d1ddd264dc5896 to your computer and use it in GitHub Desktop.

Select an option

Save yokawasa/40b064befc8d474762d1ddd264dc5896 to your computer and use it in GitHub Desktop.

Revisions

  1. yokawasa revised this gist Feb 7, 2024. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion vscode-configuration.md
    Original file line number Diff line number Diff line change
    @@ -3,6 +3,7 @@
    <!-- TOC -->

    - [VS Code Configurations](#vs-code-configurations)
    - [code command](#code-command)
    - [setting.json](#settingjson)
    - [editor.formatOnSave](#editorformatonsave)
    - [editor.renderWhitespace](#editorrenderwhitespace)
    @@ -55,7 +56,7 @@ code --goto package.json:10:5
    # disable all extensions
    code --disable-extensions .
    # you can pass the output of a process directly into VS Code to open as editor
    # when reading from stdin, so you immediately get back to the terminal prompt.
    # https://code.visualstudio.com/updates/v1_86#_do-no-enforce-wait-when-reading-from-stdin-from-the-command-line
    curl https://httpbin.org/json | code -
  2. yokawasa revised this gist Feb 7, 2024. 1 changed file with 34 additions and 0 deletions.
    34 changes: 34 additions & 0 deletions vscode-configuration.md
    Original file line number Diff line number Diff line change
    @@ -31,6 +31,40 @@

    <!-- /TOC -->

    ## code command

    ```
    # open code with current directory
    code .
    # open the current directory in the most recently used code window
    code -r .
    # create a new window
    code -n
    # change the language
    code --locale=es
    # open diff editor
    code --diff <file1> <file2>
    # open file at specific line and column <file:line[:character]>
    code --goto package.json:10:5
    # disable all extensions
    code --disable-extensions .
    # you can pass the output of a process directly into VS Code to open as editor
    # https://code.visualstudio.com/updates/v1_86#_do-no-enforce-wait-when-reading-from-stdin-from-the-command-line
    curl https://httpbin.org/json | code -
    ```

    ref: https://code.visualstudio.com/docs/getstarted/tips-and-tricks



    ## setting.json

    - Mac: `$HOME/Library/Application Support/Code/User/settings.json`
  3. yokawasa revised this gist Jun 18, 2023. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions vscode-configuration.md
    Original file line number Diff line number Diff line change
    @@ -14,6 +14,7 @@
    - [Display Language](#display-language)
    - [Code Sync Settings](#code-sync-settings)
    - [Editor Config](#editor-config)
    - [Prefer Go to Source Definition](#prefer-go-to-source-definition)
    - [Vim Plugin](#vim-plugin)
    - [Press, Hold, and Key Repeating](#press-hold-and-key-repeating)
    - [Workbench](#workbench)
  4. yokawasa revised this gist Jun 18, 2023. 1 changed file with 7 additions and 0 deletions.
    7 changes: 7 additions & 0 deletions vscode-configuration.md
    Original file line number Diff line number Diff line change
    @@ -169,6 +169,13 @@ $HOME/Library/Application Support/Code/User/settings.json
    vi ~/.editorconfig
    ```

    ## Prefer Go to Source Definition

    Enable the following options in settings:

    - JavaScript: Prefer Go to Source Definition
    - TypeScript: Prefer Go to Source Definition

    ## Vim Plugin

    ### Press, Hold, and Key Repeating
  5. yokawasa revised this gist Jun 4, 2023. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions vscode-configuration.md
    Original file line number Diff line number Diff line change
    @@ -10,6 +10,7 @@
    - [Python Per directory](#python-per-directory)
    - [Python Global Configuration](#python-global-configuration)
    - [Ruby Tag Jump](#ruby-tag-jump)
    - [Gist](#gist)
    - [Display Language](#display-language)
    - [Code Sync Settings](#code-sync-settings)
    - [Editor Config](#editor-config)
  6. yokawasa revised this gist Jun 4, 2023. 1 changed file with 0 additions and 1 deletion.
    1 change: 0 additions & 1 deletion vscode-configuration.md
    Original file line number Diff line number Diff line change
    @@ -121,7 +121,6 @@ Or you can set Python Interpreter using Command Palette: `Python: Select Interpr

    ref: https://www.fuwamaki.com/article/404


    ## Gist

    - install [Gist extension](https://marketplace.visualstudio.com/items?itemName=kenhowardpdx.vscode-gist)
  7. yokawasa revised this gist Jun 4, 2023. 1 changed file with 6 additions and 0 deletions.
    6 changes: 6 additions & 0 deletions vscode-configuration.md
    Original file line number Diff line number Diff line change
    @@ -122,6 +122,12 @@ Or you can set Python Interpreter using Command Palette: `Python: Select Interpr
    ref: https://www.fuwamaki.com/article/404


    ## Gist

    - install [Gist extension](https://marketplace.visualstudio.com/items?itemName=kenhowardpdx.vscode-gist)
    - Click GIST in footer menu in VS Code and select profile to initialize the profile selector
    - Add PAT for GIST

    ## Display Language

    - Open control panel, and select preferred lang in `Configure Display Language`
  8. yokawasa revised this gist Jun 4, 2023. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion vscode-configuration.md
    Original file line number Diff line number Diff line change
    @@ -129,7 +129,7 @@ ref: https://www.fuwamaki.com/article/404

    ## Code Sync Settings

    Settings Sync is officially supported. Follow [this](https://code.visualstudio.com/docs/editor/settings-sync).
    Settings Sync is officially supported. Please refer to [this](https://code.visualstudio.com/docs/editor/settings-sync).

    The following are deprecated configuration steps.

  9. yokawasa revised this gist Jun 4, 2023. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion vscode-configuration.md
    Original file line number Diff line number Diff line change
    @@ -10,6 +10,7 @@
    - [Python Per directory](#python-per-directory)
    - [Python Global Configuration](#python-global-configuration)
    - [Ruby Tag Jump](#ruby-tag-jump)
    - [Display Language](#display-language)
    - [Code Sync Settings](#code-sync-settings)
    - [Editor Config](#editor-config)
    - [Vim Plugin](#vim-plugin)
    @@ -128,7 +129,7 @@ ref: https://www.fuwamaki.com/article/404

    ## Code Sync Settings

    Settings Sync is officially supported. Follow [this](https://code.visualstudio.com/docs/editor/settings-sync)
    Settings Sync is officially supported. Follow [this](https://code.visualstudio.com/docs/editor/settings-sync).

    The following are deprecated configuration steps.

  10. yokawasa revised this gist Jun 4, 2023. 1 changed file with 12 additions and 0 deletions.
    12 changes: 12 additions & 0 deletions vscode-configuration.md
    Original file line number Diff line number Diff line change
    @@ -121,8 +121,19 @@ Or you can set Python Interpreter using Command Palette: `Python: Select Interpr
    ref: https://www.fuwamaki.com/article/404


    ## Display Language

    - Open control panel, and select preferred lang in `Configure Display Language`
    - Restart vscode

    ## Code Sync Settings

    Settings Sync is officially supported. Follow [this](https://code.visualstudio.com/docs/editor/settings-sync)

    The following are deprecated configuration steps.

    ---

    - Install [Settings Sync](https://marketplace.visualstudio.com/items?itemName=Shan.code-settings-sync)
    - By following instructions of Settings sync, Get `Github Personal Access Token`
    - For Uploading
    @@ -142,6 +153,7 @@ $HOME/Library/Application Support/Code/User/syncLocalSettings.json
    $HOME/Library/Application Support/Code/User/settings.json
    ```


    ## Editor Config

    - <https://editorconfig.org/>
  11. yokawasa revised this gist Apr 17, 2023. No changes.
  12. yokawasa revised this gist Apr 17, 2023. No changes.
  13. yokawasa revised this gist Apr 17, 2023. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion vscode-configuration.md
    Original file line number Diff line number Diff line change
    @@ -6,6 +6,7 @@
    - [setting.json](#settingjson)
    - [editor.formatOnSave](#editorformatonsave)
    - [editor.renderWhitespace](#editorrenderwhitespace)
    - [editor.mouseWheelZoom](#editormousewheelzoom)
    - [Python Per directory](#python-per-directory)
    - [Python Global Configuration](#python-global-configuration)
    - [Ruby Tag Jump](#ruby-tag-jump)
    @@ -71,7 +72,7 @@ display space as "・"

    ### editor.mouseWheelZoom

    `Ctrl + Scroll` allows to scale in/out only the editor's characters (NOT whole editor)
    `Ctrl + Scroll` allows to scale in/out only the editor's characters (NOT whole editor's characters)

    ```json
    "editor.mouseWheelZoom": true
  14. yokawasa revised this gist Apr 17, 2023. 1 changed file with 10 additions and 0 deletions.
    10 changes: 10 additions & 0 deletions vscode-configuration.md
    Original file line number Diff line number Diff line change
    @@ -68,6 +68,16 @@ display space as "・"
    - `all`: show all whitespace with "・" <<<< my preference
    - `display`: only the beginning and end of lines


    ### editor.mouseWheelZoom

    `Ctrl + Scroll` allows to scale in/out only the editor's characters (NOT whole editor)

    ```json
    "editor.mouseWheelZoom": true
    ```


    ### Python Per directory

    ```
  15. yokawasa revised this gist Mar 29, 2023. 1 changed file with 5 additions and 1 deletion.
    6 changes: 5 additions & 1 deletion vscode-configuration.md
    Original file line number Diff line number Diff line change
    @@ -168,7 +168,11 @@ references
    - tree indent:

    ```
    Settings > Workbench > Tree (default indent 8 up to 20)
    Settings > Workbench > Tree (default indent 8 up to 40)
    ```
    or
    ```
    "workbench.tree.indent": 8 (default = 8, but 20+ is recommended)
    ```

    ## Workspaces
  16. yokawasa revised this gist Mar 5, 2023. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions vscode-configuration.md
    Original file line number Diff line number Diff line change
    @@ -174,6 +174,7 @@ references
    ## Workspaces

    - Multi-root workspaces: <https://code.visualstudio.com/docs/editor/multi-root-workspaces>
    - Manage multiple worspaces (projects): use an extension, [Project Manager](https://marketplace.visualstudio.com/items?itemName=alefragnani.project-manager)

    ## Extension

  17. yokawasa revised this gist Feb 8, 2023. No changes.
  18. yokawasa revised this gist Feb 8, 2023. No changes.
  19. yokawasa revised this gist Feb 8, 2023. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions vscode-configuration.md
    Original file line number Diff line number Diff line change
    @@ -8,6 +8,7 @@
    - [editor.renderWhitespace](#editorrenderwhitespace)
    - [Python Per directory](#python-per-directory)
    - [Python Global Configuration](#python-global-configuration)
    - [Ruby Tag Jump](#ruby-tag-jump)
    - [Code Sync Settings](#code-sync-settings)
    - [Editor Config](#editor-config)
    - [Vim Plugin](#vim-plugin)
  20. yokawasa revised this gist Feb 8, 2023. 1 changed file with 9 additions and 0 deletions.
    9 changes: 9 additions & 0 deletions vscode-configuration.md
    Original file line number Diff line number Diff line change
    @@ -100,6 +100,15 @@ Add `python.pythonPath` to `User Settings`

    Or you can set Python Interpreter using Command Palette: `Python: Select Interpreter`

    ### Ruby Tag Jump

    - Open setting, and type `ruby`
    - Change Intellisense: false -> rubyLocate
    - Restart

    ref: https://www.fuwamaki.com/article/404


    ## Code Sync Settings

    - Install [Settings Sync](https://marketplace.visualstudio.com/items?itemName=Shan.code-settings-sync)
  21. yokawasa revised this gist Feb 5, 2023. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion vscode-configuration.md
    Original file line number Diff line number Diff line change
    @@ -10,7 +10,7 @@
    - [Python Global Configuration](#python-global-configuration)
    - [Code Sync Settings](#code-sync-settings)
    - [Editor Config](#editor-config)
    - [VIM](#vim)
    - [Vim Plugin](#vim-plugin)
    - [Press, Hold, and Key Repeating](#press-hold-and-key-repeating)
    - [Workbench](#workbench)
    - [Workspaces](#workspaces)
  22. yokawasa revised this gist Feb 5, 2023. No changes.
  23. yokawasa revised this gist Feb 5, 2023. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions vscode-configuration.md
    Original file line number Diff line number Diff line change
    @@ -11,6 +11,7 @@
    - [Code Sync Settings](#code-sync-settings)
    - [Editor Config](#editor-config)
    - [VIM](#vim)
    - [Press, Hold, and Key Repeating](#press-hold-and-key-repeating)
    - [Workbench](#workbench)
    - [Workspaces](#workspaces)
    - [Extension](#extension)
    @@ -19,7 +20,6 @@
    - [Keybindings Mac](#keybindings-mac)
    - [How to change keybindings Shortcut](#how-to-change-keybindings-shortcut)
    - [Commands Shift+Cmd+P](#commands-shiftcmdp)
    - [PressAndHold and Key repeat in VS Code vim plugin](#pressandhold-and-key-repeat-in-vs-code-vim-plugin)
    - [Debug UI](#debug-ui)
    - [VS Code on WSL](#vs-code-on-wsl)
    - [Install npm](#install-npm)
    @@ -129,7 +129,7 @@ $HOME/Library/Application Support/Code/User/settings.json
    vi ~/.editorconfig
    ```

    ## VIM
    ## Vim Plugin

    ### Press, Hold, and Key Repeating
    For MacOS, to enable key-repeating execute the following in your Terminal and restart VS Code:
  24. yokawasa revised this gist Feb 5, 2023. 1 changed file with 9 additions and 16 deletions.
    25 changes: 9 additions & 16 deletions vscode-configuration.md
    Original file line number Diff line number Diff line change
    @@ -131,21 +131,28 @@ vi ~/.editorconfig

    ## VIM

    - <https://marketplace.visualstudio.com/items?itemName=vscodevim.vim>

    ### Press, Hold, and Key Repeating
    For MacOS, to enable key-repeating execute the following in your Terminal and restart VS Code:

    ```bash
    # For VS Code
    defaults write com.microsoft.VSCode ApplePressAndHoldEnabled -bool false
    # For VS Code Insider
    defaults write com.microsoft.VSCodeInsiders ApplePressAndHoldEnabled -bool false
    # do this Just in case
    defaults write NSGlobalDomain ApplePressAndHoldEnabled -bool false

    # If necessary, reset global default
    defaults delete -g ApplePressAndHoldEnabled
    ```

    Then, `quit and start VSCode`, not simply reloading VSCode window

    references

    - [How do I press and hold a key and have it repeat in VSCode?](https://stackoverflow.com/questions/39972335/how-do-i-press-and-hold-a-key-and-have-it-repeat-in-vscode)
    - <https://marketplace.visualstudio.com/items?itemName=vscodevim.vim>

    ## Workbench

    - tree indent:
    @@ -238,20 +245,6 @@ then type `shortcut` and select `Preference: Open Keyboard Shortcuts`
    - Reload Window: `Reload Window`
    - Screencast Mode: `Toogle Screencast Mode`

    ## PressAndHold and Key repeat in VS Code vim plugin

    ```bash
    defaults write com.microsoft.VSCode ApplePressAndHoldEnabled -bool false
    defaults write NSGlobalDomain ApplePressAndHoldEnabled -bool false # do this Just in case
    defaults delete -g ApplePressAndHoldEnabled # If necessary, reset global default
    ```

    It's very important to restart VS Code afterward!!


    ref [How do I press and hold a key and have it repeat in VSCode?](https://stackoverflow.com/questions/39972335/how-do-i-press-and-hold-a-key-and-have-it-repeat-in-vscode)
    ref: https://techblg.app/articles/how-to-disable-press-and-hold-in-vscode/

    ## Debug UI

    - Add Break point
  25. yokawasa revised this gist Feb 5, 2023. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion vscode-configuration.md
    Original file line number Diff line number Diff line change
    @@ -19,7 +19,7 @@
    - [Keybindings Mac](#keybindings-mac)
    - [How to change keybindings Shortcut](#how-to-change-keybindings-shortcut)
    - [Commands Shift+Cmd+P](#commands-shiftcmdp)
    - [vim長押しを機能させる](#vim%E9%95%B7%E6%8A%BC%E3%81%97%E3%82%92%E6%A9%9F%E8%83%BD%E3%81%95%E3%81%9B%E3%82%8B)
    - [PressAndHold and Key repeat in VS Code vim plugin](#pressandhold-and-key-repeat-in-vs-code-vim-plugin)
    - [Debug UI](#debug-ui)
    - [VS Code on WSL](#vs-code-on-wsl)
    - [Install npm](#install-npm)
  26. yokawasa revised this gist Feb 5, 2023. 1 changed file with 6 additions and 1 deletion.
    7 changes: 6 additions & 1 deletion vscode-configuration.md
    Original file line number Diff line number Diff line change
    @@ -238,13 +238,18 @@ then type `shortcut` and select `Preference: Open Keyboard Shortcuts`
    - Reload Window: `Reload Window`
    - Screencast Mode: `Toogle Screencast Mode`

    ## vim長押しを機能させる
    ## PressAndHold and Key repeat in VS Code vim plugin

    ```bash
    defaults write com.microsoft.VSCode ApplePressAndHoldEnabled -bool false
    defaults write NSGlobalDomain ApplePressAndHoldEnabled -bool false # do this Just in case
    defaults delete -g ApplePressAndHoldEnabled # If necessary, reset global default
    ```

    It's very important to restart VS Code afterward!!


    ref [How do I press and hold a key and have it repeat in VSCode?](https://stackoverflow.com/questions/39972335/how-do-i-press-and-hold-a-key-and-have-it-repeat-in-vscode)
    ref: https://techblg.app/articles/how-to-disable-press-and-hold-in-vscode/

    ## Debug UI
  27. yokawasa revised this gist Feb 4, 2023. No changes.
  28. yokawasa revised this gist Feb 4, 2023. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions vscode-configuration.md
    Original file line number Diff line number Diff line change
    @@ -200,6 +200,7 @@ npm run build

    ## Keybindings (Mac)

    - Show Shortcuts: `Cmd+k, Cmd+s`
    - Relaod: `Cmd+R`
    - Command Palette: `Cmd + B`
    - Slidebar On/Off: `Cmd + B`
  29. yokawasa revised this gist Feb 4, 2023. No changes.
  30. yokawasa revised this gist Feb 4, 2023. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion vscode-configuration.md
    Original file line number Diff line number Diff line change
    @@ -224,7 +224,7 @@ npm run build
    - ⌃⌘↑ Resize Pane Up
    - ⌃⌘↓ Resize Pane Down
    - Multi-line actions
    - comment out with `//`: select lines -> `Cmd + /`
    - comment out with `//` or `#`: select lines -> `Cmd + /`


    ### How to change keybindings (Shortcut)