Tuesday, September 24, 2013

How to change the default mode for php files in Kate Editor

Whenever I open a PHP file within the excellent Kate Editor (which I prefer due to its multi-document interface), the default mode for editing the file is PHP (HTML) instead of PHP/PHP. I use much more the indentation of the last one. I always can change the mode thru Tools -> Mode -> Scripts -> PHP/PHP, but it's a pain to do it every time I open a PHP file.

But you can set the default mode to PHP/PHP by changing its priority compared to PHP (HTML)'s.

That's how I did it:

  • Go to Settings -> Configure Kate -> Open/Save -> Modes & Filetypes;
  • Select Scripts/PHP (HTML) Filetype;
  • Change Priority to 4;
  • Select the File Extensions field and copy it;
  • Select Scripts/PHP/PHP Filetype;
  • Go to the File Extensions and paste the content copied;
  • Hit Apply and Ok;
  • Close and reopen Kate.


I was hard to find that solution (see reference); I hope this can be useful.

No comments:

Post a Comment