Double click to select white space in PhpStorm - phpstorm

In Sublime I can double click whitespace in-between two characters in order to select just the white space, e.g. in:
$foo = 'bar';
Would result in the selection of:
$foo████████= 'bar';
However in PhpStorm it selects the entire line.
Is there a setting I can toggle so that whitespace can be selected with a double click in the same way I can double click a variable to select it.

This is currently not possible. There is an open issue requesting the functionality you describe on the bug tracker, you could vote for this and leave a comment that you would like to see this functionality added as well.
Apparently, according to the comments triple clicking used to work to get this done. Although that was posted in 2013 and I cannot reproduce this on the latest version anymore, so I figure they removed that somewhere along the way.

Related

Chrome: HTML date input produces strange comma

Whenever I use "input with type="date"" in Chrome, there is a strange comma on the left of the date input.
There is no such comma in Firefox and I cannot find any information regarding this.
Can anyone tell me how I can get rid of the comma or why it is there?
The value of the input is correct (no comma).
I only want to use the date input.
This problem seems to be related to how Google Chrome complies with region settings in Windows. Verify that your region settings have not been customized to display (for example) something like 'ddd, M/d/yyyy'
Open Control Panel
Click on Clock & Region
Click 'Region: Change date, time, or number formats'

Using RStudio DevTools, can you prevent the Environment Pane from hiding column values with ellipses (...)

I'd like my data to at least extend horizontally to the edge of the environment pane, but it gets truncated even if there is plenty of room left in the pane. Columns of class "chr" appear to be restricted to showing only the first 4 entries (yellow arrows in the first picture), and columns of class "num" and "int" tend to show either 5 or 10 values (green arrow in the first picture).
Right-clicking on one of the rows and selecting "Inspect element" brings up RStudio DevTools; using that, I can at least enable a scroll bar by changing "overflow-x" from 'hidden' to 'scroll'. However, the scroll bar only scrolls to the original 4, 5, or 10 values that were shown, and then you still see the ellipsis. Changing "text-overflow" from 'ellipsis' to any of the other options seems to have no effect, nor does changing any of the other properties (padding-left/right, border, white-space).
I'd just like to see more data in that pane or enable a scroll bar at the bottom of the pane instead of for each individual row, but I can't find any settings to change to enable this. The theme I'm using is Tomorrow Night Bright if that matters.
You definitely can't do it using RStudio DevTools. RStudio implements their display using Chrome, so RStudio DevTools is just Chrome DevTools: the truncation of values has already happened before Chrome sees it.
There's probably a variable somewhere in the RStudio sources that controls how the truncation takes place, but I don't know where. You can look through the sources here if you want: https://github.com/rstudio/rstudio . I kind of doubt that it will be something you can control from R, but you never know.
So I can't offer a general solution, but I can offer a small hack. Normally I use this when I want to look at an expression: many debuggers let you watch expressions, but RStudio just shows you existing variables. However, if you want to see x+y in the environment pane, you can just calculate it in the console:
`x+y` <- x+y
and it will be displayed. (You've also created a new variable, and possibly stomped on an existing one.) This doesn't change like a live expression, so it's not that great, but it's better than nothing.
For your purpose, the thing to calculate would be something to display the missing bits of your display. If you want to see more manufacturer values, then do something like
mfr <- paste(mpg$manufacturer, collapse = " ")
This creates one long string, and will show as much of it as will fit.

When I create a new class="" the cursor starts outside the quotes in PhpStorm. How can I get it to go between the quotes so I can continue typing?

When I type in class="" it autofills and puts the cursor after the closing quote.
This means I need to delete a quote to enter the class name or click between them. Both of which ruin my workflow.
Is there a way to put the cursor inbetween the quotes in settings? And if there is, is there a way to jump out of the quotes and keep adding to my markup?
In Sublime Text it puts the cursor in the class and then tab takes you outside of it. I'm sure PhpStorm can do the same.
Instead of typing the whole class="" thing by yourself -- just let IDE autocompletion to do the job for you.
Just two characters (cl) is enough to make class entry first in the list (unless you have used some other similarly named attributes/properties recently that would temporarily bring them higher than class):
Completing with Enter will have the text inserted into current position with caret located in the right place class="[CARET_HERE]".
Completing with Tab does the same but replaces the text that is currently under caret (useful when changing class/image name/function/etc completely).
If standard code completion is not good enough for some reason or you do not like automatic completion popop (and prefer invoking it manually only when needed) -- you will be interested in Live Templates functionality that allows creating some abbreviation and expanding it into the final snippet with minimal key presses (e.g. cl[Tab] into class="|")
IDE also has options to:
insert quotes ("" or '') after typing = in XML/HTML attributes.
Settings/Preferences | Editor | General | Smart Keys --> Add quotes for attribute value on typing '=' and attribute completion
insert pair quotes (closing one) when entering opening one -- works in different contexts/languages. It will "eat" the closing quote preventing you from typing too many.
Settings/Preferences | Editor | General | Smart Keys --> Insert pair quote
In Sublime Text it puts the cursor in the class and then tab takes you outside of it. I'm sure PhpStorm can do the same.
If I understood you correctly (sorry, never used Sublime myself) -- No... and may not have it for quite some time (devs say that the way how IDE works somehow conflicts with proposed Tab or Esc behaviour).
Better explanation/arguments from both sides can be found in actual ticket: https://youtrack.jetbrains.com/issue/IDEABKL-6984

PhpStorm combine multiple Predefined Live Template functions

I have a project where my files are in "lisp-case" (hyphen delimited) and I would like to use the filename as a variable in a live template, but it must be converted to CamelCase first.
I found out that you can set the expression fileNameWithoutExtension() under "Edit Template Variables" and there is also a function called camelCase() which should be able to turn my filenames into CamelCase. But I cannot figure out how to combine those two. I tried doing camelCase(fileNameWithoutExtension()) but that does not work, unfortunately.
Is it possible to achieve this some other way?
camelCase(fileNameWithoutExtension())
It's a correct syntax.
Is it possible to achieve this some other way?
Please ensure that Skip if defined checkbox is checked for this variable.
If I try to wrap fileNameWithoutExtension() inside camelCase() and press enter to save the entry the window is closed but the change is not saved
It's an IDE bug (https://youtrack.jetbrains.com/issue/IDEA-132965 -- supposed to be fixed in current 2017.1.x version).
In any case: either press Enter before leaving the field ... or click on OK button straight away (you may then reopen this window to do further changes).
Also, when editing the field it's rendered like a select box which is kind of weird. Maybe it's a bug in this specific version. I'm on PhpStorm 10.0.4 for Mac.
Not a Mac user here .. but it is an editable drop-down box indeed (it lists all possible functions).

Remove bracket highlight line

i'd like to ask a question about SublimeText configuration. Somehow i managed to disable the dots line matching two brackets or code block.
This is what i mean link
I'd like to know how to enable it again.
Switch the parameter draw_indent_guides to true in the user settings. It should be the default value though, maybe one of your plugins managed to disable it?