Atom Editor - how to automatically reformat source code (PHP, HTML, CSS, Python, Javascript, etc.)
Hi, I am using the Atom editor and I would like to know if there is any add-on that will allow me to reformat the whole code - indent PHP code eg for foreach, for functions, etc. Thanks
Hi,
yes, the Atom editor has an atom-beautify add-on for code reformatting. So you first need to download the atom. Reformatting CSS, HTML will work right away (maybe Python and javascript).
The reformatting of the source is then done by marking eg the whole code ctrl + a and then you put ctrl + shift + p and then you write eg html and choose = this will neatly reformat the whole source as html code.
Reformatting PHP requires that you first do the following (on Linux):
REPLY
Hi,
yes, the Atom editor has an atom-beautify add-on for code reformatting. So you first need to download the atom. Reformatting CSS, HTML will work right away (maybe Python and javascript).
The reformatting of the source is then done by marking eg the whole code ctrl + a and then you put ctrl + shift + p and then you write eg html and choose = this will neatly reformat the whole source as html code.
Reformatting PHP requires that you first do the following (on Linux):
wget https://cs.sensiolabs.org/download/php-cs-fixer-v2.phar -O php-cs-fixer
sudo chmod a+x php-cs-fixer
sudo mv php-cs-fixer /usr/local/bin/php-cs-fixer