this post was submitted on 15 Mar 2025
6 points (100.0% liked)

KDE

6201 readers
91 users here now

KDE is an international technology team creating user-friendly free and open source software for desktop and portable computing. KDE’s software runs on GNU/Linux, BSD and other operating systems, including Windows.

Plasma 6 Bugs

If you encounter a bug, proceed to https://bugs.kde.org/, check whether it has been reported.

If it hasn't, report it yourself.

PLEASE THINK CAREFULLY BEFORE POSTING HERE.

Developers do not look for reports on social media, so they will not see it and all it does is clutter up the feed.

founded 2 years ago
MODERATORS
 

I just spent an hour trying to figure out how to format PHP in Kate and can't do it. I downloaded phpcbf.phar and it works on local files, naturally, but can't use it for remote files which is the majority of how I work (ftp through Dolphin.) So, I need one of two things (I think):

Some sort of tool I can use through Kate to format PHP file in the editor

or

Figure out if Kate is using a local folder for tmp storage of the file from ftp, and what that folder is.

I love Kate, but this is kind of a show stopper for me. I've got a workaround but it's several steps. In VSCode it's one keyboard shortcut, but I hate it, especially compared to Kate.

top 1 comments
sorted by: hot top controversial new old
[–] [email protected] 2 points 1 week ago

The easiest way to do this would be to first select the whole documents, then go to Tools - Filter Through Command, and put PATH/YO/phpcbf.phar - (note the ending - - this is necessary), and click OK. Your document should now be formatted.

If you need to run this a lot and want to be quicker, you can set up an external tool through Tools - External Tools - Configure..., and add a new tool there. Here's an example setup:

The "best" and "official" way to do this would be to install phpactor LSP server with PHP-CS-Fixer integration, however this does not work on remote files.