Skip to content

Latest commit

 

History

History
514 lines (411 loc) · 20.6 KB

vsc_all.md

File metadata and controls

514 lines (411 loc) · 20.6 KB

Visual Studio Code

My favourite editors: ST, VSC

Installation

For Mac OS & Win OS

1. Open VSC & type `cmd+shift+p`
2. Type "Shell" & select 'Shell Command : Install code in PATH'
3. Use `$ code <project-folder-name>`
  • For permanence, follow this:

    1. Open profile in $ subl ~/.zprofile
    2. Add this line
    # install code on terminal
    export PATH="/Applications/Visual Studio Code.app/Contents/Resources/app/bin:$PATH"
    OR
    alias code="open -a /Applications/Visual\ Studio\ Code.app"
    
    1. $ source ~/.zprofile
    2. Now, use $ code <folder_or_file_path> from terminal

Extensions

In macOS, I can get the list of packages here: ~/.vscode/extensions in local PC.

last updated on 17-06-2022

For remote desktop, I just need to sync after login, then all the extensions would be synced, provided I have "Settings Sync" turned on in my source PC.

Expand:
aaron-bond.better-comments-3.0.0
adpyke.codesnap-1.3.4
ajshort.include-autocomplete-0.0.4
akamud.vscode-theme-onedark-2.2.3
akamud.vscode-theme-onelight-2.2.3
appland.appmap-0.31.0
appland.appmap-0.31.1
azemoh.one-monokai-0.5.0
bierner.markdown-mermaid-1.14.2
bierner.markdown-preview-github-styles-1.0.1
bungcip.better-toml-0.3.2
chrisdias.vscode-opennewinstance-0.0.12
christian-kohler.npm-intellisense-1.4.2
christian-kohler.path-intellisense-2.8.1
christophwolff.sublime-oceanic-after-next-theme-0.0.2
chrisvltn.vs-code-semicolon-insertion-0.0.6
contractshark.solidity-lang-1.4.0
cschlosser.doxdocgen-1.4.0
cssho.vscode-svgviewer-2.0.0
dakshmiglani.hex-to-rgba-1.0.0
davidanson.vscode-markdownlint-0.47.0
dbaeumer.vscode-eslint-2.2.2
dendron.dendron-paste-image-1.1.0
dunstontc.vscode-rust-syntax-0.0.32
eamodio.gitlens-12.1.1
eg2.vscode-npm-script-0.3.25
ericadamski.carbon-now-sh-1.2.0
esbenp.prettier-vscode-9.5.0
fabiospampinato.vscode-markdown-todo-1.1.1
fabiospampinato.vscode-todo-plus-4.18.4
felipe-mendes.slack-theme-1.9.17
formulahendry.auto-close-tag-0.5.14
gimenete.github-linker-0.2.5
gordonlarrigan.vscode-kanbn-0.11.0
grapecity.gc-excelviewer-4.2.55
gruntfuggly.calendar-0.0.13
gruntfuggly.mermaid-export-0.0.8
haaleo.timing-2.7.1
hediet.vscode-drawio-1.6.4
izaxon.todo-0.1.0
jebbs.plantuml-2.17.3
jeff-hykin.better-cpp-syntax-1.15.18
jgclark.vscode-todo-highlight-2.0.4
jithurjacob.nbpreviewer-1.2.2
joaompinto.vscode-graphviz-0.0.6
josetr.cmake-language-support-vscode-0.0.4
jrtools.mariana-1.0.8
juanblanco.solidity-0.0.139
kelvin.vscode-sshfs-1.25.0
kevinrose.vsc-python-indent-1.17.0
llvm-vs-code-extensions.vscode-clangd-0.1.17
maximetinu.identical-sublime-monokai-csharp-theme-colorizer-1.1.0
mechatroner.rainbow-csv-2.4.0
mikestead.dotenv-1.0.1
mkloubert.vscode-kanban-1.33.0
ms-azuretools.vscode-docker-1.22.0
ms-dotnettools.vscode-dotnet-runtime-1.5.0
ms-python.python-2022.8.0
ms-python.vscode-pylance-2022.6.30
ms-toolsai.jupyter-2022.5.1001601848
ms-toolsai.jupyter-keymap-1.0.0
ms-toolsai.jupyter-renderers-1.0.8
ms-toolsai.vscode-jupyter-powertoys-0.0.3
ms-vscode-remote.remote-containers-0.238.2
ms-vscode-remote.remote-ssh-0.82.1
ms-vscode-remote.remote-ssh-0.82.1.vsix
ms-vscode-remote.remote-ssh-edit-0.80.0
ms-vscode-remote.remote-wsl-0.66.3
ms-vscode.cmake-tools-1.11.26
ms-vscode.cpptools-1.10.7-darwin-arm64
ms-vscode.cpptools-extension-pack-1.2.0
ms-vscode.cpptools-themes-1.0.0
ms-vscode.hexeditor-1.9.7
ms-vscode.js-debug-companion-1.0.18
ms-vscode.references-view-0.0.89
ms-vscode.sublime-keybindings-4.0.10
mythx.mythxvsc-0.7.21
naumovs.color-highlight-2.5.0
njpwerner.autodocstring-0.6.1
nomicfoundation.hardhat-solidity-0.4.3
perkovec.emoji-1.0.1
pkief.material-icon-theme-4.18.1
royaction.color-manager-0.7.5
rust-lang.rust-analyzer-0.3.1099-darwin-arm64
rust-lang.rust-analyzer-0.3.1107-darwin-arm64
ryu1kn.partial-diff-1.4.3
smh.eosio-0.0.1
softwaredotcom.swdc-vscode-2.6.31
softwaredotcom.swdc-vscode-2.6.32
streetsidesoftware.code-spell-checker-2.2.5
supperchong.pretty-json-0.0.4
tabnine.tabnine-vscode-3.5.58
tabnine.tabnine-vscode-3.5.59
tintinweb.ethereum-security-bundle-0.0.6
tintinweb.graphviz-interactive-preview-0.3.0
tintinweb.solidity-metrics-0.0.20
tintinweb.solidity-visual-auditor-0.1.2
tintinweb.vscode-ethover-0.0.7
tintinweb.vscode-inline-bookmarks-0.0.26
tintinweb.vscode-lll-0.0.7
tintinweb.vscode-solidity-flattener-0.0.11
tintinweb.vscode-solidity-language-0.0.6
tintinweb.vscode-vyper-0.0.13
tomoki1207.pdf-1.2.0
trailofbits.slither-vscode-0.0.7
twxs.cmake-0.0.17
tyriar.luna-paint-0.15.0
tyriar.vscode-terminal-here-0.2.4
visualstudioexptteam.vscodeintellicode-1.2.21
vitelabs.soliditypp-0.7.11
vitelabs.solppdebugger-0.2.5
wakatime.vscode-wakatime-18.1.6
yzhang.markdown-all-in-one-3.4.3
zainchen.json-2.0.2

My favourite color themes:

  1. Light: Quiet Light Theme. It is bundled by vscode itself.
  2. Dark: One Dark Pro

Shortcut keys

macOS

keyboard-shortcuts-all-macos

First install the Sublime Text Keymap and Settings Importer, then follow this shortcut keys along with this:

  • cmd+, - Open preferences (global)
  • cmd+k+t, ctrl+t - change the color theme
  • cmd+shift+p - open the command palette
  • cmd+shift+c - open the terminal in the directory of root folder (opened)
  • ctrl+` - toggle the terminal (integrated)
  • ctrl+shift+` - open a new terminal (integrated)
  • ctrl+l - select multiple lines
  • ctrl+shift+l - edit multiple lines at a time
  • cmd+k,f - close the opened folder
  • cmd+k+b - toggle the explorer
  • cmd+shift+k - delete the line cursor is at
  • press cmd & hold - Edit multiple lines at different line no. simultaneously.
  • cmd+opt+1 - Only one screen
  • cmd+opt+2 - 2 screens side by side. In order to have 3 screens, just select one file opened & then press this shortcut key.
  • ctrl+g - Go to a line
  • cmd+shift+f - Find all references of a function in entire project files.
  • opt+click - Go to the file, function (definition), folder directly
  • fn+F12: Go to the definition of the function or just use the above shortcut key.
  • ctrl+w - Switch to workspace/window
  • cmd+shift+. - View a navigation pane for a file
  • opt+ 🔼/🔽 - Keeping the cursor on a line, use this move the line up or down
  • cmd+f - find in the current file
  • cmd+shift+f - find in the current workspace
  • cmd+opt+f - Replace in the current file
  • ctrl+spacebar - give suggestions at any red color cursor point
  • cmd+shift+e - show the active file in the explorer
  • cmd+k, s - Here, save file without formatting. Normally, if the formatter is enabled for the file extension type in the VSCode Settings, then when doing cmd+s, the file is saved with formatting automatically.
  • Open sub-folder in new window using this package
  • cmd+=: zoom-in
  • cmd+-: zoom-out
  • cmd+shift+d: duplicate the current line (cursor at)
  • cmd+g on terminal: Just use this shortcut key on terminal tab selected in VSCode editor. This would open the directory used in the past in VSCode editor.
  • cmd+shift+k - delete the line cursor is at
  • cmd+k (2 times) - delete the line cursor is at

Win OS

First install the Sublime Text Keymap and Settings Importer, then follow this shortcut keys along with this:

  • ctrl+k+t, ctrl+t - change the color theme
  • ctrl+shift+p - open the command palette
  • ctrl+` - toggle the terminal
  • ctrl+k,f - close the opened folder
  • ctrl+k+b - toggle the explorer
  • ctrl+shift+k - delete the line cursor is at
  • press ctrl & hold - Edit multiple lines at different line no. simultaneously.

Code

In order to get the following in *.html file,

  • type header>nav>ul>li*5:
<header>
    <nav>
        <ul>
            <li>hello</li>
            <li>hello</li>
            <li>helllo</li>
            <li>abhi</li>
            <li>arpit</li>
        </ul>
    </nav>
</header>
  • type .product$*4``div#header>ul>li*5:
<div class="product1"></div>
<div class="product2"></div>
<div class="product3"></div>
<div class="product4"></div>
  • type div#header>ul>li*5:
<div id="header">
    <ul>
        <li></li>
        <li></li>
        <li></li>
        <li></li>
        <li></li>
    </ul>
</div>

Preferences

  • In VSCode, 2 ways to be dependent on settings for a language:
    • global: cmd+shift+p >> "Preferences: Open Settings"
    • local: create a language properties for a repository like "c_cpp_properties.json" inside ".vscode/" folder.

NOTE: By default, the local settings (if defined) supersedes global settings.

Formatter

In VSCode, select the default formatter with this package for all files (sol, ts, js, md, py, java, cpp)

Procedure:

YouTube

  • Open Settings
  • type 'save format' >> tick the "Editor: Format on Save"
  • type 'formatter' >> set the "Editor: Default Formatter" to Prettier (by esbenp....)
  • type 'solidity formatter' >> set the "Solidity: Formatter" from none to prettier
  • Now, on saving any solidity (*.sol) file, it will automatically format.

Languages

C/C++

Package

  • Look at the packages to be installed above.

Linting

  • Maintain this settings in the "Preferences: Open Settings" file (get by typing after pressing key cmd+,). image
settings JSON
    "C_Cpp.workspaceSymbols": "All",
    "c-cpp-flylint.flawfinder.enable": false,
    "c-cpp-flylint.flexelint.enable": false,
    "c-cpp-flylint.lizard.enable": false,
    "cmake.configureOnOpen": true,
    "C_Cpp.errorSquiggles": "Disabled",
    "C_Cpp.default.cppStandard": "c++17",
    "C_Cpp.default.includePath": [
        "${workspaceFolder}/**",
        "/Library/Developer/CommandLineTools/usr/include",
        "/usr/local/Cellar/eosio.cdt/1.8.1/opt/eosio.cdt/include",
        "/usr/local/Cellar/eosio.cdt/1.8.1/opt/eosio.cdt/include/libc",
        "/usr/local/Cellar/eosio.cdt/1.8.1/opt/eosio.cdt/include/libcxx",
        "/usr/local/Cellar/eosio.cdt/1.8.1/opt/eosio.cdt/include/eosiolib/capi",
        "/usr/local/Cellar/eosio.cdt/1.8.1/opt/eosio.cdt/include/eosiolib/contracts",
        "/usr/local/Cellar/eosio.cdt/1.8.1/opt/eosio.cdt/include/eosiolib/core",
        "/usr/local/Cellar/eosio.cdt/1.8.1/opt/eosio.cdt/include/eosiolib/native"
    ],
    // "c-cpp-flylint.includePaths": [
    //     "${workspaceFolder}/**",
    //     "/Library/Developer/CommandLineTools/usr/include",
    //     "/usr/local/Cellar/eosio.cdt/1.8.1/opt/eosio.cdt/include",
    //     "/usr/local/Cellar/eosio.cdt/1.8.1/opt/eosio.cdt/include/libc",
    //     "/usr/local/Cellar/eosio.cdt/1.8.1/opt/eosio.cdt/include/libcxx",
    //     "/usr/local/Cellar/eosio.cdt/1.8.1/opt/eosio.cdt/include/eosiolib/capi",
    //     "/usr/local/Cellar/eosio.cdt/1.8.1/opt/eosio.cdt/include/eosiolib/contracts",
    //     "/usr/local/Cellar/eosio.cdt/1.8.1/opt/eosio.cdt/include/eosiolib/core",
    //     "/usr/local/Cellar/eosio.cdt/1.8.1/opt/eosio.cdt/include/eosiolib/native"
    // ],
    "include-autocomplete.extensions": [
        "",
        ".h",
        ".hpp",
        ".hxx",
        ".cpp"
    ],

Commented "c-cpp-flylint.includePaths" because it is not linting the imp. ones.

Compiler

  • Use this compiler based on OS:
    • Mac: clang
    • Linux (using WSL): g++
  • In Mac, clang uses this directory for compiling: "/Library/Developer/CommandLineTools/usr/include/".
  • In order to put some custom lib or folder like boost, download the folder from here & paste into this directory: "/Library/Developer/CommandLineTools/usr/include/"

Lib

Output

  • TODO also looks in good color like this image

Others

Rust

  • Add the static analyzer package above.

TypeScript

Package

  • Look at the packages to be installed above.

Linting

  • ESLint package automatically ensures linting on typescript in vscode
    • @pre
      • First install the compiler as per this

Compiler

Lib

Python

  • Add the packages above.

TypeScript

Package

  • Look at the packages to be installed above.

Linting

  • Python (by Microsoft) provides linting, suggestion

Compiler

Lib

JSON

Package

  • Look at the packages to be installed above.

TODO

How to manage todo inside VSC

  • cmd+enter / opt+enter: toggle TODO items in a .todo file.
  • opt+s: toggle start of task
  • opt+d: toggle end of task

Package

  • Look at the packages to be installed above.

Troubleshoot

In case where the terminal font style gets changed (during sync for multiple machines), then do this:

Go to settings.json file via cmd+shift+p/ctrl+shift+p: Preferences: Open Settings (JSON)

just change/remove this line:

    "terminal.integrated.fontFamily": "Menlo, Monaco, 'Courier New', monospace",