Need help finding HTML, CSS, formatting PHP code for gedit

I need help finding HTML, CSS, PHP code formatting plugin for gedit. I looked through gmate and other plugins, but I could only find formatting code for Ruby / Rails files.

+4
source share
2 answers

The way I did this in the past (although these were years) uses the External Tools plugin. Essentially, install tried and true command line utilities that can format the language you need to format as you like, and then put these commands in the External Tools plugin. Here are the commands I used:

To format HTML:

tidy -utf8 -i -w 80 -c -q -asxhtml 

To format PHP:

 php_beautifier -s4 -l "ArrayNested() IndentStyles(style=bsd) NewLines(before=if:switch:while:for:foreach:function:T_CLASS:return:break,after=T_COMMENT)" 

I wrote about this many years ago: http://www.micahcarrick.com/gedit-html-editor.html

+3
source

Here is a list of all the plugins available for Gedit here .
It seems like one of their requested plugins is "Code autoformat":

Autoformat code

Automatically apply the selected coding style when typing. A plugin that allows the user to select the encoding (or even pull it out of mode if possible). When entering, the style is applied automatically, for example, with gtk style "if (foo) {" will automatically put "{" in the next line and indent accordingly. Not to be confused with templates (for example, as in Eclipse), no characters should be automatically inserted. What autoformat: do, for, if, while argument lists, add the space between the function name and the left bracket here ...

Thus, the function (s) you are looking for may not be available, as yet.

+2
source

Source: https://habr.com/ru/post/1346344/


All Articles