Sublime Forum

[solved] Double Click PHP Varible won't highlight $

#1

In textmate we had the ability to specify “Word characters” so you could double click once and get the $ along with the variable you’re selecting… right now my work is doubled as I either have to type in $ when pasting a variable or expand selection to include before the copy…

is there anyway to specify that $ should be included when double clicking?

1 Like

Mark Spezialchar on doubleclick
#2

Look in Packages/Default/Base File.sublime-settings:

// Characters that are considered to separate words
"word_separators": "./\\()\"'-:,.;<>~!@#$%^&*|+=]{}`~?",

Remember to copy it to your User settings file though. Something like Preferences - File Settings -- More - Syntax Specific

2 Likes

#3

thanks worked perfectly! amazing product

0 Likes

#4

Thanks, that helped me too.

0 Likes

#5

I tried to use this tip, but I have a problem with it…

I’m currently trying to create the necessary files for a new language (XYplorer scripting).

I have a blabla.xys file open and go to “Preferences - File Settings – More - Syntax Specific”.

Sublime Text creates a new file, “D:\Users\Highend\Tools\Sublime Text\Data\Packages\User\XYS.sublime-settings”

I copy

// Characters that are considered to separate words "word_separators": "./\\()\"'-:,.;<>~!@#$%^&*|+=]{}`~?"

into it and try to save it.

I get the following error message:

Error trying to parse settings: Unexpected trailing characters in D:\UsersVHighend\Tools\Sublime Text\Data\Packages\User\XYS.sublime-settings:2:18

Did I do anything wrong?

Regards,
Highend

0 Likes

#6

If the file was empty before you pasted, you’d need the open/close braces:

{
    // Characters that are considered to separate words
    "word_separators": "./\\()\"'-:,.;<>~!@#$%^&*|+=]{}`~?"
}
0 Likes

#7

[quote=“nick.”]If the file was empty before you pasted, you’d need the open/close braces:

{ // Characters that are considered to separate words "word_separators": "./\\()\"'-:,.;<>~!@#$%^&*|+=]{}`~?" } [/quote]

Ah, thanks!

I removed the $ char as well and now I can doubleclick variables with the dollar sign included, too :smile:

0 Likes

#8

Just registered to thank you guys for this!

Switched from TextMate and trying out ST2, which is pretty awesome so far, but was ready to switch back because of this.
Awesome that the solution is so simple.

0 Likes

#9

Hi,
can anybody in this thread confirm this error: https://forum.sublimetext.com/t/bug-cmd-d-repeat-not-working-os-x-2215/6538/1

Seems that CMD-D Repeat is broken with the change in word separators…

Thanks!

0 Likes

#10

Yup, I have the same problem. sublimetext.userecho.com/topic/6 … variables/ seems to be reporting the same issue.

0 Likes

#11

i’m not sure, but is it possible to define the word_seperate only for php files or only global?

0 Likes

#12

You can open the php setting via the menu Preferences > Settings - Syntax Specific inside a PHP file to only define it for PHP files.

4 Likes

#13

It works :slight_smile: thank you

0 Likes