Skip to content

Instantly share code, notes, and snippets.

@AmboMaya
Last active April 12, 2020 00:47
Show Gist options
  • Save AmboMaya/19b8f577c6fd069348f079b5825e57d0 to your computer and use it in GitHub Desktop.
Save AmboMaya/19b8f577c6fd069348f079b5825e57d0 to your computer and use it in GitHub Desktop.
VS Code shortcut keys MAC

Delete line cmnd+shift+k

Select All Occurrences of Find Match cmd+shift+l (hint: select a word first) Select A single Occurrences of Find Match cmd+d (hint: select a word first) or skip the next one cmd+k then cmd+d

Toggle to previously visited file cmd+pp

Multi cursor select alt+shift and select

Activating Type-checking: If your project already is et up for TS, just add "checkJs: true" to your tsconfig.json otherwise, add a comment at the top of your JS file

Write better code by declaring types in the code block. Example below is best use case for on modifier such on submit which is used on the html form element as a target.

 /**
  *
  * @param {Event & {target: HTMLFormElement}} evt
 */
 onloginFormSubmit(evt) {
   const {target} = evt;
   const val = target.querySelector('select').value;

Type expression examples

  /**
    * @type {number} | @type {string} 
    * @param {string}
    * @param {number}
    * @param {boolean}
    * @callback callback func
    * @return 

To stop any running server ctrl+z take note of the node ID, kill -s KILL nodeID

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