composer global require magento-ecg/coding-standard
composer global require magento/marketplace-eqp
export PATH=$HOME/bin:/usr/local/bin:$PATH:$HOME/.composer/vendor/bin
phpcs --config-set installed_paths $HOME/.composer/vendor/magento-ecg/coding-standard/,$HOME/.composer/vendor/magento/marketplace-eqp/
Settings > Languages & Frameworks > PHP > CodeSniffer
put the path for phpcs (locate it with which phpcs in your terminal) and validate it, apply and we're done.
Settings > Editor > Inspections > PHP > PHP Code Sniffer validation
Enable it and search in the screen for Coding Standard and pick Ecg, EcgM2, MEQP1 and MEQP2