A
A
Artem Volkov2018-02-13 19:38:12
mint
Artem Volkov, 2018-02-13 19:38:12

How to fix code syntax in Sublime Text 3 on OC Linux (Mint 18.3)?

Hello.
I write code in PHP and often use the Tab button and I wanted to tweak the basic syntax of the code a little.
For example:

// по умолчанию php+Tab
<?php ?>
// мне нужно
<?php
    code...
?>
// Если написать ifelse+Tab
// по умолчанию
if (condition) {
    # code...
} else {
    # code...
}
// Нужно
if ( condition ) {
    # code...
} 
else {
    # else code...
}

This is what the studio requires, but when I was on windows I fixed it, but I can’t find it on linux. I will be grateful for help.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Kovalsky, 2018-02-13
@lazalu68

So it seems to be platform independent, still create a snippet ( Packages\User\my-awesome.sublime-snippet ) and declare a trigger:

<snippet>
  <content><![CDATA[
<?php
  ${1:code...}
?>
]]></content>
  <tabTrigger>php</tabTrigger>
</snippet>

You need to change the default snippet for .php, for example, using Package Resource Viewer :
1. Install Package Control,
2. Install Package Resource Viewer,
3. Using prv: Open Resource go to PHP/Snippets/php.sublime-snippet, change it .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question