PhpStorm 5 saving watches and a single file - debugging

I have two questions on PhpStorm 5.
1) Can Watches be saved along with a debug configuration, so I don't have to re-create them every time I close and re-open the software? I have noticed that watches may be deleted by the software even during a working session.
2) Is there a way to save just a single file instead of saving all of the open files (only 'Save All' function exists).

1. Unfortunately No. Watches got deleted as soon as debug tool window is closed.
Corresponding ticket: http://youtrack.jetbrains.com/issue/IDEA-42954
UPDATE: Yes, this is now possible as of version 10 or so -- the aforementioned ticket has been implemented so all watches are now saved together with Run/Debug Configuration that was used to launch the debug.
2. Yes, you can -- but only since PhpStorm v7. But that still makes little to no difference as all other files will be saved anyway on standard occasion (change setting; run/re-run something etc -- same logic as before -- you cannot close editor tab and reject all changes automatically or be asked if file must be saved or not).
More details in this SO answer: https://stackoverflow.com/a/19147691/783119

Related

How can I automatically change RStudio's options?

I use RStudio on a shared Windows server. I prefer to not have auto-matched parentheses when I code in RStudio. I know I can turn that option off through Tools >> Options >> Code >> Editing >> Insert matching parens/quotes. However, whenever I log onto the server and open RStudio for the first time during a session on that server, all of the changes I made to RStudio's options the last time I was on the server have been reset. Is there a way to ensure that my preferences for RStudio's options persist over time? I do not have admin access to this server, so that may limit my options.
I looked into R profiles and created one to permanently set some options for R, but I did not find any way to set RStudio options that way.
Any help is greatly appreciated!
Global options are stored in a subdirectory described in https://support.rstudio.com/hc/en-us/articles/200534577-Resetting-RStudio-Desktop-s-State. On my Mac it is ~/.rstudio-desktop.
This is not part of the RStudio documented behaviour, so it may change, but I see the setting in the file
.rstudio-desktop/monitored/user-settings/user-settings
This is a plain text file; it looks like YAML to me. The setting you want is in the uiPrefs entry in that file.
What I'd recommend is that you follow the instructions on the web page I mentioned for making a backup of your settings, then restore them when you move to a new machine. If you are very adventurous you could try editing that file, but don't expect it to be easy.

How to automatically upload externally changed file without IDE focus

I know about the automatic upload on external change setting in PHP Storm, but it only happens if PHP Storm is "active / in user focus". So if a file get's changed by some other source and my window focus is e.g. a browser, the file doesn't get uploaded until i refocus the IDE.
Do you know any way how to fix this behavior?
'Upload on external change' can't work unless PHPStorm is aware of this change. This is only possible if IDE virtual file system is synchronized with external changes - and it's get synchronized when you move focus to PHPStorm (if 'synchronize files on frame activation' is enabled). To synchronize VFS automatically, you need to run your 'some other source' from PHPStorm (as a file watcher, for example). Otherwise focusing IDE is the only way to make this work

Setting Webstorm/PHPStorm file refresh time

It's probably just some simple setting I can't seem to find. Here's the thing: I have a web project with some Compass/Sass CSS. When I modify the Sass file, Compass automatically creates the corresponding CSS-file for me. If the file has changed, Webstorm uploads it to my server, all by itself. Neat!
However, Webstorm (or PHPStorm, for that matter) doesn't immediately notice the change in the CSS file, but checks on external modifications every 2 minutes or so. The CSS file is then being reloaded and uploaded to the server.
How do I set the time interval for checking for external changes!? 2 minutes (or so, I haven't timed it) is too much, I'd rather set it to 10 seconds. What would work for me too, is if I have the option to tell Webstorm to reload the CSS file, because I know it has changed. Sort of like F5 in eclipse. (F5 in Webstorm copies something and I can't find a refresh command or button anywhere.)
Thanks for helping out!
SOLUTION:
See CrazyCoder's comment. Using the 6.0 EAP version of WS solves the problem.
Such command/action to manually "reload" already there -- 3rd button on main toolbar.
File | Synchronize
There is no option in user interface to make any adjustments for the interval. Only things like "Synchronize when IDE gathers focus".
Maybe it is possible to pass some config values via *.vmoptions file, bit I know none of them for file watcher, unfortunately.

Decrypt/Read/Modify “.automaticDestinations-ms” and/or ".customDestinations-ms"

Does anyone know how to read the files Microsoft creates for JumpLists?
I want to clear from JumpList all history/most visited/recently closed, WITHOUT clearing up the tasks.
I tried to use the APPID from win7api, and clear for example, google chrome's jumplist. But with "ClearAllUserTasks" method it clears EVERYTHING from the jumplist, even the "Tasks". The same thing is with deleting the file.
Isn't any way of knowing the format of the *destinations-ms files, so I can modify them myself? Basically, wanting to clear just history/most visited, but couldn't find anything in Windows 7 Api (nor C++ or .NET).
The file is a Structured Storage file.
The OpenMCDF project is capable of reading and basic editing out of the box and you can easily create a specific tool with the library.
Here are steps to the hacky approach I took to clear Chrome's Recent list:
Open the AutomaticDestinations folder
%APPDATA%\Microsoft\Windows\Recent\AutomaticDestinations
Sort the AutomaticDestinations folder descending by Date modified
Open Chrome and visit a site
In the AutomaticDestinations folder, rename the most recently modified item
Right click on Chrome's icon
If the Recent list has been removed, you have the right file and can delete it.
Otherwise, repeat steps 3 through 5 until the Recent list is empty
Don't forget to return the other files back to their original names.
To clear the Recent list of other applications, open them and perform and action that will cause their list to be modified.
The advantage of this method is that removes the need to read .automaticDestinations-ms files.

GVim runs very slowly when editing files on a windows share

On my computer at work, any time I open a file located on a network share, GVim becomes completely unusable. Scrolling through the document can take 15 seconds to go one "page". Even using the movement keys to go from one word to another can take 2 to 3 seconds. This seems to be a new behavior, but for the life of me I can't remember changing anything that would cause it. I'm under the impression that Vim doesn't actually access a file except on open and on save. Is that right?
There are a few factors which may affect this.
First, make sure you have Vim setup to prefer storing the swapfile locally. If your $HOME is on a local drive, I tend to put this in my vimrc (which will either be at $HOME\_vimrc or $VIM\_vimrc). Make sure you create that directory, otherwise Vim will continue to use one of the other directories in the list.
set directory^=$HOME/tmp
This prepends the $HOME/tmp directory to the start of the list that Vim checks for where to place swapfiles.
Second, do the same for the backup file that Vim creates. Same situation as above but the option you'll be changing is backupdir instead of directory.
Third, make sure you disable the matchparen plugin. This plugin is new to Vim 7, so you may be used to using an older version of Vim. This causes frequent scanning of the file for matching parens, braces, etc. which can drastically slow Vim down when the file is on a network share. Again, this should go in your vimrc.
let g:loaded_matchparen = 1
If you only want to disable the plugin temporarily, you can use the command :NoMatchParen and then :DoMatchParen to re-enable it later in that Vim session.
Finally, if none of those help you can always copy the file locally and edit it.
Swap file has nothing to do with it. I have my swap file local and still have the problem. I use Process Monitor from SysInternals.com and it revealed bad behavior when attempting to open "\server\TestTool\foo\ReadMe.TXT"
It first attempts a CreateFile (aka, Directory open) on "\serve\". Notice the last character is missing. This will cause 4 seconds to time out with "OBJECT PATH INVALID".
Then it tries CreateFile on "\server\TestToo\". Server name is correct by the last letter of "TestTool" is clipped. Again, a 3 second time out with "BAD NETWORK NAME".
Finally it gets it right and calls CreateFile on "\server\TestTool\" which works right away.
Then CreateFile on "\server\TestTool\foo" which works right away.
Then CreateFile on "\server\TestTool\foo\ReadMe.TXT" which works right away.
WHY is it trying bad names for the server and the root directory??? What madness is this?
I fixed this issue after setting HOME path by force in advanced system settings.
(Your current HOME path would be a network directory.)
Control Panel > All Control Panel Items > System > Advanced system settings > Environment variables
Press "New..."
Variable name: HOME
Variable value: c:\Home\ **<-- Type your home directory**
A follow up on jamessan's answer: to disable the plugin automatically when you edit files on a share, put this line in you _vimrc
autocmd BufReadPre //* :NoMatchParen
You could consider installing LargeFile plugin. It disables a couple of features impacting the performance.
Having a similar issue as David Anderson, but no solution yet.
When loading \\ServerName\A$\B\C\File.txt Vim will do:
Open \ServerName\A$\B\C\File.txt
Then it does many loops like:
CreateFile \ServerName\A$ <-- Each taking roughly 1 sec
QueryDirectory \ServerName\A$\B
QueryDirectory \ServerName\A$
QueryDirectory \ServerName\A$\B\C
QueryDirectory \ServerName\A$\B
To compare with Notepad++ which loads files almost instantaneously there are more lines and Notepad++ never queries \\ServerName\A$.
Also the duration (Duration column) written in Process Monitor is low, but the time taken by Vim seem quiet high (Time of Day column) for the CreateFile \\ServerName\A$.
I've no plugins installed as far as I know and followed other tips to speed up network shares loading.
Note: The dollar is in the path. More weird is that Vim will load very fast on more recent Windows Server (2008 instead of 2003) with the same folder structure.
I had the same problem (slow gvim editing over network drive) and have fixed it. It was for me -- no kidding -- the titlestring.
Background: I use a vertically arranged taskbar with Windows 10. This has the advantage that my open windows behave like a growing stack from top to bottom. For example, see here some currently open windows with how-to-run.txt as a network file:
With that it makes sense, that the filename is going first in the window title of gvim and the path goes after that. So I used exactly the titlestring in my vimrc, which is still officially recommended in the help file vim81/doc/options.txt, line 8202:
set titlestring=%t%(\ %M%)%(\ (%{expand(\"%:~:.:h\")})%)%(\ %a%)
For local files that's ok, but for network files this is way too slow.
Now my fix:
set titlestring=
Same effect (filename first), but now gvim runs very fast for remote files as well!
BTW, I also tried all the above mentioned recommendations (directory, backupdir, matchparen, disabled all the plugins, tried the LargeFile plugin although I observed the slow gvim also for small files, etc.). I also changed my statusline to something really simple.
It all had no effect for me. But the funny titlestring...

Resources